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