OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 "platform/assert.h" | 5 #include "platform/assert.h" |
6 #include "vm/globals.h" | 6 #include "vm/globals.h" |
7 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) | 7 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) |
8 | 8 |
9 #include "vm/ast.h" | 9 #include "vm/ast.h" |
10 #include "vm/assembler.h" | 10 #include "vm/assembler.h" |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 } | 181 } |
182 CODEGEN_TEST_RUN(StackmapCodegen, Smi::New(1)) | 182 CODEGEN_TEST_RUN(StackmapCodegen, Smi::New(1)) |
183 | 183 |
184 | 184 |
185 DEFINE_NATIVE_ENTRY(NativeFunc, 2) { | 185 DEFINE_NATIVE_ENTRY(NativeFunc, 2) { |
186 GET_NATIVE_ARGUMENT(Smi, i, arguments->At(0)); | 186 GET_NATIVE_ARGUMENT(Smi, i, arguments->At(0)); |
187 GET_NATIVE_ARGUMENT(Smi, k, arguments->At(1)); | 187 GET_NATIVE_ARGUMENT(Smi, k, arguments->At(1)); |
188 EXPECT_EQ(10, i.Value()); | 188 EXPECT_EQ(10, i.Value()); |
189 EXPECT_EQ(20, k.Value()); | 189 EXPECT_EQ(20, k.Value()); |
190 Isolate::Current()->heap()->CollectAllGarbage(); | 190 Isolate::Current()->heap()->CollectAllGarbage(); |
| 191 return Object::null(); |
191 } | 192 } |
192 | 193 |
193 | 194 |
194 static Dart_NativeFunction native_resolver(Dart_Handle name, | 195 static Dart_NativeFunction native_resolver(Dart_Handle name, |
195 int argument_count) { | 196 int argument_count) { |
196 return reinterpret_cast<Dart_NativeFunction>(&DN_NativeFunc); | 197 return reinterpret_cast<Dart_NativeFunction>(&DN_NativeFunc); |
197 } | 198 } |
198 | 199 |
199 | 200 |
200 TEST_CASE(StackmapGC) { | 201 TEST_CASE(StackmapGC) { |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 GrowableArray<const Object*> arguments; | 275 GrowableArray<const Object*> arguments; |
275 const Array& kNoArgumentNames = Array::Handle(); | 276 const Array& kNoArgumentNames = Array::Handle(); |
276 Object& result = Object::Handle(); | 277 Object& result = Object::Handle(); |
277 result = DartEntry::InvokeStatic(function_foo, arguments, kNoArgumentNames); | 278 result = DartEntry::InvokeStatic(function_foo, arguments, kNoArgumentNames); |
278 EXPECT(!result.IsError()); | 279 EXPECT(!result.IsError()); |
279 } | 280 } |
280 | 281 |
281 } // namespace dart | 282 } // namespace dart |
282 | 283 |
283 #endif // defined TARGET_ARCH_IA32 || defined(TARGET_ARCH_X64) | 284 #endif // defined TARGET_ARCH_IA32 || defined(TARGET_ARCH_X64) |
OLD | NEW |