Index: src/code-stubs-hydrogen.cc |
diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc |
index dae884ac2214e3c2423aa1c80a23f7b94051f014..e4f75a4e0f2377bf69ed7c1f404c63141b3ab443 100644 |
--- a/src/code-stubs-hydrogen.cc |
+++ b/src/code-stubs-hydrogen.cc |
@@ -2137,14 +2137,13 @@ HValue* CodeStubGraphBuilder<FastNewContextStub>::BuildCodeStub() { |
HObjectAccess::ForContextSlot(Context::EXTENSION_INDEX), |
graph()->GetConstant0()); |
- // Copy the global object from the previous context. |
- HValue* global_object = Add<HLoadNamedField>( |
+ // Copy the native context from the previous context. |
+ HValue* native_context = Add<HLoadNamedField>( |
context(), nullptr, |
- HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX)); |
- Add<HStoreNamedField>(function_context, |
- HObjectAccess::ForContextSlot( |
- Context::GLOBAL_OBJECT_INDEX), |
- global_object); |
+ HObjectAccess::ForContextSlot(Context::NATIVE_CONTEXT_INDEX)); |
+ Add<HStoreNamedField>(function_context, HObjectAccess::ForContextSlot( |
+ Context::NATIVE_CONTEXT_INDEX), |
+ native_context); |
// Initialize the rest of the slots to undefined. |
for (int i = Context::MIN_CONTEXT_SLOTS; i < length; ++i) { |