Title: [181650] trunk/Source/_javascript_Core
Revision
181650
Author
[email protected]
Date
2015-03-17 08:50:44 -0700 (Tue, 17 Mar 2015)

Log Message

DFG IR shouldn't have a separate node for every kind of put hint that could be described using PromotedLocationDescriptor
https://bugs.webkit.org/show_bug.cgi?id=142769

Reviewed by Michael Saboff.
        
When we sink an object allocation, we need to have some way of tracking what stores would
have happened had the allocation not been sunk, so that we know how to rematerialize the
object on OSR exit. Prior to this change, trunk had two ways of describing such a "put
hint":
        
- The PutStrutureHint and PutByOffsetHint node types.
- The PromotedLocationDescriptor class, which has an enum with cases StructurePLoc and
  NamedPropertyPLoc.
        
We also had ways of converting from a Node with those two node types to a
PromotedLocationDescriptor, and we had a way of converting a PromotedLocationDescriptor to
a Node.
        
This change removes the redundancy. We now have just one node type that corresponds to a
put hint, and it's called PutHint. It has a PromotedLocationDescriptor as metadata.
Converting between a PutHint node and a PromotedLocationDescriptor and vice-versa is now
trivial.
        
This means that if we add new kinds of sunken objects, we'll have less pro-forma to write
for the put hints to those objects. This is mainly to simplify the implementation of
arguments elimination in bug 141174.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::dump):
(JSC::DFG::Graph::mergeRelevantToOSR):
* dfg/DFGMayExit.cpp:
(JSC::DFG::mayExit):
* dfg/DFGNode.cpp:
(JSC::DFG::Node::convertToPutHint):
(JSC::DFG::Node::convertToPutStructureHint):
(JSC::DFG::Node::convertToPutByOffsetHint):
(JSC::DFG::Node::promotedLocationDescriptor):
* dfg/DFGNode.h:
(JSC::DFG::Node::hasIdentifier):
(JSC::DFG::Node::hasPromotedLocationDescriptor):
(JSC::DFG::Node::convertToPutByOffsetHint): Deleted.
(JSC::DFG::Node::convertToPutStructureHint): Deleted.
* dfg/DFGNodeType.h:
* dfg/DFGOSRAvailabilityAnalysisPhase.cpp:
(JSC::DFG::LocalOSRAvailabilityCalculator::executeNode):
* dfg/DFGObjectAllocationSinkingPhase.cpp:
(JSC::DFG::ObjectAllocationSinkingPhase::run):
(JSC::DFG::ObjectAllocationSinkingPhase::lowerNonReadingOperationsOnPhantomAllocations):
(JSC::DFG::ObjectAllocationSinkingPhase::handleNode):
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGPromoteHeapAccess.h:
(JSC::DFG::promoteHeapAccess):
* dfg/DFGPromotedHeapLocation.cpp:
(JSC::DFG::PromotedHeapLocation::createHint):
* dfg/DFGPromotedHeapLocation.h:
(JSC::DFG::PromotedLocationDescriptor::imm1):
(JSC::DFG::PromotedLocationDescriptor::imm2):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGValidate.cpp:
(JSC::DFG::Validate::validateCPS):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileNode):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (181649 => 181650)


