| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 // absolute code pointer inside code object moves with the code object. | 54 // absolute code pointer inside code object moves with the code object. |
| 55 int32_t* p = reinterpret_cast<int32_t*>(pc_); | 55 int32_t* p = reinterpret_cast<int32_t*>(pc_); |
| 56 *p += delta; // relocate entry | 56 *p += delta; // relocate entry |
| 57 } | 57 } |
| 58 // We do not use pc relative addressing on ARM, so there is | 58 // We do not use pc relative addressing on ARM, so there is |
| 59 // nothing else to do. | 59 // nothing else to do. |
| 60 } | 60 } |
| 61 | 61 |
| 62 | 62 |
| 63 Address RelocInfo::target_address() { | 63 Address RelocInfo::target_address() { |
| 64 ASSERT(IsCodeTarget(rmode_)); | 64 ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY); |
| 65 return Assembler::target_address_at(pc_); | 65 return Assembler::target_address_at(pc_); |
| 66 } | 66 } |
| 67 | 67 |
| 68 | 68 |
| 69 Address RelocInfo::target_address_address() { |
| 70 ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY); |
| 71 return reinterpret_cast<Address>(Assembler::target_address_address_at(pc_)); |
| 72 } |
| 73 |
| 74 |
| 69 void RelocInfo::set_target_address(Address target) { | 75 void RelocInfo::set_target_address(Address target) { |
| 70 ASSERT(IsCodeTarget(rmode_)); | 76 ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY); |
| 71 Assembler::set_target_address_at(pc_, target); | 77 Assembler::set_target_address_at(pc_, target); |
| 72 } | 78 } |
| 73 | 79 |
| 74 | 80 |
| 75 Object* RelocInfo::target_object() { | 81 Object* RelocInfo::target_object() { |
| 76 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); | 82 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); |
| 77 return reinterpret_cast<Object*>(Assembler::target_address_at(pc_)); | 83 return reinterpret_cast<Object*>(Assembler::target_address_at(pc_)); |
| 78 } | 84 } |
| 79 | 85 |
| 80 | 86 |
| 81 Object** RelocInfo::target_object_address() { | 87 Object** RelocInfo::target_object_address() { |
| 82 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); | 88 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); |
| 83 return reinterpret_cast<Object**>(Assembler::target_address_address_at(pc_)); | 89 return reinterpret_cast<Object**>(Assembler::target_address_address_at(pc_)); |
| 84 } | 90 } |
| 85 | 91 |
| 86 | 92 |
| 87 void RelocInfo::set_target_object(Object* target) { | 93 void RelocInfo::set_target_object(Object* target) { |
| 88 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); | 94 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); |
| 89 Assembler::set_target_address_at(pc_, reinterpret_cast<Address>(target)); | 95 Assembler::set_target_address_at(pc_, reinterpret_cast<Address>(target)); |
| 90 } | 96 } |
| 91 | 97 |
| 92 | 98 |
| 93 Address* RelocInfo::target_reference_address() { | 99 Address* RelocInfo::target_reference_address() { |
| 94 ASSERT(rmode_ == EXTERNAL_REFERENCE); | 100 ASSERT(rmode_ == EXTERNAL_REFERENCE); |
| 95 return reinterpret_cast<Address*>(pc_); | 101 return reinterpret_cast<Address*>(Assembler::target_address_address_at(pc_)); |
| 96 } | 102 } |
| 97 | 103 |
| 98 | 104 |
| 99 Address RelocInfo::call_address() { | 105 Address RelocInfo::call_address() { |
| 100 ASSERT(is_call_instruction()); | 106 ASSERT(is_call_instruction()); |
| 101 UNIMPLEMENTED(); | 107 UNIMPLEMENTED(); |
| 102 return NULL; | 108 return NULL; |
| 103 } | 109 } |
| 104 | 110 |
| 105 | 111 |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 // CPU::FlushICache(pc, sizeof(target)); | 240 // CPU::FlushICache(pc, sizeof(target)); |
| 235 // However, on ARM, no instruction was actually patched by the assignment | 241 // However, on ARM, no instruction was actually patched by the assignment |
| 236 // above; the target address is not part of an instruction, it is patched in | 242 // above; the target address is not part of an instruction, it is patched in |
| 237 // the constant pool and is read via a data access; the instruction accessing | 243 // the constant pool and is read via a data access; the instruction accessing |
| 238 // this address in the constant pool remains unchanged. | 244 // this address in the constant pool remains unchanged. |
| 239 } | 245 } |
| 240 | 246 |
| 241 } } // namespace v8::internal | 247 } } // namespace v8::internal |
| 242 | 248 |
| 243 #endif // V8_ASSEMBLER_ARM_INL_H_ | 249 #endif // V8_ASSEMBLER_ARM_INL_H_ |
| OLD | NEW |