Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Unified Diff: test/mjsunit/mjsunit.js

Issue 300003007: Cache optimization status getter in mjsunit.js (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/mjsunit.js
diff --git a/test/mjsunit/mjsunit.js b/test/mjsunit/mjsunit.js
index a5f65e24e75cc6279a3650407134ab493fea85bc..121b7e0a0e2043952017a02759706806bddaaf4d 100644
--- a/test/mjsunit/mjsunit.js
+++ b/test/mjsunit/mjsunit.js
@@ -371,11 +371,18 @@ var assertUnoptimized;
throw new MjsUnitAssertionError(message);
};
+ var OptimizationStatusImpl = undefined;
+
var OptimizationStatus = function(fun, sync_opt) {
- try {
- return eval("%GetOptimizationStatus(fun, sync_opt);");
- } catch (e) {
- throw new Error("natives syntax not allowed");
+ if (OptimizationStatusImpl === undefined) {
+ try {
+ OptimizationStatusImpl = new Function(
+ "fun", "sync", "return %GetOptimizationStatus(fun, sync);");
+ } catch (e) {
+ throw new Error("natives syntax not allowed");
+ }
+ } else {
+ OptimizationStatusImpl(fun, sync_opt);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698