Index: src/compiler/node-properties.cc |
diff --git a/src/compiler/node-properties.cc b/src/compiler/node-properties.cc |
index 90ffef30ee5fed5c23d8a74faaefb6c0b258e555..ac9cc34dd9cd1ac577bf2bdf455e4c6fe3ff1d6a 100644 |
--- a/src/compiler/node-properties.cc |
+++ b/src/compiler/node-properties.cc |
@@ -4,6 +4,7 @@ |
#include "src/compiler/common-operator.h" |
#include "src/compiler/graph.h" |
+#include "src/compiler/js-operator.h" |
#include "src/compiler/linkage.h" |
#include "src/compiler/node-properties.h" |
#include "src/compiler/operator-properties.h" |
@@ -335,6 +336,16 @@ MaybeHandle<Context> NodeProperties::GetSpecializationNativeContext( |
Node* node, MaybeHandle<Context> native_context) { |
while (true) { |
switch (node->opcode()) { |
+ case IrOpcode::kJSLoadContext: { |
+ ContextAccess const& access = ContextAccessOf(node->op()); |
+ if (access.index() != Context::NATIVE_CONTEXT_INDEX) { |
+ return MaybeHandle<Context>(); |
+ } |
+ // Skip over the intermediate contexts, we're only interested in the |
+ // very last context in the context chain anyway. |
+ node = NodeProperties::GetContextInput(node); |
+ break; |
+ } |
case IrOpcode::kJSCreateBlockContext: |
case IrOpcode::kJSCreateCatchContext: |
case IrOpcode::kJSCreateFunctionContext: |