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 #ifndef RUNTIME_VM_GLOBALS_H_ | 5 #ifndef RUNTIME_VM_GLOBALS_H_ |
6 #define RUNTIME_VM_GLOBALS_H_ | 6 #define RUNTIME_VM_GLOBALS_H_ |
7 | 7 |
8 // This file contains global definitions for the VM library only. Anything that | 8 // This file contains global definitions for the VM library only. Anything that |
9 // is more globally useful should be added to 'vm/globals.h'. | 9 // is more globally useful should be added to 'vm/globals.h'. |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 | 37 |
38 // The expression ARRAY_SIZE(array) is a compile-time constant of type | 38 // The expression ARRAY_SIZE(array) is a compile-time constant of type |
39 // size_t which represents the number of elements of the given | 39 // size_t which represents the number of elements of the given |
40 // array. You should only use ARRAY_SIZE on statically allocated | 40 // array. You should only use ARRAY_SIZE on statically allocated |
41 // arrays. | 41 // arrays. |
42 #define ARRAY_SIZE(array) \ | 42 #define ARRAY_SIZE(array) \ |
43 ((sizeof(array) / sizeof(*(array))) / \ | 43 ((sizeof(array) / sizeof(*(array))) / \ |
44 static_cast<intptr_t>(!(sizeof(array) % sizeof(*(array))))) // NOLINT | 44 static_cast<intptr_t>(!(sizeof(array) % sizeof(*(array))))) // NOLINT |
45 | 45 |
46 | 46 |
47 #if defined(ARCH_IS_64_BIT) | |
48 #define HASH_IN_OBJECT_HEADER 1 | |
49 #endif | |
50 | |
51 // The expression OFFSET_OF(type, field) computes the byte-offset of | 47 // The expression OFFSET_OF(type, field) computes the byte-offset of |
52 // the specified field relative to the containing type. | 48 // the specified field relative to the containing type. |
53 // | 49 // |
54 // The expression OFFSET_OF_RETURNED_VALUE(type, accessor) computes the | 50 // The expression OFFSET_OF_RETURNED_VALUE(type, accessor) computes the |
55 // byte-offset of the return value of the accessor to the containing type. | 51 // byte-offset of the return value of the accessor to the containing type. |
56 // | 52 // |
57 // None of these use 0 or NULL, which causes a problem with the compiler | 53 // None of these use 0 or NULL, which causes a problem with the compiler |
58 // warnings we have enabled (which is also why 'offsetof' doesn't seem to work). | 54 // warnings we have enabled (which is also why 'offsetof' doesn't seem to work). |
59 // The workaround is to use the non-zero value kOffsetOfPtr. | 55 // The workaround is to use the non-zero value kOffsetOfPtr. |
60 const intptr_t kOffsetOfPtr = 32; | 56 const intptr_t kOffsetOfPtr = 32; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 | 118 |
123 // Assume GCC-compatible builtins. | 119 // Assume GCC-compatible builtins. |
124 #define COPY_FP_REGISTER(fp) \ | 120 #define COPY_FP_REGISTER(fp) \ |
125 fp = reinterpret_cast<uintptr_t>(__builtin_frame_address(0)); | 121 fp = reinterpret_cast<uintptr_t>(__builtin_frame_address(0)); |
126 | 122 |
127 #endif // !defined(HOST_OS_WINDOWS)) | 123 #endif // !defined(HOST_OS_WINDOWS)) |
128 | 124 |
129 } // namespace dart | 125 } // namespace dart |
130 | 126 |
131 #endif // RUNTIME_VM_GLOBALS_H_ | 127 #endif // RUNTIME_VM_GLOBALS_H_ |
OLD | NEW |