Reviewers: ulan,
Description:
Fix mjsunit's assertOptimized and assertUnoptimized.
This was broken some time ago by a refactor.
[email protected]
Please review this at https://codereview.chromium.org/349423003/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+18, -2 lines):
M test/mjsunit/mjsunit.js
A test/mjsunit/mjsunit-assertoptimized.js
Index: test/mjsunit/mjsunit-assertoptimized.js
diff --git a/test/mjsunit/mjsunit-assertoptimized.js
b/test/mjsunit/mjsunit-assertoptimized.js
new file mode 100644
index
0000000000000000000000000000000000000000..d395012f3c9a9dc85a4d1849f0a5ce1f495b6215
--- /dev/null
+++ b/test/mjsunit/mjsunit-assertoptimized.js
@@ -0,0 +1,17 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --allow-natives-syntax --crankshaft
+
+function f() {};
+f();
+f();
+%OptimizeFunctionOnNextCall(f);
+f();
+assertOptimized(f);
+assertThrows(function() { assertUnoptimized(f); });
+%DeoptimizeFunction(f);
+assertUnoptimized(f);
+assertThrows(function() { assertOptimized(f); });
+quit(); // Prevent stress runs.
Index: test/mjsunit/mjsunit.js
diff --git a/test/mjsunit/mjsunit.js b/test/mjsunit/mjsunit.js
index
bcd4913b3b775b59983b116281e1a267ebc0a011..043027908853d0dfd9169553dae00a19a3efde55
100644
--- a/test/mjsunit/mjsunit.js
+++ b/test/mjsunit/mjsunit.js
@@ -391,9 +391,8 @@ var assertUnoptimized;
} catch (e) {
throw new Error("natives syntax not allowed");
}
- } else {
- OptimizationStatusImpl(fun, sync_opt);
}
+ return OptimizationStatusImpl(fun, sync_opt);
}
assertUnoptimized = function assertUnoptimized(fun, sync_opt, name_opt) {
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.