OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
6 | 6 |
7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/compiler.h" | 8 #include "src/compiler.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/frames-inl.h" | 10 #include "src/frames-inl.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 | 130 |
131 RUNTIME_FUNCTION(Runtime_NotifyDeoptimized) { | 131 RUNTIME_FUNCTION(Runtime_NotifyDeoptimized) { |
132 HandleScope scope(isolate); | 132 HandleScope scope(isolate); |
133 DCHECK(args.length() == 1); | 133 DCHECK(args.length() == 1); |
134 CONVERT_SMI_ARG_CHECKED(type_arg, 0); | 134 CONVERT_SMI_ARG_CHECKED(type_arg, 0); |
135 Deoptimizer::BailoutType type = | 135 Deoptimizer::BailoutType type = |
136 static_cast<Deoptimizer::BailoutType>(type_arg); | 136 static_cast<Deoptimizer::BailoutType>(type_arg); |
137 Deoptimizer* deoptimizer = Deoptimizer::Grab(isolate); | 137 Deoptimizer* deoptimizer = Deoptimizer::Grab(isolate); |
138 DCHECK(AllowHeapAllocation::IsAllowed()); | 138 DCHECK(AllowHeapAllocation::IsAllowed()); |
139 TimerEventScope<TimerEventDeoptimizeCode> timer(isolate); | 139 TimerEventScope<TimerEventDeoptimizeCode> timer(isolate); |
| 140 TRACE_EVENT0("v8", "V8.DeoptimizeCode"); |
140 | 141 |
141 Handle<JSFunction> function = deoptimizer->function(); | 142 Handle<JSFunction> function = deoptimizer->function(); |
142 Handle<Code> optimized_code = deoptimizer->compiled_code(); | 143 Handle<Code> optimized_code = deoptimizer->compiled_code(); |
143 | 144 |
144 DCHECK(optimized_code->kind() == Code::OPTIMIZED_FUNCTION); | 145 DCHECK(optimized_code->kind() == Code::OPTIMIZED_FUNCTION); |
145 DCHECK(type == deoptimizer->bailout_type()); | 146 DCHECK(type == deoptimizer->bailout_type()); |
146 | 147 |
147 // Make sure to materialize objects before causing any allocation. | 148 // Make sure to materialize objects before causing any allocation. |
148 JavaScriptFrameIterator it(isolate); | 149 JavaScriptFrameIterator it(isolate); |
149 deoptimizer->MaterializeHeapObjects(&it); | 150 deoptimizer->MaterializeHeapObjects(&it); |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 DCHECK(is_valid_language_mode(args.smi_at(3))); | 430 DCHECK(is_valid_language_mode(args.smi_at(3))); |
430 LanguageMode language_mode = static_cast<LanguageMode>(args.smi_at(3)); | 431 LanguageMode language_mode = static_cast<LanguageMode>(args.smi_at(3)); |
431 DCHECK(args[4]->IsSmi()); | 432 DCHECK(args[4]->IsSmi()); |
432 Handle<SharedFunctionInfo> outer_info(args.at<JSFunction>(2)->shared(), | 433 Handle<SharedFunctionInfo> outer_info(args.at<JSFunction>(2)->shared(), |
433 isolate); | 434 isolate); |
434 return CompileGlobalEval(isolate, args.at<String>(1), outer_info, | 435 return CompileGlobalEval(isolate, args.at<String>(1), outer_info, |
435 language_mode, args.smi_at(4)); | 436 language_mode, args.smi_at(4)); |
436 } | 437 } |
437 } // namespace internal | 438 } // namespace internal |
438 } // namespace v8 | 439 } // namespace v8 |
OLD | NEW |