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

Side by Side Diff: src/compiler/code-assembler.cc

Issue 2539093002: [runtime] Port simple String.prototype.indexOf cases to TF Builtin (Closed)
Patch Set: merging with master Created 4 years 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
« no previous file with comments | « src/compiler/code-assembler.h ('k') | src/compiler/raw-machine-assembler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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 "src/compiler/code-assembler.h" 5 #include "src/compiler/code-assembler.h"
6 6
7 #include <ostream> 7 #include <ostream>
8 8
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/compiler/graph.h" 10 #include "src/compiler/graph.h"
(...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after
978 } 978 }
979 979
980 Node* CodeAssembler::CallCFunction2(MachineType return_type, 980 Node* CodeAssembler::CallCFunction2(MachineType return_type,
981 MachineType arg0_type, 981 MachineType arg0_type,
982 MachineType arg1_type, Node* function, 982 MachineType arg1_type, Node* function,
983 Node* arg0, Node* arg1) { 983 Node* arg0, Node* arg1) {
984 return raw_assembler()->CallCFunction2(return_type, arg0_type, arg1_type, 984 return raw_assembler()->CallCFunction2(return_type, arg0_type, arg1_type,
985 function, arg0, arg1); 985 function, arg0, arg1);
986 } 986 }
987 987
988 Node* CodeAssembler::CallCFunction3(MachineType return_type,
989 MachineType arg0_type,
990 MachineType arg1_type,
991 MachineType arg2_type, Node* function,
992 Node* arg0, Node* arg1, Node* arg2) {
993 return raw_assembler()->CallCFunction3(return_type, arg0_type, arg1_type,
994 arg2_type, function, arg0, arg1, arg2);
995 }
996
988 void CodeAssembler::Goto(Label* label) { 997 void CodeAssembler::Goto(Label* label) {
989 label->MergeVariables(); 998 label->MergeVariables();
990 raw_assembler()->Goto(label->label_); 999 raw_assembler()->Goto(label->label_);
991 } 1000 }
992 1001
993 void CodeAssembler::GotoIf(Node* condition, Label* true_label) { 1002 void CodeAssembler::GotoIf(Node* condition, Label* true_label) {
994 Label false_label(this); 1003 Label false_label(this);
995 Branch(condition, true_label, &false_label); 1004 Branch(condition, true_label, &false_label);
996 Bind(&false_label); 1005 Bind(&false_label);
997 } 1006 }
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
1150 variable_phis_[var] = nullptr; 1159 variable_phis_[var] = nullptr;
1151 } 1160 }
1152 } 1161 }
1153 } 1162 }
1154 } 1163 }
1155 } 1164 }
1156 1165
1157 for (auto var : variable_phis_) { 1166 for (auto var : variable_phis_) {
1158 CodeAssemblerVariable::Impl* var_impl = var.first; 1167 CodeAssemblerVariable::Impl* var_impl = var.first;
1159 auto i = variable_merges_.find(var_impl); 1168 auto i = variable_merges_.find(var_impl);
1160 // If the following assert fires, then a variable that has been marked as 1169 // If the following asserts fire, then a variable that has been marked as
1161 // being merged at the label--either by explicitly marking it so in the 1170 // being merged at the label--either by explicitly marking it so in the
1162 // label constructor or by having seen different bound values at branches 1171 // label constructor or by having seen different bound values at branches
1163 // into the label--doesn't have a bound value along all of the paths that 1172 // into the label--doesn't have a bound value along all of the paths that
1164 // have been merged into the label up to this point. 1173 // have been merged into the label up to this point.
1165 DCHECK(i != variable_merges_.end() && i->second.size() == merge_count_); 1174 DCHECK(i != variable_merges_.end());
1175 DCHECK_EQ(i->second.size(), merge_count_);
1166 Node* phi = state_->raw_assembler_->Phi( 1176 Node* phi = state_->raw_assembler_->Phi(
1167 var.first->rep_, static_cast<int>(merge_count_), &(i->second[0])); 1177 var.first->rep_, static_cast<int>(merge_count_), &(i->second[0]));
1168 variable_phis_[var_impl] = phi; 1178 variable_phis_[var_impl] = phi;
1169 } 1179 }
1170 1180
1171 // Bind all variables to a merge phi, the common value along all paths or 1181 // Bind all variables to a merge phi, the common value along all paths or
1172 // null. 1182 // null.
1173 for (auto var : state_->variables_) { 1183 for (auto var : state_->variables_) {
1174 auto i = variable_phis_.find(var); 1184 auto i = variable_phis_.find(var);
1175 if (i != variable_phis_.end()) { 1185 if (i != variable_phis_.end()) {
1176 var->value_ = i->second; 1186 var->value_ = i->second;
1177 } else { 1187 } else {
1178 auto j = variable_merges_.find(var); 1188 auto j = variable_merges_.find(var);
1179 if (j != variable_merges_.end() && j->second.size() == merge_count_) { 1189 if (j != variable_merges_.end() && j->second.size() == merge_count_) {
1180 var->value_ = j->second.back(); 1190 var->value_ = j->second.back();
1181 } else { 1191 } else {
1182 var->value_ = nullptr; 1192 var->value_ = nullptr;
1183 } 1193 }
1184 } 1194 }
1185 } 1195 }
1186 1196
1187 bound_ = true; 1197 bound_ = true;
1188 } 1198 }
1189 1199
1190 } // namespace compiler 1200 } // namespace compiler
1191 } // namespace internal 1201 } // namespace internal
1192 } // namespace v8 1202 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/code-assembler.h ('k') | src/compiler/raw-machine-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698