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

Unified Diff: src/runtime.cc

Issue 19776006: Fix %NeverOptimizeFunction runtime call. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add assert for safety. Created 7 years, 5 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 | « src/runtime.h ('k') | test/mjsunit/compiler/inline-arguments.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 8391bef9490d150e6318de906020622029737a53..a14f501b96eefd5e6ac073270cad6aef75c3a5b6 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -8425,23 +8425,12 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_OptimizeFunctionOnNextCall) {
}
-RUNTIME_FUNCTION(MaybeObject*, Runtime_NeverOptimize) {
+RUNTIME_FUNCTION(MaybeObject*, Runtime_NeverOptimizeFunction) {
HandleScope scope(isolate);
-
- if (args.length() == 0) {
- // Disable optimization for the calling function.
- JavaScriptFrameIterator it(isolate);
- if (!it.done()) {
- it.frame()->function()->shared()->set_optimization_disabled(true);
- }
- return isolate->heap()->undefined_value();
- }
-
- // Disable optimization for the functions passed.
- for (int i = 0; i < args.length(); i++) {
- CONVERT_ARG_CHECKED(JSFunction, function, i);
- function->shared()->set_optimization_disabled(true);
- }
+ ASSERT(args.length() == 1);
+ CONVERT_ARG_CHECKED(JSFunction, function, 0);
+ ASSERT(!function->IsOptimized());
+ function->shared()->set_optimization_disabled(true);
return isolate->heap()->undefined_value();
}
« no previous file with comments | « src/runtime.h ('k') | test/mjsunit/compiler/inline-arguments.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698