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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 127 |
128 | 128 |
129 RUNTIME_FUNCTION(Runtime_NotifyDeoptimized) { | 129 RUNTIME_FUNCTION(Runtime_NotifyDeoptimized) { |
130 HandleScope scope(isolate); | 130 HandleScope scope(isolate); |
131 DCHECK(args.length() == 1); | 131 DCHECK(args.length() == 1); |
132 CONVERT_SMI_ARG_CHECKED(type_arg, 0); | 132 CONVERT_SMI_ARG_CHECKED(type_arg, 0); |
133 Deoptimizer::BailoutType type = | 133 Deoptimizer::BailoutType type = |
134 static_cast<Deoptimizer::BailoutType>(type_arg); | 134 static_cast<Deoptimizer::BailoutType>(type_arg); |
135 Deoptimizer* deoptimizer = Deoptimizer::Grab(isolate); | 135 Deoptimizer* deoptimizer = Deoptimizer::Grab(isolate); |
136 DCHECK(AllowHeapAllocation::IsAllowed()); | 136 DCHECK(AllowHeapAllocation::IsAllowed()); |
| 137 TimerEventScope<TimerEventDeoptimizeCode> timer(isolate); |
137 | 138 |
138 Handle<JSFunction> function = deoptimizer->function(); | 139 Handle<JSFunction> function = deoptimizer->function(); |
139 Handle<Code> optimized_code = deoptimizer->compiled_code(); | 140 Handle<Code> optimized_code = deoptimizer->compiled_code(); |
140 | 141 |
141 DCHECK(optimized_code->kind() == Code::OPTIMIZED_FUNCTION); | 142 DCHECK(optimized_code->kind() == Code::OPTIMIZED_FUNCTION); |
142 DCHECK(type == deoptimizer->bailout_type()); | 143 DCHECK(type == deoptimizer->bailout_type()); |
143 | 144 |
144 // Make sure to materialize objects before causing any allocation. | 145 // Make sure to materialize objects before causing any allocation. |
145 JavaScriptFrameIterator it(isolate); | 146 JavaScriptFrameIterator it(isolate); |
146 deoptimizer->MaterializeHeapObjects(&it); | 147 deoptimizer->MaterializeHeapObjects(&it); |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 DCHECK(is_valid_language_mode(args.smi_at(3))); | 424 DCHECK(is_valid_language_mode(args.smi_at(3))); |
424 LanguageMode language_mode = static_cast<LanguageMode>(args.smi_at(3)); | 425 LanguageMode language_mode = static_cast<LanguageMode>(args.smi_at(3)); |
425 DCHECK(args[4]->IsSmi()); | 426 DCHECK(args[4]->IsSmi()); |
426 Handle<SharedFunctionInfo> outer_info(args.at<JSFunction>(2)->shared(), | 427 Handle<SharedFunctionInfo> outer_info(args.at<JSFunction>(2)->shared(), |
427 isolate); | 428 isolate); |
428 return CompileGlobalEval(isolate, args.at<String>(1), outer_info, | 429 return CompileGlobalEval(isolate, args.at<String>(1), outer_info, |
429 language_mode, args.smi_at(4)); | 430 language_mode, args.smi_at(4)); |
430 } | 431 } |
431 } // namespace internal | 432 } // namespace internal |
432 } // namespace v8 | 433 } // namespace v8 |
OLD | NEW |