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

Unified Diff: src/ast.h

Issue 14582007: Implement yield* (delegating yield) (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Fix asm nits; rework test suite to test yield* on everything Created 7 years, 7 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 | « src/arm/full-codegen-arm.cc ('k') | src/heap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.h
diff --git a/src/ast.h b/src/ast.h
index 10ae7de458d1653e36a7ab688dd15b9b68e297f4..e74cd461c978abf7d3c58b1b9747070c91090a2c 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -1982,6 +1982,18 @@ class Yield: public Expression {
Kind yield_kind() const { return yield_kind_; }
virtual int position() const { return pos_; }
+ // Delegating yield surrounds the "yield" in a "try/catch". This index
+ // locates the catch handler in the handler table, and is equivalent to
+ // TryCatchStatement::index().
+ int index() const {
+ ASSERT(yield_kind() == DELEGATING);
+ return index_;
+ }
+ void set_index(int index) {
+ ASSERT(yield_kind() == DELEGATING);
+ index_ = index;
+ }
+
protected:
Yield(Isolate* isolate,
Expression* generator_object,
@@ -1992,12 +2004,14 @@ class Yield: public Expression {
generator_object_(generator_object),
expression_(expression),
yield_kind_(yield_kind),
+ index_(-1),
pos_(pos) { }
private:
Expression* generator_object_;
Expression* expression_;
Kind yield_kind_;
+ int index_;
int pos_;
};
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698