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 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 restriction, eval_scope_position, eval_position), | 447 restriction, eval_scope_position, eval_position), |
448 isolate->heap()->exception()); | 448 isolate->heap()->exception()); |
449 return *compiled; | 449 return *compiled; |
450 } | 450 } |
451 | 451 |
452 | 452 |
453 RUNTIME_FUNCTION(Runtime_ResolvePossiblyDirectEval) { | 453 RUNTIME_FUNCTION(Runtime_ResolvePossiblyDirectEval) { |
454 HandleScope scope(isolate); | 454 HandleScope scope(isolate); |
455 DCHECK(args.length() == 6); | 455 DCHECK(args.length() == 6); |
456 | 456 |
457 Handle<Object> callee = args.at<Object>(0); | 457 Handle<Object> callee = args.at(0); |
458 | 458 |
459 // If "eval" didn't refer to the original GlobalEval, it's not a | 459 // If "eval" didn't refer to the original GlobalEval, it's not a |
460 // direct call to eval. | 460 // direct call to eval. |
461 // (And even if it is, but the first argument isn't a string, just let | 461 // (And even if it is, but the first argument isn't a string, just let |
462 // execution default to an indirect call to eval, which will also return | 462 // execution default to an indirect call to eval, which will also return |
463 // the first argument without doing anything). | 463 // the first argument without doing anything). |
464 if (*callee != isolate->native_context()->global_eval_fun() || | 464 if (*callee != isolate->native_context()->global_eval_fun() || |
465 !args[1]->IsString()) { | 465 !args[1]->IsString()) { |
466 return *callee; | 466 return *callee; |
467 } | 467 } |
468 | 468 |
469 DCHECK(args[3]->IsSmi()); | 469 DCHECK(args[3]->IsSmi()); |
470 DCHECK(is_valid_language_mode(args.smi_at(3))); | 470 DCHECK(is_valid_language_mode(args.smi_at(3))); |
471 LanguageMode language_mode = static_cast<LanguageMode>(args.smi_at(3)); | 471 LanguageMode language_mode = static_cast<LanguageMode>(args.smi_at(3)); |
472 DCHECK(args[4]->IsSmi()); | 472 DCHECK(args[4]->IsSmi()); |
473 Handle<SharedFunctionInfo> outer_info(args.at<JSFunction>(2)->shared(), | 473 Handle<SharedFunctionInfo> outer_info(args.at<JSFunction>(2)->shared(), |
474 isolate); | 474 isolate); |
475 return CompileGlobalEval(isolate, args.at<String>(1), outer_info, | 475 return CompileGlobalEval(isolate, args.at<String>(1), outer_info, |
476 language_mode, args.smi_at(4), args.smi_at(5)); | 476 language_mode, args.smi_at(4), args.smi_at(5)); |
477 } | 477 } |
478 } // namespace internal | 478 } // namespace internal |
479 } // namespace v8 | 479 } // namespace v8 |
OLD | NEW |