| 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_debugger_api.h" | 5 #include "include/dart_debugger_api.h" |
| 6 #include "platform/assert.h" | 6 #include "platform/assert.h" |
| 7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
| 8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
| 9 #include "vm/dart_api_impl.h" | 9 #include "vm/dart_api_impl.h" |
| 10 #include "vm/dart_api_message.h" | 10 #include "vm/dart_api_message.h" |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 CheckBigint("-0x11111111111111111111"); | 453 CheckBigint("-0x11111111111111111111"); |
| 454 CheckBigint("0x9876543210987654321098765432109876543210"); | 454 CheckBigint("0x9876543210987654321098765432109876543210"); |
| 455 CheckBigint("-0x9876543210987654321098765432109876543210"); | 455 CheckBigint("-0x9876543210987654321098765432109876543210"); |
| 456 } | 456 } |
| 457 | 457 |
| 458 TEST_CASE(SerializeSingletons) { | 458 TEST_CASE(SerializeSingletons) { |
| 459 // Write snapshot with object content. | 459 // Write snapshot with object content. |
| 460 uint8_t* buffer; | 460 uint8_t* buffer; |
| 461 MessageWriter writer(&buffer, &malloc_allocator); | 461 MessageWriter writer(&buffer, &malloc_allocator); |
| 462 writer.WriteObject(Object::class_class()); | 462 writer.WriteObject(Object::class_class()); |
| 463 writer.WriteObject(Object::null_class()); | |
| 464 writer.WriteObject(Object::type_arguments_class()); | 463 writer.WriteObject(Object::type_arguments_class()); |
| 465 writer.WriteObject(Object::instantiated_type_arguments_class()); | 464 writer.WriteObject(Object::instantiated_type_arguments_class()); |
| 466 writer.WriteObject(Object::function_class()); | 465 writer.WriteObject(Object::function_class()); |
| 467 writer.WriteObject(Object::field_class()); | 466 writer.WriteObject(Object::field_class()); |
| 468 writer.WriteObject(Object::token_stream_class()); | 467 writer.WriteObject(Object::token_stream_class()); |
| 469 writer.WriteObject(Object::script_class()); | 468 writer.WriteObject(Object::script_class()); |
| 470 writer.WriteObject(Object::library_class()); | 469 writer.WriteObject(Object::library_class()); |
| 471 writer.WriteObject(Object::code_class()); | 470 writer.WriteObject(Object::code_class()); |
| 472 writer.WriteObject(Object::instructions_class()); | 471 writer.WriteObject(Object::instructions_class()); |
| 473 writer.WriteObject(Object::pc_descriptors_class()); | 472 writer.WriteObject(Object::pc_descriptors_class()); |
| 474 writer.WriteObject(Object::exception_handlers_class()); | 473 writer.WriteObject(Object::exception_handlers_class()); |
| 475 writer.WriteObject(Object::context_class()); | 474 writer.WriteObject(Object::context_class()); |
| 476 writer.WriteObject(Object::context_scope_class()); | 475 writer.WriteObject(Object::context_scope_class()); |
| 477 intptr_t buffer_len = writer.BytesWritten(); | 476 intptr_t buffer_len = writer.BytesWritten(); |
| 478 | 477 |
| 479 // Read object back from the snapshot. | 478 // Read object back from the snapshot. |
| 480 SnapshotReader reader(buffer, buffer_len, Snapshot::kMessage, | 479 SnapshotReader reader(buffer, buffer_len, Snapshot::kMessage, |
| 481 Isolate::Current()); | 480 Isolate::Current()); |
| 482 EXPECT(Object::class_class() == reader.ReadObject()); | 481 EXPECT(Object::class_class() == reader.ReadObject()); |
| 483 EXPECT(Object::null_class() == reader.ReadObject()); | |
| 484 EXPECT(Object::type_arguments_class() == reader.ReadObject()); | 482 EXPECT(Object::type_arguments_class() == reader.ReadObject()); |
| 485 EXPECT(Object::instantiated_type_arguments_class() == reader.ReadObject()); | 483 EXPECT(Object::instantiated_type_arguments_class() == reader.ReadObject()); |
| 486 EXPECT(Object::function_class() == reader.ReadObject()); | 484 EXPECT(Object::function_class() == reader.ReadObject()); |
| 487 EXPECT(Object::field_class() == reader.ReadObject()); | 485 EXPECT(Object::field_class() == reader.ReadObject()); |
| 488 EXPECT(Object::token_stream_class() == reader.ReadObject()); | 486 EXPECT(Object::token_stream_class() == reader.ReadObject()); |
| 489 EXPECT(Object::script_class() == reader.ReadObject()); | 487 EXPECT(Object::script_class() == reader.ReadObject()); |
| 490 EXPECT(Object::library_class() == reader.ReadObject()); | 488 EXPECT(Object::library_class() == reader.ReadObject()); |
| 491 EXPECT(Object::code_class() == reader.ReadObject()); | 489 EXPECT(Object::code_class() == reader.ReadObject()); |
| 492 EXPECT(Object::instructions_class() == reader.ReadObject()); | 490 EXPECT(Object::instructions_class() == reader.ReadObject()); |
| 493 EXPECT(Object::pc_descriptors_class() == reader.ReadObject()); | 491 EXPECT(Object::pc_descriptors_class() == reader.ReadObject()); |
| (...skipping 1998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2492 result = Dart_RunLoop(); | 2490 result = Dart_RunLoop(); |
| 2493 EXPECT(Dart_IsError(result)); | 2491 EXPECT(Dart_IsError(result)); |
| 2494 EXPECT(Dart_ErrorHasException(result)); | 2492 EXPECT(Dart_ErrorHasException(result)); |
| 2495 EXPECT_SUBSTRING("Exception: nulltruefalse123456æøå3.14[]100123456789\n", | 2493 EXPECT_SUBSTRING("Exception: nulltruefalse123456æøå3.14[]100123456789\n", |
| 2496 Dart_GetError(result)); | 2494 Dart_GetError(result)); |
| 2497 | 2495 |
| 2498 Dart_ExitScope(); | 2496 Dart_ExitScope(); |
| 2499 } | 2497 } |
| 2500 | 2498 |
| 2501 } // namespace dart | 2499 } // namespace dart |
| OLD | NEW |