Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: runtime/vm/globals.h

Issue 2895183002: More compact string representation on 64 bit. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/dart.cc ('k') | runtime/vm/intermediate_language_arm64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
47 // The expression OFFSET_OF(type, field) computes the byte-offset of 51 // The expression OFFSET_OF(type, field) computes the byte-offset of
48 // the specified field relative to the containing type. 52 // the specified field relative to the containing type.
49 // 53 //
50 // The expression OFFSET_OF_RETURNED_VALUE(type, accessor) computes the 54 // The expression OFFSET_OF_RETURNED_VALUE(type, accessor) computes the
51 // byte-offset of the return value of the accessor to the containing type. 55 // byte-offset of the return value of the accessor to the containing type.
52 // 56 //
53 // None of these use 0 or NULL, which causes a problem with the compiler 57 // None of these use 0 or NULL, which causes a problem with the compiler
54 // warnings we have enabled (which is also why 'offsetof' doesn't seem to work). 58 // warnings we have enabled (which is also why 'offsetof' doesn't seem to work).
55 // The workaround is to use the non-zero value kOffsetOfPtr. 59 // The workaround is to use the non-zero value kOffsetOfPtr.
56 const intptr_t kOffsetOfPtr = 32; 60 const intptr_t kOffsetOfPtr = 32;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 122
119 // Assume GCC-compatible builtins. 123 // Assume GCC-compatible builtins.
120 #define COPY_FP_REGISTER(fp) \ 124 #define COPY_FP_REGISTER(fp) \
121 fp = reinterpret_cast<uintptr_t>(__builtin_frame_address(0)); 125 fp = reinterpret_cast<uintptr_t>(__builtin_frame_address(0));
122 126
123 #endif // !defined(HOST_OS_WINDOWS)) 127 #endif // !defined(HOST_OS_WINDOWS))
124 128
125 } // namespace dart 129 } // namespace dart
126 130
127 #endif // RUNTIME_VM_GLOBALS_H_ 131 #endif // RUNTIME_VM_GLOBALS_H_
OLDNEW
« no previous file with comments | « runtime/vm/dart.cc ('k') | runtime/vm/intermediate_language_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698