Index: src/compiler/js-call-reducer.cc |
diff --git a/src/compiler/js-call-reducer.cc b/src/compiler/js-call-reducer.cc |
index e6b4fb8d80a85d5e146f87090aabf61720cd7243..0ca8fff05367b393e3b641b0975edab9f4cddd15 100644 |
--- a/src/compiler/js-call-reducer.cc |
+++ b/src/compiler/js-call-reducer.cc |
@@ -407,6 +407,9 @@ Reduction JSCallReducer::ReduceJSCallFunction(Node* node) { |
return Changed(node); |
} |
+ // Don't inline cross native context. |
+ if (function->native_context() != *native_context()) return NoChange(); |
+ |
// Check for known builtin functions. |
switch (shared->code()->builtin_index()) { |
case Builtins::kFunctionPrototypeApply: |
@@ -569,6 +572,9 @@ Reduction JSCallReducer::ReduceJSCallConstruct(Node* node) { |
return Changed(node); |
} |
+ // Don't inline cross native context. |
+ if (function->native_context() != *native_context()) return NoChange(); |
+ |
// Check for the ArrayConstructor. |
if (*function == function->native_context()->array_function()) { |
// Check if we have an allocation site. |