| Index: src/x64/full-codegen-x64.cc
|
| diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc
|
| index 18820767fdbb53a6a979eaa73ff13953903843b5..6629927675b73449e08a763b4c6db1ea0e75977d 100644
|
| --- a/src/x64/full-codegen-x64.cc
|
| +++ b/src/x64/full-codegen-x64.cc
|
| @@ -4180,19 +4180,20 @@ void FullCodeGenerator::LoadContextField(Register dst, int context_index) {
|
|
|
|
|
| void FullCodeGenerator::PushFunctionArgumentForContextAllocation() {
|
| - if (scope()->is_global_scope()) {
|
| + Scope* declaration_scope = scope()->DeclarationScope();
|
| + if (declaration_scope->is_global_scope()) {
|
| // Contexts nested in the global context have a canonical empty function
|
| // as their closure, not the anonymous closure containing the global
|
| // code. Pass a smi sentinel and let the runtime look up the empty
|
| // function.
|
| __ Push(Smi::FromInt(0));
|
| - } else if (scope()->is_eval_scope()) {
|
| + } else if (declaration_scope->is_eval_scope()) {
|
| // Contexts created by a call to eval have the same closure as the
|
| // context calling eval, not the anonymous closure containing the eval
|
| // code. Fetch it from the context.
|
| __ push(ContextOperand(rsi, Context::CLOSURE_INDEX));
|
| } else {
|
| - ASSERT(scope()->is_function_scope() || scope()->is_catch_scope());
|
| + ASSERT(declaration_scope->is_function_scope());
|
| __ push(Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
|
| }
|
| }
|
|
|