| 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 static void NativeFunc(Dart_NativeArguments args) { | 185 static void NativeFunc(Dart_NativeArguments args) { |
| 186 Dart_EnterScope(); | 186 Dart_EnterScope(); |
| 187 Dart_Handle i = Dart_GetNativeArgument(args, 0); | 187 Dart_Handle i = Dart_GetNativeArgument(args, 0); |
| 188 Dart_Handle k = Dart_GetNativeArgument(args, 1); | 188 Dart_Handle k = Dart_GetNativeArgument(args, 1); |
| 189 int64_t value = -1; | 189 int64_t value = -1; |
| 190 EXPECT_VALID(Dart_IntegerToInt64(i, &value)); | 190 EXPECT_VALID(Dart_IntegerToInt64(i, &value)); |
| 191 EXPECT_EQ(10, value); | 191 EXPECT_EQ(10, value); |
| 192 EXPECT_VALID(Dart_IntegerToInt64(k, &value)); | 192 EXPECT_VALID(Dart_IntegerToInt64(k, &value)); |
| 193 EXPECT_EQ(20, value); | 193 EXPECT_EQ(20, value); |
| 194 Isolate::Current()->heap()->CollectAllGarbage(); | 194 Isolate::Current()->heap()->CollectAllGarbage(); |
| 195 Dart_ExitScope(); |
| 195 } | 196 } |
| 196 | 197 |
| 197 | 198 |
| 198 static Dart_NativeFunction native_resolver(Dart_Handle name, | 199 static Dart_NativeFunction native_resolver(Dart_Handle name, |
| 199 int argument_count) { | 200 int argument_count) { |
| 200 return reinterpret_cast<Dart_NativeFunction>(&NativeFunc); | 201 return reinterpret_cast<Dart_NativeFunction>(&NativeFunc); |
| 201 } | 202 } |
| 202 | 203 |
| 203 | 204 |
| 204 TEST_CASE(StackmapGC) { | 205 TEST_CASE(StackmapGC) { |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 GrowableArray<const Object*> arguments; | 280 GrowableArray<const Object*> arguments; |
| 280 const Array& kNoArgumentNames = Array::Handle(); | 281 const Array& kNoArgumentNames = Array::Handle(); |
| 281 Object& result = Object::Handle(); | 282 Object& result = Object::Handle(); |
| 282 result = DartEntry::InvokeStatic(function_foo, arguments, kNoArgumentNames); | 283 result = DartEntry::InvokeStatic(function_foo, arguments, kNoArgumentNames); |
| 283 EXPECT(!result.IsError()); | 284 EXPECT(!result.IsError()); |
| 284 } | 285 } |
| 285 | 286 |
| 286 } // namespace dart | 287 } // namespace dart |
| 287 | 288 |
| 288 #endif // defined TARGET_ARCH_IA32 || defined(TARGET_ARCH_X64) | 289 #endif // defined TARGET_ARCH_IA32 || defined(TARGET_ARCH_X64) |
| OLD | NEW |