| 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/bootstrap.h" | 8 #include "vm/bootstrap.h" |
| 9 #include "vm/class_finalizer.h" | 9 #include "vm/class_finalizer.h" |
| 10 #include "vm/dart.h" | 10 #include "vm/dart.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "vm/verified_memory.h" | 21 #include "vm/verified_memory.h" |
| 22 #include "vm/version.h" | 22 #include "vm/version.h" |
| 23 | 23 |
| 24 // We currently only expect the Dart mutator to read snapshots. | 24 // We currently only expect the Dart mutator to read snapshots. |
| 25 #define ASSERT_NO_SAFEPOINT_SCOPE() \ | 25 #define ASSERT_NO_SAFEPOINT_SCOPE() \ |
| 26 isolate()->AssertCurrentThreadIsMutator(); \ | 26 isolate()->AssertCurrentThreadIsMutator(); \ |
| 27 ASSERT(thread()->no_safepoint_scope_depth() != 0) | 27 ASSERT(thread()->no_safepoint_scope_depth() != 0) |
| 28 | 28 |
| 29 namespace dart { | 29 namespace dart { |
| 30 | 30 |
| 31 DECLARE_FLAG(bool, use_field_guards); |
| 32 |
| 33 |
| 31 static const int kNumVmIsolateSnapshotReferences = 32 * KB; | 34 static const int kNumVmIsolateSnapshotReferences = 32 * KB; |
| 32 static const int kNumInitialReferencesInFullSnapshot = 160 * KB; | 35 static const int kNumInitialReferencesInFullSnapshot = 160 * KB; |
| 33 static const int kNumInitialReferences = 64; | 36 static const int kNumInitialReferences = 64; |
| 34 | 37 |
| 35 | 38 |
| 36 static bool IsSingletonClassId(intptr_t class_id) { | 39 static bool IsSingletonClassId(intptr_t class_id) { |
| 37 // Check if this is a singleton object class which is shared by all isolates. | 40 // Check if this is a singleton object class which is shared by all isolates. |
| 38 return ((class_id >= kClassCid && class_id <= kUnwindErrorCid) || | 41 return ((class_id >= kClassCid && class_id <= kUnwindErrorCid) || |
| 39 (class_id >= kNullCid && class_id <= kVoidCid)); | 42 (class_id >= kNullCid && class_id <= kVoidCid)); |
| 40 } | 43 } |
| (...skipping 2634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2675 if (setjmp(*jump.Set()) == 0) { | 2678 if (setjmp(*jump.Set()) == 0) { |
| 2676 NoSafepointScope no_safepoint; | 2679 NoSafepointScope no_safepoint; |
| 2677 WriteObject(obj.raw()); | 2680 WriteObject(obj.raw()); |
| 2678 } else { | 2681 } else { |
| 2679 ThrowException(exception_type(), exception_msg()); | 2682 ThrowException(exception_type(), exception_msg()); |
| 2680 } | 2683 } |
| 2681 } | 2684 } |
| 2682 | 2685 |
| 2683 | 2686 |
| 2684 } // namespace dart | 2687 } // namespace dart |
| OLD | NEW |