Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(448)

Unified Diff: src/ast.h

Issue 938443002: [es6] implement spread calls (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add construct support, clean out some gunk Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/ast.h
diff --git a/src/ast.h b/src/ast.h
index 68cbb38e8b6902b9ed908c812113a4d6d0019205..07673770e4006773c1af9dac6a96c347210ac12e 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -93,6 +93,7 @@ namespace internal {
V(CountOperation) \
V(BinaryOperation) \
V(CompareOperation) \
+ V(SpreadOperation) \
V(ThisFunction) \
V(SuperReference) \
V(CaseClause)
@@ -2241,6 +2242,26 @@ class CompareOperation FINAL : public Expression {
};
+class SpreadOperation FINAL : public Expression {
+ public:
+ DECLARE_NODE_TYPE(SpreadOperation)
+
+ Expression* expression() const { return expression_; }
+
+ static int num_ids() { return parent_num_ids(); }
+
+ protected:
+ SpreadOperation(Zone* zone, Expression* expression, int pos)
+ : Expression(zone, pos), expression_(expression) {}
+ static int parent_num_ids() { return Expression::num_ids(); }
+
+ private:
+ int local_id(int n) const { return base_id() + parent_num_ids() + n; }
+
+ Expression* expression_;
+};
+
+
class Conditional FINAL : public Expression {
public:
DECLARE_NODE_TYPE(Conditional)
@@ -3460,6 +3481,10 @@ class AstNodeFactory FINAL BASE_EMBEDDED {
return new (zone_) CompareOperation(zone_, op, left, right, pos);
}
+ SpreadOperation* NewSpreadOperation(Expression* expression, int pos) {
+ return new (zone_) SpreadOperation(zone_, expression, pos);
+ }
+
Conditional* NewConditional(Expression* condition,
Expression* then_expression,
Expression* else_expression,
« no previous file with comments | « BUILD.gn ('k') | src/ast-numbering.cc » ('j') | src/compiler/ast-graph-builder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698