JSC Parser: Shrink BindingNode.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Jan 2014 01:10:29 +0000 (01:10 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Jan 2014 01:10:29 +0000 (01:10 +0000)
<https://webkit.org/b/127253>

The "divot" and "end" source locations are always identical for
BindingNodes, so store only "start" and "end" instead.

1.19 MB progression on Membuster3.

Reviewed by Geoff Garen.

* bytecompiler/NodesCodegen.cpp:
(JSC::BindingNode::bindValue):
* parser/ASTBuilder.h:
(JSC::ASTBuilder::createBindingLocation):
* parser/NodeConstructors.h:
(JSC::BindingNode::create):
(JSC::BindingNode::BindingNode):
* parser/Nodes.h:
(JSC::BindingNode::divotStart):
(JSC::BindingNode::divotEnd):
* parser/Parser.cpp:
(JSC::Parser<LexerType>::createBindingPattern):
* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::operatorStackPop):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162393 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
Source/JavaScriptCore/parser/ASTBuilder.h
Source/JavaScriptCore/parser/NodeConstructors.h
Source/JavaScriptCore/parser/Nodes.h
Source/JavaScriptCore/parser/Parser.cpp
Source/JavaScriptCore/parser/SyntaxChecker.h

index e6a03d64ae0f4a45f68af0e2e85c1326b163b1f8..85613c6c9550fbc12aacd3b2030c7951e1624bff 100644 (file)
@@ -1,3 +1,30 @@
+2014-01-19  Andreas Kling  <akling@apple.com>
+
+        JSC Parser: Shrink BindingNode.
+        <https://webkit.org/b/127253>
+
+        The "divot" and "end" source locations are always identical for
+        BindingNodes, so store only "start" and "end" instead.
+
+        1.19 MB progression on Membuster3.
+
+        Reviewed by Geoff Garen.
+
+        * bytecompiler/NodesCodegen.cpp:
+        (JSC::BindingNode::bindValue):
+        * parser/ASTBuilder.h:
+        (JSC::ASTBuilder::createBindingLocation):
+        * parser/NodeConstructors.h:
+        (JSC::BindingNode::create):
+        (JSC::BindingNode::BindingNode):
+        * parser/Nodes.h:
+        (JSC::BindingNode::divotStart):
+        (JSC::BindingNode::divotEnd):
+        * parser/Parser.cpp:
+        (JSC::Parser<LexerType>::createBindingPattern):
+        * parser/SyntaxChecker.h:
+        (JSC::SyntaxChecker::operatorStackPop):
+
 2014-01-20  Filip Pizlo  <fpizlo@apple.com>
 
         op_captured_mov and op_new_captured_func in UnlinkedCodeBlocks should use the IdentifierMap instead of the strings directly
index 9741174f07c1553b4584b461b8ee92d99294c3dc..1ffd4f311882d0ee5c5514f5b8b25939d975e379 100644 (file)
@@ -2475,9 +2475,9 @@ void BindingNode::bindValue(BytecodeGenerator& generator, RegisterID* value) con
         return;
     }
     if (generator.isStrictMode())
-        generator.emitExpressionInfo(divot(), divotStart(), divotEnd());
+        generator.emitExpressionInfo(divotEnd(), divotStart(), divotEnd());
     RegisterID* scope = generator.emitResolveScope(generator.newTemporary(), m_boundProperty);
-    generator.emitExpressionInfo(divot(), divotStart(), divotEnd());
+    generator.emitExpressionInfo(divotEnd(), divotStart(), divotEnd());
     generator.emitPutToScope(scope, m_boundProperty, value, generator.isStrictMode() ? ThrowIfNotFound : DoNotThrowIfNotFound);
     return;
 }
index 58713864e852b6cb9207773e5ad060fa6872a7da..8ec1fd32a3ada22e125229570dcf7ff28eabf1ed 100644 (file)
@@ -674,9 +674,9 @@ public:
         node->appendEntry(location, identifier, wasString, pattern.get());
     }
     
-    BindingPattern createBindingLocation(const JSTokenLocation&, const Identifier& boundProperty, const JSTextPosition& divot, const JSTextPosition& start, const JSTextPosition& end)
+    BindingPattern createBindingLocation(const JSTokenLocation&, const Identifier& boundProperty, const JSTextPosition& start, const JSTextPosition& end)
     {
-        return BindingNode::create(m_vm, boundProperty, divot, start, end);
+        return BindingNode::create(m_vm, boundProperty, start, end);
     }
     
 private:
index a062ffe015a51434fe46c86eac60f49c834d5748..917126975f05a021e30832debacd964073438fbc 100644 (file)
@@ -888,14 +888,15 @@ inline ResolveNode::ResolveNode(const JSTokenLocation& location, const Identifie
         return adoptRef(new ObjectPatternNode(vm));
     }
 
-    inline PassRefPtr<BindingNode> BindingNode::create(VM* vm, const Identifier& boundProperty, const JSTextPosition& divot, const JSTextPosition& start, const JSTextPosition& end)
+    inline PassRefPtr<BindingNode> BindingNode::create(VM* vm, const Identifier& boundProperty, const JSTextPosition& start, const JSTextPosition& end)
     {
-        return adoptRef(new BindingNode(vm, boundProperty, divot, start, end));
+        return adoptRef(new BindingNode(vm, boundProperty, start, end));
     }
     
-    inline BindingNode::BindingNode(VM* vm, const Identifier& boundProperty, const JSTextPosition& divot, const JSTextPosition& start, const JSTextPosition& end)
+    inline BindingNode::BindingNode(VM* vm, const Identifier& boundProperty, const JSTextPosition& start, const JSTextPosition& end)
         : DeconstructionPatternNode(vm)
-        , ThrowableExpressionData(divot, start, end)
+        , m_divotStart(start)
+        , m_divotEnd(end)
         , m_boundProperty(boundProperty)
     {
     }
index dd487e5f0faefa470e37860874b4c10a0f78a447..d779a178d956ff99fd0bed5d5f454aa3e6b50879 100644 (file)
@@ -1641,20 +1641,25 @@ namespace JSC {
         Vector<Entry> m_targetPatterns;
     };
 
-    class BindingNode : public DeconstructionPatternNode, ThrowableExpressionData {
+    class BindingNode : public DeconstructionPatternNode {
     public:
-        static PassRefPtr<BindingNode> create(VM*, const Identifier& boundProperty, const JSTextPosition& divot, const JSTextPosition& start, const JSTextPosition& end);
+        static PassRefPtr<BindingNode> create(VM*, const Identifier& boundProperty, const JSTextPosition& start, const JSTextPosition& end);
         const Identifier& boundProperty() const { return m_boundProperty; }
+
+        const JSTextPosition& divotStart() const { return m_divotStart; }
+        const JSTextPosition& divotEnd() const { return m_divotEnd; }
         
     private:
-        BindingNode(VM*, const Identifier& boundProperty, const JSTextPosition& divot, const JSTextPosition& start, const JSTextPosition& end);
+        BindingNode(VM*, const Identifier& boundProperty, const JSTextPosition& start, const JSTextPosition& end);
 
         virtual void collectBoundIdentifiers(Vector<Identifier>&) const override;
         virtual void bindValue(BytecodeGenerator&, RegisterID*) const override;
         virtual void toString(StringBuilder&) const override;
         
         virtual bool isBindingNode() const override { return true; }
-        
+
+        JSTextPosition m_divotStart;
+        JSTextPosition m_divotEnd;
         Identifier m_boundProperty;
     };
 
index f856baf512a80fa5f888cc9840e703ba79d220ce..bf578020bc79ca4aeb49119523ecdb980be449bc 100644 (file)
@@ -518,7 +518,7 @@ template <class TreeBuilder> TreeDeconstructionPattern Parser<LexerType>::create
             }
         }
     }
-    return context.createBindingLocation(m_token.m_location, name, m_token.m_endPosition, m_token.m_startPosition, m_token.m_endPosition);
+    return context.createBindingLocation(m_token.m_location, name, m_token.m_startPosition, m_token.m_endPosition);
 }
 
 template <typename LexerType>
index 71e871a8e98a686473a7ca7855133205207efe27..0328b1273a224c1f1f09987708ebdd24df4b6758 100644 (file)
@@ -280,7 +280,7 @@ public:
     void appendObjectPatternEntry(ArrayPattern, const JSTokenLocation&, bool, const Identifier&, DeconstructionPattern)
     {
     }
-    DeconstructionPattern createBindingLocation(const JSTokenLocation&, const Identifier&, const JSTextPosition&, const JSTextPosition&, const JSTextPosition&)
+    DeconstructionPattern createBindingLocation(const JSTokenLocation&, const Identifier&, const JSTextPosition&, const JSTextPosition&)
     {
         return 1;
     }