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

Unified Diff: runtime/vm/constants_arm64.h

Issue 1417433002: Don't touch x18 on ARM64 - it is globally reserved on iOS. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/constants_arm.h ('k') | runtime/vm/constants_ia32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/constants_arm64.h
diff --git a/runtime/vm/constants_arm64.h b/runtime/vm/constants_arm64.h
index ab76fd16b9c433fb055da7f951df57882f71f34b..b14ce5533515bfc00bd3419083aa1cc39d1d1215 100644
--- a/runtime/vm/constants_arm64.h
+++ b/runtime/vm/constants_arm64.h
@@ -10,7 +10,6 @@
namespace dart {
enum Register {
- kFirstFreeCpuRegister = 0,
R0 = 0,
R1 = 1,
R2 = 2,
@@ -29,16 +28,15 @@ enum Register {
R15 = 15,
R16 = 16, // IP0 aka TMP
R17 = 17, // IP1 aka TMP2
- R18 = 18, // SP in Dart code.
- R19 = 19,
- R20 = 20,
+ R18 = 18, // "platform register" on iOS.
+ R19 = 19, // SP in Dart code.
+ R20 = 20, // THR
R21 = 21,
R22 = 22,
R23 = 23,
R24 = 24,
R25 = 25,
R26 = 26,
- kLastFreeCpuRegister = 26,
R27 = 27, // PP
R28 = 28, // CTX
R29 = 29, // FP
@@ -55,11 +53,12 @@ enum Register {
// Aliases.
IP0 = R16,
IP1 = R17,
- SP = R18,
+ SP = R19,
FP = R29,
LR = R30,
};
+
enum VRegister {
V0 = 0,
V1 = 1,
@@ -113,12 +112,13 @@ const Register CTX = R28; // Location of current context at method entry.
const Register PP = R27; // Caches object pool pointer in generated code.
const Register CODE_REG = R24;
const Register FPREG = FP; // Frame pointer register.
-const Register SPREG = R18; // Stack pointer register.
+const Register SPREG = R19; // Stack pointer register.
const Register LRREG = LR; // Link register.
const Register ICREG = R5; // IC data register.
const Register ARGS_DESC_REG = R4; // Arguments descriptor register.
const Register THR = R20; // Caches current thread in generated code.
+
// Exception object is passed in this register to the catch handlers when an
// exception is thrown.
const Register kExceptionObjectReg = R0;
@@ -143,25 +143,31 @@ const RegList kAbiArgumentCpuRegs =
(1 << R0) | (1 << R1) | (1 << R2) | (1 << R3) |
(1 << R4) | (1 << R5) | (1 << R6) | (1 << R7);
const RegList kAbiPreservedCpuRegs =
- (1 << R19) | (1 << R20) | (1 << R21) | (1 << R22) |
- (1 << R23) | (1 << R24) | (1 << R25) | (1 << R26) |
- (1 << R27) | (1 << R28);
-const Register kAbiFirstPreservedCpuReg = R19;
+ (1 << R20) | (1 << R21) | (1 << R22) | (1 << R23) |
+ (1 << R24) | (1 << R25) | (1 << R26) | (1 << R27) |
+ (1 << R28);
+const Register kAbiFirstPreservedCpuReg = R20;
const Register kAbiLastPreservedCpuReg = R28;
-const int kAbiPreservedCpuRegCount = 10;
+const int kAbiPreservedCpuRegCount = 9;
const VRegister kAbiFirstPreservedFpuReg = V8;
const VRegister kAbiLastPreservedFpuReg = V15;
const int kAbiPreservedFpuRegCount = 8;
+const intptr_t kReservedCpuRegisters =
+ (1 << SPREG) | // Dart SP
+ (1 << FPREG) |
+ (1 << TMP) |
+ (1 << TMP2) |
+ (1 << PP) |
+ (1 << THR) |
+ (1 << LR) |
+ (1 << R31) | // C++ SP
+ (1 << CTX) |
+ (1 << R18); // iOS platform register.
+ // TODO(rmacnak): Only reserve on Mac & iOS.
// CPU registers available to Dart allocator.
const RegList kDartAvailableCpuRegs =
- (1 << R0) | (1 << R1) | (1 << R2) | (1 << R3) |
- (1 << R4) | (1 << R5) | (1 << R6) | (1 << R7) |
- (1 << R8) | (1 << R9) | (1 << R10) | (1 << R11) |
- (1 << R12) | (1 << R13) | (1 << R14) | (1 << R15) |
- (1 << R19) | (1 << R20) | (1 << R21) | (1 << R22) |
- (1 << R23) | (1 << R24) | (1 << R25) | (1 << R26);
-
+ kAllCpuRegistersList & ~kReservedCpuRegisters;
// Registers available to Dart that are not preserved by runtime calls.
const RegList kDartVolatileCpuRegs =
kDartAvailableCpuRegs & ~kAbiPreservedCpuRegs;
« no previous file with comments | « runtime/vm/constants_arm.h ('k') | runtime/vm/constants_ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698