| Index: runtime/vm/scopes.h
|
| ===================================================================
|
| --- runtime/vm/scopes.h (revision 5935)
|
| +++ runtime/vm/scopes.h (working copy)
|
| @@ -11,6 +11,7 @@
|
|
|
| namespace dart {
|
|
|
| +class JoinEntryInstr;
|
| class LocalScope;
|
| class LocalVariable;
|
| class SourceLabel;
|
| @@ -114,7 +115,11 @@
|
| owner_(NULL),
|
| kind_(kind),
|
| continue_label_(),
|
| - break_label_() {
|
| + break_label_(),
|
| + is_break_jump_target_(false),
|
| + join_for_break_(NULL),
|
| + is_continue_jump_target_(false),
|
| + join_for_continue_(NULL) {
|
| }
|
|
|
| static SourceLabel* New(intptr_t token_index, String* name, Kind kind) {
|
| @@ -139,6 +144,35 @@
|
| Label* break_label() { return &break_label_; }
|
| Label* continue_label() { return &continue_label_; }
|
|
|
| + void SetIsJumpTarget(Token::Kind jump_kind) {
|
| + ASSERT((jump_kind == Token::kBREAK) || (jump_kind == Token::kCONTINUE));
|
| + if (jump_kind == Token::kBREAK) {
|
| + is_break_jump_target_ = true;
|
| + } else {
|
| + is_continue_jump_target_ = true;
|
| + }
|
| + }
|
| + bool is_break_jump_target() const { return is_break_jump_target_; }
|
| + bool is_continue_jump_target() const { return is_continue_jump_target_; }
|
| +
|
| + 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 +186,10 @@
|
| Kind kind_;
|
| Label continue_label_;
|
| Label break_label_;
|
| + bool is_break_jump_target_;
|
| + JoinEntryInstr* join_for_break_;
|
| + bool is_continue_jump_target_;
|
| + JoinEntryInstr* join_for_continue_;
|
| static const char* kDefaultLabelName;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(SourceLabel);
|
|
|