Chromium Code Reviews| 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; i++) { |
|
fschneider
2011/04/06 14:06:55
That's a little confusing to get to the bottom fra
| |
| 7329 if (i != 0) it.Advance(); | 7332 if (i != 0) it.Advance(); |
| 7330 frame = it.frame(); | |
| 7331 deoptimizer->InsertHeapNumberValues(frames - i - 1, frame); | |
| 7332 } | 7333 } |
| 7333 delete deoptimizer; | 7334 frame = it.frame(); |
| 7334 | 7335 |
| 7335 RUNTIME_ASSERT(frame->function()->IsJSFunction()); | 7336 RUNTIME_ASSERT(frame->function()->IsJSFunction()); |
| 7336 Handle<JSFunction> function(JSFunction::cast(frame->function()), isolate); | 7337 Handle<JSFunction> function(JSFunction::cast(frame->function()), isolate); |
| 7337 Handle<Object> arguments; | 7338 Handle<Object> arguments; |
| 7338 for (int i = frame->ComputeExpressionsCount() - 1; i >= 0; --i) { | 7339 for (int i = frame->ComputeExpressionsCount() - 1; i >= 0; --i) { |
| 7339 if (frame->GetExpression(i) == isolate->heap()->arguments_marker()) { | 7340 if (frame->GetExpression(i) == isolate->heap()->arguments_marker()) { |
| 7340 if (arguments.is_null()) { | 7341 if (arguments.is_null()) { |
| 7341 // FunctionGetArguments can't throw an exception, so cast away the | 7342 // FunctionGetArguments can't throw an exception, so cast away the |
| 7342 // doubt with an assert. | 7343 // doubt with an assert. |
| 7343 arguments = Handle<Object>( | 7344 arguments = Handle<Object>( |
| (...skipping 4596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 11940 } else { | 11941 } else { |
| 11941 // Handle last resort GC and make sure to allow future allocations | 11942 // Handle last resort GC and make sure to allow future allocations |
| 11942 // to grow the heap without causing GCs (if possible). | 11943 // to grow the heap without causing GCs (if possible). |
| 11943 isolate->counters()->gc_last_resort_from_js()->Increment(); | 11944 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 11944 isolate->heap()->CollectAllGarbage(false); | 11945 isolate->heap()->CollectAllGarbage(false); |
| 11945 } | 11946 } |
| 11946 } | 11947 } |
| 11947 | 11948 |
| 11948 | 11949 |
| 11949 } } // namespace v8::internal | 11950 } } // namespace v8::internal |
| OLD | NEW |