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/asmjs/asm-js.h" | 8 #include "src/asmjs/asm-js.h" |
9 #include "src/compiler-dispatcher/optimizing-compile-dispatcher.h" | 9 #include "src/compiler-dispatcher/optimizing-compile-dispatcher.h" |
10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 DCHECK_NULL(isolate->context()); | 175 DCHECK_NULL(isolate->context()); |
176 | 176 |
177 // TODO(turbofan): For Crankshaft we restore the context before objects are | 177 // TODO(turbofan): For Crankshaft we restore the context before objects are |
178 // being materialized, because it never de-materializes the context but it | 178 // being materialized, because it never de-materializes the context but it |
179 // requires a context to materialize arguments objects. This is specific to | 179 // requires a context to materialize arguments objects. This is specific to |
180 // Crankshaft and can be removed once only TurboFan goes through here. | 180 // Crankshaft and can be removed once only TurboFan goes through here. |
181 if (!optimized_code->is_turbofanned()) { | 181 if (!optimized_code->is_turbofanned()) { |
182 JavaScriptFrameIterator top_it(isolate); | 182 JavaScriptFrameIterator top_it(isolate); |
183 JavaScriptFrame* top_frame = top_it.frame(); | 183 JavaScriptFrame* top_frame = top_it.frame(); |
184 isolate->set_context(Context::cast(top_frame->context())); | 184 isolate->set_context(Context::cast(top_frame->context())); |
| 185 } else { |
| 186 // TODO(turbofan): We currently need the native context to materialize |
| 187 // the arguments object, but only to get to its map. |
| 188 isolate->set_context(function->native_context()); |
185 } | 189 } |
186 | 190 |
187 // Make sure to materialize objects before causing any allocation. | 191 // Make sure to materialize objects before causing any allocation. |
188 JavaScriptFrameIterator it(isolate); | 192 JavaScriptFrameIterator it(isolate); |
189 deoptimizer->MaterializeHeapObjects(&it); | 193 deoptimizer->MaterializeHeapObjects(&it); |
190 delete deoptimizer; | 194 delete deoptimizer; |
191 | 195 |
192 // Ensure the context register is updated for materialized objects. | 196 // Ensure the context register is updated for materialized objects. |
193 if (optimized_code->is_turbofanned()) { | 197 if (optimized_code->is_turbofanned()) { |
194 JavaScriptFrameIterator top_it(isolate); | 198 JavaScriptFrameIterator top_it(isolate); |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 DCHECK(is_valid_language_mode(args.smi_at(3))); | 474 DCHECK(is_valid_language_mode(args.smi_at(3))); |
471 LanguageMode language_mode = static_cast<LanguageMode>(args.smi_at(3)); | 475 LanguageMode language_mode = static_cast<LanguageMode>(args.smi_at(3)); |
472 DCHECK(args[4]->IsSmi()); | 476 DCHECK(args[4]->IsSmi()); |
473 Handle<SharedFunctionInfo> outer_info(args.at<JSFunction>(2)->shared(), | 477 Handle<SharedFunctionInfo> outer_info(args.at<JSFunction>(2)->shared(), |
474 isolate); | 478 isolate); |
475 return CompileGlobalEval(isolate, args.at<String>(1), outer_info, | 479 return CompileGlobalEval(isolate, args.at<String>(1), outer_info, |
476 language_mode, args.smi_at(4), args.smi_at(5)); | 480 language_mode, args.smi_at(4), args.smi_at(5)); |
477 } | 481 } |
478 } // namespace internal | 482 } // namespace internal |
479 } // namespace v8 | 483 } // namespace v8 |
OLD | NEW |