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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 | 129 |
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 | 140 |
140 Handle<JSFunction> function = deoptimizer->function(); | 141 Handle<JSFunction> function = deoptimizer->function(); |
141 Handle<Code> optimized_code = deoptimizer->compiled_code(); | 142 Handle<Code> optimized_code = deoptimizer->compiled_code(); |
142 | 143 |
143 DCHECK(optimized_code->kind() == Code::OPTIMIZED_FUNCTION); | 144 DCHECK(optimized_code->kind() == Code::OPTIMIZED_FUNCTION); |
144 DCHECK(type == deoptimizer->bailout_type()); | 145 DCHECK(type == deoptimizer->bailout_type()); |
145 | 146 |
146 // Make sure to materialize objects before causing any allocation. | 147 // Make sure to materialize objects before causing any allocation. |
147 JavaScriptFrameIterator it(isolate); | 148 JavaScriptFrameIterator it(isolate); |
148 deoptimizer->MaterializeHeapObjects(&it); | 149 deoptimizer->MaterializeHeapObjects(&it); |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 DCHECK(is_valid_language_mode(args.smi_at(3))); | 429 DCHECK(is_valid_language_mode(args.smi_at(3))); |
429 LanguageMode language_mode = static_cast<LanguageMode>(args.smi_at(3)); | 430 LanguageMode language_mode = static_cast<LanguageMode>(args.smi_at(3)); |
430 DCHECK(args[4]->IsSmi()); | 431 DCHECK(args[4]->IsSmi()); |
431 Handle<SharedFunctionInfo> outer_info(args.at<JSFunction>(2)->shared(), | 432 Handle<SharedFunctionInfo> outer_info(args.at<JSFunction>(2)->shared(), |
432 isolate); | 433 isolate); |
433 return CompileGlobalEval(isolate, args.at<String>(1), outer_info, | 434 return CompileGlobalEval(isolate, args.at<String>(1), outer_info, |
434 language_mode, args.smi_at(4)); | 435 language_mode, args.smi_at(4)); |
435 } | 436 } |
436 } // namespace internal | 437 } // namespace internal |
437 } // namespace v8 | 438 } // namespace v8 |
OLD | NEW |