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

Side by Side Diff: test/cctest/compiler/codegen-tester.h

Issue 1645653002: [turbofan] Add the StackSlot operator to turbofan. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Explicitly state the type of test values. Created 4 years, 10 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/x87/code-generator-x87.cc ('k') | test/cctest/compiler/test-run-machops.cc » ('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 #ifndef V8_CCTEST_COMPILER_CODEGEN_TESTER_H_ 5 #ifndef V8_CCTEST_COMPILER_CODEGEN_TESTER_H_
6 #define V8_CCTEST_COMPILER_CODEGEN_TESTER_H_ 6 #define V8_CCTEST_COMPILER_CODEGEN_TESTER_H_
7 7
8 #include "src/compiler/instruction-selector.h" 8 #include "src/compiler/instruction-selector.h"
9 #include "src/compiler/pipeline.h" 9 #include "src/compiler/pipeline.h"
10 #include "src/compiler/raw-machine-assembler.h" 10 #include "src/compiler/raw-machine-assembler.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 // The BufferedRawMachineAssemblerTester does not pass parameters directly 89 // The BufferedRawMachineAssemblerTester does not pass parameters directly
90 // to the constructed IR graph. Instead it passes a pointer to the parameter 90 // to the constructed IR graph. Instead it passes a pointer to the parameter
91 // to the IR graph, and adds Load nodes to the IR graph to load the 91 // to the IR graph, and adds Load nodes to the IR graph to load the
92 // parameters from memory. Thereby it is possible to pass 64 bit parameters 92 // parameters from memory. Thereby it is possible to pass 64 bit parameters
93 // to the IR graph. 93 // to the IR graph.
94 Node* Parameter(size_t index) { 94 Node* Parameter(size_t index) {
95 CHECK(index < 4); 95 CHECK(index < 4);
96 return parameter_nodes_[index]; 96 return parameter_nodes_[index];
97 } 97 }
98 98
99
100 // The BufferedRawMachineAssemblerTester adds a Store node to the IR graph 99 // The BufferedRawMachineAssemblerTester adds a Store node to the IR graph
101 // to store the graph's return value in memory. The memory address for the 100 // to store the graph's return value in memory. The memory address for the
102 // Store node is provided as a parameter. By storing the return value in 101 // Store node is provided as a parameter. By storing the return value in
103 // memory it is possible to return 64 bit values. 102 // memory it is possible to return 64 bit values.
104 void Return(Node* input) { 103 void Return(Node* input) {
105 Store(MachineTypeForC<ReturnType>().representation(), 104 Store(MachineTypeForC<ReturnType>().representation(),
106 RawMachineAssembler::Parameter(return_parameter_index_), input, 105 RawMachineAssembler::Parameter(return_parameter_index_), input,
107 kNoWriteBarrier); 106 kNoWriteBarrier);
108 RawMachineAssembler::Return(Int32Constant(1234)); 107 RawMachineAssembler::Return(Int32Constant(1234));
109 } 108 }
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 ? nullptr 237 ? nullptr
239 : Load(p1, RawMachineAssembler::Parameter(1)); 238 : Load(p1, RawMachineAssembler::Parameter(1));
240 parameter_nodes_[2] = p2 == MachineType::None() 239 parameter_nodes_[2] = p2 == MachineType::None()
241 ? nullptr 240 ? nullptr
242 : Load(p2, RawMachineAssembler::Parameter(2)); 241 : Load(p2, RawMachineAssembler::Parameter(2));
243 parameter_nodes_[3] = p3 == MachineType::None() 242 parameter_nodes_[3] = p3 == MachineType::None()
244 ? nullptr 243 ? nullptr
245 : Load(p3, RawMachineAssembler::Parameter(3)); 244 : Load(p3, RawMachineAssembler::Parameter(3));
246 } 245 }
247 246
248
249 // The BufferedRawMachineAssemblerTester does not pass parameters directly 247 // The BufferedRawMachineAssemblerTester does not pass parameters directly
250 // to the constructed IR graph. Instead it passes a pointer to the parameter 248 // to the constructed IR graph. Instead it passes a pointer to the parameter
251 // to the IR graph, and adds Load nodes to the IR graph to load the 249 // to the IR graph, and adds Load nodes to the IR graph to load the
252 // parameters from memory. Thereby it is possible to pass 64 bit parameters 250 // parameters from memory. Thereby it is possible to pass 64 bit parameters
253 // to the IR graph. 251 // to the IR graph.
254 Node* Parameter(size_t index) { 252 Node* Parameter(size_t index) {
255 CHECK(index >= 0 && index < 4); 253 CHECK(index >= 0 && index < 4);
256 return parameter_nodes_[index]; 254 return parameter_nodes_[index];
257 } 255 }
258 256
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 } else { 551 } else {
554 CHECK_EQ(x, y); 552 CHECK_EQ(x, y);
555 } 553 }
556 } 554 }
557 555
558 } // namespace compiler 556 } // namespace compiler
559 } // namespace internal 557 } // namespace internal
560 } // namespace v8 558 } // namespace v8
561 559
562 #endif // V8_CCTEST_COMPILER_CODEGEN_TESTER_H_ 560 #endif // V8_CCTEST_COMPILER_CODEGEN_TESTER_H_
OLDNEW
« no previous file with comments | « src/compiler/x87/code-generator-x87.cc ('k') | test/cctest/compiler/test-run-machops.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698