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

Side by Side Diff: src/runtime.cc

Issue 8700008: New approach to Crankshaft decision-making (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix function self-optimization; address first comment Created 9 years 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
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 8311 matching lines...) Expand 10 before | Expand all | Expand 10 after
8322 ASSERT(function->is_compiled()); 8322 ASSERT(function->is_compiled());
8323 return function->code(); 8323 return function->code();
8324 } 8324 }
8325 8325
8326 8326
8327 RUNTIME_FUNCTION(MaybeObject*, Runtime_LazyRecompile) { 8327 RUNTIME_FUNCTION(MaybeObject*, Runtime_LazyRecompile) {
8328 HandleScope scope(isolate); 8328 HandleScope scope(isolate);
8329 ASSERT(args.length() == 1); 8329 ASSERT(args.length() == 1);
8330 Handle<JSFunction> function = args.at<JSFunction>(0); 8330 Handle<JSFunction> function = args.at<JSFunction>(0);
8331 8331
8332 function->set_profiler_ticks(0);
8333
8332 // If the function is not compiled ignore the lazy 8334 // If the function is not compiled ignore the lazy
8333 // recompilation. This can happen if the debugger is activated and 8335 // recompilation. This can happen if the debugger is activated and
8334 // the function is returned to the not compiled state. 8336 // the function is returned to the not compiled state.
8335 if (!function->shared()->is_compiled()) { 8337 if (!function->shared()->is_compiled()) {
8336 function->ReplaceCode(function->shared()->code()); 8338 function->ReplaceCode(function->shared()->code());
8337 return function->code(); 8339 return function->code();
8338 } 8340 }
8339 8341
8340 // If the function is not optimizable or debugger is active continue using the 8342 // If the function is not optimizable or debugger is active continue using the
8341 // code from the full compiler. 8343 // code from the full compiler.
(...skipping 5226 matching lines...) Expand 10 before | Expand all | Expand 10 after
13568 } else { 13570 } else {
13569 // Handle last resort GC and make sure to allow future allocations 13571 // Handle last resort GC and make sure to allow future allocations
13570 // to grow the heap without causing GCs (if possible). 13572 // to grow the heap without causing GCs (if possible).
13571 isolate->counters()->gc_last_resort_from_js()->Increment(); 13573 isolate->counters()->gc_last_resort_from_js()->Increment();
13572 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags); 13574 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags);
13573 } 13575 }
13574 } 13576 }
13575 13577
13576 13578
13577 } } // namespace v8::internal 13579 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698