| 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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 MessageTemplate::kCodeGenFromStrings, error_message); | 448 MessageTemplate::kCodeGenFromStrings, error_message); |
| 449 if (maybe_error.ToHandle(&error)) isolate->Throw(*error); | 449 if (maybe_error.ToHandle(&error)) isolate->Throw(*error); |
| 450 return isolate->heap()->exception(); | 450 return isolate->heap()->exception(); |
| 451 } | 451 } |
| 452 | 452 |
| 453 // Deal with a normal eval call with a string argument. Compile it | 453 // Deal with a normal eval call with a string argument. Compile it |
| 454 // and return the compiled function bound in the local context. | 454 // and return the compiled function bound in the local context. |
| 455 static const ParseRestriction restriction = NO_PARSE_RESTRICTION; | 455 static const ParseRestriction restriction = NO_PARSE_RESTRICTION; |
| 456 Handle<JSFunction> compiled; | 456 Handle<JSFunction> compiled; |
| 457 ASSIGN_RETURN_ON_EXCEPTION_VALUE( | 457 ASSIGN_RETURN_ON_EXCEPTION_VALUE( |
| 458 isolate, compiled, Compiler::GetFunctionFromEval( | 458 isolate, compiled, |
| 459 source, outer_info, context, language_mode, | 459 Compiler::GetFunctionFromEval(source, outer_info, context, language_mode, |
| 460 restriction, eval_scope_position, eval_position), | 460 restriction, kNoSourcePosition, |
| 461 eval_scope_position, eval_position), |
| 461 isolate->heap()->exception()); | 462 isolate->heap()->exception()); |
| 462 return *compiled; | 463 return *compiled; |
| 463 } | 464 } |
| 464 | 465 |
| 465 | 466 |
| 466 RUNTIME_FUNCTION(Runtime_ResolvePossiblyDirectEval) { | 467 RUNTIME_FUNCTION(Runtime_ResolvePossiblyDirectEval) { |
| 467 HandleScope scope(isolate); | 468 HandleScope scope(isolate); |
| 468 DCHECK(args.length() == 6); | 469 DCHECK(args.length() == 6); |
| 469 | 470 |
| 470 Handle<Object> callee = args.at<Object>(0); | 471 Handle<Object> callee = args.at<Object>(0); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 483 DCHECK(is_valid_language_mode(args.smi_at(3))); | 484 DCHECK(is_valid_language_mode(args.smi_at(3))); |
| 484 LanguageMode language_mode = static_cast<LanguageMode>(args.smi_at(3)); | 485 LanguageMode language_mode = static_cast<LanguageMode>(args.smi_at(3)); |
| 485 DCHECK(args[4]->IsSmi()); | 486 DCHECK(args[4]->IsSmi()); |
| 486 Handle<SharedFunctionInfo> outer_info(args.at<JSFunction>(2)->shared(), | 487 Handle<SharedFunctionInfo> outer_info(args.at<JSFunction>(2)->shared(), |
| 487 isolate); | 488 isolate); |
| 488 return CompileGlobalEval(isolate, args.at<String>(1), outer_info, | 489 return CompileGlobalEval(isolate, args.at<String>(1), outer_info, |
| 489 language_mode, args.smi_at(4), args.smi_at(5)); | 490 language_mode, args.smi_at(4), args.smi_at(5)); |
| 490 } | 491 } |
| 491 } // namespace internal | 492 } // namespace internal |
| 492 } // namespace v8 | 493 } // namespace v8 |
| OLD | NEW |