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

Side by Side Diff: src/compiler/control-builders.cc

Issue 850803002: First simple implementation of for-of in TurboFan. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "control-builders.h" 5 #include "control-builders.h"
6 6
7 namespace v8 { 7 namespace v8 {
8 namespace internal { 8 namespace internal {
9 namespace compiler { 9 namespace compiler {
10 10
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 void LoopBuilder::BreakUnless(Node* condition) { 66 void LoopBuilder::BreakUnless(Node* condition) {
67 IfBuilder control_if(builder_); 67 IfBuilder control_if(builder_);
68 control_if.If(condition); 68 control_if.If(condition);
69 control_if.Then(); 69 control_if.Then();
70 control_if.Else(); 70 control_if.Else();
71 Break(); 71 Break();
72 control_if.End(); 72 control_if.End();
73 } 73 }
74 74
75 75
76 void LoopBuilder::BreakWhen(Node* condition) {
77 IfBuilder control_if(builder_);
78 control_if.If(condition);
79 control_if.Then();
80 Break();
81 control_if.Else();
82 control_if.End();
83 }
84
85
76 void SwitchBuilder::BeginSwitch() { 86 void SwitchBuilder::BeginSwitch() {
77 body_environment_ = environment()->CopyAsUnreachable(); 87 body_environment_ = environment()->CopyAsUnreachable();
78 label_environment_ = environment()->CopyAsUnreachable(); 88 label_environment_ = environment()->CopyAsUnreachable();
79 break_environment_ = environment()->CopyAsUnreachable(); 89 break_environment_ = environment()->CopyAsUnreachable();
80 } 90 }
81 91
82 92
83 void SwitchBuilder::BeginLabel(int index, Node* condition) { 93 void SwitchBuilder::BeginLabel(int index, Node* condition) {
84 builder_->NewBranch(condition); 94 builder_->NewBranch(condition);
85 label_environment_ = environment()->CopyForConditional(); 95 label_environment_ = environment()->CopyForConditional();
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 } 143 }
134 144
135 145
136 void BlockBuilder::EndBlock() { 146 void BlockBuilder::EndBlock() {
137 break_environment_->Merge(environment()); 147 break_environment_->Merge(environment());
138 set_environment(break_environment_); 148 set_environment(break_environment_);
139 } 149 }
140 } 150 }
141 } 151 }
142 } // namespace v8::internal::compiler 152 } // namespace v8::internal::compiler
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698