--- trunk/Source/_javascript_Core/ChangeLog	2015-03-17 15:48:32 UTC (rev 181649)
+++ trunk/Source/_javascript_Core/ChangeLog	2015-03-17 15:50:44 UTC (rev 181650)
@@ -1,3 +1,84 @@
+2015-03-16  Filip Pizlo  <[email protected]>
+
+        DFG IR shouldn't have a separate node for every kind of put hint that could be described using PromotedLocationDescriptor
+        https://bugs.webkit.org/show_bug.cgi?id=142769
+
+        Reviewed by Michael Saboff.
+        
+        When we sink an object allocation, we need to have some way of tracking what stores would
+        have happened had the allocation not been sunk, so that we know how to rematerialize the
+        object on OSR exit. Prior to this change, trunk had two ways of describing such a "put
+        hint":
+        
+        - The PutStrutureHint and PutByOffsetHint node types.
+        - The PromotedLocationDescriptor class, which has an enum with cases StructurePLoc and
+          NamedPropertyPLoc.
+        
+        We also had ways of converting from a Node with those two node types to a
+        PromotedLocationDescriptor, and we had a way of converting a PromotedLocationDescriptor to
+        a Node.
+        
+        This change removes the redundancy. We now have just one node type that corresponds to a
+        put hint, and it's called PutHint. It has a PromotedLocationDescriptor as metadata.
+        Converting between a PutHint node and a PromotedLocationDescriptor and vice-versa is now
+        trivial.
+        
+        This means that if we add new kinds of sunken objects, we'll have less pro-forma to write
+        for the put hints to those objects. This is mainly to simplify the implementation of
+        arguments elimination in bug 141174.
+
+        * dfg/DFGAbstractInterpreterInlines.h:
+        (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
+        * dfg/DFGClobberize.h:
+        (JSC::DFG::clobberize):
+        * dfg/DFGDoesGC.cpp:
+        (JSC::DFG::doesGC):
+        * dfg/DFGFixupPhase.cpp:
+        (JSC::DFG::FixupPhase::fixupNode):
+        * dfg/DFGGraph.cpp:
+        (JSC::DFG::Graph::dump):
+        (JSC::DFG::Graph::mergeRelevantToOSR):
+        * dfg/DFGMayExit.cpp:
+        (JSC::DFG::mayExit):
+        * dfg/DFGNode.cpp:
+        (JSC::DFG::Node::convertToPutHint):
+        (JSC::DFG::Node::convertToPutStructureHint):
+        (JSC::DFG::Node::convertToPutByOffsetHint):
+        (JSC::DFG::Node::promotedLocationDescriptor):
+        * dfg/DFGNode.h:
+        (JSC::DFG::Node::hasIdentifier):
+        (JSC::DFG::Node::hasPromotedLocationDescriptor):
+        (JSC::DFG::Node::convertToPutByOffsetHint): Deleted.
+        (JSC::DFG::Node::convertToPutStructureHint): Deleted.
+        * dfg/DFGNodeType.h:
+        * dfg/DFGOSRAvailabilityAnalysisPhase.cpp:
+        (JSC::DFG::LocalOSRAvailabilityCalculator::executeNode):
+        * dfg/DFGObjectAllocationSinkingPhase.cpp:
+        (JSC::DFG::ObjectAllocationSinkingPhase::run):
+        (JSC::DFG::ObjectAllocationSinkingPhase::lowerNonReadingOperationsOnPhantomAllocations):
+        (JSC::DFG::ObjectAllocationSinkingPhase::handleNode):
+        * dfg/DFGPredictionPropagationPhase.cpp:
+        (JSC::DFG::PredictionPropagationPhase::propagate):
+        * dfg/DFGPromoteHeapAccess.h:
+        (JSC::DFG::promoteHeapAccess):
+        * dfg/DFGPromotedHeapLocation.cpp:
+        (JSC::DFG::PromotedHeapLocation::createHint):
+        * dfg/DFGPromotedHeapLocation.h:
+        (JSC::DFG::PromotedLocationDescriptor::imm1):
+        (JSC::DFG::PromotedLocationDescriptor::imm2):
+        * dfg/DFGSafeToExecute.h:
+        (JSC::DFG::safeToExecute):
+        * dfg/DFGSpeculativeJIT32_64.cpp:
+        (JSC::DFG::SpeculativeJIT::compile):
+        * dfg/DFGSpeculativeJIT64.cpp:
+        (JSC::DFG::SpeculativeJIT::compile):
+        * dfg/DFGValidate.cpp:
+        (JSC::DFG::Validate::validateCPS):
+        * ftl/FTLCapabilities.cpp:
+        (JSC::FTL::canCompile):
+        * ftl/FTLLowerDFGToLLVM.cpp:
+        (JSC::FTL::LowerDFGToLLVM::compileNode):
+
 2015-03-17  Michael Saboff  <[email protected]>
 
         Windows X86-64 should use the fixed executable allocator

Modified: trunk/Source/_javascript_Core/dfg/DFGAbstractInterpreterInlines.h (181649 => 181650)


--- trunk/Source/_javascript_Core/dfg/DFGAbstractInterpreterInlines.h	2015-03-17 15:48:32 UTC (rev 181649)
+++ trunk/Source/_javascript_Core/dfg/DFGAbstractInterpreterInlines.h	2015-03-17 15:50:44 UTC (rev 181650)
@@ -1308,8 +1308,7 @@
         // This claims to return bottom.
         break;
         
-    case PutByOffsetHint:
-    case PutStructureHint:
+    case PutHint:
         break;
         
     case MaterializeNewObject: {

Modified: trunk/Source/_javascript_Core/dfg/DFGClobberize.h (181649 => 181650)


--- trunk/Source/_javascript_Core/dfg/DFGClobberize.h	2015-03-17 15:48:32 UTC (rev 181649)
+++ trunk/Source/_javascript_Core/dfg/DFGClobberize.h	2015-03-17 15:50:44 UTC (rev 181650)
@@ -290,8 +290,7 @@
     case ProfileControlFlow:
     case StoreBarrier:
     case StoreBarrierWithNullCheck:
-    case PutByOffsetHint:
-    case PutStructureHint:
+    case PutHint:
         write(SideState);
         return;
         

Modified: trunk/Source/_javascript_Core/dfg/DFGDoesGC.cpp (181649 => 181650)


--- trunk/Source/_javascript_Core/dfg/DFGDoesGC.cpp	2015-03-17 15:48:32 UTC (rev 181649)
+++ trunk/Source/_javascript_Core/dfg/DFGDoesGC.cpp	2015-03-17 15:50:44 UTC (rev 181650)
@@ -204,9 +204,8 @@
     case CheckBadCell:
     case BottomValue:
     case PhantomNewObject:
-    case PutByOffsetHint:
+    case PutHint:
     case CheckStructureImmediate:
-    case PutStructureHint:
     case PutStack:
     case KillStack:
     case GetStack:

Modified: trunk/Source/_javascript_Core/dfg/DFGFixupPhase.cpp (181649 => 181650)


--- trunk/Source/_javascript_Core/dfg/DFGFixupPhase.cpp	2015-03-17 15:48:32 UTC (rev 181649)
+++ trunk/Source/_javascript_Core/dfg/DFGFixupPhase.cpp	2015-03-17 15:50:44 UTC (rev 181650)
@@ -1068,9 +1068,8 @@
         case Identity: // This should have been cleaned up.
         case BooleanToNumber:
         case PhantomNewObject:
-        case PutByOffsetHint:
+        case PutHint:
         case CheckStructureImmediate:
-        case PutStructureHint:
         case MaterializeNewObject:
         case PutStack:
         case KillStack:

Modified: trunk/Source/_javascript_Core/dfg/DFGGraph.cpp (181649 => 181650)


--- trunk/Source/_javascript_Core/dfg/DFGGraph.cpp	2015-03-17 15:48:32 UTC (rev 181649)
+++ trunk/Source/_javascript_Core/dfg/DFGGraph.cpp	2015-03-17 15:50:44 UTC (rev 181650)
@@ -222,6 +222,8 @@
         out.print(comma, "global", globalObjectFor(node->origin.semantic)->findRegisterIndex(node->registerPointer()), "(", RawPointer(node->registerPointer()), ")");
     if (node->hasIdentifier())
         out.print(comma, "id", node->identifierNumber(), "{", identifiers()[node->identifierNumber()], "}");
+    if (node->hasPromotedLocationDescriptor())
+        out.print(comma, node->promotedLocationDescriptor());
     if (node->hasStructureSet())
         out.print(comma, inContext(node->structureSet(), context));
     if (node->hasStructure())
@@ -585,8 +587,7 @@
                 node->child1()->mergeFlags(NodeRelevantToOSR);
                 break;
                 
-            case PutStructureHint:
-            case PutByOffsetHint:
+            case PutHint:
                 node->child2()->mergeFlags(NodeRelevantToOSR);
                 break;
                 

Modified: trunk/Source/_javascript_Core/dfg/DFGMayExit.cpp (181649 => 181650)


--- trunk/Source/_javascript_Core/dfg/DFGMayExit.cpp	2015-03-17 15:48:32 UTC (rev 181649)
+++ trunk/Source/_javascript_Core/dfg/DFGMayExit.cpp	2015-03-17 15:50:44 UTC (rev 181650)
@@ -76,8 +76,7 @@
     case Upsilon:
     case ZombieHint:
     case BottomValue:
-    case PutStructureHint:
-    case PutByOffsetHint:
+    case PutHint:
     case PhantomNewObject:
     case PutStack:
     case KillStack:

Modified: trunk/Source/_javascript_Core/dfg/DFGNode.cpp (181649 => 181650)


--- trunk/Source/_javascript_Core/dfg/DFGNode.cpp	2015-03-17 15:48:32 UTC (rev 181649)
+++ trunk/Source/_javascript_Core/dfg/DFGNode.cpp	2015-03-17 15:50:44 UTC (rev 181650)
@@ -30,6 +30,7 @@
 
 #include "DFGGraph.h"
 #include "DFGNodeAllocator.h"
+#include "DFGPromotedHeapLocation.h"
 #include "JSCInlines.h"
 
 namespace JSC { namespace DFG {
@@ -93,6 +94,36 @@
     setResult(result);
 }
 
+void Node::convertToPutHint(const PromotedLocationDescriptor& descriptor, Node* base, Node* value)
+{
+    m_op = PutHint;
+    m_opInfo = descriptor.imm1().m_value;
+    m_opInfo2 = descriptor.imm2().m_value;
+    child1() = base->defaultEdge();
+    child2() = value->defaultEdge();
+    child3() = Edge();
+}
+
+void Node::convertToPutStructureHint(Node* structure)
+{
+    ASSERT(m_op == PutStructure);
+    ASSERT(structure->castConstant<Structure*>() == transition()->next);
+    convertToPutHint(StructurePLoc, child1().node(), structure);
+}
+
+void Node::convertToPutByOffsetHint()
+{
+    ASSERT(m_op == PutByOffset);
+    convertToPutHint(
+        PromotedLocationDescriptor(NamedPropertyPLoc, storageAccessData().identifierNumber),
+        child2().node(), child3().node());
+}
+
+PromotedLocationDescriptor Node::promotedLocationDescriptor()
+{
+    return PromotedLocationDescriptor(static_cast<PromotedLocationKind>(m_opInfo), m_opInfo2);
+}
+
 } } // namespace JSC::DFG
 
 namespace WTF {

Modified: trunk/Source/_javascript_Core/dfg/DFGNode.h (181649 => 181650)


--- trunk/Source/_javascript_Core/dfg/DFGNode.h	2015-03-17 15:48:32 UTC (rev 181649)
+++ trunk/Source/_javascript_Core/dfg/DFGNode.h	2015-03-17 15:50:44 UTC (rev 181650)
@@ -56,6 +56,7 @@
 namespace JSC { namespace DFG {
 
 class Graph;
+class PromotedLocationDescriptor;
 struct BasicBlock;
 
 struct StorageAccessData {
@@ -557,24 +558,10 @@
         m_op = MultiPutByOffset;
     }
     
-    void convertToPutByOffsetHint()
-    {
-        ASSERT(m_op == PutByOffset);
-        m_opInfo = storageAccessData().identifierNumber;
-        m_op = PutByOffsetHint;
-        child1() = child2();
-        child2() = child3();
-        child3() = Edge();
-    }
+    void convertToPutHint(const PromotedLocationDescriptor&, Node* base, Node* value);
     
-    void convertToPutStructureHint(Node* structure)
-    {
-        ASSERT(m_op == PutStructure);
-        ASSERT(structure->castConstant<Structure*>() == transition()->next);
-        m_op = PutStructureHint;
-        m_opInfo = 0;
-        child2() = Edge(structure, KnownCellUse);
-    }
+    void convertToPutByOffsetHint();
+    void convertToPutStructureHint(Node* structure);
     
     void convertToPhantomNewObject()
     {
@@ -830,7 +817,6 @@
         case PutById:
         case PutByIdFlush:
         case PutByIdDirect:
-        case PutByOffsetHint:
             return true;
         default:
             return false;
@@ -843,6 +829,13 @@
         return m_opInfo;
     }
     
+    bool hasPromotedLocationDescriptor()
+    {
+        return op() == PutHint;
+    }
+    
+    PromotedLocationDescriptor promotedLocationDescriptor();
+    
     // This corrects the arithmetic node flags, so that irrelevant bits are
     // ignored. In particular, anything other than ArithMul does not need
     // to know if it can speculate on negative zero.

Modified: trunk/Source/_javascript_Core/dfg/DFGNodeType.h (181649 => 181650)


--- trunk/Source/_javascript_Core/dfg/DFGNodeType.h	2015-03-17 15:48:32 UTC (rev 181649)
+++ trunk/Source/_javascript_Core/dfg/DFGNodeType.h	2015-03-17 15:50:44 UTC (rev 181650)
@@ -237,9 +237,8 @@
     \
     /* Support for allocation sinking. */\
     macro(PhantomNewObject, NodeResultJS) \
-    macro(PutByOffsetHint, NodeMustGenerate) \
+    macro(PutHint, NodeMustGenerate) \
     macro(CheckStructureImmediate, NodeMustGenerate) \
-    macro(PutStructureHint, NodeMustGenerate) \
     macro(MaterializeNewObject, NodeResultJS | NodeHasVarArgs) \
     \
     /* Nodes for misc operations. */\

Modified: trunk/Source/_javascript_Core/dfg/DFGOSRAvailabilityAnalysisPhase.cpp (181649 => 181650)


--- trunk/Source/_javascript_Core/dfg/DFGOSRAvailabilityAnalysisPhase.cpp	2015-03-17 15:48:32 UTC (rev 181649)
+++ trunk/Source/_javascript_Core/dfg/DFGOSRAvailabilityAnalysisPhase.cpp	2015-03-17 15:50:44 UTC (rev 181650)
@@ -166,16 +166,16 @@
         break;
     }
         
+    case PutHint: {
+        m_availability.m_heap.set(
+            PromotedHeapLocation(node->child1().node(), node->promotedLocationDescriptor()),
+            Availability(node->child2().node()));
+        break;
+    }
+        
     default:
         break;
     }
-    
-    promoteHeapAccess(
-        node,
-        [&] (PromotedHeapLocation location, Edge value) {
-            m_availability.m_heap.set(location, Availability(value.node()));
-        },
-        [&] (PromotedHeapLocation) { });
 }
 
 } } // namespace JSC::DFG

