Commit cd285951 authored by Sigurd Schneider's avatar Sigurd Schneider Committed by Commit Bot

[arm] Use constant pool for off-heap targets

This CL puts off-heap targets (i.e. code addresses for embedded builtins)
in the constant pool on ARM.

We are landing this CL to evaluate impact on benchmarks and code size,
and expect to revert it once we have gathered that data.

Bug: v8:6666

Change-Id: If4935a6fb162cd1ffb34489c6fa9630f10ca2c9f
Reviewed-on: https://chromium-review.googlesource.com/1154924
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54914}
parent 497f5a71
......@@ -1097,6 +1097,9 @@ bool UseMovImmediateLoad(const Operand& x, const Assembler* assembler) {
if (x.MustOutputRelocInfo(assembler)) {
// Prefer constant pool if data is likely to be patched.
return false;
} else if (x.IsOffHeapTarget()) {
// Use constant pool for off heap targets.
return false;
} else {
// Otherwise, use immediate load if movw / movt is available.
return CpuFeatures::IsSupported(ARMv7);
......
......@@ -480,6 +480,7 @@ class Operand BASE_EMBEDDED {
Register rs() const { return rs_; }
ShiftOp shift_op() const { return shift_op_; }
bool IsOffHeapTarget() const { return RelocInfo::IsOffHeapTarget(rmode_); }
private:
Register rm_ = no_reg;
......
......@@ -1956,7 +1956,7 @@ void TurboAssembler::Jump(Handle<Code> code, RelocInfo::Mode rmode,
Register scratch = temps.AcquireX();
EmbeddedData d = EmbeddedData::FromBlob();
Address entry = d.InstructionStartOfBuiltin(builtin_index);
Mov(scratch, Operand(entry, RelocInfo::OFF_HEAP_TARGET));
Ldr(scratch, Operand(entry, RelocInfo::OFF_HEAP_TARGET));
Jump(scratch, cond);
return;
}
......@@ -2014,7 +2014,7 @@ void TurboAssembler::Call(Handle<Code> code, RelocInfo::Mode rmode) {
Register scratch = temps.AcquireX();
EmbeddedData d = EmbeddedData::FromBlob();
Address entry = d.InstructionStartOfBuiltin(builtin_index);
Mov(scratch, Operand(entry, RelocInfo::OFF_HEAP_TARGET));
Ldr(scratch, Operand(entry, RelocInfo::OFF_HEAP_TARGET));
Call(scratch);
return;
}
......
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