OLD | NEW |
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 8401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8412 ASSERT(function->is_compiled()); | 8412 ASSERT(function->is_compiled()); |
8413 return function->code(); | 8413 return function->code(); |
8414 } | 8414 } |
8415 | 8415 |
8416 | 8416 |
8417 RUNTIME_FUNCTION(MaybeObject*, Runtime_LazyRecompile) { | 8417 RUNTIME_FUNCTION(MaybeObject*, Runtime_LazyRecompile) { |
8418 HandleScope scope(isolate); | 8418 HandleScope scope(isolate); |
8419 ASSERT(args.length() == 1); | 8419 ASSERT(args.length() == 1); |
8420 Handle<JSFunction> function = args.at<JSFunction>(0); | 8420 Handle<JSFunction> function = args.at<JSFunction>(0); |
8421 | 8421 |
| 8422 function->shared()->set_profiler_ticks(0); |
| 8423 |
8422 // If the function is not compiled ignore the lazy | 8424 // If the function is not compiled ignore the lazy |
8423 // recompilation. This can happen if the debugger is activated and | 8425 // recompilation. This can happen if the debugger is activated and |
8424 // the function is returned to the not compiled state. | 8426 // the function is returned to the not compiled state. |
8425 if (!function->shared()->is_compiled()) { | 8427 if (!function->shared()->is_compiled()) { |
8426 function->ReplaceCode(function->shared()->code()); | 8428 function->ReplaceCode(function->shared()->code()); |
8427 return function->code(); | 8429 return function->code(); |
8428 } | 8430 } |
8429 | 8431 |
8430 // If the function is not optimizable or debugger is active continue using the | 8432 // If the function is not optimizable or debugger is active continue using the |
8431 // code from the full compiler. | 8433 // code from the full compiler. |
(...skipping 5224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13656 // Handle last resort GC and make sure to allow future allocations | 13658 // Handle last resort GC and make sure to allow future allocations |
13657 // to grow the heap without causing GCs (if possible). | 13659 // to grow the heap without causing GCs (if possible). |
13658 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13660 isolate->counters()->gc_last_resort_from_js()->Increment(); |
13659 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13661 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
13660 "Runtime::PerformGC"); | 13662 "Runtime::PerformGC"); |
13661 } | 13663 } |
13662 } | 13664 } |
13663 | 13665 |
13664 | 13666 |
13665 } } // namespace v8::internal | 13667 } } // namespace v8::internal |
OLD | NEW |