Index: src/runtime/runtime-compiler.cc |
diff --git a/src/runtime/runtime-compiler.cc b/src/runtime/runtime-compiler.cc |
index ba92faa3fafe1bca55007012429250f266be7555..09ac2ab96b22ddb0d33dd24ab899fdaeabf1ad34 100644 |
--- a/src/runtime/runtime-compiler.cc |
+++ b/src/runtime/runtime-compiler.cc |
@@ -381,10 +381,11 @@ |
} |
-static Object* CompileGlobalEval(Isolate* isolate, Handle<String> source, |
- Handle<SharedFunctionInfo> outer_info, |
- LanguageMode language_mode, |
- int scope_position) { |
+static ObjectPair CompileGlobalEval(Isolate* isolate, Handle<String> source, |
+ Handle<SharedFunctionInfo> outer_info, |
+ Handle<Object> receiver, |
+ LanguageMode language_mode, |
+ int scope_position) { |
Handle<Context> context = Handle<Context>(isolate->context()); |
Handle<Context> native_context = Handle<Context>(context->native_context()); |
@@ -398,7 +399,7 @@ |
MaybeHandle<Object> maybe_error = isolate->factory()->NewEvalError( |
MessageTemplate::kCodeGenFromStrings, error_message); |
if (maybe_error.ToHandle(&error)) isolate->Throw(*error); |
- return isolate->heap()->exception(); |
+ return MakePair(isolate->heap()->exception(), NULL); |
} |
// Deal with a normal eval call with a string argument. Compile it |
@@ -409,14 +410,14 @@ |
isolate, compiled, |
Compiler::GetFunctionFromEval(source, outer_info, context, language_mode, |
restriction, scope_position), |
- isolate->heap()->exception()); |
- return *compiled; |
-} |
- |
- |
-RUNTIME_FUNCTION(Runtime_ResolvePossiblyDirectEval) { |
- HandleScope scope(isolate); |
- DCHECK(args.length() == 5); |
+ MakePair(isolate->heap()->exception(), NULL)); |
+ return MakePair(*compiled, *receiver); |
+} |
+ |
+ |
+RUNTIME_FUNCTION_RETURN_PAIR(Runtime_ResolvePossiblyDirectEval) { |
+ HandleScope scope(isolate); |
+ DCHECK(args.length() == 6); |
Handle<Object> callee = args.at<Object>(0); |
@@ -427,17 +428,17 @@ |
// the first argument without doing anything). |
if (*callee != isolate->native_context()->global_eval_fun() || |
!args[1]->IsString()) { |
- return *callee; |
- } |
- |
- DCHECK(args[3]->IsSmi()); |
- DCHECK(is_valid_language_mode(args.smi_at(3))); |
- LanguageMode language_mode = static_cast<LanguageMode>(args.smi_at(3)); |
+ return MakePair(*callee, isolate->heap()->undefined_value()); |
+ } |
+ |
DCHECK(args[4]->IsSmi()); |
+ DCHECK(is_valid_language_mode(args.smi_at(4))); |
+ LanguageMode language_mode = static_cast<LanguageMode>(args.smi_at(4)); |
+ DCHECK(args[5]->IsSmi()); |
Handle<SharedFunctionInfo> outer_info(args.at<JSFunction>(2)->shared(), |
isolate); |
return CompileGlobalEval(isolate, args.at<String>(1), outer_info, |
- language_mode, args.smi_at(4)); |
+ args.at<Object>(3), language_mode, args.smi_at(5)); |
} |
} // namespace internal |
} // namespace v8 |