summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.cpp')
-rw-r--r--Source/JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/Source/JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.cpp b/Source/JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.cpp
index 9208cde1b..000e1a938 100644
--- a/Source/JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.cpp
@@ -317,6 +317,17 @@ public:
// PhantomArguments and OSR exit will still do the right things.
break;
+ case CheckStructure:
+ case ForwardCheckStructure:
+ case StructureTransitionWatchpoint:
+ case ForwardStructureTransitionWatchpoint:
+ // We don't care about these because if we get uses of the relevant
+ // variable then we can safely get rid of these, too. This of course
+ // relies on there not being any information transferred by the CFA
+ // from a CheckStructure on one variable to the information about the
+ // structures of another variable.
+ break;
+
default:
observeBadArgumentsUses(node);
break;
@@ -471,6 +482,19 @@ public:
break;
}
+ case CheckStructure:
+ case ForwardCheckStructure:
+ case StructureTransitionWatchpoint:
+ case ForwardStructureTransitionWatchpoint: {
+ // We can just get rid of this node, if it references a phantom argument.
+ if (!isOKToOptimize(m_graph[node.child1()]))
+ break;
+ m_graph.deref(node.child1());
+ node.setOpAndDefaultFlags(Phantom);
+ node.children.setChild1(Edge());
+ break;
+ }
+
case GetByVal: {
if (!node.prediction()
|| !m_graph[node.child1()].prediction()