Modified: trunk/Source/_javascript_Core/dfg/DFGObjectAllocationSinkingPhase.cpp (181649 => 181650)


--- trunk/Source/_javascript_Core/dfg/DFGObjectAllocationSinkingPhase.cpp	2015-03-17 15:48:32 UTC (rev 181649)
+++ trunk/Source/_javascript_Core/dfg/DFGObjectAllocationSinkingPhase.cpp	2015-03-17 15:50:44 UTC (rev 181650)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014, 2015 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -72,10 +72,10 @@
         //   that would see any other escape. Note that Upsilons constitute escaping sites. Then we
         //   insert additional MaterializeNewObject nodes on Upsilons that feed into Phis that mix
         //   materializations and the original PhantomNewObject. We then turn each PutByOffset over a
-        //   PhantomNewObject into a PutByOffsetHint.
+        //   PhantomNewObject into a PutHint.
         //
         // - We perform the same optimization for MaterializeNewObject. This allows us to cover
-        //   cases where we had MaterializeNewObject flowing into a PutByOffsetHint.
+        //   cases where we had MaterializeNewObject flowing into a PutHint.
         //
         // We could also add this rule:
         //
@@ -527,9 +527,10 @@
                     if (m_sinkCandidates.contains(node)) {
                         Node* structure = m_insertionSet.insertConstant(
                             nodeIndex + 1, node->origin, JSValue(node->structure()));
-                        m_insertionSet.insertNode(
-                            nodeIndex + 1, SpecNone, PutStructureHint, node->origin,
-                            Edge(node, KnownCellUse), Edge(structure, KnownCellUse));
+                        m_insertionSet.insert(
+                            nodeIndex + 1,
+                            PromotedHeapLocation(StructurePLoc, node).createHint(
+                                m_graph, node->origin, structure));
                         node->convertToPhantomNewObject();
                     }
                     break;
