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 "vm/snapshot.h" | 5 #include "vm/snapshot.h" |
6 | 6 |
7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
8 #include "vm/bigint_operations.h" | 8 #include "vm/bigint_operations.h" |
9 #include "vm/bootstrap.h" | 9 #include "vm/bootstrap.h" |
10 #include "vm/class_finalizer.h" | 10 #include "vm/class_finalizer.h" |
11 #include "vm/exceptions.h" | 11 #include "vm/exceptions.h" |
12 #include "vm/heap.h" | 12 #include "vm/heap.h" |
13 #include "vm/longjump.h" | 13 #include "vm/longjump.h" |
14 #include "vm/object.h" | 14 #include "vm/object.h" |
15 #include "vm/object_store.h" | 15 #include "vm/object_store.h" |
16 #include "vm/snapshot_ids.h" | 16 #include "vm/snapshot_ids.h" |
17 #include "vm/symbols.h" | 17 #include "vm/symbols.h" |
18 | 18 |
19 namespace dart { | 19 namespace dart { |
20 | 20 |
21 static const int kNumInitialReferencesInFullSnapshot = 160 * KB; | 21 static const int kNumInitialReferencesInFullSnapshot = 160 * KB; |
22 static const int kNumInitialReferences = 4; | 22 static const int kNumInitialReferences = 64; |
23 | 23 |
24 | 24 |
25 static bool IsSingletonClassId(intptr_t class_id) { | 25 static bool IsSingletonClassId(intptr_t class_id) { |
26 // Check if this is a singleton object class which is shared by all isolates. | 26 // Check if this is a singleton object class which is shared by all isolates. |
27 return ((class_id >= kClassCid && class_id <= kUnwindErrorCid) || | 27 return ((class_id >= kClassCid && class_id <= kUnwindErrorCid) || |
28 (class_id >= kNullCid && class_id <= kVoidCid)); | 28 (class_id >= kNullCid && class_id <= kVoidCid)); |
29 } | 29 } |
30 | 30 |
31 | 31 |
32 static bool IsObjectStoreClassId(intptr_t class_id) { | 32 static bool IsObjectStoreClassId(intptr_t class_id) { |
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
833 result.SetTypeArguments(*TypeArgumentsHandle()); | 833 result.SetTypeArguments(*TypeArgumentsHandle()); |
834 | 834 |
835 for (intptr_t i = 0; i < len; i++) { | 835 for (intptr_t i = 0; i < len; i++) { |
836 *ObjectHandle() = ReadObjectRef(); | 836 *ObjectHandle() = ReadObjectRef(); |
837 result.SetAt(i, *ObjectHandle()); | 837 result.SetAt(i, *ObjectHandle()); |
838 } | 838 } |
839 } | 839 } |
840 | 840 |
841 | 841 |
842 SnapshotWriter::SnapshotWriter(Snapshot::Kind kind, | 842 SnapshotWriter::SnapshotWriter(Snapshot::Kind kind, |
843 uint8_t** buffer, | 843 uint8_t** buffer, |
844 ReAlloc alloc, | 844 ReAlloc alloc, |
845 intptr_t increment_size) | 845 intptr_t initial_size) |
846 : BaseWriter(buffer, alloc, increment_size), | 846 : BaseWriter(buffer, alloc, initial_size), |
847 kind_(kind), | 847 kind_(kind), |
848 object_store_(Isolate::Current()->object_store()), | 848 object_store_(Isolate::Current()->object_store()), |
849 class_table_(Isolate::Current()->class_table()), | 849 class_table_(Isolate::Current()->class_table()), |
850 forward_list_(), | 850 forward_list_(), |
851 exception_type_(Exceptions::kNone), | 851 exception_type_(Exceptions::kNone), |
852 exception_msg_(NULL), | 852 exception_msg_(NULL), |
853 error_(LanguageError::Handle()) { | 853 error_(LanguageError::Handle()) { |
854 } | 854 } |
855 | 855 |
856 | 856 |
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1414 UnmarkAll(); | 1414 UnmarkAll(); |
1415 isolate->set_long_jump_base(base); | 1415 isolate->set_long_jump_base(base); |
1416 } else { | 1416 } else { |
1417 isolate->set_long_jump_base(base); | 1417 isolate->set_long_jump_base(base); |
1418 ThrowException(exception_type(), exception_msg()); | 1418 ThrowException(exception_type(), exception_msg()); |
1419 } | 1419 } |
1420 } | 1420 } |
1421 | 1421 |
1422 | 1422 |
1423 } // namespace dart | 1423 } // namespace dart |
OLD | NEW |