Revision: 21522
Author:   [email protected]
Date:     Tue May 27 12:52:15 2014 UTC
Log:      Cache optimization status getter in mjsunit.js

[email protected]

Review URL: https://codereview.chromium.org/300003007
http://code.google.com/p/v8/source/detail?r=21522

Modified:
 /branches/bleeding_edge/test/mjsunit/mjsunit.js

=======================================
--- /branches/bleeding_edge/test/mjsunit/mjsunit.js Tue May 27 11:53:12 2014 UTC +++ /branches/bleeding_edge/test/mjsunit/mjsunit.js Tue May 27 12:52:15 2014 UTC
@@ -371,11 +371,18 @@
     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);
     }
   }

--
--
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.

Reply via email to