| 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 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
| 8 #include "src/compiler.h" | 8 #include "src/compiler.h" |
| 9 #include "src/parser.h" | 9 #include "src/parser.h" |
| 10 #include "src/zone.h" | 10 #include "src/zone.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 static Operator dummy_operator(IrOpcode::kParameter, Operator::kNoWrite, | 27 static Operator dummy_operator(IrOpcode::kParameter, Operator::kNoWrite, |
| 28 "dummy", 0, 0, 0, 0, 0, 0); | 28 "dummy", 0, 0, 0, 0, 0, 0); |
| 29 | 29 |
| 30 // So we can get a real JS function. | 30 // So we can get a real JS function. |
| 31 static Handle<JSFunction> Compile(const char* source) { | 31 static Handle<JSFunction> Compile(const char* source) { |
| 32 Isolate* isolate = CcTest::i_isolate(); | 32 Isolate* isolate = CcTest::i_isolate(); |
| 33 Handle<String> source_code = isolate->factory() | 33 Handle<String> source_code = isolate->factory() |
| 34 ->NewStringFromUtf8(CStrVector(source)) | 34 ->NewStringFromUtf8(CStrVector(source)) |
| 35 .ToHandleChecked(); | 35 .ToHandleChecked(); |
| 36 Handle<SharedFunctionInfo> shared_function = Compiler::CompileScript( | 36 Handle<SharedFunctionInfo> shared_function = Compiler::CompileScript( |
| 37 source_code, Handle<String>(), 0, 0, false, false, Handle<Object>(), | 37 source_code, Handle<String>(), 0, 0, v8::ScriptOriginOptions(), |
| 38 Handle<Context>(isolate->native_context()), NULL, NULL, | 38 Handle<Object>(), Handle<Context>(isolate->native_context()), NULL, NULL, |
| 39 v8::ScriptCompiler::kNoCompileOptions, NOT_NATIVES_CODE, false); | 39 v8::ScriptCompiler::kNoCompileOptions, NOT_NATIVES_CODE, false); |
| 40 return isolate->factory()->NewFunctionFromSharedFunctionInfo( | 40 return isolate->factory()->NewFunctionFromSharedFunctionInfo( |
| 41 shared_function, isolate->native_context()); | 41 shared_function, isolate->native_context()); |
| 42 } | 42 } |
| 43 | 43 |
| 44 | 44 |
| 45 TEST(TestLinkageCreate) { | 45 TEST(TestLinkageCreate) { |
| 46 HandleAndZoneScope handles; | 46 HandleAndZoneScope handles; |
| 47 Handle<JSFunction> function = Compile("a + b"); | 47 Handle<JSFunction> function = Compile("a + b"); |
| 48 ParseInfo parse_info(handles.main_zone(), function); | 48 ParseInfo parse_info(handles.main_zone(), function); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 // TODO(titzer): test linkage creation for outgoing runtime calls. | 109 // TODO(titzer): test linkage creation for outgoing runtime calls. |
| 110 } | 110 } |
| 111 | 111 |
| 112 | 112 |
| 113 TEST(TestLinkageStubCall) { | 113 TEST(TestLinkageStubCall) { |
| 114 // TODO(titzer): test linkage creation for outgoing stub calls. | 114 // TODO(titzer): test linkage creation for outgoing stub calls. |
| 115 } | 115 } |
| 116 | 116 |
| 117 | 117 |
| 118 #endif // V8_TURBOFAN_TARGET | 118 #endif // V8_TURBOFAN_TARGET |
| OLD | NEW |