@@ -537,13 +538,19 @@
                     
                 case MaterializeNewObject: {
                     if (m_sinkCandidates.contains(node)) {
-                        m_insertionSet.insertNode(
-                            nodeIndex + 1, SpecNone, PutStructureHint, node->origin,
-                            Edge(node, KnownCellUse), m_graph.varArgChild(node, 0));
+                        m_insertionSet.insert(
+                            nodeIndex + 1,
+                            PromotedHeapLocation(StructurePLoc, node).createHint(
+                                m_graph, node->origin, m_graph.varArgChild(node, 0).node()));
                         for (unsigned i = 0; i < node->objectMaterializationData().m_properties.size(); ++i) {
-                            m_insertionSet.insertNode(
-                                nodeIndex + 1, SpecNone, PutByOffsetHint, node->origin,
-                                Edge(node, KnownCellUse), m_graph.varArgChild(node, i + 1));
+                            unsigned identifierNumber =
+                                node->objectMaterializationData().m_properties[i].m_identifierNumber;
+                            m_insertionSet.insert(
+                                nodeIndex + 1,
+                                PromotedHeapLocation(
+                                    NamedPropertyPLoc, node, identifierNumber).createHint(
+                                    m_graph, node->origin,
+                                    m_graph.varArgChild(node, i + 1).node()));
                         }
                         node->convertToPhantomNewObject();
                     }
@@ -762,7 +769,7 @@
         case HardPhantom:
         case StoreBarrier:
         case StoreBarrierWithNullCheck:
-        case PutByOffsetHint:
+        case PutHint:
             break;
             
         case PutByOffset:

Modified: trunk/Source/_javascript_Core/dfg/DFGPredictionPropagationPhase.cpp (181649 => 181650)


--- trunk/Source/_javascript_Core/dfg/DFGPredictionPropagationPhase.cpp	2015-03-17 15:48:32 UTC (rev 181649)
+++ trunk/Source/_javascript_Core/dfg/DFGPredictionPropagationPhase.cpp	2015-03-17 15:50:44 UTC (rev 181650)
@@ -542,9 +542,8 @@
         case Identity:
         case BooleanToNumber:
         case PhantomNewObject:
-        case PutByOffsetHint:
+        case PutHint:
         case CheckStructureImmediate:
-        case PutStructureHint:
         case MaterializeNewObject:
         case PutStack:
         case KillStack:

Modified: trunk/Source/_javascript_Core/dfg/DFGPromoteHeapAccess.h (181649 => 181650)


--- trunk/Source/_javascript_Core/dfg/DFGPromoteHeapAccess.h	2015-03-17 15:48:32 UTC (rev 181649)
+++ trunk/Source/_javascript_Core/dfg/DFGPromoteHeapAccess.h	2015-03-17 15:50:44 UTC (rev 181650)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014, 2015 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -33,8 +33,6 @@
 
 namespace JSC { namespace DFG {
 
-// Note that the write functor is really the useful thing here. The read functor is only useful
-// for the object allocation sinking phase.
 template<typename WriteFunctor, typename ReadFunctor>
 void promoteHeapAccess(Node* node, const WriteFunctor& write, const ReadFunctor& read)
 {
@@ -61,18 +59,11 @@
         }
         break;
     }
-
-    case PutStructureHint: {
+        
+    case PutHint: {
         ASSERT(node->child1()->isPhantomObjectAllocation());
-        write(PromotedHeapLocation(StructurePLoc, node->child1()), node->child2());
-        break;
-    }
-
-    case PutByOffsetHint: {
-        ASSERT(node->child1()->isPhantomObjectAllocation());
-        unsigned identifierNumber = node->identifierNumber();
         write(
-            PromotedHeapLocation(NamedPropertyPLoc, node->child1(), identifierNumber),
+            PromotedHeapLocation(node->child1().node(), node->promotedLocationDescriptor()),
             node->child2());
         break;
     }

Modified: trunk/Source/_javascript_Core/dfg/DFGPromotedHeapLocation.cpp (181649 => 181650)


--- trunk/Source/_javascript_Core/dfg/DFGPromotedHeapLocation.cpp	2015-03-17 15:48:32 UTC (rev 181649)
+++ trunk/Source/_javascript_Core/dfg/DFGPromotedHeapLocation.cpp	2015-03-17 15:50:44 UTC (rev 181650)
@@ -40,23 +40,9 @@
 
 Node* PromotedHeapLocation::createHint(Graph& graph, NodeOrigin origin, Node* value)
 {
-    switch (kind()) {
-    case StructurePLoc:
-        return graph.addNode(
-            SpecNone, PutStructureHint, origin,
-            Edge(base(), KnownCellUse), Edge(value, KnownCellUse));
-        
-    case NamedPropertyPLoc:
-        return graph.addNode(
-            SpecNone, PutByOffsetHint, origin,
-            OpInfo(info()), Edge(base(), KnownCellUse), Edge(value, UntypedUse));
-        
-    case InvalidPromotedLocationKind:
-        return nullptr;
-    }
-    
-    RELEASE_ASSERT_NOT_REACHED();
-    return nullptr;
+    return graph.addNode(
+        SpecNone, PutHint, origin, OpInfo(descriptor().imm1()), OpInfo(descriptor().imm2()),
+        base()->defaultEdge(), value->defaultEdge());
 }
 
 void PromotedHeapLocation::dump(PrintStream& out) const

Modified: trunk/Source/_javascript_Core/dfg/DFGPromotedHeapLocation.h (181649 => 181650)


--- trunk/Source/_javascript_Core/dfg/DFGPromotedHeapLocation.h	2015-03-17 15:48:32 UTC (rev 181649)
+++ trunk/Source/_javascript_Core/dfg/DFGPromotedHeapLocation.h	2015-03-17 15:50:44 UTC (rev 181650)
@@ -54,6 +54,9 @@
     PromotedLocationKind kind() const { return m_kind; }
     unsigned info() const { return m_info; }
     
+    OpInfo imm1() const { return OpInfo(static_cast<uint32_t>(m_kind)); }
+    OpInfo imm2() const { return OpInfo(static_cast<uint32_t>(m_info)); }
+    
     unsigned hash() const
     {
         return m_kind + m_info;

Modified: trunk/Source/_javascript_Core/dfg/DFGSafeToExecute.h (181649 => 181650)


--- trunk/Source/_javascript_Core/dfg/DFGSafeToExecute.h	2015-03-17 15:48:32 UTC (rev 181649)
+++ trunk/Source/_javascript_Core/dfg/DFGSafeToExecute.h	2015-03-17 15:50:44 UTC (rev 181650)
@@ -277,9 +277,8 @@
     case GetEnumeratorPname:
     case ToIndexString:
     case PhantomNewObject:
-    case PutByOffsetHint:
+    case PutHint:
     case CheckStructureImmediate:
-    case PutStructureHint:
     case MaterializeNewObject:
         return true;
 

Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp (181649 => 181650)


--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp	2015-03-17 15:48:32 UTC (rev 181649)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp	2015-03-17 15:50:44 UTC (rev 181650)
@@ -5092,9 +5092,8 @@
     case CheckBadCell:
     case BottomValue:
     case PhantomNewObject:
-    case PutByOffsetHint:
+    case PutHint:
     case CheckStructureImmediate:
-    case PutStructureHint:
     case MaterializeNewObject:
     case PutStack:
     case KillStack:

Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp (181649 => 181650)


--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp	2015-03-17 15:48:32 UTC (rev 181649)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp	2015-03-17 15:50:44 UTC (rev 181650)
@@ -5163,9 +5163,8 @@
     case CheckBadCell:
     case BottomValue:
     case PhantomNewObject:
-    case PutByOffsetHint:
+    case PutHint:
     case CheckStructureImmediate:
-    case PutStructureHint:
     case MaterializeNewObject:
     case PutStack:
     case KillStack:

Modified: trunk/Source/_javascript_Core/dfg/DFGValidate.cpp (181649 => 181650)


--- trunk/Source/_javascript_Core/dfg/DFGValidate.cpp	2015-03-17 15:48:32 UTC (rev 181649)
+++ trunk/Source/_javascript_Core/dfg/DFGValidate.cpp	2015-03-17 15:50:44 UTC (rev 181650)
@@ -438,9 +438,8 @@
                 case Upsilon:
                 case CheckInBounds:
                 case PhantomNewObject:
-                case PutByOffsetHint:
+                case PutHint:
                 case CheckStructureImmediate:
-                case PutStructureHint:
                 case MaterializeNewObject:
                 case PutStack:
                 case KillStack:

Modified: trunk/Source/_javascript_Core/ftl/FTLCapabilities.cpp (181649 => 181650)


--- trunk/Source/_javascript_Core/ftl/FTLCapabilities.cpp	2015-03-17 15:48:32 UTC (rev 181649)
+++ trunk/Source/_javascript_Core/ftl/FTLCapabilities.cpp	2015-03-17 15:50:44 UTC (rev 181650)
@@ -177,9 +177,8 @@
     case ToIndexString:
     case BottomValue:
     case PhantomNewObject:
-    case PutByOffsetHint:
+    case PutHint:
     case CheckStructureImmediate:
-    case PutStructureHint:
     case MaterializeNewObject:
         // These are OK.
         break;

Modified: trunk/Source/_javascript_Core/ftl/FTLLowerDFGToLLVM.cpp (181649 => 181650)


--- trunk/Source/_javascript_Core/ftl/FTLLowerDFGToLLVM.cpp	2015-03-17 15:48:32 UTC (rev 181649)
+++ trunk/Source/_javascript_Core/ftl/FTLLowerDFGToLLVM.cpp	2015-03-17 15:50:44 UTC (rev 181650)
@@ -829,8 +829,7 @@
         case MovHint:
         case ZombieHint:
         case PhantomNewObject:
-        case PutByOffsetHint:
-        case PutStructureHint:
+        case PutHint:
         case BottomValue:
         case KillStack:
             break;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to