Reviewers: jarin,

Description:
[turbofan] Carefully update frame states during inlining.

During inlining we should pay attention to only rewire the outer frame
states of the inlinee, but leave any inner frame states of the inlinee
untouched.  Otherwise we might run into trouble once we start caching
graphs, or do getter/setter inlining.

[email protected]

Please review this at https://codereview.chromium.org/1134973006/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+8, -3 lines):
  M src/compiler/js-inlining.cc


Index: src/compiler/js-inlining.cc
diff --git a/src/compiler/js-inlining.cc b/src/compiler/js-inlining.cc
index 66d71a6e298daf623d612a0f511f6881bb90baec..90c6eecb2e94688016ddeca3e213a4ff50b5b18d 100644
--- a/src/compiler/js-inlining.cc
+++ b/src/compiler/js-inlining.cc
@@ -351,10 +351,15 @@ Reduction JSInliner::Reduce(Node* node) {
outer_frame_state = CreateArgumentsAdaptorFrameState(&call, info.zone());
   }

-  for (Node* node : visitor.copies()) {
-    if (node && node->opcode() == IrOpcode::kFrameState) {
+  // Fix up all outer frame states from the inlinee.
+  for (Node* const node : visitor.copies()) {
+    if (node->opcode() == IrOpcode::kFrameState) {
DCHECK_EQ(1, OperatorProperties::GetFrameStateInputCount(node->op()));
-      NodeProperties::ReplaceFrameStateInput(node, 0, outer_frame_state);
+ // Don't touch this frame state, if it already has an "outer frame state".
+      if (NodeProperties::GetFrameStateInput(node, 0)->opcode() !=
+          IrOpcode::kFrameState) {
+        NodeProperties::ReplaceFrameStateInput(node, 0, outer_frame_state);
+      }
     }
   }



--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to