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 "include/dart_api.h" | 5 #include "include/dart_api.h" |
6 #include "platform/assert.h" | 6 #include "platform/assert.h" |
7 #include "vm/class_finalizer.h" | 7 #include "vm/class_finalizer.h" |
8 #include "vm/compiler.h" | 8 #include "vm/compiler.h" |
9 #include "vm/dart_api_impl.h" | 9 #include "vm/dart_api_impl.h" |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 } | 35 } |
36 | 36 |
37 | 37 |
38 #define FUNCTION_NAME(name) StackFrame_##name | 38 #define FUNCTION_NAME(name) StackFrame_##name |
39 #define REGISTER_FUNCTION(name, count) \ | 39 #define REGISTER_FUNCTION(name, count) \ |
40 { ""#name, FUNCTION_NAME(name), count }, | 40 { ""#name, FUNCTION_NAME(name), count }, |
41 | 41 |
42 | 42 |
43 void FUNCTION_NAME(StackFrame_equals)(Dart_NativeArguments args) { | 43 void FUNCTION_NAME(StackFrame_equals)(Dart_NativeArguments args) { |
44 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); | 44 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); |
45 const Instance& expected = Instance::CheckedHandle(arguments->At(0)); | 45 const Instance& expected = Instance::CheckedHandle(arguments->NativeArgAt(0)); |
46 const Instance& actual = Instance::CheckedHandle(arguments->At(1)); | 46 const Instance& actual = Instance::CheckedHandle(arguments->NativeArgAt(1)); |
47 if (!expected.Equals(actual)) { | 47 if (!expected.Equals(actual)) { |
48 OS::Print("expected: '%s' actual: '%s'\n", | 48 OS::Print("expected: '%s' actual: '%s'\n", |
49 expected.ToCString(), actual.ToCString()); | 49 expected.ToCString(), actual.ToCString()); |
50 FATAL("Expect_equals fails.\n"); | 50 FATAL("Expect_equals fails.\n"); |
51 } | 51 } |
52 } | 52 } |
53 | 53 |
54 | 54 |
55 void FUNCTION_NAME(StackFrame_frameCount)(Dart_NativeArguments args) { | 55 void FUNCTION_NAME(StackFrame_frameCount)(Dart_NativeArguments args) { |
56 int count = 0; | 56 int count = 0; |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 "}"; | 282 "}"; |
283 Dart_Handle lib = TestCase::LoadTestScript( | 283 Dart_Handle lib = TestCase::LoadTestScript( |
284 kScriptChars, | 284 kScriptChars, |
285 reinterpret_cast<Dart_NativeEntryResolver>(native_lookup)); | 285 reinterpret_cast<Dart_NativeEntryResolver>(native_lookup)); |
286 Dart_Handle cls = Dart_GetClass(lib, NewString("StackFrame2Test")); | 286 Dart_Handle cls = Dart_GetClass(lib, NewString("StackFrame2Test")); |
287 EXPECT_VALID(Dart_Invoke(cls, NewString("testMain"), 0, NULL)); | 287 EXPECT_VALID(Dart_Invoke(cls, NewString("testMain"), 0, NULL)); |
288 } | 288 } |
289 #endif // TARGET_ARCH_IA32 || TARGET_ARCH_X64. | 289 #endif // TARGET_ARCH_IA32 || TARGET_ARCH_X64. |
290 | 290 |
291 } // namespace dart | 291 } // namespace dart |
OLD | NEW |