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" |
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/unit_test.h" | 15 #include "vm/unit_test.h" |
16 | 16 |
17 #define __ assembler-> | 17 #define __ assembler-> |
18 | 18 |
19 namespace dart { | 19 namespace dart { |
20 | 20 |
21 DECLARE_RUNTIME_ENTRY(TestSmiSub); | 21 DECLARE_RUNTIME_ENTRY(TestSmiSub); |
22 DECLARE_LEAF_RUNTIME_ENTRY(RawObject*, TestLeafSmiAdd, RawObject*, RawObject*); | 22 DECLARE_LEAF_RUNTIME_ENTRY(RawObject*, TestLeafSmiAdd, RawObject*, RawObject*); |
23 | 23 |
24 | 24 |
25 static Function* CreateFunction(const char* name) { | 25 static Function* CreateFunction(const char* name) { |
26 const String& function_name = String::ZoneHandle(String::NewSymbol(name)); | 26 const String& function_name = String::ZoneHandle(String::NewSymbol(name)); |
27 Function& function = Function::ZoneHandle( | 27 Function& function = Function::ZoneHandle( |
28 Function::New(function_name, RawFunction::kFunction, true, false, 0)); | 28 Function::New(function_name, RawFunction::kRegularFunction, |
| 29 true, false, 0)); |
29 return &function; | 30 return &function; |
30 } | 31 } |
31 | 32 |
32 // Test calls to stub code which calls into the runtime. | 33 // Test calls to stub code which calls into the runtime. |
33 static void GenerateCallToCallRuntimeStub(Assembler* assembler, | 34 static void GenerateCallToCallRuntimeStub(Assembler* assembler, |
34 int value1, int value2) { | 35 int value1, int value2) { |
35 const int argc = 2; | 36 const int argc = 2; |
36 const Smi& smi1 = Smi::ZoneHandle(Smi::New(value1)); | 37 const Smi& smi1 = Smi::ZoneHandle(Smi::New(value1)); |
37 const Smi& smi2 = Smi::ZoneHandle(Smi::New(value2)); | 38 const Smi& smi2 = Smi::ZoneHandle(Smi::New(value2)); |
38 const Object& result = Object::ZoneHandle(); | 39 const Object& result = Object::ZoneHandle(); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 GrowableArray<const Object*> arguments; | 153 GrowableArray<const Object*> arguments; |
153 const Array& kNoArgumentNames = Array::Handle(); | 154 const Array& kNoArgumentNames = Array::Handle(); |
154 Smi& result = Smi::Handle(); | 155 Smi& result = Smi::Handle(); |
155 result ^= DartEntry::InvokeStatic(function, arguments, kNoArgumentNames); | 156 result ^= DartEntry::InvokeStatic(function, arguments, kNoArgumentNames); |
156 EXPECT_EQ((value1 - value2), result.Value()); | 157 EXPECT_EQ((value1 - value2), result.Value()); |
157 } | 158 } |
158 | 159 |
159 } // namespace dart | 160 } // namespace dart |
160 | 161 |
161 #endif // defined TARGET_ARCH_IA32 | 162 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |