Title: [108233] trunk/Source/_javascript_Core
Revision
108233
Author
[email protected]
Date
2012-02-20 04:49:41 -0800 (Mon, 20 Feb 2012)

Log Message

2012-02-120  Andy Wingo  <[email protected]>

Remove unused features from CodeFeatures
https://bugs.webkit.org/show_bug.cgi?id=78804

Reviewed by Gavin Barraclough.

* parser/Nodes.h:
* parser/ASTBuilder.h:
(JSC::ClosureFeature):
(JSC::ASTBuilder::createFunctionBody):
(JSC::ASTBuilder::usesClosures):
Remove "ClosureFeature".  Since we track captured variables more
precisely, this bit doesn't do us any good.

(JSC::AssignFeature):
(JSC::ASTBuilder::makeAssignNode):
(JSC::ASTBuilder::makePrefixNode):
(JSC::ASTBuilder::makePostfixNode):
(JSC::ASTBuilder::usesAssignment):
Similarly, remove AssignFeature.  It is unused.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (108232 => 108233)


--- trunk/Source/_javascript_Core/ChangeLog	2012-02-20 12:25:14 UTC (rev 108232)
+++ trunk/Source/_javascript_Core/ChangeLog	2012-02-20 12:49:41 UTC (rev 108233)
@@ -1,3 +1,25 @@
+2012-02-120  Andy Wingo  <[email protected]>
+
+        Remove unused features from CodeFeatures
+        https://bugs.webkit.org/show_bug.cgi?id=78804
+
+        Reviewed by Gavin Barraclough.
+
+        * parser/Nodes.h:
+        * parser/ASTBuilder.h:
+        (JSC::ClosureFeature):
+        (JSC::ASTBuilder::createFunctionBody):
+        (JSC::ASTBuilder::usesClosures):
+        Remove "ClosureFeature".  Since we track captured variables more
+        precisely, this bit doesn't do us any good.
+
+        (JSC::AssignFeature):
+        (JSC::ASTBuilder::makeAssignNode):
+        (JSC::ASTBuilder::makePrefixNode):
+        (JSC::ASTBuilder::makePostfixNode):
+        (JSC::ASTBuilder::usesAssignment):
+        Similarly, remove AssignFeature.  It is unused.
+
 2012-02-19  Carlos Garcia Campos  <[email protected]>
 
         Unreviewed. Fix make distcheck issues.

Modified: trunk/Source/_javascript_Core/parser/ASTBuilder.h (108232 => 108233)


--- trunk/Source/_javascript_Core/parser/ASTBuilder.h	2012-02-20 12:25:14 UTC (rev 108232)
+++ trunk/Source/_javascript_Core/parser/ASTBuilder.h	2012-02-20 12:49:41 UTC (rev 108233)
@@ -265,7 +265,6 @@
 
     FunctionBodyNode* createFunctionBody(int lineNumber, bool inStrictContext)
     {
-        usesClosures();
         return FunctionBodyNode::create(m_globalData, lineNumber, inStrictContext);
     }
     
@@ -624,9 +623,7 @@
     void incConstants() { m_scope.m_numConstants++; }
     void usesThis() { m_scope.m_features |= ThisFeature; }
     void usesCatch() { m_scope.m_features |= CatchFeature; }
-    void usesClosures() { m_scope.m_features |= ClosureFeature; }
     void usesArguments() { m_scope.m_features |= ArgumentsFeature; }
-    void usesAssignment() { m_scope.m_features |= AssignFeature; }
     void usesWith() { m_scope.m_features |= WithFeature; }
     void usesEval() 
     {
@@ -904,7 +901,6 @@
 
 ExpressionNode* ASTBuilder::makeAssignNode(int lineNumber, ExpressionNode* loc, Operator op, ExpressionNode* expr, bool locHasAssignments, bool exprHasAssignments, int start, int divot, int end)
 {
-    usesAssignment();
     if (!loc->isLocation())
         return new (m_globalData) AssignErrorNode(lineNumber, loc, op, expr, divot, divot - start, end - divot);
 
@@ -942,7 +938,6 @@
 
 ExpressionNode* ASTBuilder::makePrefixNode(int lineNumber, ExpressionNode* expr, Operator op, int start, int divot, int end)
 {
-    usesAssignment();
     if (!expr->isLocation())
         return new (m_globalData) PrefixErrorNode(lineNumber, expr, op, divot, divot - start, end - divot);
 
@@ -965,7 +960,6 @@
 
 ExpressionNode* ASTBuilder::makePostfixNode(int lineNumber, ExpressionNode* expr, Operator op, int start, int divot, int end)
 {
-    usesAssignment();
     if (!expr->isLocation())
         return new (m_globalData) PostfixErrorNode(lineNumber, expr, op, divot, divot - start, end - divot);
 

Modified: trunk/Source/_javascript_Core/parser/Nodes.h (108232 => 108233)


--- trunk/Source/_javascript_Core/parser/Nodes.h	2012-02-20 12:25:14 UTC (rev 108232)
+++ trunk/Source/_javascript_Core/parser/Nodes.h	2012-02-20 12:49:41 UTC (rev 108233)
@@ -51,17 +51,14 @@
 
     const CodeFeatures NoFeatures = 0;
     const CodeFeatures EvalFeature = 1 << 0;
-    const CodeFeatures ClosureFeature = 1 << 1;
-    const CodeFeatures AssignFeature = 1 << 2;
-    const CodeFeatures ArgumentsFeature = 1 << 3;
-    const CodeFeatures WithFeature = 1 << 4;
-    const CodeFeatures CatchFeature = 1 << 5;
-    const CodeFeatures ThisFeature = 1 << 6;
-    const CodeFeatures StrictModeFeature = 1 << 7;
-    const CodeFeatures ShadowsArgumentsFeature = 1 << 8;
+    const CodeFeatures ArgumentsFeature = 1 << 1;
+    const CodeFeatures WithFeature = 1 << 2;
+    const CodeFeatures CatchFeature = 1 << 3;
+    const CodeFeatures ThisFeature = 1 << 4;
+    const CodeFeatures StrictModeFeature = 1 << 5;
+    const CodeFeatures ShadowsArgumentsFeature = 1 << 6;
     
-    
-    const CodeFeatures AllFeatures = EvalFeature | ClosureFeature | AssignFeature | ArgumentsFeature | WithFeature | CatchFeature | ThisFeature | StrictModeFeature | ShadowsArgumentsFeature;
+    const CodeFeatures AllFeatures = EvalFeature | ArgumentsFeature | WithFeature | CatchFeature | ThisFeature | StrictModeFeature | ShadowsArgumentsFeature;
 
     enum Operator {
         OpEqual,
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to