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 8247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8258 function->PrintName(); | 8258 function->PrintName(); |
8259 PrintF("]\n"); | 8259 PrintF("]\n"); |
8260 } | 8260 } |
8261 InterruptStub interrupt_stub; | 8261 InterruptStub interrupt_stub; |
8262 Handle<Code> interrupt_code = interrupt_stub.GetCode(isolate); | 8262 Handle<Code> interrupt_code = interrupt_stub.GetCode(isolate); |
8263 Handle<Code> replacement_code = isolate->builtins()->OnStackReplacement(); | 8263 Handle<Code> replacement_code = isolate->builtins()->OnStackReplacement(); |
8264 Deoptimizer::RevertInterruptCode(*unoptimized, | 8264 Deoptimizer::RevertInterruptCode(*unoptimized, |
8265 *interrupt_code, | 8265 *interrupt_code, |
8266 *replacement_code); | 8266 *replacement_code); |
8267 | 8267 |
8268 // Allow OSR only at nesting level zero again. | |
8269 unoptimized->set_allow_osr_at_loop_nesting_level(0); | |
8270 | |
8271 // If the optimization attempt succeeded, return the AST id tagged as a | 8268 // If the optimization attempt succeeded, return the AST id tagged as a |
8272 // smi. This tells the builtin that we need to translate the unoptimized | 8269 // smi. This tells the builtin that we need to translate the unoptimized |
8273 // frame to an optimized one. | 8270 // frame to an optimized one. |
8274 if (succeeded) { | 8271 if (succeeded) { |
8275 ASSERT(function->code()->kind() == Code::OPTIMIZED_FUNCTION); | 8272 ASSERT(function->code()->kind() == Code::OPTIMIZED_FUNCTION); |
8276 return Smi::FromInt(ast_id.ToInt()); | 8273 return Smi::FromInt(ast_id.ToInt()); |
8277 } else { | 8274 } else { |
8278 if (function->IsMarkedForLazyRecompilation()) { | 8275 if (function->IsMarkedForLazyRecompilation()) { |
8279 function->ReplaceCode(function->shared()->code()); | 8276 function->ReplaceCode(function->shared()->code()); |
8280 } | 8277 } |
(...skipping 5375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13656 // Handle last resort GC and make sure to allow future allocations | 13653 // Handle last resort GC and make sure to allow future allocations |
13657 // to grow the heap without causing GCs (if possible). | 13654 // to grow the heap without causing GCs (if possible). |
13658 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13655 isolate->counters()->gc_last_resort_from_js()->Increment(); |
13659 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13656 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
13660 "Runtime::PerformGC"); | 13657 "Runtime::PerformGC"); |
13661 } | 13658 } |
13662 } | 13659 } |
13663 | 13660 |
13664 | 13661 |
13665 } } // namespace v8::internal | 13662 } } // namespace v8::internal |
OLD | NEW |