Address RelocInfo::target_address() {
- ASSERT(IsCodeTarget(rmode_));
+ ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY);
return Assembler::target_address_at(pc_);
}
+Address RelocInfo::target_address_address() {
+ ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY);
+ return reinterpret_cast<Address>(Assembler::target_address_address_at(pc_));
+}
+
+
void RelocInfo::set_target_address(Address target) {
- ASSERT(IsCodeTarget(rmode_));
+ ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY);
Assembler::set_target_address_at(pc_, target);
}
Address* RelocInfo::target_reference_address() {
ASSERT(rmode_ == EXTERNAL_REFERENCE);
- return reinterpret_cast<Address*>(pc_);
+ return reinterpret_cast<Address*>(Assembler::target_address_address_at(pc_));
}
}
+Address RelocInfo::target_address_address() {
+ ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY);
+ return reinterpret_cast<Address>(pc_);
+}
+
+
void RelocInfo::set_target_address(Address target) {
ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY);
Assembler::set_target_address_at(pc_, target);
// Apply a relocation by delta bytes
INLINE(void apply(int delta));
- // Read/modify the code target in the branch/call instruction this relocation
- // applies to; can only be called if IsCodeTarget(rmode_)
+ // Read/modify the code target in the branch/call instruction
+ // this relocation applies to;
+ // can only be called if IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY
INLINE(Address target_address());
INLINE(void set_target_address(Address target));
INLINE(Object* target_object());
INLINE(Object** target_object_address());
INLINE(void set_target_object(Object* target));
+ // Read the address of the word containing the target_address. Can only
+ // be called if IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY.
+ INLINE(Address target_address_address());
+
// Read/modify the reference in the instruction this relocation
// applies to; can only be called if rmode_ is external_reference
INLINE(Address* target_reference_address());
UNCLASSIFIED,
3,
"StackGuard::address_of_limit()");
- Add(ExternalReference::debug_break().address(),
+ Add(ExternalReference::address_of_regexp_stack_limit().address(),
UNCLASSIFIED,
4,
+ "RegExpStack::limit_address()");
+ Add(ExternalReference::debug_break().address(),
+ UNCLASSIFIED,
+ 5,
"Debug::Break()");
Add(ExternalReference::new_space_start().address(),
UNCLASSIFIED,
- 5,
+ 6,
"Heap::NewSpaceStart()");
Add(ExternalReference::heap_always_allocate_scope_depth().address(),
UNCLASSIFIED,
- 6,
+ 7,
"Heap::always_allocate_scope_depth()");
Add(ExternalReference::new_space_allocation_limit_address().address(),
UNCLASSIFIED,
- 7,
+ 8,
"Heap::NewSpaceAllocationLimitAddress()");
Add(ExternalReference::new_space_allocation_top_address().address(),
UNCLASSIFIED,
- 8,
+ 9,
"Heap::NewSpaceAllocationTopAddress()");
Add(ExternalReference::debug_step_in_fp_address().address(),
UNCLASSIFIED,
- 9,
+ 10,
"Debug::step_in_fp_addr()");
}
Address target = rinfo->target_address();
uint32_t encoding = reference_encoder_->Encode(target);
CHECK(target == NULL ? encoding == 0 : encoding != 0);
- offsets_.Add(reinterpret_cast<Address>(rinfo->pc()) - obj_address_);
+ offsets_.Add(rinfo->target_address_address() - obj_address_);
addresses_.Add(reinterpret_cast<Address>(encoding));
}
void Deserializer::VisitRuntimeEntry(RelocInfo* rinfo) {
- uint32_t* pc = reinterpret_cast<uint32_t*>(rinfo->pc());
+ uint32_t* pc = reinterpret_cast<uint32_t*>(rinfo->target_address_address());
uint32_t encoding = *pc;
Address target = reference_decoder_->Decode(encoding);
rinfo->set_target_address(target);
ExternalReference::address_of_stack_guard_limit();
CHECK_EQ(make_code(UNCLASSIFIED, 3),
encoder.Encode(stack_guard_limit_address.address()));
- CHECK_EQ(make_code(UNCLASSIFIED, 4),
- encoder.Encode(ExternalReference::debug_break().address()));
CHECK_EQ(make_code(UNCLASSIFIED, 5),
+ encoder.Encode(ExternalReference::debug_break().address()));
+ CHECK_EQ(make_code(UNCLASSIFIED, 6),
encoder.Encode(ExternalReference::new_space_start().address()));
}
CHECK_EQ(ExternalReference::address_of_stack_guard_limit().address(),
decoder.Decode(make_code(UNCLASSIFIED, 3)));
CHECK_EQ(ExternalReference::debug_break().address(),
- decoder.Decode(make_code(UNCLASSIFIED, 4)));
- CHECK_EQ(ExternalReference::new_space_start().address(),
decoder.Decode(make_code(UNCLASSIFIED, 5)));
+ CHECK_EQ(ExternalReference::new_space_start().address(),
+ decoder.Decode(make_code(UNCLASSIFIED, 6)));
}