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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 | 82 |
83 static void CheckOffsets() { | 83 static void CheckOffsets() { |
84 #define CHECK_OFFSET(expr, offset) \ | 84 #define CHECK_OFFSET(expr, offset) \ |
85 if ((expr) != (offset)) { \ | 85 if ((expr) != (offset)) { \ |
86 FATAL2("%s == %" Pd, #expr, (expr)); \ | 86 FATAL2("%s == %" Pd, #expr, (expr)); \ |
87 } | 87 } |
88 | 88 |
89 #if defined(TARGET_ARCH_ARM) | 89 #if defined(TARGET_ARCH_ARM) |
90 // These offsets are embedded in precompiled instructions. We need simarm | 90 // These offsets are embedded in precompiled instructions. We need simarm |
91 // (compiler) and arm (runtime) to agree. | 91 // (compiler) and arm (runtime) to agree. |
92 CHECK_OFFSET(Heap::TopOffset(Heap::kNew), 8); | |
93 CHECK_OFFSET(Thread::stack_limit_offset(), 4); | 92 CHECK_OFFSET(Thread::stack_limit_offset(), 4); |
94 CHECK_OFFSET(Thread::object_null_offset(), 40); | 93 CHECK_OFFSET(Thread::object_null_offset(), 48); |
95 CHECK_OFFSET(SingleTargetCache::upper_limit_offset(), 14); | 94 CHECK_OFFSET(SingleTargetCache::upper_limit_offset(), 14); |
96 CHECK_OFFSET(Isolate::object_store_offset(), 28); | 95 CHECK_OFFSET(Isolate::object_store_offset(), 28); |
97 NOT_IN_PRODUCT(CHECK_OFFSET(sizeof(ClassHeapStats), 120)); | 96 NOT_IN_PRODUCT(CHECK_OFFSET(sizeof(ClassHeapStats), 120)); |
98 #endif | 97 #endif |
99 #if defined(TARGET_ARCH_ARM64) | 98 #if defined(TARGET_ARCH_ARM64) |
100 // These offsets are embedded in precompiled instructions. We need simarm64 | 99 // These offsets are embedded in precompiled instructions. We need simarm64 |
101 // (compiler) and arm64 (runtime) to agree. | 100 // (compiler) and arm64 (runtime) to agree. |
102 CHECK_OFFSET(Heap::TopOffset(Heap::kNew), 8); | |
103 CHECK_OFFSET(Thread::stack_limit_offset(), 8); | 101 CHECK_OFFSET(Thread::stack_limit_offset(), 8); |
104 CHECK_OFFSET(Thread::object_null_offset(), 80); | 102 CHECK_OFFSET(Thread::object_null_offset(), 96); |
105 CHECK_OFFSET(SingleTargetCache::upper_limit_offset(), 26); | 103 CHECK_OFFSET(SingleTargetCache::upper_limit_offset(), 26); |
106 CHECK_OFFSET(Isolate::object_store_offset(), 56); | 104 CHECK_OFFSET(Isolate::object_store_offset(), 56); |
107 NOT_IN_PRODUCT(CHECK_OFFSET(sizeof(ClassHeapStats), 208)); | 105 NOT_IN_PRODUCT(CHECK_OFFSET(sizeof(ClassHeapStats), 208)); |
108 #endif | 106 #endif |
109 #undef CHECK_OFFSET | 107 #undef CHECK_OFFSET |
110 } | 108 } |
111 | 109 |
112 char* Dart::InitOnce(const uint8_t* vm_isolate_snapshot, | 110 char* Dart::InitOnce(const uint8_t* vm_isolate_snapshot, |
113 const uint8_t* instructions_snapshot, | 111 const uint8_t* instructions_snapshot, |
114 Dart_IsolateCreateCallback create, | 112 Dart_IsolateCreateCallback create, |
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 ASSERT(predefined_handles_ != NULL); | 747 ASSERT(predefined_handles_ != NULL); |
750 return predefined_handles_->handles_.IsValidScopedHandle(address); | 748 return predefined_handles_->handles_.IsValidScopedHandle(address); |
751 } | 749 } |
752 | 750 |
753 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { | 751 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { |
754 ASSERT(predefined_handles_ != NULL); | 752 ASSERT(predefined_handles_ != NULL); |
755 return predefined_handles_->api_handles_.IsValidHandle(handle); | 753 return predefined_handles_->api_handles_.IsValidHandle(handle); |
756 } | 754 } |
757 | 755 |
758 } // namespace dart | 756 } // namespace dart |
OLD | NEW |