OLD | NEW |
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 90 matching lines...) Loading... |
101 if (use_result_buffer) { | 101 if (use_result_buffer) { |
102 CHECK_EQ(CHECK_VALUE, T->Call()); | 102 CHECK_EQ(CHECK_VALUE, T->Call()); |
103 return result; | 103 return result; |
104 } else { | 104 } else { |
105 return static_cast<CType>(T->Call()); | 105 return static_cast<CType>(T->Call()); |
106 } | 106 } |
107 } | 107 } |
108 | 108 |
109 void AddReturn(Node* val) { | 109 void AddReturn(Node* val) { |
110 if (use_result_buffer) { | 110 if (use_result_buffer) { |
111 T->Store(StoreRepresentation(rep, kNoWriteBarrier), | 111 T->Store(rep, T->PointerConstant(&result), T->Int32Constant(0), val, |
112 T->PointerConstant(&result), T->Int32Constant(0), val); | 112 kNoWriteBarrier); |
113 T->Return(T->Int32Constant(CHECK_VALUE)); | 113 T->Return(T->Int32Constant(CHECK_VALUE)); |
114 } else { | 114 } else { |
115 T->Return(val); | 115 T->Return(val); |
116 } | 116 } |
117 } | 117 } |
118 | 118 |
119 template <typename Ci, typename Cj, typename Fn> | 119 template <typename Ci, typename Cj, typename Fn> |
120 void Run(const Ci& ci, const Cj& cj, const Fn& fn) { | 120 void Run(const Ci& ci, const Cj& cj, const Fn& fn) { |
121 typename Ci::const_iterator i; | 121 typename Ci::const_iterator i; |
122 typename Cj::const_iterator j; | 122 typename Cj::const_iterator j; |
(...skipping 196 matching lines...) Loading... |
319 } else { | 319 } else { |
320 CHECK_EQ(x, y); | 320 CHECK_EQ(x, y); |
321 } | 321 } |
322 } | 322 } |
323 | 323 |
324 } // namespace compiler | 324 } // namespace compiler |
325 } // namespace internal | 325 } // namespace internal |
326 } // namespace v8 | 326 } // namespace v8 |
327 | 327 |
328 #endif // V8_CCTEST_COMPILER_CODEGEN_TESTER_H_ | 328 #endif // V8_CCTEST_COMPILER_CODEGEN_TESTER_H_ |
OLD | NEW |