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 8458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8469 | 8469 |
8470 | 8470 |
8471 RUNTIME_FUNCTION(MaybeObject*, Runtime_NotifyDeoptimized) { | 8471 RUNTIME_FUNCTION(MaybeObject*, Runtime_NotifyDeoptimized) { |
8472 HandleScope scope(isolate); | 8472 HandleScope scope(isolate); |
8473 ASSERT(args.length() == 1); | 8473 ASSERT(args.length() == 1); |
8474 RUNTIME_ASSERT(args[0]->IsSmi()); | 8474 RUNTIME_ASSERT(args[0]->IsSmi()); |
8475 Deoptimizer::BailoutType type = | 8475 Deoptimizer::BailoutType type = |
8476 static_cast<Deoptimizer::BailoutType>(args.smi_at(0)); | 8476 static_cast<Deoptimizer::BailoutType>(args.smi_at(0)); |
8477 Deoptimizer* deoptimizer = Deoptimizer::Grab(isolate); | 8477 Deoptimizer* deoptimizer = Deoptimizer::Grab(isolate); |
8478 ASSERT(isolate->heap()->IsAllocationAllowed()); | 8478 ASSERT(isolate->heap()->IsAllocationAllowed()); |
8479 int frames = deoptimizer->output_count(); | 8479 int jsframes = deoptimizer->jsframes_count(); |
8480 | 8480 |
8481 deoptimizer->MaterializeHeapNumbers(); | 8481 deoptimizer->MaterializeHeapNumbers(); |
8482 delete deoptimizer; | 8482 delete deoptimizer; |
8483 | 8483 |
8484 JavaScriptFrameIterator it(isolate); | 8484 JavaScriptFrameIterator it(isolate); |
8485 JavaScriptFrame* frame = NULL; | 8485 JavaScriptFrame* frame = NULL; |
8486 for (int i = 0; i < frames - 1; i++) it.Advance(); | 8486 for (int i = 0; i < jsframes - 1; i++) it.Advance(); |
8487 frame = it.frame(); | 8487 frame = it.frame(); |
8488 | 8488 |
8489 RUNTIME_ASSERT(frame->function()->IsJSFunction()); | 8489 RUNTIME_ASSERT(frame->function()->IsJSFunction()); |
8490 Handle<JSFunction> function(JSFunction::cast(frame->function()), isolate); | 8490 Handle<JSFunction> function(JSFunction::cast(frame->function()), isolate); |
8491 Handle<Object> arguments; | 8491 Handle<Object> arguments; |
8492 for (int i = frame->ComputeExpressionsCount() - 1; i >= 0; --i) { | 8492 for (int i = frame->ComputeExpressionsCount() - 1; i >= 0; --i) { |
8493 if (frame->GetExpression(i) == isolate->heap()->arguments_marker()) { | 8493 if (frame->GetExpression(i) == isolate->heap()->arguments_marker()) { |
8494 if (arguments.is_null()) { | 8494 if (arguments.is_null()) { |
8495 // FunctionGetArguments can't throw an exception, so cast away the | 8495 // FunctionGetArguments can't throw an exception, so cast away the |
8496 // doubt with an assert. | 8496 // doubt with an assert. |
(...skipping 5128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13625 } else { | 13625 } else { |
13626 // Handle last resort GC and make sure to allow future allocations | 13626 // Handle last resort GC and make sure to allow future allocations |
13627 // to grow the heap without causing GCs (if possible). | 13627 // to grow the heap without causing GCs (if possible). |
13628 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13628 isolate->counters()->gc_last_resort_from_js()->Increment(); |
13629 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags); | 13629 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags); |
13630 } | 13630 } |
13631 } | 13631 } |
13632 | 13632 |
13633 | 13633 |
13634 } } // namespace v8::internal | 13634 } } // namespace v8::internal |
OLD | NEW |