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_mirrors_api.h" | 5 #include "include/dart_mirrors_api.h" |
6 #include "include/dart_tools_api.h" | 6 #include "include/dart_tools_api.h" |
7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
8 #include "vm/dart_api_impl.h" | 8 #include "vm/dart_api_impl.h" |
9 #include "vm/lockers.h" | 9 #include "vm/lockers.h" |
10 #include "vm/unit_test.h" | 10 #include "vm/unit_test.h" |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 uintptr_t last_frame_pointer = 0; | 275 uintptr_t last_frame_pointer = 0; |
276 uintptr_t frame_pointer; | 276 uintptr_t frame_pointer; |
277 for (int i = 0; i < trace_len; i++) { | 277 for (int i = 0; i < trace_len; i++) { |
278 Dart_ActivationFrame frame; | 278 Dart_ActivationFrame frame; |
279 res = Dart_GetActivationFrame(trace, i, &frame); | 279 res = Dart_GetActivationFrame(trace, i, &frame); |
280 EXPECT_TRUE(res); | 280 EXPECT_TRUE(res); |
281 | 281 |
282 res = Dart_ActivationFrameGetFramePointer(frame, &frame_pointer); | 282 res = Dart_ActivationFrameGetFramePointer(frame, &frame_pointer); |
283 EXPECT_TRUE(res); | 283 EXPECT_TRUE(res); |
284 if (i > 0) { | 284 if (i > 0) { |
| 285 #if !defined(TARGET_ARCH_DBC) |
285 // We expect the stack to grow from high to low addresses. | 286 // We expect the stack to grow from high to low addresses. |
286 EXPECT_GT(frame_pointer, last_frame_pointer); | 287 EXPECT_GT(frame_pointer, last_frame_pointer); |
| 288 #else |
| 289 // On DBC stack grows upwards from low to high addresses. |
| 290 EXPECT_LT(frame_pointer, last_frame_pointer); |
| 291 #endif |
287 } | 292 } |
288 last_frame_pointer = frame_pointer; | 293 last_frame_pointer = frame_pointer; |
289 if (i < expected_frames) { | 294 if (i < expected_frames) { |
290 VerifyStackFrame(frame, func_names[i], local_vars[i], skip_null_expects); | 295 VerifyStackFrame(frame, func_names[i], local_vars[i], skip_null_expects); |
291 } else { | 296 } else { |
292 VerifyStackFrame(frame, NULL, Dart_Null(), skip_null_expects); | 297 VerifyStackFrame(frame, NULL, Dart_Null(), skip_null_expects); |
293 } | 298 } |
294 } | 299 } |
295 } | 300 } |
296 | 301 |
(...skipping 2033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2330 " null, 5, 17, 5, 18, 9, 19, 12," | 2335 " null, 5, 17, 5, 18, 9, 19, 12," |
2331 " null, 6, 21, 1," | 2336 " null, 6, 21, 1," |
2332 " null, 8, 24, 1, 25, 5, 26, 6, 27, 8," | 2337 " null, 8, 24, 1, 25, 5, 26, 6, 27, 8," |
2333 " null, 9, 29, 1]", | 2338 " null, 9, 29, 1]", |
2334 tokens_cstr); | 2339 tokens_cstr); |
2335 } | 2340 } |
2336 | 2341 |
2337 #endif | 2342 #endif |
2338 | 2343 |
2339 } // namespace dart | 2344 } // namespace dart |
OLD | NEW |