OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 7305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7316 RUNTIME_FUNCTION(MaybeObject*, Runtime_NotifyDeoptimized) { | 7316 RUNTIME_FUNCTION(MaybeObject*, Runtime_NotifyDeoptimized) { |
7317 HandleScope scope(isolate); | 7317 HandleScope scope(isolate); |
7318 ASSERT(args.length() == 1); | 7318 ASSERT(args.length() == 1); |
7319 RUNTIME_ASSERT(args[0]->IsSmi()); | 7319 RUNTIME_ASSERT(args[0]->IsSmi()); |
7320 Deoptimizer::BailoutType type = | 7320 Deoptimizer::BailoutType type = |
7321 static_cast<Deoptimizer::BailoutType>(Smi::cast(args[0])->value()); | 7321 static_cast<Deoptimizer::BailoutType>(Smi::cast(args[0])->value()); |
7322 Deoptimizer* deoptimizer = Deoptimizer::Grab(isolate); | 7322 Deoptimizer* deoptimizer = Deoptimizer::Grab(isolate); |
7323 ASSERT(isolate->heap()->IsAllocationAllowed()); | 7323 ASSERT(isolate->heap()->IsAllocationAllowed()); |
7324 int frames = deoptimizer->output_count(); | 7324 int frames = deoptimizer->output_count(); |
7325 | 7325 |
| 7326 deoptimizer->MaterializeHeapNumbers(); |
| 7327 delete deoptimizer; |
| 7328 |
7326 JavaScriptFrameIterator it(isolate); | 7329 JavaScriptFrameIterator it(isolate); |
7327 JavaScriptFrame* frame = NULL; | 7330 JavaScriptFrame* frame = NULL; |
7328 for (int i = 0; i < frames; i++) { | 7331 for (int i = 0; i < frames - 1; i++) it.Advance(); |
7329 if (i != 0) it.Advance(); | 7332 frame = it.frame(); |
7330 frame = it.frame(); | |
7331 deoptimizer->InsertHeapNumberValues(frames - i - 1, frame); | |
7332 } | |
7333 delete deoptimizer; | |
7334 | 7333 |
7335 RUNTIME_ASSERT(frame->function()->IsJSFunction()); | 7334 RUNTIME_ASSERT(frame->function()->IsJSFunction()); |
7336 Handle<JSFunction> function(JSFunction::cast(frame->function()), isolate); | 7335 Handle<JSFunction> function(JSFunction::cast(frame->function()), isolate); |
7337 Handle<Object> arguments; | 7336 Handle<Object> arguments; |
7338 for (int i = frame->ComputeExpressionsCount() - 1; i >= 0; --i) { | 7337 for (int i = frame->ComputeExpressionsCount() - 1; i >= 0; --i) { |
7339 if (frame->GetExpression(i) == isolate->heap()->arguments_marker()) { | 7338 if (frame->GetExpression(i) == isolate->heap()->arguments_marker()) { |
7340 if (arguments.is_null()) { | 7339 if (arguments.is_null()) { |
7341 // FunctionGetArguments can't throw an exception, so cast away the | 7340 // FunctionGetArguments can't throw an exception, so cast away the |
7342 // doubt with an assert. | 7341 // doubt with an assert. |
7343 arguments = Handle<Object>( | 7342 arguments = Handle<Object>( |
(...skipping 4596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11940 } else { | 11939 } else { |
11941 // Handle last resort GC and make sure to allow future allocations | 11940 // Handle last resort GC and make sure to allow future allocations |
11942 // to grow the heap without causing GCs (if possible). | 11941 // to grow the heap without causing GCs (if possible). |
11943 isolate->counters()->gc_last_resort_from_js()->Increment(); | 11942 isolate->counters()->gc_last_resort_from_js()->Increment(); |
11944 isolate->heap()->CollectAllGarbage(false); | 11943 isolate->heap()->CollectAllGarbage(false); |
11945 } | 11944 } |
11946 } | 11945 } |
11947 | 11946 |
11948 | 11947 |
11949 } } // namespace v8::internal | 11948 } } // namespace v8::internal |
OLD | NEW |