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