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

Side by Side Diff: src/compiler/raw-machine-assembler.cc

Issue 1252093002: [turbofan] Remove bloated GraphBuilder base class. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « src/compiler/raw-machine-assembler.h ('k') | test/cctest/compiler/graph-builder-tester.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/code-factory.h" 5 #include "src/code-factory.h"
6 #include "src/compiler/pipeline.h" 6 #include "src/compiler/pipeline.h"
7 #include "src/compiler/raw-machine-assembler.h" 7 #include "src/compiler/raw-machine-assembler.h"
8 #include "src/compiler/scheduler.h" 8 #include "src/compiler/scheduler.h"
9 9
10 namespace v8 { 10 namespace v8 {
11 namespace internal { 11 namespace internal {
12 namespace compiler { 12 namespace compiler {
13 13
14 RawMachineAssembler::RawMachineAssembler(Isolate* isolate, Graph* graph, 14 RawMachineAssembler::RawMachineAssembler(Isolate* isolate, Graph* graph,
15 CallDescriptor* call_descriptor, 15 CallDescriptor* call_descriptor,
16 MachineType word, 16 MachineType word,
17 MachineOperatorBuilder::Flags flags) 17 MachineOperatorBuilder::Flags flags)
18 : GraphBuilder(isolate, graph), 18 : isolate_(isolate),
19 graph_(graph),
19 schedule_(new (zone()) Schedule(zone())), 20 schedule_(new (zone()) Schedule(zone())),
20 machine_(zone(), word, flags), 21 machine_(zone(), word, flags),
21 common_(zone()), 22 common_(zone()),
22 call_descriptor_(call_descriptor), 23 call_descriptor_(call_descriptor),
23 parameters_(NULL), 24 parameters_(NULL),
24 current_block_(schedule()->start()) { 25 current_block_(schedule()->start()) {
25 int param_count = static_cast<int>(parameter_count()); 26 int param_count = static_cast<int>(parameter_count());
26 Node* s = graph->NewNode(common_.Start(param_count)); 27 Node* s = graph->NewNode(common_.Start(param_count));
27 graph->SetStart(s); 28 graph->SetStart(s);
28 if (parameter_count() == 0) return; 29 if (parameter_count() == 0) return;
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 } 235 }
235 236
236 237
237 BasicBlock* RawMachineAssembler::CurrentBlock() { 238 BasicBlock* RawMachineAssembler::CurrentBlock() {
238 DCHECK(current_block_); 239 DCHECK(current_block_);
239 return current_block_; 240 return current_block_;
240 } 241 }
241 242
242 243
243 Node* RawMachineAssembler::MakeNode(const Operator* op, int input_count, 244 Node* RawMachineAssembler::MakeNode(const Operator* op, int input_count,
244 Node** inputs, bool incomplete) { 245 Node** inputs) {
245 DCHECK(ScheduleValid()); 246 DCHECK(ScheduleValid());
246 DCHECK(current_block_ != NULL); 247 DCHECK(current_block_ != NULL);
247 Node* node = graph()->NewNode(op, input_count, inputs, incomplete); 248 Node* node = graph()->NewNode(op, input_count, inputs);
248 BasicBlock* block = op->opcode() == IrOpcode::kParameter ? schedule()->start() 249 BasicBlock* block = op->opcode() == IrOpcode::kParameter ? schedule()->start()
249 : CurrentBlock(); 250 : CurrentBlock();
250 if (op->opcode() != IrOpcode::kReturn) { 251 if (op->opcode() != IrOpcode::kReturn) {
251 schedule()->AddNode(block, node); 252 schedule()->AddNode(block, node);
252 } 253 }
253 return node; 254 return node;
254 } 255 }
255 256
256 } // namespace compiler 257 } // namespace compiler
257 } // namespace internal 258 } // namespace internal
258 } // namespace v8 259 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/raw-machine-assembler.h ('k') | test/cctest/compiler/graph-builder-tester.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698