OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/globals.h" | 5 #include "vm/globals.h" |
6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
7 | 7 |
8 #include "vm/isolate.h" | 8 #include "vm/isolate.h" |
9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
10 #include "vm/native_entry.h" | 10 #include "vm/native_entry.h" |
11 #include "vm/native_entry_test.h" | 11 #include "vm/native_entry_test.h" |
12 #include "vm/object.h" | 12 #include "vm/object.h" |
13 #include "vm/runtime_entry.h" | 13 #include "vm/runtime_entry.h" |
14 #include "vm/stub_code.h" | 14 #include "vm/stub_code.h" |
15 #include "vm/symbols.h" | 15 #include "vm/symbols.h" |
16 #include "vm/unit_test.h" | 16 #include "vm/unit_test.h" |
17 | 17 |
18 #define __ assembler-> | 18 #define __ assembler-> |
19 | 19 |
20 namespace dart { | 20 namespace dart { |
21 | 21 |
22 static Function* CreateFunction(const char* name) { | 22 static Function* CreateFunction(const char* name) { |
23 const String& class_name = String::Handle(Symbols::New("ownerClass")); | 23 const String& class_name = String::Handle(Symbols::New("ownerClass")); |
24 const Script& script = Script::Handle(); | 24 const Script& script = Script::Handle(); |
25 const Class& owner_class = | 25 const Class& owner_class = Class::Handle( |
26 Class::Handle(Class::New(class_name, script, Token::kNoSourcePos)); | 26 Class::New(class_name, script, TokenPosition::kNoSource)); |
27 const Library& lib = Library::Handle(Library::New(class_name)); | 27 const Library& lib = Library::Handle(Library::New(class_name)); |
28 owner_class.set_library(lib); | 28 owner_class.set_library(lib); |
29 const String& function_name = String::ZoneHandle(Symbols::New(name)); | 29 const String& function_name = String::ZoneHandle(Symbols::New(name)); |
30 Function& function = Function::ZoneHandle( | 30 Function& function = Function::ZoneHandle( |
31 Function::New(function_name, RawFunction::kRegularFunction, | 31 Function::New(function_name, RawFunction::kRegularFunction, |
32 true, false, false, false, false, owner_class, 0)); | 32 true, false, false, false, false, owner_class, |
| 33 TokenPosition::kNoSource)); |
33 return &function; | 34 return &function; |
34 } | 35 } |
35 | 36 |
36 | 37 |
37 // Test calls to stub code which calls into the runtime. | 38 // Test calls to stub code which calls into the runtime. |
38 static void GenerateCallToCallRuntimeStub(Assembler* assembler, | 39 static void GenerateCallToCallRuntimeStub(Assembler* assembler, |
39 int length) { | 40 int length) { |
40 const int argc = 2; | 41 const int argc = 2; |
41 const Smi& smi_length = Smi::ZoneHandle(Smi::New(length)); | 42 const Smi& smi_length = Smi::ZoneHandle(Smi::New(length)); |
42 __ EnterDartFrame(0); | 43 __ EnterDartFrame(0); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 *CreateFunction("Test_CallLeafRuntimeStubCode"), &_assembler_)); | 100 *CreateFunction("Test_CallLeafRuntimeStubCode"), &_assembler_)); |
100 const Function& function = RegisterFakeFunction(kName, code); | 101 const Function& function = RegisterFakeFunction(kName, code); |
101 Smi& result = Smi::Handle(); | 102 Smi& result = Smi::Handle(); |
102 result ^= DartEntry::InvokeFunction(function, Object::empty_array()); | 103 result ^= DartEntry::InvokeFunction(function, Object::empty_array()); |
103 EXPECT_EQ(1, result.Value()); | 104 EXPECT_EQ(1, result.Value()); |
104 } | 105 } |
105 | 106 |
106 } // namespace dart | 107 } // namespace dart |
107 | 108 |
108 #endif // defined TARGET_ARCH_ARM64 | 109 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |