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

Side by Side Diff: test/cctest/compiler/test-changes-lowering.cc

Issue 425003004: Implement representation selection as part of SimplifiedLowering. Representation selection also req… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
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 <limits> 5 #include <limits>
6 6
7 #include "src/compiler/control-builders.h" 7 #include "src/compiler/control-builders.h"
8 #include "src/compiler/generic-node-inl.h" 8 #include "src/compiler/generic-node-inl.h"
9 #include "src/compiler/node-properties-inl.h" 9 #include "src/compiler/node-properties-inl.h"
10 #include "src/compiler/pipeline.h" 10 #include "src/compiler/pipeline.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 101
102 void BuildAndLower(Operator* op) { 102 void BuildAndLower(Operator* op) {
103 // We build a graph by hand here, because the raw machine assembler 103 // We build a graph by hand here, because the raw machine assembler
104 // does not add the correct control and effect nodes. 104 // does not add the correct control and effect nodes.
105 Node* p0 = this->Parameter(0); 105 Node* p0 = this->Parameter(0);
106 Node* change = this->graph()->NewNode(op, p0); 106 Node* change = this->graph()->NewNode(op, p0);
107 Node* ret = this->graph()->NewNode(this->common()->Return(), change, 107 Node* ret = this->graph()->NewNode(this->common()->Return(), change,
108 this->start(), this->start()); 108 this->start(), this->start());
109 Node* end = this->graph()->NewNode(this->common()->End(), ret); 109 Node* end = this->graph()->NewNode(this->common()->End(), ret);
110 this->graph()->SetEnd(end); 110 this->graph()->SetEnd(end);
111 this->lowering.Lower(change); 111 this->lowering.LowerChange(change, this->start(), this->start());
112 Verifier::Run(this->graph()); 112 Verifier::Run(this->graph());
113 } 113 }
114 114
115 void BuildStoreAndLower(Operator* op, Operator* store_op, void* location) { 115 void BuildStoreAndLower(Operator* op, Operator* store_op, void* location) {
116 // We build a graph by hand here, because the raw machine assembler 116 // We build a graph by hand here, because the raw machine assembler
117 // does not add the correct control and effect nodes. 117 // does not add the correct control and effect nodes.
118 Node* p0 = this->Parameter(0); 118 Node* p0 = this->Parameter(0);
119 Node* change = this->graph()->NewNode(op, p0); 119 Node* change = this->graph()->NewNode(op, p0);
120 Node* store = this->graph()->NewNode( 120 Node* store = this->graph()->NewNode(
121 store_op, this->PointerConstant(location), this->Int32Constant(0), 121 store_op, this->PointerConstant(location), this->Int32Constant(0),
122 change, this->start(), this->start()); 122 change, this->start(), this->start());
123 Node* ret = this->graph()->NewNode( 123 Node* ret = this->graph()->NewNode(
124 this->common()->Return(), this->Int32Constant(0), store, this->start()); 124 this->common()->Return(), this->Int32Constant(0), store, this->start());
125 Node* end = this->graph()->NewNode(this->common()->End(), ret); 125 Node* end = this->graph()->NewNode(this->common()->End(), ret);
126 this->graph()->SetEnd(end); 126 this->graph()->SetEnd(end);
127 this->lowering.Lower(change); 127 this->lowering.LowerChange(change, this->start(), this->start());
128 Verifier::Run(this->graph()); 128 Verifier::Run(this->graph());
129 } 129 }
130 130
131 void BuildLoadAndLower(Operator* op, Operator* load_op, void* location) { 131 void BuildLoadAndLower(Operator* op, Operator* load_op, void* location) {
132 // We build a graph by hand here, because the raw machine assembler 132 // We build a graph by hand here, because the raw machine assembler
133 // does not add the correct control and effect nodes. 133 // does not add the correct control and effect nodes.
134 Node* load = 134 Node* load =
135 this->graph()->NewNode(load_op, this->PointerConstant(location), 135 this->graph()->NewNode(load_op, this->PointerConstant(location),
136 this->Int32Constant(0), this->start()); 136 this->Int32Constant(0), this->start());
137 Node* change = this->graph()->NewNode(op, load); 137 Node* change = this->graph()->NewNode(op, load);
138 Node* ret = this->graph()->NewNode(this->common()->Return(), change, 138 Node* ret = this->graph()->NewNode(this->common()->Return(), change,
139 this->start(), this->start()); 139 this->start(), this->start());
140 Node* end = this->graph()->NewNode(this->common()->End(), ret); 140 Node* end = this->graph()->NewNode(this->common()->End(), ret);
141 this->graph()->SetEnd(end); 141 this->graph()->SetEnd(end);
142 this->lowering.Lower(change); 142 this->lowering.LowerChange(change, this->start(), this->start());
143 Verifier::Run(this->graph()); 143 Verifier::Run(this->graph());
144 } 144 }
145 145
146 Factory* factory() { return this->isolate()->factory(); } 146 Factory* factory() { return this->isolate()->factory(); }
147 Heap* heap() { return this->isolate()->heap(); } 147 Heap* heap() { return this->isolate()->heap(); }
148 }; 148 };
149 149
150 150
151 TEST(RunChangeTaggedToInt32) { 151 TEST(RunChangeTaggedToInt32) {
152 // Build and lower a graph by hand. 152 // Build and lower a graph by hand.
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 388
389 if (TODO_FLOAT64_TO_TAGGED && Pipeline::SupportedTarget()) { 389 if (TODO_FLOAT64_TO_TAGGED && Pipeline::SupportedTarget()) {
390 FOR_FLOAT64_INPUTS(i) { 390 FOR_FLOAT64_INPUTS(i) {
391 input = *i; 391 input = *i;
392 SimulateFullSpace(CcTest::heap()->new_space()); 392 SimulateFullSpace(CcTest::heap()->new_space());
393 Object* result = t.CallWithPotentialGC<Object>(); 393 Object* result = t.CallWithPotentialGC<Object>();
394 t.CheckNumber(input, result); 394 t.CheckNumber(input, result);
395 } 395 }
396 } 396 }
397 } 397 }
OLDNEW
« no previous file with comments | « test/cctest/compiler/graph-builder-tester.h ('k') | test/cctest/compiler/test-simplified-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698