| 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 8367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8378 if (type == Deoptimizer::EAGER) { | 8378 if (type == Deoptimizer::EAGER) { |
| 8379 RUNTIME_ASSERT(function->IsOptimized()); | 8379 RUNTIME_ASSERT(function->IsOptimized()); |
| 8380 } | 8380 } |
| 8381 | 8381 |
| 8382 // Avoid doing too much work when running with --always-opt and keep | 8382 // Avoid doing too much work when running with --always-opt and keep |
| 8383 // the optimized code around. | 8383 // the optimized code around. |
| 8384 if (FLAG_always_opt || type == Deoptimizer::LAZY) { | 8384 if (FLAG_always_opt || type == Deoptimizer::LAZY) { |
| 8385 return isolate->heap()->undefined_value(); | 8385 return isolate->heap()->undefined_value(); |
| 8386 } | 8386 } |
| 8387 | 8387 |
| 8388 // Find other optimized activations of the function. | 8388 // Find other optimized activations of the function or functions that |
| 8389 // share the same optimized code. |
| 8389 bool has_other_activations = false; | 8390 bool has_other_activations = false; |
| 8390 while (!it.done()) { | 8391 while (!it.done()) { |
| 8391 JavaScriptFrame* frame = it.frame(); | 8392 JavaScriptFrame* frame = it.frame(); |
| 8392 if (frame->is_optimized() && frame->function() == *function) { | 8393 JSFunction* other_function = JSFunction::cast(frame->function()); |
| 8394 if (frame->is_optimized() && other_function->code() == function->code()) { |
| 8393 has_other_activations = true; | 8395 has_other_activations = true; |
| 8394 break; | 8396 break; |
| 8395 } | 8397 } |
| 8396 it.Advance(); | 8398 it.Advance(); |
| 8397 } | 8399 } |
| 8398 | 8400 |
| 8399 if (!has_other_activations) { | 8401 if (!has_other_activations) { |
| 8400 ActivationsFinder activations_finder(*function); | 8402 ActivationsFinder activations_finder(*function); |
| 8401 isolate->thread_manager()->IterateArchivedThreads(&activations_finder); | 8403 isolate->thread_manager()->IterateArchivedThreads(&activations_finder); |
| 8402 has_other_activations = activations_finder.has_activations(); | 8404 has_other_activations = activations_finder.has_activations(); |
| (...skipping 5312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13715 // Handle last resort GC and make sure to allow future allocations | 13717 // Handle last resort GC and make sure to allow future allocations |
| 13716 // to grow the heap without causing GCs (if possible). | 13718 // to grow the heap without causing GCs (if possible). |
| 13717 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13719 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 13718 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13720 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
| 13719 "Runtime::PerformGC"); | 13721 "Runtime::PerformGC"); |
| 13720 } | 13722 } |
| 13721 } | 13723 } |
| 13722 | 13724 |
| 13723 | 13725 |
| 13724 } } // namespace v8::internal | 13726 } } // namespace v8::internal |
| OLD | NEW |