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_FUNCTION_TESTER_H_ | 5 #ifndef V8_CCTEST_COMPILER_FUNCTION_TESTER_H_ |
6 #define V8_CCTEST_COMPILER_FUNCTION_TESTER_H_ | 6 #define V8_CCTEST_COMPILER_FUNCTION_TESTER_H_ |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 #include "test/cctest/cctest.h" | 9 #include "test/cctest/cctest.h" |
10 | 10 |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 Handle<String> Val(const char* string) { | 130 Handle<String> Val(const char* string) { |
131 return isolate->factory()->InternalizeUtf8String(string); | 131 return isolate->factory()->InternalizeUtf8String(string); |
132 } | 132 } |
133 | 133 |
134 Handle<Object> Val(double value) { | 134 Handle<Object> Val(double value) { |
135 return isolate->factory()->NewNumber(value); | 135 return isolate->factory()->NewNumber(value); |
136 } | 136 } |
137 | 137 |
138 Handle<Object> infinity() { return isolate->factory()->infinity_value(); } | 138 Handle<Object> infinity() { return isolate->factory()->infinity_value(); } |
139 | 139 |
140 Handle<Object> minus_infinity() { | 140 Handle<Object> minus_infinity() { return Val(-V8_INFINITY); } |
141 return Val(-std::numeric_limits<double>::infinity()); | |
142 } | |
143 | 141 |
144 Handle<Object> nan() { return isolate->factory()->nan_value(); } | 142 Handle<Object> nan() { return isolate->factory()->nan_value(); } |
145 | 143 |
146 Handle<Object> undefined() { return isolate->factory()->undefined_value(); } | 144 Handle<Object> undefined() { return isolate->factory()->undefined_value(); } |
147 | 145 |
148 Handle<Object> null() { return isolate->factory()->null_value(); } | 146 Handle<Object> null() { return isolate->factory()->null_value(); } |
149 | 147 |
150 Handle<Object> true_value() { return isolate->factory()->true_value(); } | 148 Handle<Object> true_value() { return isolate->factory()->true_value(); } |
151 | 149 |
152 Handle<Object> false_value() { return isolate->factory()->false_value(); } | 150 Handle<Object> false_value() { return isolate->factory()->false_value(); } |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 CHECK(!code.is_null()); | 220 CHECK(!code.is_null()); |
223 function->ReplaceCode(*code); | 221 function->ReplaceCode(*code); |
224 return function; | 222 return function; |
225 } | 223 } |
226 }; | 224 }; |
227 } | 225 } |
228 } | 226 } |
229 } // namespace v8::internal::compiler | 227 } // namespace v8::internal::compiler |
230 | 228 |
231 #endif // V8_CCTEST_COMPILER_FUNCTION_TESTER_H_ | 229 #endif // V8_CCTEST_COMPILER_FUNCTION_TESTER_H_ |
OLD | NEW |