[ia32] Add a root-relative addressing mode
.. and use it for generating faster loads of external references. This changes the stack check instruction sequence from mov ecx,0x567651dc // The address of the stack limit. cmp esp,[ecx] to cmp esp,[ebx+0x3c] This addressing mode was likely forgotten when we recently added root register support on ia32. Bug: chromium:998751,v8:9534 Change-Id: I3521519da1e9d373dfcd83831b3e399e0e9c895b Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1781056 Reviewed-by: Sigurd Schneider <sigurds@chromium.org> Commit-Queue: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#63508}
This commit is contained in:
parent
6039d7baa2
commit
f6fc9d6e3e
@ -165,6 +165,11 @@ class IA32OperandConverter : public InstructionOperandConverter {
|
|||||||
Constant ctant = ToConstant(instr_->InputAt(NextOffset(offset)));
|
Constant ctant = ToConstant(instr_->InputAt(NextOffset(offset)));
|
||||||
return Operand(ctant.ToInt32(), ctant.rmode());
|
return Operand(ctant.ToInt32(), ctant.rmode());
|
||||||
}
|
}
|
||||||
|
case kMode_Root: {
|
||||||
|
Register base = kRootRegister;
|
||||||
|
int32_t disp = InputInt32(NextOffset(offset));
|
||||||
|
return Operand(base, disp);
|
||||||
|
}
|
||||||
case kMode_None:
|
case kMode_None:
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
}
|
}
|
||||||
|
@ -393,7 +393,8 @@ namespace compiler {
|
|||||||
V(M2I) /* [ %r2*2 + K] */ \
|
V(M2I) /* [ %r2*2 + K] */ \
|
||||||
V(M4I) /* [ %r2*4 + K] */ \
|
V(M4I) /* [ %r2*4 + K] */ \
|
||||||
V(M8I) /* [ %r2*8 + K] */ \
|
V(M8I) /* [ %r2*8 + K] */ \
|
||||||
V(MI) /* [ K] */
|
V(MI) /* [ K] */ \
|
||||||
|
V(Root) /* [%root + K] */
|
||||||
|
|
||||||
} // namespace compiler
|
} // namespace compiler
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
@ -152,6 +152,21 @@ class IA32OperandGenerator final : public OperandGenerator {
|
|||||||
AddressingMode GetEffectiveAddressMemoryOperand(Node* node,
|
AddressingMode GetEffectiveAddressMemoryOperand(Node* node,
|
||||||
InstructionOperand inputs[],
|
InstructionOperand inputs[],
|
||||||
size_t* input_count) {
|
size_t* input_count) {
|
||||||
|
{
|
||||||
|
LoadMatcher<ExternalReferenceMatcher> m(node);
|
||||||
|
if (m.index().HasValue() && m.object().HasValue() &&
|
||||||
|
selector()->CanAddressRelativeToRootsRegister(m.object().Value())) {
|
||||||
|
ptrdiff_t const delta =
|
||||||
|
m.index().Value() +
|
||||||
|
TurboAssemblerBase::RootRegisterOffsetForExternalReference(
|
||||||
|
selector()->isolate(), m.object().Value());
|
||||||
|
if (is_int32(delta)) {
|
||||||
|
inputs[(*input_count)++] = TempImmediate(static_cast<int32_t>(delta));
|
||||||
|
return kMode_Root;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
BaseWithIndexAndDisplacement32Matcher m(node, AddressOption::kAllowAll);
|
BaseWithIndexAndDisplacement32Matcher m(node, AddressOption::kAllowAll);
|
||||||
DCHECK(m.matches());
|
DCHECK(m.matches());
|
||||||
if ((m.displacement() == nullptr || CanBeImmediate(m.displacement()))) {
|
if ((m.displacement() == nullptr || CanBeImmediate(m.displacement()))) {
|
||||||
|
Loading…
Reference in New Issue
Block a user