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/globals.h" | 5 #include "platform/globals.h" |
6 | 6 |
7 #include "include/dart_tools_api.h" | 7 #include "include/dart_tools_api.h" |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/class_finalizer.h" | 9 #include "vm/class_finalizer.h" |
10 #include "vm/dart_api_impl.h" | 10 #include "vm/dart_api_impl.h" |
11 #include "vm/dart_api_message.h" | 11 #include "vm/dart_api_message.h" |
12 #include "vm/dart_api_state.h" | 12 #include "vm/dart_api_state.h" |
13 #include "vm/flags.h" | 13 #include "vm/flags.h" |
14 #include "vm/snapshot.h" | 14 #include "vm/snapshot.h" |
15 #include "vm/symbols.h" | 15 #include "vm/symbols.h" |
16 #include "vm/unicode.h" | 16 #include "vm/unicode.h" |
17 #include "vm/unit_test.h" | 17 #include "vm/unit_test.h" |
18 | 18 |
19 namespace dart { | 19 namespace dart { |
20 | 20 |
21 DECLARE_FLAG(bool, concurrent_sweep); | |
22 | |
23 // Check if serialized and deserialized objects are equal. | 21 // Check if serialized and deserialized objects are equal. |
24 static bool Equals(const Object& expected, const Object& actual) { | 22 static bool Equals(const Object& expected, const Object& actual) { |
25 if (expected.IsNull()) { | 23 if (expected.IsNull()) { |
26 return actual.IsNull(); | 24 return actual.IsNull(); |
27 } | 25 } |
28 if (expected.IsSmi()) { | 26 if (expected.IsSmi()) { |
29 if (actual.IsSmi()) { | 27 if (actual.IsSmi()) { |
30 return expected.raw() == actual.raw(); | 28 return expected.raw() == actual.raw(); |
31 } | 29 } |
32 return false; | 30 return false; |
(...skipping 2980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3013 StackZone zone(Thread::Current()); | 3011 StackZone zone(Thread::Current()); |
3014 uint8_t* buffer; | 3012 uint8_t* buffer; |
3015 MessageWriter writer(&buffer, &zone_allocator, true); | 3013 MessageWriter writer(&buffer, &zone_allocator, true); |
3016 writer.WriteInlinedObjectHeader(kOmittedObjectId); | 3014 writer.WriteInlinedObjectHeader(kOmittedObjectId); |
3017 // For performance, we'd like single-byte headers when ids are omitted. | 3015 // For performance, we'd like single-byte headers when ids are omitted. |
3018 // If this starts failing, consider renumbering the snapshot ids. | 3016 // If this starts failing, consider renumbering the snapshot ids. |
3019 EXPECT_EQ(1, writer.BytesWritten()); | 3017 EXPECT_EQ(1, writer.BytesWritten()); |
3020 } | 3018 } |
3021 | 3019 |
3022 } // namespace dart | 3020 } // namespace dart |
OLD | NEW |