Index: src/compiler/bytecode-graph-builder.cc |
diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc |
index aca372689b845ca099564d0f42fb9b014298db9b..47a22df239854b4ef2568736d4c8bcaa87a2a32a 100644 |
--- a/src/compiler/bytecode-graph-builder.cc |
+++ b/src/compiler/bytecode-graph-builder.cc |
@@ -148,10 +148,17 @@ |
} |
+Node* BytecodeGraphBuilder::BuildLoadGlobalObject() { |
+ const Operator* load_op = |
+ javascript()->LoadContext(0, Context::GLOBAL_OBJECT_INDEX, true); |
+ return NewNode(load_op, GetFunctionContext()); |
+} |
+ |
+ |
Node* BytecodeGraphBuilder::BuildLoadNativeContextField(int index) { |
- const Operator* op = |
- javascript()->LoadContext(0, Context::NATIVE_CONTEXT_INDEX, true); |
- Node* native_context = NewNode(op, environment()->Context()); |
+ Node* global = BuildLoadGlobalObject(); |
+ Node* native_context = |
+ BuildLoadObjectField(global, JSGlobalObject::kNativeContextOffset); |
return NewNode(javascript()->LoadContext(0, index, true), native_context); |
} |