diff options
Diffstat (limited to 'Source/JavaScriptCore/dfg/DFGSSALoweringPhase.cpp')
| -rw-r--r-- | Source/JavaScriptCore/dfg/DFGSSALoweringPhase.cpp | 35 |
1 files changed, 11 insertions, 24 deletions
diff --git a/Source/JavaScriptCore/dfg/DFGSSALoweringPhase.cpp b/Source/JavaScriptCore/dfg/DFGSSALoweringPhase.cpp index c4b67a361..51d5fd0e4 100644 --- a/Source/JavaScriptCore/dfg/DFGSSALoweringPhase.cpp +++ b/Source/JavaScriptCore/dfg/DFGSSALoweringPhase.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. + * Copyright (C) 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,7 +32,7 @@ #include "DFGGraph.h" #include "DFGInsertionSet.h" #include "DFGPhase.h" -#include "JSCInlines.h" +#include "Operations.h" namespace JSC { namespace DFG { @@ -69,49 +69,36 @@ private: { switch (m_node->op()) { case GetByVal: - case HasIndexedProperty: lowerBoundsCheck(m_node->child1(), m_node->child2(), m_node->child3()); break; case PutByVal: - case PutByValDirect: { - Edge base = m_graph.varArgChild(m_node, 0); - Edge index = m_graph.varArgChild(m_node, 1); - Edge storage = m_graph.varArgChild(m_node, 3); - if (lowerBoundsCheck(base, index, storage)) - break; - - if (m_node->arrayMode().typedArrayType() != NotTypedArray && m_node->arrayMode().isOutOfBounds()) { - Node* length = m_insertionSet.insertNode( - m_nodeIndex, SpecInt32, GetArrayLength, m_node->origin, - OpInfo(m_node->arrayMode().asWord()), base, storage); - - m_graph.varArgChild(m_node, 4) = Edge(length, KnownInt32Use); - break; - } + case PutByValDirect: + lowerBoundsCheck( + m_graph.varArgChild(m_node, 0), + m_graph.varArgChild(m_node, 1), + m_graph.varArgChild(m_node, 3)); break; - } default: break; } } - bool lowerBoundsCheck(Edge base, Edge index, Edge storage) + void lowerBoundsCheck(Edge base, Edge index, Edge storage) { if (!m_node->arrayMode().permitsBoundsCheckLowering()) - return false; + return; if (!m_node->arrayMode().lengthNeedsStorage()) storage = Edge(); Node* length = m_insertionSet.insertNode( - m_nodeIndex, SpecInt32, GetArrayLength, m_node->origin, + m_nodeIndex, SpecInt32, GetArrayLength, m_node->codeOrigin, OpInfo(m_node->arrayMode().asWord()), base, storage); m_insertionSet.insertNode( - m_nodeIndex, SpecInt32, CheckInBounds, m_node->origin, + m_nodeIndex, SpecInt32, CheckInBounds, m_node->codeOrigin, index, Edge(length, KnownInt32Use)); - return true; } InsertionSet m_insertionSet; |
