| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 83 |
| 84 static void CheckOffsets() { | 84 static void CheckOffsets() { |
| 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(Thread::stack_limit_offset(), 4); | 94 CHECK_OFFSET(Thread::stack_limit_offset(), 4); |
| 94 CHECK_OFFSET(Thread::object_null_offset(), 48); | 95 CHECK_OFFSET(Thread::object_null_offset(), 40); |
| 95 CHECK_OFFSET(SingleTargetCache::upper_limit_offset(), 14); | 96 CHECK_OFFSET(SingleTargetCache::upper_limit_offset(), 14); |
| 96 CHECK_OFFSET(Isolate::object_store_offset(), 28); | 97 CHECK_OFFSET(Isolate::object_store_offset(), 28); |
| 97 NOT_IN_PRODUCT(CHECK_OFFSET(sizeof(ClassHeapStats), 120)); | 98 NOT_IN_PRODUCT(CHECK_OFFSET(sizeof(ClassHeapStats), 120)); |
| 98 #endif | 99 #endif |
| 99 #if defined(TARGET_ARCH_ARM64) | 100 #if defined(TARGET_ARCH_ARM64) |
| 100 // These offsets are embedded in precompiled instructions. We need simarm64 | 101 // These offsets are embedded in precompiled instructions. We need simarm64 |
| 101 // (compiler) and arm64 (runtime) to agree. | 102 // (compiler) and arm64 (runtime) to agree. |
| 103 CHECK_OFFSET(Heap::TopOffset(Heap::kNew), 8); |
| 102 CHECK_OFFSET(Thread::stack_limit_offset(), 8); | 104 CHECK_OFFSET(Thread::stack_limit_offset(), 8); |
| 103 CHECK_OFFSET(Thread::object_null_offset(), 96); | 105 CHECK_OFFSET(Thread::object_null_offset(), 80); |
| 104 CHECK_OFFSET(SingleTargetCache::upper_limit_offset(), 26); | 106 CHECK_OFFSET(SingleTargetCache::upper_limit_offset(), 26); |
| 105 CHECK_OFFSET(Isolate::object_store_offset(), 56); | 107 CHECK_OFFSET(Isolate::object_store_offset(), 56); |
| 106 NOT_IN_PRODUCT(CHECK_OFFSET(sizeof(ClassHeapStats), 208)); | 108 NOT_IN_PRODUCT(CHECK_OFFSET(sizeof(ClassHeapStats), 208)); |
| 107 #endif | 109 #endif |
| 108 #undef CHECK_OFFSET | 110 #undef CHECK_OFFSET |
| 109 } | 111 } |
| 110 | 112 |
| 111 | 113 |
| 112 char* Dart::InitOnce(const uint8_t* vm_isolate_snapshot, | 114 char* Dart::InitOnce(const uint8_t* vm_isolate_snapshot, |
| 113 const uint8_t* instructions_snapshot, | 115 const uint8_t* instructions_snapshot, |
| (...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 return predefined_handles_->handles_.IsValidScopedHandle(address); | 767 return predefined_handles_->handles_.IsValidScopedHandle(address); |
| 766 } | 768 } |
| 767 | 769 |
| 768 | 770 |
| 769 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { | 771 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { |
| 770 ASSERT(predefined_handles_ != NULL); | 772 ASSERT(predefined_handles_ != NULL); |
| 771 return predefined_handles_->api_handles_.IsValidHandle(handle); | 773 return predefined_handles_->api_handles_.IsValidHandle(handle); |
| 772 } | 774 } |
| 773 | 775 |
| 774 } // namespace dart | 776 } // namespace dart |
| OLD | NEW |