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 7871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7882 } | 7882 } |
7883 | 7883 |
7884 bool has_activations() { return has_activations_; } | 7884 bool has_activations() { return has_activations_; } |
7885 | 7885 |
7886 private: | 7886 private: |
7887 JSFunction* function_; | 7887 JSFunction* function_; |
7888 bool has_activations_; | 7888 bool has_activations_; |
7889 }; | 7889 }; |
7890 | 7890 |
7891 | 7891 |
7892 RUNTIME_FUNCTION(MaybeObject*, Runtime_NotifyICMiss) { | |
7893 HandleScope scope(isolate); | |
7894 ASSERT(args.length() == 0); | |
7895 Deoptimizer* deoptimizer = Deoptimizer::Grab(isolate); | |
7896 ASSERT(isolate->heap()->IsAllocationAllowed()); | |
7897 ASSERT(deoptimizer->compiled_code_kind() == Code::COMPILED_STUB); | |
7898 delete deoptimizer; | |
7899 return isolate->heap()->undefined_value(); | |
7900 } | |
7901 | |
7902 | |
7903 RUNTIME_FUNCTION(MaybeObject*, Runtime_NotifyDeoptimized) { | 7892 RUNTIME_FUNCTION(MaybeObject*, Runtime_NotifyDeoptimized) { |
7904 HandleScope scope(isolate); | 7893 HandleScope scope(isolate); |
7905 ASSERT(args.length() == 1); | 7894 ASSERT(args.length() == 1); |
7906 RUNTIME_ASSERT(args[0]->IsSmi()); | 7895 RUNTIME_ASSERT(args[0]->IsSmi()); |
7907 Deoptimizer::BailoutType type = | 7896 Deoptimizer::BailoutType type = |
7908 static_cast<Deoptimizer::BailoutType>(args.smi_at(0)); | 7897 static_cast<Deoptimizer::BailoutType>(args.smi_at(0)); |
7909 Deoptimizer* deoptimizer = Deoptimizer::Grab(isolate); | 7898 Deoptimizer* deoptimizer = Deoptimizer::Grab(isolate); |
7910 ASSERT(isolate->heap()->IsAllocationAllowed()); | 7899 ASSERT(isolate->heap()->IsAllocationAllowed()); |
7911 | 7900 JavaScriptFrameIterator it(isolate); |
7912 ASSERT(deoptimizer->compiled_code_kind() != Code::COMPILED_STUB); | |
7913 | 7901 |
7914 // Make sure to materialize objects before causing any allocation. | 7902 // Make sure to materialize objects before causing any allocation. |
7915 JavaScriptFrameIterator it(isolate); | |
7916 deoptimizer->MaterializeHeapObjects(&it); | 7903 deoptimizer->MaterializeHeapObjects(&it); |
7917 delete deoptimizer; | 7904 delete deoptimizer; |
7918 | 7905 |
7919 JavaScriptFrame* frame = it.frame(); | 7906 JavaScriptFrame* frame = it.frame(); |
7920 RUNTIME_ASSERT(frame->function()->IsJSFunction()); | 7907 RUNTIME_ASSERT(frame->function()->IsJSFunction()); |
7921 Handle<JSFunction> function(JSFunction::cast(frame->function()), isolate); | 7908 Handle<JSFunction> function(JSFunction::cast(frame->function()), isolate); |
7922 RUNTIME_ASSERT(type != Deoptimizer::EAGER || function->IsOptimized()); | 7909 RUNTIME_ASSERT(type != Deoptimizer::EAGER || function->IsOptimized()); |
7923 | 7910 |
7924 // Avoid doing too much work when running with --always-opt and keep | 7911 // Avoid doing too much work when running with --always-opt and keep |
7925 // the optimized code around. | 7912 // the optimized code around. |
(...skipping 5591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13517 // Handle last resort GC and make sure to allow future allocations | 13504 // Handle last resort GC and make sure to allow future allocations |
13518 // to grow the heap without causing GCs (if possible). | 13505 // to grow the heap without causing GCs (if possible). |
13519 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13506 isolate->counters()->gc_last_resort_from_js()->Increment(); |
13520 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13507 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
13521 "Runtime::PerformGC"); | 13508 "Runtime::PerformGC"); |
13522 } | 13509 } |
13523 } | 13510 } |
13524 | 13511 |
13525 | 13512 |
13526 } } // namespace v8::internal | 13513 } } // namespace v8::internal |
OLD | NEW |