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