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