| 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/ast-numbering.h" | 8 #include "src/ast-numbering.h" |
| 9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
| 10 #include "src/compiler/linkage.h" | 10 #include "src/compiler/linkage.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 void CheckFalse(double a, double b) { | 117 void CheckFalse(double a, double b) { |
| 118 CheckCall(false_value(), Val(a), Val(b)); | 118 CheckCall(false_value(), Val(a), Val(b)); |
| 119 } | 119 } |
| 120 | 120 |
| 121 Handle<JSFunction> NewFunction(const char* source) { | 121 Handle<JSFunction> NewFunction(const char* source) { |
| 122 return Handle<JSFunction>::cast(v8::Utils::OpenHandle( | 122 return Handle<JSFunction>::cast(v8::Utils::OpenHandle( |
| 123 *v8::Local<v8::Function>::Cast(CompileRun(source)))); | 123 *v8::Local<v8::Function>::Cast(CompileRun(source)))); |
| 124 } | 124 } |
| 125 | 125 |
| 126 Handle<JSObject> NewObject(const char* source) { | 126 Handle<JSObject> NewObject(const char* source) { |
| 127 return v8::Utils::OpenHandle( | 127 return Handle<JSObject>::cast(v8::Utils::OpenHandle( |
| 128 *v8::Local<v8::Object>::Cast(CompileRun(source))); | 128 *v8::Local<v8::Object>::Cast(CompileRun(source)))); |
| 129 } | 129 } |
| 130 | 130 |
| 131 Handle<String> Val(const char* string) { | 131 Handle<String> Val(const char* string) { |
| 132 return isolate->factory()->InternalizeUtf8String(string); | 132 return isolate->factory()->InternalizeUtf8String(string); |
| 133 } | 133 } |
| 134 | 134 |
| 135 Handle<Object> Val(double value) { | 135 Handle<Object> Val(double value) { |
| 136 return isolate->factory()->NewNumber(value); | 136 return isolate->factory()->NewNumber(value); |
| 137 } | 137 } |
| 138 | 138 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 CHECK(!code.is_null()); | 209 CHECK(!code.is_null()); |
| 210 function->ReplaceCode(*code); | 210 function->ReplaceCode(*code); |
| 211 return function; | 211 return function; |
| 212 } | 212 } |
| 213 }; | 213 }; |
| 214 } // namespace compiler | 214 } // namespace compiler |
| 215 } // namespace internal | 215 } // namespace internal |
| 216 } // namespace v8 | 216 } // namespace v8 |
| 217 | 217 |
| 218 #endif // V8_CCTEST_COMPILER_FUNCTION_TESTER_H_ | 218 #endif // V8_CCTEST_COMPILER_FUNCTION_TESTER_H_ |
| OLD | NEW |