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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/runtime.h ('k') | test/mjsunit/compiler/inline-arguments.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 8407 matching lines...) Expand 10 before | Expand all | Expand 10 after
8418 } 8418 }
8419 } else if (type->IsOneByteEqualTo(STATIC_ASCII_VECTOR("parallel"))) { 8419 } else if (type->IsOneByteEqualTo(STATIC_ASCII_VECTOR("parallel"))) {
8420 function->MarkForParallelRecompilation(); 8420 function->MarkForParallelRecompilation();
8421 } 8421 }
8422 } 8422 }
8423 8423
8424 return isolate->heap()->undefined_value(); 8424 return isolate->heap()->undefined_value();
8425 } 8425 }
8426 8426
8427 8427
8428 RUNTIME_FUNCTION(MaybeObject*, Runtime_NeverOptimize) { 8428 RUNTIME_FUNCTION(MaybeObject*, Runtime_NeverOptimizeFunction) {
8429 HandleScope scope(isolate); 8429 HandleScope scope(isolate);
8430 8430 ASSERT(args.length() == 1);
8431 if (args.length() == 0) { 8431 CONVERT_ARG_CHECKED(JSFunction, function, 0);
8432 // Disable optimization for the calling function. 8432 ASSERT(!function->IsOptimized());
8433 JavaScriptFrameIterator it(isolate); 8433 function->shared()->set_optimization_disabled(true);
8434 if (!it.done()) {
8435 it.frame()->function()->shared()->set_optimization_disabled(true);
8436 }
8437 return isolate->heap()->undefined_value();
8438 }
8439
8440 // Disable optimization for the functions passed.
8441 for (int i = 0; i < args.length(); i++) {
8442 CONVERT_ARG_CHECKED(JSFunction, function, i);
8443 function->shared()->set_optimization_disabled(true);
8444 }
8445 return isolate->heap()->undefined_value(); 8434 return isolate->heap()->undefined_value();
8446 } 8435 }
8447 8436
8448 8437
8449 RUNTIME_FUNCTION(MaybeObject*, Runtime_CompleteOptimization) { 8438 RUNTIME_FUNCTION(MaybeObject*, Runtime_CompleteOptimization) {
8450 HandleScope scope(isolate); 8439 HandleScope scope(isolate);
8451 ASSERT(args.length() == 1); 8440 ASSERT(args.length() == 1);
8452 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); 8441 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
8453 if (FLAG_parallel_recompilation && V8::UseCrankshaft()) { 8442 if (FLAG_parallel_recompilation && V8::UseCrankshaft()) {
8454 // While function is in optimization pipeline, it is marked accordingly. 8443 // While function is in optimization pipeline, it is marked accordingly.
(...skipping 5530 matching lines...) Expand 10 before | Expand all | Expand 10 after
13985 // Handle last resort GC and make sure to allow future allocations 13974 // Handle last resort GC and make sure to allow future allocations
13986 // to grow the heap without causing GCs (if possible). 13975 // to grow the heap without causing GCs (if possible).
13987 isolate->counters()->gc_last_resort_from_js()->Increment(); 13976 isolate->counters()->gc_last_resort_from_js()->Increment();
13988 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 13977 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
13989 "Runtime::PerformGC"); 13978 "Runtime::PerformGC");
13990 } 13979 }
13991 } 13980 }
13992 13981
13993 13982
13994 } } // namespace v8::internal 13983 } } // namespace v8::internal
OLDNEW
« 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