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 7618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7629 JSFunction* function_; | 7629 JSFunction* function_; |
7630 bool has_activations_; | 7630 bool has_activations_; |
7631 }; | 7631 }; |
7632 | 7632 |
7633 | 7633 |
7634 RUNTIME_FUNCTION(MaybeObject*, Runtime_NotifyStubFailure) { | 7634 RUNTIME_FUNCTION(MaybeObject*, Runtime_NotifyStubFailure) { |
7635 HandleScope scope(isolate); | 7635 HandleScope scope(isolate); |
7636 ASSERT(args.length() == 0); | 7636 ASSERT(args.length() == 0); |
7637 Deoptimizer* deoptimizer = Deoptimizer::Grab(isolate); | 7637 Deoptimizer* deoptimizer = Deoptimizer::Grab(isolate); |
7638 ASSERT(isolate->heap()->IsAllocationAllowed()); | 7638 ASSERT(isolate->heap()->IsAllocationAllowed()); |
7639 ASSERT(deoptimizer->compiled_code_kind() == Code::COMPILED_STUB); | |
7640 delete deoptimizer; | 7639 delete deoptimizer; |
7641 return isolate->heap()->undefined_value(); | 7640 return isolate->heap()->undefined_value(); |
7642 } | 7641 } |
7643 | 7642 |
7644 | 7643 |
7645 RUNTIME_FUNCTION(MaybeObject*, Runtime_NotifyDeoptimized) { | 7644 RUNTIME_FUNCTION(MaybeObject*, Runtime_NotifyDeoptimized) { |
7646 HandleScope scope(isolate); | 7645 HandleScope scope(isolate); |
7647 ASSERT(args.length() == 1); | 7646 ASSERT(args.length() == 1); |
7648 RUNTIME_ASSERT(args[0]->IsSmi()); | 7647 RUNTIME_ASSERT(args[0]->IsSmi()); |
7649 Deoptimizer::BailoutType type = | 7648 Deoptimizer::BailoutType type = |
7650 static_cast<Deoptimizer::BailoutType>(args.smi_at(0)); | 7649 static_cast<Deoptimizer::BailoutType>(args.smi_at(0)); |
7651 Deoptimizer* deoptimizer = Deoptimizer::Grab(isolate); | 7650 Deoptimizer* deoptimizer = Deoptimizer::Grab(isolate); |
7652 ASSERT(isolate->heap()->IsAllocationAllowed()); | 7651 ASSERT(isolate->heap()->IsAllocationAllowed()); |
7653 | 7652 |
7654 ASSERT(deoptimizer->compiled_code_kind() != Code::COMPILED_STUB); | 7653 ASSERT(deoptimizer->compiled_code_kind() == Code::OPTIMIZED_FUNCTION); |
7655 | 7654 |
7656 // Make sure to materialize objects before causing any allocation. | 7655 // Make sure to materialize objects before causing any allocation. |
7657 JavaScriptFrameIterator it(isolate); | 7656 JavaScriptFrameIterator it(isolate); |
7658 deoptimizer->MaterializeHeapObjects(&it); | 7657 deoptimizer->MaterializeHeapObjects(&it); |
7659 delete deoptimizer; | 7658 delete deoptimizer; |
7660 | 7659 |
7661 JavaScriptFrame* frame = it.frame(); | 7660 JavaScriptFrame* frame = it.frame(); |
7662 RUNTIME_ASSERT(frame->function()->IsJSFunction()); | 7661 RUNTIME_ASSERT(frame->function()->IsJSFunction()); |
7663 Handle<JSFunction> function(JSFunction::cast(frame->function()), isolate); | 7662 Handle<JSFunction> function(JSFunction::cast(frame->function()), isolate); |
7664 RUNTIME_ASSERT(type != Deoptimizer::EAGER || function->IsOptimized()); | 7663 RUNTIME_ASSERT(type != Deoptimizer::EAGER || function->IsOptimized()); |
(...skipping 5542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13207 // Handle last resort GC and make sure to allow future allocations | 13206 // Handle last resort GC and make sure to allow future allocations |
13208 // to grow the heap without causing GCs (if possible). | 13207 // to grow the heap without causing GCs (if possible). |
13209 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13208 isolate->counters()->gc_last_resort_from_js()->Increment(); |
13210 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13209 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
13211 "Runtime::PerformGC"); | 13210 "Runtime::PerformGC"); |
13212 } | 13211 } |
13213 } | 13212 } |
13214 | 13213 |
13215 | 13214 |
13216 } } // namespace v8::internal | 13215 } } // namespace v8::internal |
OLD | NEW |