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

Unified Diff: src/ast/ast.h

Issue 1927943003: Assign yield ids in ast-numbering rather than in bytecode-generator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: nit Created 4 years, 8 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
« no previous file with comments | « no previous file | src/ast/ast-numbering.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/ast.h
diff --git a/src/ast/ast.h b/src/ast/ast.h
index 4d97fc249b3499267b25229a1dd8c0b1beaef773..203dbd34197893872887622dfd098b112b4da77e 100644
--- a/src/ast/ast.h
+++ b/src/ast/ast.h
@@ -647,8 +647,12 @@ class IterationStatement : public BreakableStatement {
Statement* body() const { return body_; }
void set_body(Statement* s) { body_ = s; }
- int yield_count() { return yield_count_; }
+ int yield_count() const { return yield_count_; }
+ int first_yield_id() const { return first_yield_id_; }
void set_yield_count(int yield_count) { yield_count_ = yield_count; }
+ void set_first_yield_id(int first_yield_id) {
+ first_yield_id_ = first_yield_id;
+ }
static int num_ids() { return parent_num_ids() + 1; }
BailoutId OsrEntryId() const { return BailoutId(local_id(0)); }
@@ -662,7 +666,8 @@ class IterationStatement : public BreakableStatement {
IterationStatement(Zone* zone, ZoneList<const AstRawString*>* labels, int pos)
: BreakableStatement(zone, labels, TARGET_FOR_ANONYMOUS, pos),
body_(NULL),
- yield_count_(0) {}
+ yield_count_(0),
+ first_yield_id_(0) {}
static int parent_num_ids() { return BreakableStatement::num_ids(); }
void Initialize(Statement* body) { body_ = body; }
@@ -672,6 +677,7 @@ class IterationStatement : public BreakableStatement {
Statement* body_;
Label continue_target_;
int yield_count_;
+ int first_yield_id_;
};
@@ -2531,20 +2537,24 @@ class Yield final : public Expression {
Expression* generator_object() const { return generator_object_; }
Expression* expression() const { return expression_; }
+ int yield_id() const { return yield_id_; }
void set_generator_object(Expression* e) { generator_object_ = e; }
void set_expression(Expression* e) { expression_ = e; }
+ void set_yield_id(int yield_id) { yield_id_ = yield_id; }
protected:
Yield(Zone* zone, Expression* generator_object, Expression* expression,
int pos)
: Expression(zone, pos),
generator_object_(generator_object),
- expression_(expression) {}
+ expression_(expression),
+ yield_id_(-1) {}
private:
Expression* generator_object_;
Expression* expression_;
+ int yield_id_;
};
« no previous file with comments | « no previous file | src/ast/ast-numbering.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698