OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/dart.h" | 5 #include "vm/dart.h" |
6 | 6 |
7 #include "vm/become.h" | 7 #include "vm/become.h" |
8 #include "vm/clustered_snapshot.h" | 8 #include "vm/clustered_snapshot.h" |
9 #include "vm/code_observers.h" | 9 #include "vm/code_observers.h" |
10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 #define CHECK_OFFSET(expr, offset) \ | 85 #define CHECK_OFFSET(expr, offset) \ |
86 if ((expr) != (offset)) { \ | 86 if ((expr) != (offset)) { \ |
87 FATAL2("%s == %" Pd, #expr, (expr)); \ | 87 FATAL2("%s == %" Pd, #expr, (expr)); \ |
88 } | 88 } |
89 | 89 |
90 #if defined(TARGET_ARCH_ARM) | 90 #if defined(TARGET_ARCH_ARM) |
91 // These offsets are embedded in precompiled instructions. We need simarm | 91 // These offsets are embedded in precompiled instructions. We need simarm |
92 // (compiler) and arm (runtime) to agree. | 92 // (compiler) and arm (runtime) to agree. |
93 CHECK_OFFSET(Heap::TopOffset(Heap::kNew), 8); | 93 CHECK_OFFSET(Heap::TopOffset(Heap::kNew), 8); |
94 CHECK_OFFSET(Thread::stack_limit_offset(), 4); | 94 CHECK_OFFSET(Thread::stack_limit_offset(), 4); |
95 CHECK_OFFSET(Thread::object_null_offset(), 36); | 95 CHECK_OFFSET(Thread::object_null_offset(), 40); |
96 CHECK_OFFSET(SingleTargetCache::upper_limit_offset(), 14); | 96 CHECK_OFFSET(SingleTargetCache::upper_limit_offset(), 14); |
97 CHECK_OFFSET(Isolate::object_store_offset(), 28); | 97 CHECK_OFFSET(Isolate::object_store_offset(), 28); |
98 NOT_IN_PRODUCT(CHECK_OFFSET(sizeof(ClassHeapStats), 120)); | 98 NOT_IN_PRODUCT(CHECK_OFFSET(sizeof(ClassHeapStats), 120)); |
99 #endif | 99 #endif |
100 #if defined(TARGET_ARCH_MIPS) | 100 #if defined(TARGET_ARCH_MIPS) |
101 // These offsets are embedded in precompiled instructions. We need simmips | 101 // These offsets are embedded in precompiled instructions. We need simmips |
102 // (compiler) and mips (runtime) to agree. | 102 // (compiler) and mips (runtime) to agree. |
103 CHECK_OFFSET(Heap::TopOffset(Heap::kNew), 8); | 103 CHECK_OFFSET(Heap::TopOffset(Heap::kNew), 8); |
104 CHECK_OFFSET(Thread::stack_limit_offset(), 4); | 104 CHECK_OFFSET(Thread::stack_limit_offset(), 4); |
105 CHECK_OFFSET(Thread::object_null_offset(), 36); | 105 CHECK_OFFSET(Thread::object_null_offset(), 40); |
106 CHECK_OFFSET(SingleTargetCache::upper_limit_offset(), 14); | 106 CHECK_OFFSET(SingleTargetCache::upper_limit_offset(), 14); |
107 CHECK_OFFSET(Isolate::object_store_offset(), 28); | 107 CHECK_OFFSET(Isolate::object_store_offset(), 28); |
108 NOT_IN_PRODUCT(CHECK_OFFSET(sizeof(ClassHeapStats), 120)); | 108 NOT_IN_PRODUCT(CHECK_OFFSET(sizeof(ClassHeapStats), 120)); |
109 #endif | 109 #endif |
110 #if defined(TARGET_ARCH_ARM64) | 110 #if defined(TARGET_ARCH_ARM64) |
111 // These offsets are embedded in precompiled instructions. We need simarm64 | 111 // These offsets are embedded in precompiled instructions. We need simarm64 |
112 // (compiler) and arm64 (runtime) to agree. | 112 // (compiler) and arm64 (runtime) to agree. |
113 CHECK_OFFSET(Heap::TopOffset(Heap::kNew), 8); | 113 CHECK_OFFSET(Heap::TopOffset(Heap::kNew), 8); |
114 CHECK_OFFSET(Thread::stack_limit_offset(), 8); | 114 CHECK_OFFSET(Thread::stack_limit_offset(), 8); |
115 CHECK_OFFSET(Thread::object_null_offset(), 72); | 115 CHECK_OFFSET(Thread::object_null_offset(), 80); |
116 CHECK_OFFSET(SingleTargetCache::upper_limit_offset(), 28); | 116 CHECK_OFFSET(SingleTargetCache::upper_limit_offset(), 28); |
117 CHECK_OFFSET(Isolate::object_store_offset(), 56); | 117 CHECK_OFFSET(Isolate::object_store_offset(), 56); |
118 NOT_IN_PRODUCT(CHECK_OFFSET(sizeof(ClassHeapStats), 208)); | 118 NOT_IN_PRODUCT(CHECK_OFFSET(sizeof(ClassHeapStats), 208)); |
119 #endif | 119 #endif |
120 #undef CHECK_OFFSET | 120 #undef CHECK_OFFSET |
121 } | 121 } |
122 | 122 |
123 | 123 |
124 char* Dart::InitOnce(const uint8_t* vm_isolate_snapshot, | 124 char* Dart::InitOnce(const uint8_t* vm_isolate_snapshot, |
125 const uint8_t* instructions_snapshot, | 125 const uint8_t* instructions_snapshot, |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 return predefined_handles_->handles_.IsValidScopedHandle(address); | 742 return predefined_handles_->handles_.IsValidScopedHandle(address); |
743 } | 743 } |
744 | 744 |
745 | 745 |
746 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { | 746 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { |
747 ASSERT(predefined_handles_ != NULL); | 747 ASSERT(predefined_handles_ != NULL); |
748 return predefined_handles_->api_handles_.IsValidHandle(handle); | 748 return predefined_handles_->api_handles_.IsValidHandle(handle); |
749 } | 749 } |
750 | 750 |
751 } // namespace dart | 751 } // namespace dart |
OLD | NEW |