| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 } | 79 } |
| 80 | 80 |
| 81 | 81 |
| 82 int RelocInfo::target_address_size() { | 82 int RelocInfo::target_address_size() { |
| 83 return kPointerSize; | 83 return kPointerSize; |
| 84 } | 84 } |
| 85 | 85 |
| 86 | 86 |
| 87 void RelocInfo::set_target_address(Address target, WriteBarrierMode mode) { | 87 void RelocInfo::set_target_address(Address target, WriteBarrierMode mode) { |
| 88 ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY); | 88 ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY); |
| 89 Assembler::set_target_address_at(pc_, reinterpret_cast<Address>( | 89 Assembler::set_target_address_at(pc_, target); |
| 90 reinterpret_cast<intptr_t>(target) & ~3)); | |
| 91 if (mode == UPDATE_WRITE_BARRIER && host() != NULL && IsCodeTarget(rmode_)) { | 90 if (mode == UPDATE_WRITE_BARRIER && host() != NULL && IsCodeTarget(rmode_)) { |
| 92 Object* target_code = Code::GetCodeFromTargetAddress(target); | 91 Object* target_code = Code::GetCodeFromTargetAddress(target); |
| 93 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode( | 92 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode( |
| 94 host(), this, HeapObject::cast(target_code)); | 93 host(), this, HeapObject::cast(target_code)); |
| 95 } | 94 } |
| 96 } | 95 } |
| 97 | 96 |
| 98 | 97 |
| 99 Object* RelocInfo::target_object() { | 98 Object* RelocInfo::target_object() { |
| 100 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); | 99 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 // However, on ARM, no instruction is actually patched in the case | 465 // However, on ARM, no instruction is actually patched in the case |
| 467 // of embedded constants of the form: | 466 // of embedded constants of the form: |
| 468 // ldr ip, [pc, #...] | 467 // ldr ip, [pc, #...] |
| 469 // since the instruction accessing this address in the constant pool remains | 468 // since the instruction accessing this address in the constant pool remains |
| 470 // unchanged. | 469 // unchanged. |
| 471 } | 470 } |
| 472 } | 471 } |
| 473 | 472 |
| 474 | 473 |
| 475 Address Assembler::target_address_at(Address pc) { | 474 Address Assembler::target_address_at(Address pc) { |
| 476 return reinterpret_cast<Address>( | 475 return target_pointer_at(pc); |
| 477 reinterpret_cast<intptr_t>(target_pointer_at(pc)) & ~3); | |
| 478 } | 476 } |
| 479 | 477 |
| 480 | 478 |
| 481 void Assembler::set_target_address_at(Address pc, Address target) { | 479 void Assembler::set_target_address_at(Address pc, Address target) { |
| 482 set_target_pointer_at(pc, reinterpret_cast<Address>( | 480 set_target_pointer_at(pc, target); |
| 483 reinterpret_cast<intptr_t>(target) & ~3)); | |
| 484 } | 481 } |
| 485 | 482 |
| 486 | 483 |
| 487 } } // namespace v8::internal | 484 } } // namespace v8::internal |
| 488 | 485 |
| 489 #endif // V8_ARM_ASSEMBLER_ARM_INL_H_ | 486 #endif // V8_ARM_ASSEMBLER_ARM_INL_H_ |
| OLD | NEW |