| 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 // TODO(zra): Remove when tests are ready to enable. | 5 // TODO(zra): Remove when tests are ready to enable. |
| 6 #include "platform/globals.h" | 6 #include "platform/globals.h" |
| 7 #if !defined(TARGET_ARCH_ARM64) | 7 #if !defined(TARGET_ARCH_ARM64) |
| 8 | 8 |
| 9 #include "include/dart_api.h" | 9 #include "include/dart_api.h" |
| 10 #include "platform/assert.h" | 10 #include "platform/assert.h" |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 "class StackFrame {" | 254 "class StackFrame {" |
| 255 " static equals(var obj1, var obj2) native \"StackFrame_equals\";" | 255 " static equals(var obj1, var obj2) native \"StackFrame_equals\";" |
| 256 " static int frameCount() native \"StackFrame_frameCount\";" | 256 " static int frameCount() native \"StackFrame_frameCount\";" |
| 257 " static int dartFrameCount() native \"StackFrame_dartFrameCount\";" | 257 " static int dartFrameCount() native \"StackFrame_dartFrameCount\";" |
| 258 " static validateFrame(int index," | 258 " static validateFrame(int index," |
| 259 " String name) native \"StackFrame_validateFrame\";" | 259 " String name) native \"StackFrame_validateFrame\";" |
| 260 "} " | 260 "} " |
| 261 "class StackFrame2Test {" | 261 "class StackFrame2Test {" |
| 262 " StackFrame2Test() {}" | 262 " StackFrame2Test() {}" |
| 263 " noSuchMethod(Invocation im) {" | 263 " noSuchMethod(Invocation im) {" |
| 264 " /* We should have 8 general frames and 3 dart frames as follows:" | 264 " /* We should have 6 general frames and 4 dart frames as follows:" |
| 265 " * exit frame" | 265 " * exit frame" |
| 266 " * dart frame corresponding to StackFrame.frameCount" | 266 " * dart frame corresponding to StackFrame.frameCount" |
| 267 " * dart frame corresponding to StackFrame2Test.noSuchMethod" | 267 " * dart frame corresponding to StackFrame2Test.noSuchMethod" |
| 268 " * entry frame" | |
| 269 " * exit frame" | |
| 270 " * frame for instance function invocation stub calling noSuchMethod" | 268 " * frame for instance function invocation stub calling noSuchMethod" |
| 271 " * dart frame corresponding to StackFrame2Test.testMain" | 269 " * dart frame corresponding to StackFrame2Test.testMain" |
| 272 " * entry frame" | 270 " * entry frame" |
| 273 " */" | 271 " */" |
| 274 " StackFrame.equals(9, StackFrame.frameCount());" | 272 " StackFrame.equals(6, StackFrame.frameCount());" |
| 275 " StackFrame.equals(4, StackFrame.dartFrameCount());" | 273 " StackFrame.equals(4, StackFrame.dartFrameCount());" |
| 276 " StackFrame.validateFrame(0, \"StackFrame_validateFrame\");" | 274 " StackFrame.validateFrame(0, \"StackFrame_validateFrame\");" |
| 277 " StackFrame.validateFrame(1, \"StackFrame2Test_noSuchMethod\");" | 275 " StackFrame.validateFrame(1, \"StackFrame2Test_noSuchMethod\");" |
| 278 " StackFrame.validateFrame(2, \"StackFrame2Test_foo\");" | 276 " StackFrame.validateFrame(2, \"StackFrame2Test_foo\");" |
| 279 " StackFrame.validateFrame(3, \"StackFrame2Test_testMain\");" | 277 " StackFrame.validateFrame(3, \"StackFrame2Test_testMain\");" |
| 280 " return 5;" | 278 " return 5;" |
| 281 " }" | 279 " }" |
| 282 " static testMain() {" | 280 " static testMain() {" |
| 283 " var obj = new StackFrame2Test();" | 281 " var obj = new StackFrame2Test();" |
| 284 " StackFrame.equals(5, obj.foo(101, 202));" | 282 " StackFrame.equals(5, obj.foo(101, 202));" |
| 285 " }" | 283 " }" |
| 286 "}"; | 284 "}"; |
| 287 Dart_Handle lib = TestCase::LoadTestScript( | 285 Dart_Handle lib = TestCase::LoadTestScript( |
| 288 kScriptChars, | 286 kScriptChars, |
| 289 reinterpret_cast<Dart_NativeEntryResolver>(native_lookup)); | 287 reinterpret_cast<Dart_NativeEntryResolver>(native_lookup)); |
| 290 Dart_Handle cls = Dart_GetClass(lib, NewString("StackFrame2Test")); | 288 Dart_Handle cls = Dart_GetClass(lib, NewString("StackFrame2Test")); |
| 291 EXPECT_VALID(Dart_Invoke(cls, NewString("testMain"), 0, NULL)); | 289 EXPECT_VALID(Dart_Invoke(cls, NewString("testMain"), 0, NULL)); |
| 292 } | 290 } |
| 293 | 291 |
| 294 } // namespace dart | 292 } // namespace dart |
| 295 | 293 |
| 296 #endif // !defined(TARGET_ARCH_ARM64) | 294 #endif // !defined(TARGET_ARCH_ARM64) |
| OLD | NEW |