| 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 VM_GLOBALS_H_ | 5 #ifndef VM_GLOBALS_H_ |
| 6 #define VM_GLOBALS_H_ | 6 #define 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 83 |
| 84 | 84 |
| 85 // Zap value used to indicate uninitialized handle area (debug purposes). | 85 // Zap value used to indicate uninitialized handle area (debug purposes). |
| 86 #if defined(ARCH_IS_32_BIT) | 86 #if defined(ARCH_IS_32_BIT) |
| 87 static const uword kZapUninitializedWord = 0xabababab; | 87 static const uword kZapUninitializedWord = 0xabababab; |
| 88 #else | 88 #else |
| 89 static const uword kZapUninitializedWord = 0xabababababababab; | 89 static const uword kZapUninitializedWord = 0xabababababababab; |
| 90 #endif | 90 #endif |
| 91 | 91 |
| 92 | 92 |
| 93 // Macros to get the contents of the fp register. |
| 94 #if defined(TARGET_OS_WINDOWS) |
| 95 |
| 96 #if defined(HOST_ARCH_IA32) |
| 97 #define COPY_FP_REGISTER(fp) __asm { movl [fp], ebp }; // NOLINT |
| 98 #elif defined(HOST_ARCH_X64) |
| 99 #define COPY_FP_REGISTER(fp) __asm { movq [fp], rbp }; // NOLINT |
| 100 #else |
| 101 #error Unknown host architecture. |
| 102 #endif |
| 103 |
| 104 #else // !defined(TARGET_OS_WINDOWS)) |
| 105 |
| 106 // Assume GCC-like inline syntax is valid. |
| 107 #if defined(HOST_ARCH_IA32) |
| 108 #define COPY_FP_REGISTER(fp) asm volatile ("movl %%ebp, %0" : "=r" (fp) ); |
| 109 #elif defined(HOST_ARCH_X64) |
| 110 #define COPY_FP_REGISTER(fp) asm volatile ("movq %%rbp, %0" : "=r" (fp) ); |
| 111 #elif defined(HOST_ARCH_ARM) |
| 112 #define COPY_FP_REGISTER(fp) asm volatile ("mov %0, %%r11" : "=r" (fp) ); |
| 113 #elif defined(HOST_ARCH_ARM64) |
| 114 #define COPY_FP_REGISTER(fp) asm volatile ("mov %0, %%x29" : "=r" (fp) ); |
| 115 #elif defined(HOST_ARCH_MIPS) |
| 116 #define COPY_FP_REGISTER(fp) asm volatile ("move %0, %%r30" : "=r" (fp) ); |
| 117 #else |
| 118 #error Unknown host architecture. |
| 119 #endif |
| 120 |
| 121 |
| 122 #endif // !defined(TARGET_OS_WINDOWS)) |
| 123 |
| 93 } // namespace dart | 124 } // namespace dart |
| 94 | 125 |
| 95 #endif // VM_GLOBALS_H_ | 126 #endif // VM_GLOBALS_H_ |
| OLD | NEW |