OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
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" |
(...skipping 15 matching lines...) Expand all Loading... |
26 static Function* CreateFunction(const char* name) { | 26 static Function* CreateFunction(const char* name) { |
27 const String& class_name = String::Handle(Symbols::New("ownerClass")); | 27 const String& class_name = String::Handle(Symbols::New("ownerClass")); |
28 const Script& script = Script::Handle(); | 28 const Script& script = Script::Handle(); |
29 const Class& owner_class = | 29 const Class& owner_class = |
30 Class::Handle(Class::New(class_name, script, Scanner::kDummyTokenIndex)); | 30 Class::Handle(Class::New(class_name, script, Scanner::kDummyTokenIndex)); |
31 const Library& lib = Library::Handle(Library::New(class_name)); | 31 const Library& lib = Library::Handle(Library::New(class_name)); |
32 owner_class.set_library(lib); | 32 owner_class.set_library(lib); |
33 const String& function_name = String::ZoneHandle(Symbols::New(name)); | 33 const String& function_name = String::ZoneHandle(Symbols::New(name)); |
34 Function& function = Function::ZoneHandle( | 34 Function& function = Function::ZoneHandle( |
35 Function::New(function_name, RawFunction::kRegularFunction, | 35 Function::New(function_name, RawFunction::kRegularFunction, |
36 true, false, false, false, owner_class, 0)); | 36 true, false, false, false, false, owner_class, 0)); |
37 return &function; | 37 return &function; |
38 } | 38 } |
39 | 39 |
40 | 40 |
41 // Test calls to stub code which calls into the runtime. | 41 // Test calls to stub code which calls into the runtime. |
42 static void GenerateCallToCallRuntimeStub(Assembler* assembler, | 42 static void GenerateCallToCallRuntimeStub(Assembler* assembler, |
43 int value1, int value2) { | 43 int value1, int value2) { |
44 const int argc = 2; | 44 const int argc = 2; |
45 const Smi& smi1 = Smi::ZoneHandle(Smi::New(value1)); | 45 const Smi& smi1 = Smi::ZoneHandle(Smi::New(value1)); |
46 const Smi& smi2 = Smi::ZoneHandle(Smi::New(value2)); | 46 const Smi& smi2 = Smi::ZoneHandle(Smi::New(value2)); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 *CreateFunction("Test_CallLeafRuntimeStubCode"), &_assembler_)); | 108 *CreateFunction("Test_CallLeafRuntimeStubCode"), &_assembler_)); |
109 const Function& function = RegisterFakeFunction(kName, code); | 109 const Function& function = RegisterFakeFunction(kName, code); |
110 Smi& result = Smi::Handle(); | 110 Smi& result = Smi::Handle(); |
111 result ^= DartEntry::InvokeFunction(function, Object::empty_array()); | 111 result ^= DartEntry::InvokeFunction(function, Object::empty_array()); |
112 EXPECT_EQ((value1 + value2), result.Value()); | 112 EXPECT_EQ((value1 + value2), result.Value()); |
113 } | 113 } |
114 | 114 |
115 } // namespace dart | 115 } // namespace dart |
116 | 116 |
117 #endif // defined TARGET_ARCH_IA32 | 117 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |