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

Unified Diff: runtime/vm/scopes.h

Issue 9907001: Implement JumpNode for break/continue in for loops. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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 | « runtime/vm/flow_graph_builder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/scopes.h
===================================================================
--- runtime/vm/scopes.h (revision 6046)
+++ runtime/vm/scopes.h (working copy)
@@ -11,6 +11,7 @@
namespace dart {
+class JoinEntryInstr;
class LocalScope;
class LocalVariable;
class SourceLabel;
@@ -114,7 +115,9 @@
owner_(NULL),
kind_(kind),
continue_label_(),
- break_label_() {
+ break_label_(),
+ join_for_break_(NULL),
+ join_for_continue_(NULL) {
}
static SourceLabel* New(intptr_t token_index, String* name, Kind kind) {
@@ -139,6 +142,24 @@
Label* break_label() { return &break_label_; }
Label* continue_label() { return &continue_label_; }
+ void set_join_for_continue(JoinEntryInstr* join) {
+ ASSERT(join_for_continue_ == NULL);
+ join_for_continue_ = join;
+ }
+
+ JoinEntryInstr* join_for_continue() const {
+ return join_for_continue_;
+ }
+
+ void set_join_for_break(JoinEntryInstr* join) {
+ ASSERT(join_for_break_ == NULL);
+ join_for_break_ = join;
+ }
+
+ JoinEntryInstr* join_for_break() const {
+ return join_for_break_;
+ }
+
// Returns the function level of the scope in which the label is defined.
int FunctionLevel() const;
@@ -152,6 +173,8 @@
Kind kind_;
Label continue_label_;
Label break_label_;
+ JoinEntryInstr* join_for_break_;
+ JoinEntryInstr* join_for_continue_;
static const char* kDefaultLabelName;
DISALLOW_COPY_AND_ASSIGN(SourceLabel);
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698