| Index: src/x64/assembler-x64.h
|
| ===================================================================
|
| --- src/x64/assembler-x64.h (revision 6941)
|
| +++ src/x64/assembler-x64.h (working copy)
|
| @@ -98,6 +98,16 @@
|
| static const int kNumRegisters = 16;
|
| static const int kNumAllocatableRegisters = 10;
|
|
|
| + static int ToAllocationIndex(Register reg) {
|
| + return allocationIndexByRegisterCode[reg.code()];
|
| + }
|
| +
|
| + static Register FromAllocationIndex(int index) {
|
| + ASSERT(index >= 0 && index < kNumAllocatableRegisters);
|
| + Register result = { registerCodeByAllocationIndex[index] };
|
| + return result;
|
| + }
|
| +
|
| static const char* AllocationIndexToString(int index) {
|
| ASSERT(index >= 0 && index < kNumAllocatableRegisters);
|
| const char* const names[] = {
|
| @@ -143,6 +153,9 @@
|
| // Unfortunately we can't make this private in a struct when initializing
|
| // by assignment.
|
| int code_;
|
| + private:
|
| + static const int registerCodeByAllocationIndex[kNumAllocatableRegisters];
|
| + static const int allocationIndexByRegisterCode[kNumRegisters];
|
| };
|
|
|
| const Register rax = { 0 };
|
| @@ -173,6 +186,12 @@
|
| return reg.code() - 1;
|
| }
|
|
|
| + static XMMRegister FromAllocationIndex(int index) {
|
| + ASSERT(0 <= index && index < kNumAllocatableRegisters);
|
| + XMMRegister result = { index + 1 };
|
| + return result;
|
| + }
|
| +
|
| static const char* AllocationIndexToString(int index) {
|
| ASSERT(index >= 0 && index < kNumAllocatableRegisters);
|
| const char* const names[] = {
|
| @@ -554,6 +573,8 @@
|
| // The debug break slot must be able to contain a call instruction.
|
| static const int kDebugBreakSlotLength = kCallInstructionLength;
|
|
|
| + // One byte opcode for test eax,0xXXXXXXXX.
|
| + static const byte kTestEaxByte = 0xA9;
|
|
|
| // ---------------------------------------------------------------------------
|
| // Code generation
|
|
|