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 7884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7895 } | 7895 } |
7896 | 7896 |
7897 bool has_activations() { return has_activations_; } | 7897 bool has_activations() { return has_activations_; } |
7898 | 7898 |
7899 private: | 7899 private: |
7900 JSFunction* function_; | 7900 JSFunction* function_; |
7901 bool has_activations_; | 7901 bool has_activations_; |
7902 }; | 7902 }; |
7903 | 7903 |
7904 | 7904 |
7905 RUNTIME_FUNCTION(MaybeObject*, Runtime_NotifyICMiss) { | |
7906 HandleScope scope(isolate); | |
7907 ASSERT(args.length() == 0); | |
7908 Deoptimizer* deoptimizer = Deoptimizer::Grab(isolate); | |
7909 ASSERT(isolate->heap()->IsAllocationAllowed()); | |
7910 ASSERT(deoptimizer->compiled_code_kind() == Code::COMPILED_STUB); | |
7911 delete deoptimizer; | |
7912 return isolate->heap()->undefined_value(); | |
7913 } | |
7914 | |
7915 | |
7916 RUNTIME_FUNCTION(MaybeObject*, Runtime_NotifyDeoptimized) { | 7905 RUNTIME_FUNCTION(MaybeObject*, Runtime_NotifyDeoptimized) { |
7917 HandleScope scope(isolate); | 7906 HandleScope scope(isolate); |
7918 ASSERT(args.length() == 1); | 7907 ASSERT(args.length() == 1); |
7919 RUNTIME_ASSERT(args[0]->IsSmi()); | 7908 RUNTIME_ASSERT(args[0]->IsSmi()); |
7920 Deoptimizer::BailoutType type = | 7909 Deoptimizer::BailoutType type = |
7921 static_cast<Deoptimizer::BailoutType>(args.smi_at(0)); | 7910 static_cast<Deoptimizer::BailoutType>(args.smi_at(0)); |
7922 Deoptimizer* deoptimizer = Deoptimizer::Grab(isolate); | 7911 Deoptimizer* deoptimizer = Deoptimizer::Grab(isolate); |
7923 ASSERT(isolate->heap()->IsAllocationAllowed()); | 7912 ASSERT(isolate->heap()->IsAllocationAllowed()); |
7924 | 7913 JavaScriptFrameIterator it(isolate); |
7925 ASSERT(deoptimizer->compiled_code_kind() != Code::COMPILED_STUB); | |
7926 | 7914 |
7927 // Make sure to materialize objects before causing any allocation. | 7915 // Make sure to materialize objects before causing any allocation. |
7928 JavaScriptFrameIterator it(isolate); | |
7929 deoptimizer->MaterializeHeapObjects(&it); | 7916 deoptimizer->MaterializeHeapObjects(&it); |
7930 delete deoptimizer; | 7917 delete deoptimizer; |
7931 | 7918 |
7932 JavaScriptFrame* frame = it.frame(); | 7919 JavaScriptFrame* frame = it.frame(); |
7933 RUNTIME_ASSERT(frame->function()->IsJSFunction()); | 7920 RUNTIME_ASSERT(frame->function()->IsJSFunction()); |
7934 Handle<JSFunction> function(JSFunction::cast(frame->function()), isolate); | 7921 Handle<JSFunction> function(JSFunction::cast(frame->function()), isolate); |
7935 RUNTIME_ASSERT(type != Deoptimizer::EAGER || function->IsOptimized()); | 7922 RUNTIME_ASSERT(type != Deoptimizer::EAGER || function->IsOptimized()); |
7936 | 7923 |
7937 // Avoid doing too much work when running with --always-opt and keep | 7924 // Avoid doing too much work when running with --always-opt and keep |
7938 // the optimized code around. | 7925 // the optimized code around. |
(...skipping 5457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13396 // Handle last resort GC and make sure to allow future allocations | 13383 // Handle last resort GC and make sure to allow future allocations |
13397 // to grow the heap without causing GCs (if possible). | 13384 // to grow the heap without causing GCs (if possible). |
13398 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13385 isolate->counters()->gc_last_resort_from_js()->Increment(); |
13399 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13386 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
13400 "Runtime::PerformGC"); | 13387 "Runtime::PerformGC"); |
13401 } | 13388 } |
13402 } | 13389 } |
13403 | 13390 |
13404 | 13391 |
13405 } } // namespace v8::internal | 13392 } } // namespace v8::internal |
OLD | NEW |