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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 | 144 |
145 // Make sure to materialize objects before causing any allocation. | 145 // Make sure to materialize objects before causing any allocation. |
146 JavaScriptFrameIterator it(isolate); | 146 JavaScriptFrameIterator it(isolate); |
147 deoptimizer->MaterializeHeapObjects(&it); | 147 deoptimizer->MaterializeHeapObjects(&it); |
148 delete deoptimizer; | 148 delete deoptimizer; |
149 | 149 |
150 JavaScriptFrame* frame = it.frame(); | 150 JavaScriptFrame* frame = it.frame(); |
151 RUNTIME_ASSERT(frame->function()->IsJSFunction()); | 151 RUNTIME_ASSERT(frame->function()->IsJSFunction()); |
152 DCHECK(frame->function() == *function); | 152 DCHECK(frame->function() == *function); |
153 | 153 |
| 154 // Ensure the context register is updated for materialized objects. |
| 155 JavaScriptFrameIterator top_it(isolate); |
| 156 JavaScriptFrame* top_frame = top_it.frame(); |
| 157 isolate->set_context(Context::cast(top_frame->context())); |
| 158 |
154 if (type == Deoptimizer::LAZY) { | 159 if (type == Deoptimizer::LAZY) { |
155 return isolate->heap()->undefined_value(); | 160 return isolate->heap()->undefined_value(); |
156 } | 161 } |
157 | 162 |
158 // Search for other activations of the same function and code. | 163 // Search for other activations of the same function and code. |
159 ActivationsFinder activations_finder(*optimized_code); | 164 ActivationsFinder activations_finder(*optimized_code); |
160 activations_finder.VisitFrames(&it); | 165 activations_finder.VisitFrames(&it); |
161 isolate->thread_manager()->IterateArchivedThreads(&activations_finder); | 166 isolate->thread_manager()->IterateArchivedThreads(&activations_finder); |
162 | 167 |
163 if (!activations_finder.has_code_activations_) { | 168 if (!activations_finder.has_code_activations_) { |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 DCHECK(is_valid_language_mode(args.smi_at(3))); | 424 DCHECK(is_valid_language_mode(args.smi_at(3))); |
420 LanguageMode language_mode = static_cast<LanguageMode>(args.smi_at(3)); | 425 LanguageMode language_mode = static_cast<LanguageMode>(args.smi_at(3)); |
421 DCHECK(args[4]->IsSmi()); | 426 DCHECK(args[4]->IsSmi()); |
422 Handle<SharedFunctionInfo> outer_info(args.at<JSFunction>(2)->shared(), | 427 Handle<SharedFunctionInfo> outer_info(args.at<JSFunction>(2)->shared(), |
423 isolate); | 428 isolate); |
424 return CompileGlobalEval(isolate, args.at<String>(1), outer_info, | 429 return CompileGlobalEval(isolate, args.at<String>(1), outer_info, |
425 language_mode, args.smi_at(4)); | 430 language_mode, args.smi_at(4)); |
426 } | 431 } |
427 } // namespace internal | 432 } // namespace internal |
428 } // namespace v8 | 433 } // namespace v8 |
OLD | NEW |