Index: src/full-codegen/x64/full-codegen-x64.cc |
diff --git a/src/full-codegen/x64/full-codegen-x64.cc b/src/full-codegen/x64/full-codegen-x64.cc |
index f31bad90b46f26c73bc625319705a6710be3d512..b5f3ebbab627034768821b7bae11957c9c3e9eb7 100644 |
--- a/src/full-codegen/x64/full-codegen-x64.cc |
+++ b/src/full-codegen/x64/full-codegen-x64.cc |
@@ -4731,9 +4731,10 @@ void FullCodeGenerator::PushFunctionArgumentForContextAllocation() { |
closure_scope->is_module_scope()) { |
// Contexts nested in the native 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)); |
+ // code. |
+ __ movp(rax, GlobalObjectOperand()); |
+ __ movp(rax, FieldOperand(rax, JSGlobalObject::kNativeContextOffset)); |
+ __ Push(ContextOperand(rax, Context::CLOSURE_INDEX)); |
} else if (closure_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 |