Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_CONSTANTS_ARM64_H_ | 5 #ifndef VM_CONSTANTS_ARM64_H_ |
| 6 #define VM_CONSTANTS_ARM64_H_ | 6 #define VM_CONSTANTS_ARM64_H_ |
| 7 | 7 |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 | 9 |
| 10 namespace dart { | 10 namespace dart { |
| 11 | 11 |
| 12 enum Register { | 12 enum Register { |
| 13 kFirstFreeCpuRegister = 0, | 13 kFirstFreeCpuRegister = 0, |
| 14 R0 = 0, | 14 R0 = 0, |
| 15 R1 = 1, | 15 R1 = 1, |
| 16 R2 = 2, | 16 R2 = 2, |
| 17 R3 = 3, | 17 R3 = 3, |
| 18 R4 = 4, | 18 R4 = 4, |
| 19 R5 = 5, | 19 R5 = 5, |
| 20 R6 = 6, | 20 R6 = 6, |
| 21 R7 = 7, | 21 R7 = 7, |
| 22 R8 = 8, | 22 R8 = 8, |
| 23 R9 = 9, | 23 R9 = 9, |
| 24 R10 = 10, | 24 R10 = 10, |
| 25 R11 = 11, | 25 R11 = 11, |
| 26 R12 = 12, | 26 R12 = 12, |
| 27 R13 = 13, | 27 R13 = 13, |
| 28 R14 = 14, | 28 R14 = 14, |
| 29 R15 = 15, | 29 R15 = 15, |
| 30 kLastFreeCpuRegister = 15, | |
|
zra
2014/08/28 17:40:07
When writing the port, I checked that the allocato
Florian Schneider
2014/08/29 10:30:51
This fix is temporary for now. Ideally, we want to
| |
| 30 R16 = 16, // IP0 aka TMP | 31 R16 = 16, // IP0 aka TMP |
| 31 R17 = 17, // IP1 aka TMP2 | 32 R17 = 17, // IP1 aka TMP2 |
| 32 R18 = 18, // SP in Dart code. | 33 R18 = 18, // SP in Dart code. |
| 33 R19 = 19, | 34 R19 = 19, |
| 34 R20 = 20, | 35 R20 = 20, |
| 35 R21 = 21, | 36 R21 = 21, |
| 36 R22 = 22, | 37 R22 = 22, |
| 37 R23 = 23, | 38 R23 = 23, |
| 38 R24 = 24, | 39 R24 = 24, |
| 39 R25 = 25, | 40 R25 = 25, |
| 40 R26 = 26, | 41 R26 = 26, |
| 41 kLastFreeCpuRegister = 26, | |
| 42 R27 = 27, // PP | 42 R27 = 27, // PP |
| 43 R28 = 28, // CTX | 43 R28 = 28, // CTX |
| 44 R29 = 29, // FP | 44 R29 = 29, // FP |
| 45 R30 = 30, // LR | 45 R30 = 30, // LR |
| 46 R31 = 31, // ZR, CSP | 46 R31 = 31, // ZR, CSP |
| 47 kNumberOfCpuRegisters = 32, | 47 kNumberOfCpuRegisters = 32, |
| 48 kNoRegister = -1, | 48 kNoRegister = -1, |
| 49 | 49 |
| 50 // These registers both use the encoding R31, but to avoid mistakes we give | 50 // These registers both use the encoding R31, but to avoid mistakes we give |
| 51 // them different values, and then translate before encoding. | 51 // them different values, and then translate before encoding. |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 108 | 108 |
| 109 // Register aliases. | 109 // Register aliases. |
| 110 const Register TMP = R16; // Used as scratch register by assembler. | 110 const Register TMP = R16; // Used as scratch register by assembler. |
| 111 const Register TMP2 = R17; | 111 const Register TMP2 = R17; |
| 112 const Register CTX = R28; // Caches current context in generated code. | 112 const Register CTX = R28; // Caches current context in generated code. |
| 113 const Register PP = R27; // Caches object pool pointer in generated code. | 113 const Register PP = R27; // Caches object pool pointer in generated code. |
| 114 const Register kNoPP = kNoRegister; | 114 const Register kNoPP = kNoRegister; |
| 115 const Register FPREG = FP; // Frame pointer register. | 115 const Register FPREG = FP; // Frame pointer register. |
| 116 const Register SPREG = R18; // Stack pointer register. | 116 const Register SPREG = R18; // Stack pointer register. |
| 117 const Register ICREG = R5; // IC data register. | 117 const Register ICREG = R5; // IC data register. |
| 118 const Register ARGS_DESC_REG = R4; // Arguments descriptor register. | |
| 118 | 119 |
| 119 // Exception object is passed in this register to the catch handlers when an | 120 // Exception object is passed in this register to the catch handlers when an |
| 120 // exception is thrown. | 121 // exception is thrown. |
| 121 const Register kExceptionObjectReg = R0; | 122 const Register kExceptionObjectReg = R0; |
| 122 | 123 |
| 123 // Stack trace object is passed in this register to the catch handlers when | 124 // Stack trace object is passed in this register to the catch handlers when |
| 124 // an exception is thrown. | 125 // an exception is thrown. |
| 125 const Register kStackTraceObjectReg = R1; | 126 const Register kStackTraceObjectReg = R1; |
| 126 | 127 |
| 127 // Masks, sizes, etc. | 128 // Masks, sizes, etc. |
| (...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1016 static Instr* At(uword pc) { return reinterpret_cast<Instr*>(pc); } | 1017 static Instr* At(uword pc) { return reinterpret_cast<Instr*>(pc); } |
| 1017 | 1018 |
| 1018 private: | 1019 private: |
| 1019 DISALLOW_ALLOCATION(); | 1020 DISALLOW_ALLOCATION(); |
| 1020 DISALLOW_IMPLICIT_CONSTRUCTORS(Instr); | 1021 DISALLOW_IMPLICIT_CONSTRUCTORS(Instr); |
| 1021 }; | 1022 }; |
| 1022 | 1023 |
| 1023 } // namespace dart | 1024 } // namespace dart |
| 1024 | 1025 |
| 1025 #endif // VM_CONSTANTS_ARM64_H_ | 1026 #endif // VM_CONSTANTS_ARM64_H_ |
| OLD | NEW |