| Index: src/runtime/runtime-compiler.cc
|
| diff --git a/src/runtime/runtime-compiler.cc b/src/runtime/runtime-compiler.cc
|
| index 94cd343d58feae41587fba15828c4ad4296f91a7..2e806facb2bd6536bb51f0000dec34ecd5c36385 100644
|
| --- a/src/runtime/runtime-compiler.cc
|
| +++ b/src/runtime/runtime-compiler.cc
|
| @@ -369,16 +369,18 @@ RUNTIME_FUNCTION(Runtime_CompileString) {
|
| ParseRestriction restriction = function_literal_only
|
| ? ONLY_SINGLE_FUNCTION_LITERAL
|
| : NO_PARSE_RESTRICTION;
|
| + Handle<SharedFunctionInfo> outer_info(context->closure()->shared(), isolate);
|
| Handle<JSFunction> fun;
|
| ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
|
| isolate, fun,
|
| - Compiler::GetFunctionFromEval(source, context, SLOPPY, restriction,
|
| - RelocInfo::kNoPosition));
|
| + Compiler::GetFunctionFromEval(source, outer_info, context, SLOPPY,
|
| + restriction, RelocInfo::kNoPosition));
|
| return *fun;
|
| }
|
|
|
|
|
| static ObjectPair CompileGlobalEval(Isolate* isolate, Handle<String> source,
|
| + Handle<SharedFunctionInfo> outer_info,
|
| Handle<Object> receiver,
|
| StrictMode strict_mode,
|
| int scope_position) {
|
| @@ -404,8 +406,8 @@ static ObjectPair CompileGlobalEval(Isolate* isolate, Handle<String> source,
|
| Handle<JSFunction> compiled;
|
| ASSIGN_RETURN_ON_EXCEPTION_VALUE(
|
| isolate, compiled,
|
| - Compiler::GetFunctionFromEval(source, context, strict_mode, restriction,
|
| - scope_position),
|
| + Compiler::GetFunctionFromEval(source, outer_info, context, strict_mode,
|
| + restriction, scope_position),
|
| MakePair(isolate->heap()->exception(), NULL));
|
| return MakePair(*compiled, *receiver);
|
| }
|
| @@ -413,7 +415,7 @@ static ObjectPair CompileGlobalEval(Isolate* isolate, Handle<String> source,
|
|
|
| RUNTIME_FUNCTION_RETURN_PAIR(Runtime_ResolvePossiblyDirectEval) {
|
| HandleScope scope(isolate);
|
| - DCHECK(args.length() == 5);
|
| + DCHECK(args.length() == 6);
|
|
|
| Handle<Object> callee = args.at<Object>(0);
|
|
|
| @@ -427,12 +429,14 @@ RUNTIME_FUNCTION_RETURN_PAIR(Runtime_ResolvePossiblyDirectEval) {
|
| return MakePair(*callee, isolate->heap()->undefined_value());
|
| }
|
|
|
| - DCHECK(args[3]->IsSmi());
|
| - DCHECK(args.smi_at(3) == SLOPPY || args.smi_at(3) == STRICT);
|
| - StrictMode strict_mode = static_cast<StrictMode>(args.smi_at(3));
|
| DCHECK(args[4]->IsSmi());
|
| - return CompileGlobalEval(isolate, args.at<String>(1), args.at<Object>(2),
|
| - strict_mode, args.smi_at(4));
|
| + DCHECK(args.smi_at(4) == SLOPPY || args.smi_at(4) == STRICT);
|
| + StrictMode strict_mode = static_cast<StrictMode>(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,
|
| + args.at<Object>(3), strict_mode, args.smi_at(5));
|
| }
|
| }
|
| } // namespace v8::internal
|
|
|