Commit 8d20dfaf authored by zhengxing.li's avatar zhengxing.li Committed by Commit bot

X87: [compiler] Add relocatable pointer constants for wasm memory references.

  port 52148c41 (r35407)

  original commit message:
  Add relocatable pointers for wasm memory references that need to be updated when wasm GrowMemory is used. Code generator changes to accept relocatable constants as immediates.

BUG=

Review URL: https://codereview.chromium.org/1895673002

Cr-Commit-Position: refs/heads/master@{#35556}
parent 80704958
......@@ -59,6 +59,11 @@ class X87OperandConverter : public InstructionOperandConverter {
Immediate ToImmediate(InstructionOperand* operand) {
Constant constant = ToConstant(operand);
if (constant.type() == Constant::kInt32 &&
constant.rmode() == RelocInfo::WASM_MEMORY_REFERENCE) {
return Immediate(reinterpret_cast<Address>(constant.ToInt32()),
constant.rmode());
}
switch (constant.type()) {
case Constant::kInt32:
return Immediate(constant.ToInt32());
......
......@@ -60,6 +60,8 @@ class X87OperandGenerator final : public OperandGenerator {
case IrOpcode::kInt32Constant:
case IrOpcode::kNumberConstant:
case IrOpcode::kExternalConstant:
case IrOpcode::kRelocatableInt32Constant:
case IrOpcode::kRelocatableInt64Constant:
return true;
case IrOpcode::kHeapConstant: {
// Constants in new space cannot be used as immediates in V8 because
......
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