Commit db8f7e03 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Cache optimization status getter in mjsunit.js

R=mvstanton@chromium.org

Review URL: https://codereview.chromium.org/300003007

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21522 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent ee88832b
......@@ -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);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment