| OLD | NEW |
| 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
| 2 // All Rights Reserved. | 2 // All Rights Reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions | 5 // modification, are permitted provided that the following conditions |
| 6 // are met: | 6 // are met: |
| 7 // | 7 // |
| 8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
| 9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
| 10 // | 10 // |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 // Core register | 157 // Core register |
| 158 struct Register { | 158 struct Register { |
| 159 static const int kNumRegisters = 16; | 159 static const int kNumRegisters = 16; |
| 160 static const int kMaxNumAllocatableRegisters = | 160 static const int kMaxNumAllocatableRegisters = |
| 161 FLAG_enable_ool_constant_pool ? 8 : 9; | 161 FLAG_enable_ool_constant_pool ? 8 : 9; |
| 162 static const int kSizeInBytes = 4; | 162 static const int kSizeInBytes = 4; |
| 163 | 163 |
| 164 inline static int NumAllocatableRegisters(); | 164 inline static int NumAllocatableRegisters(); |
| 165 | 165 |
| 166 static int ToAllocationIndex(Register reg) { | 166 static int ToAllocationIndex(Register reg) { |
| 167 if (FLAG_enable_ool_constant_pool && (reg.code() >= kRegister_r8_Code)) { | |
| 168 return reg.code() - 1; | |
| 169 } | |
| 170 ASSERT(reg.code() < kMaxNumAllocatableRegisters); | 167 ASSERT(reg.code() < kMaxNumAllocatableRegisters); |
| 171 return reg.code(); | 168 return reg.code(); |
| 172 } | 169 } |
| 173 | 170 |
| 174 static Register FromAllocationIndex(int index) { | 171 static Register FromAllocationIndex(int index) { |
| 175 ASSERT(index >= 0 && index < kMaxNumAllocatableRegisters); | 172 ASSERT(index >= 0 && index < kMaxNumAllocatableRegisters); |
| 176 if (FLAG_enable_ool_constant_pool && (index >= 7)) { | |
| 177 return from_code(index + 1); | |
| 178 } | |
| 179 return from_code(index); | 173 return from_code(index); |
| 180 } | 174 } |
| 181 | 175 |
| 182 static const char* AllocationIndexToString(int index) { | 176 static const char* AllocationIndexToString(int index) { |
| 183 ASSERT(index >= 0 && index < kMaxNumAllocatableRegisters); | 177 ASSERT(index >= 0 && index < kMaxNumAllocatableRegisters); |
| 184 const char* const names[] = { | 178 const char* const names[] = { |
| 185 "r0", | 179 "r0", |
| 186 "r1", | 180 "r1", |
| 187 "r2", | 181 "r2", |
| 188 "r3", | 182 "r3", |
| (...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 796 | 790 |
| 797 // Given the address of the beginning of a call, return the address | 791 // Given the address of the beginning of a call, return the address |
| 798 // in the instruction stream that the call will return from. | 792 // in the instruction stream that the call will return from. |
| 799 INLINE(static Address return_address_from_call_start(Address pc)); | 793 INLINE(static Address return_address_from_call_start(Address pc)); |
| 800 | 794 |
| 801 // This sets the branch destination (which is in the constant pool on ARM). | 795 // This sets the branch destination (which is in the constant pool on ARM). |
| 802 // This is for calls and branches within generated code. | 796 // This is for calls and branches within generated code. |
| 803 inline static void deserialization_set_special_target_at( | 797 inline static void deserialization_set_special_target_at( |
| 804 Address constant_pool_entry, Address target); | 798 Address constant_pool_entry, Address target); |
| 805 | 799 |
| 806 // This sets the branch destination (which is in the constant pool on ARM). | |
| 807 // This is for calls and branches to runtime code. | |
| 808 inline static void set_external_target_at(Address constant_pool_entry, | |
| 809 Address target); | |
| 810 | |
| 811 // Here we are patching the address in the constant pool, not the actual call | 800 // Here we are patching the address in the constant pool, not the actual call |
| 812 // instruction. The address in the constant pool is the same size as a | 801 // instruction. The address in the constant pool is the same size as a |
| 813 // pointer. | 802 // pointer. |
| 814 static const int kSpecialTargetSize = kPointerSize; | 803 static const int kSpecialTargetSize = kPointerSize; |
| 815 | 804 |
| 816 // Size of an instruction. | 805 // Size of an instruction. |
| 817 static const int kInstrSize = sizeof(Instr); | 806 static const int kInstrSize = sizeof(Instr); |
| 818 | 807 |
| 819 // Distance between start of patched return sequence and the emitted address | 808 // Distance between start of patched return sequence and the emitted address |
| 820 // to jump to. | 809 // to jump to. |
| (...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1615 public: | 1604 public: |
| 1616 explicit EnsureSpace(Assembler* assembler) { | 1605 explicit EnsureSpace(Assembler* assembler) { |
| 1617 assembler->CheckBuffer(); | 1606 assembler->CheckBuffer(); |
| 1618 } | 1607 } |
| 1619 }; | 1608 }; |
| 1620 | 1609 |
| 1621 | 1610 |
| 1622 } } // namespace v8::internal | 1611 } } // namespace v8::internal |
| 1623 | 1612 |
| 1624 #endif // V8_ARM_ASSEMBLER_ARM_H_ | 1613 #endif // V8_ARM_ASSEMBLER_ARM_H_ |
| OLD | NEW |