Commit 27998dbe authored by Sigurd Schneider's avatar Sigurd Schneider Committed by Commit Bot

[arm64] Replace {Get,Add}CodeTarget with {Get,Add}EmbeddedObject

The functionality is identical and AddEmbeddedObject makes more effort
to deduplicate handles.

Change-Id: I3d0468da28596aad09ceceb320ca4038aed60bd4
Bug: v8:8054, v8:8977, v8:7703
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1672925
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62538}
parent 6e099565
......@@ -508,7 +508,8 @@ Handle<Code> Assembler::code_target_object_handle_at(Address pc) {
} else {
DCHECK(instr->IsBranchAndLink() || instr->IsUnconditionalBranch());
DCHECK_EQ(instr->ImmPCOffset() % kInstrSize, 0);
return GetCodeTarget(instr->ImmPCOffset() >> kInstrSizeLog2);
return Handle<Code>::cast(
GetEmbeddedObject(instr->ImmPCOffset() >> kInstrSizeLog2));
}
}
......
......@@ -4318,9 +4318,10 @@ void Assembler::near_call(int offset, RelocInfo::Mode rmode) {
void Assembler::near_call(HeapObjectRequest request) {
BlockPoolsScope no_pool_before_bl_instr(this);
RequestHeapObject(request);
int index = AddCodeTarget(Handle<Code>());
EmbeddedObjectIndex index = AddEmbeddedObject(Handle<Code>());
RecordRelocInfo(RelocInfo::CODE_TARGET, index, NO_POOL_ENTRY);
bl(index);
DCHECK(is_int32(index));
bl(static_cast<int>(index));
}
// Constant Pool
......
......@@ -1865,7 +1865,9 @@ void TurboAssembler::Jump(Handle<Code> code, RelocInfo::Mode rmode,
}
if (CanUseNearCallOrJump(rmode)) {
JumpHelper(static_cast<int64_t>(AddCodeTarget(code)), rmode, cond);
EmbeddedObjectIndex index = AddEmbeddedObject(code);
DCHECK(is_int32(index));
JumpHelper(static_cast<int64_t>(index), rmode, cond);
} else {
Jump(code.address(), rmode, cond);
}
......@@ -1911,7 +1913,9 @@ void TurboAssembler::Call(Handle<Code> code, RelocInfo::Mode rmode) {
}
if (CanUseNearCallOrJump(rmode)) {
near_call(AddCodeTarget(code), rmode);
EmbeddedObjectIndex index = AddEmbeddedObject(code);
DCHECK(is_int32(index));
near_call(static_cast<int32_t>(index), rmode);
} else {
IndirectCall(code.address(), rmode);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment