Commit 2a50c752 authored by adamk's avatar adamk Committed by Commit bot

Revert of [ignition] Inline the binary op TurboFan code stubs in the bytecode...

Revert of [ignition] Inline the binary op TurboFan code stubs in the bytecode handlers. (patchset #1 id:1 of https://codereview.chromium.org/1974293002/ )

Reason for revert:
Causes cctest/test-serialize/SnapshotDataBlobWithWarmup failure on arm64:
https://build.chromium.org/p/client.v8.ports/builders/V8%20Linux%20-%20arm64%20-%20sim%20-%20debug/builds/534

Original issue's description:
> [ignition] Inline the binary op TurboFan code stubs in the bytecode handlers.
>
> Trying to reland http://crrev.com/1902823002.
>
> This time some blocks have been shuffled around in the AddStub so that the frame still doesn't get built for the fast path.
>
> Committed: https://crrev.com/567160122de0bdb78aea79a9faa0dc15a564484c
> Cr-Commit-Position: refs/heads/master@{#36251}

TBR=bmeurer@chromium.org,rmcilroy@chromium.org,epertoso@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/1978993003
Cr-Commit-Position: refs/heads/master@{#36255}
parent d33aedb7
This diff is collapsed.
......@@ -402,18 +402,6 @@ class CodeStub BASE_EMBEDDED {
void GenerateAssembly(CodeStubAssembler* assembler) const override; \
DEFINE_CODE_STUB(NAME, SUPER)
#define DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(NAME, SUPER) \
public: \
static compiler::Node* Generate(CodeStubAssembler* assembler, \
compiler::Node* left, compiler::Node* right, \
compiler::Node* context); \
void GenerateAssembly(CodeStubAssembler* assembler) const override { \
assembler->Return(Generate(assembler, assembler->Parameter(0), \
assembler->Parameter(1), \
assembler->Parameter(2))); \
} \
DEFINE_CODE_STUB(NAME, SUPER)
#define DEFINE_HANDLER_CODE_STUB(NAME, SUPER) \
public: \
Handle<Code> GenerateCode() override; \
......@@ -693,7 +681,7 @@ class AddStub final : public TurboFanCodeStub {
explicit AddStub(Isolate* isolate) : TurboFanCodeStub(isolate) {}
DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp);
DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(Add, TurboFanCodeStub);
DEFINE_TURBOFAN_CODE_STUB(Add, TurboFanCodeStub);
};
class SubtractStub final : public TurboFanCodeStub {
......@@ -701,7 +689,7 @@ class SubtractStub final : public TurboFanCodeStub {
explicit SubtractStub(Isolate* isolate) : TurboFanCodeStub(isolate) {}
DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp);
DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(Subtract, TurboFanCodeStub);
DEFINE_TURBOFAN_CODE_STUB(Subtract, TurboFanCodeStub);
};
class MultiplyStub final : public TurboFanCodeStub {
......@@ -709,7 +697,7 @@ class MultiplyStub final : public TurboFanCodeStub {
explicit MultiplyStub(Isolate* isolate) : TurboFanCodeStub(isolate) {}
DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp);
DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(Multiply, TurboFanCodeStub);
DEFINE_TURBOFAN_CODE_STUB(Multiply, TurboFanCodeStub);
};
class DivideStub final : public TurboFanCodeStub {
......@@ -717,7 +705,7 @@ class DivideStub final : public TurboFanCodeStub {
explicit DivideStub(Isolate* isolate) : TurboFanCodeStub(isolate) {}
DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp);
DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(Divide, TurboFanCodeStub);
DEFINE_TURBOFAN_CODE_STUB(Divide, TurboFanCodeStub);
};
class ModulusStub final : public TurboFanCodeStub {
......@@ -725,7 +713,7 @@ class ModulusStub final : public TurboFanCodeStub {
explicit ModulusStub(Isolate* isolate) : TurboFanCodeStub(isolate) {}
DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp);
DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(Modulus, TurboFanCodeStub);
DEFINE_TURBOFAN_CODE_STUB(Modulus, TurboFanCodeStub);
};
class ShiftRightStub final : public TurboFanCodeStub {
......@@ -733,7 +721,7 @@ class ShiftRightStub final : public TurboFanCodeStub {
explicit ShiftRightStub(Isolate* isolate) : TurboFanCodeStub(isolate) {}
DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp);
DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(ShiftRight, TurboFanCodeStub);
DEFINE_TURBOFAN_CODE_STUB(ShiftRight, TurboFanCodeStub);
};
class ShiftRightLogicalStub final : public TurboFanCodeStub {
......@@ -742,7 +730,7 @@ class ShiftRightLogicalStub final : public TurboFanCodeStub {
: TurboFanCodeStub(isolate) {}
DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp);
DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(ShiftRightLogical, TurboFanCodeStub);
DEFINE_TURBOFAN_CODE_STUB(ShiftRightLogical, TurboFanCodeStub);
};
class ShiftLeftStub final : public TurboFanCodeStub {
......@@ -750,7 +738,7 @@ class ShiftLeftStub final : public TurboFanCodeStub {
explicit ShiftLeftStub(Isolate* isolate) : TurboFanCodeStub(isolate) {}
DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp);
DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(ShiftLeft, TurboFanCodeStub);
DEFINE_TURBOFAN_CODE_STUB(ShiftLeft, TurboFanCodeStub);
};
class BitwiseAndStub final : public TurboFanCodeStub {
......@@ -758,7 +746,7 @@ class BitwiseAndStub final : public TurboFanCodeStub {
explicit BitwiseAndStub(Isolate* isolate) : TurboFanCodeStub(isolate) {}
DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp);
DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(BitwiseAnd, TurboFanCodeStub);
DEFINE_TURBOFAN_CODE_STUB(BitwiseAnd, TurboFanCodeStub);
};
class BitwiseOrStub final : public TurboFanCodeStub {
......@@ -766,7 +754,7 @@ class BitwiseOrStub final : public TurboFanCodeStub {
explicit BitwiseOrStub(Isolate* isolate) : TurboFanCodeStub(isolate) {}
DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp);
DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(BitwiseOr, TurboFanCodeStub);
DEFINE_TURBOFAN_CODE_STUB(BitwiseOr, TurboFanCodeStub);
};
class BitwiseXorStub final : public TurboFanCodeStub {
......@@ -774,7 +762,7 @@ class BitwiseXorStub final : public TurboFanCodeStub {
explicit BitwiseXorStub(Isolate* isolate) : TurboFanCodeStub(isolate) {}
DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp);
DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(BitwiseXor, TurboFanCodeStub);
DEFINE_TURBOFAN_CODE_STUB(BitwiseXor, TurboFanCodeStub);
};
class IncStub final : public TurboFanCodeStub {
......
......@@ -729,22 +729,12 @@ void Interpreter::DoBinaryOp(Runtime::FunctionId function_id,
__ Dispatch();
}
template <class Generator>
void Interpreter::DoBinaryOp(InterpreterAssembler* assembler) {
Node* reg_index = __ BytecodeOperandReg(0);
Node* lhs = __ LoadRegister(reg_index);
Node* rhs = __ GetAccumulator();
Node* context = __ GetContext();
Node* result = Generator::Generate(assembler, lhs, rhs, context);
__ SetAccumulator(result);
__ Dispatch();
}
// Add <src>
//
// Add register <src> to accumulator.
void Interpreter::DoAdd(InterpreterAssembler* assembler) {
DoBinaryOp<AddStub>(assembler);
DoBinaryOp(CodeFactory::Add(isolate_), assembler);
}
......@@ -752,7 +742,7 @@ void Interpreter::DoAdd(InterpreterAssembler* assembler) {
//
// Subtract register <src> from accumulator.
void Interpreter::DoSub(InterpreterAssembler* assembler) {
DoBinaryOp<SubtractStub>(assembler);
DoBinaryOp(CodeFactory::Subtract(isolate_), assembler);
}
......@@ -760,7 +750,7 @@ void Interpreter::DoSub(InterpreterAssembler* assembler) {
//
// Multiply accumulator by register <src>.
void Interpreter::DoMul(InterpreterAssembler* assembler) {
DoBinaryOp<MultiplyStub>(assembler);
DoBinaryOp(CodeFactory::Multiply(isolate_), assembler);
}
......@@ -768,7 +758,7 @@ void Interpreter::DoMul(InterpreterAssembler* assembler) {
//
// Divide register <src> by accumulator.
void Interpreter::DoDiv(InterpreterAssembler* assembler) {
DoBinaryOp<DivideStub>(assembler);
DoBinaryOp(CodeFactory::Divide(isolate_), assembler);
}
......@@ -776,7 +766,7 @@ void Interpreter::DoDiv(InterpreterAssembler* assembler) {
//
// Modulo register <src> by accumulator.
void Interpreter::DoMod(InterpreterAssembler* assembler) {
DoBinaryOp<ModulusStub>(assembler);
DoBinaryOp(CodeFactory::Modulus(isolate_), assembler);
}
......@@ -784,7 +774,7 @@ void Interpreter::DoMod(InterpreterAssembler* assembler) {
//
// BitwiseOr register <src> to accumulator.
void Interpreter::DoBitwiseOr(InterpreterAssembler* assembler) {
DoBinaryOp<BitwiseOrStub>(assembler);
DoBinaryOp(CodeFactory::BitwiseOr(isolate_), assembler);
}
......@@ -792,7 +782,7 @@ void Interpreter::DoBitwiseOr(InterpreterAssembler* assembler) {
//
// BitwiseXor register <src> to accumulator.
void Interpreter::DoBitwiseXor(InterpreterAssembler* assembler) {
DoBinaryOp<BitwiseXorStub>(assembler);
DoBinaryOp(CodeFactory::BitwiseXor(isolate_), assembler);
}
......@@ -800,7 +790,7 @@ void Interpreter::DoBitwiseXor(InterpreterAssembler* assembler) {
//
// BitwiseAnd register <src> to accumulator.
void Interpreter::DoBitwiseAnd(InterpreterAssembler* assembler) {
DoBinaryOp<BitwiseAndStub>(assembler);
DoBinaryOp(CodeFactory::BitwiseAnd(isolate_), assembler);
}
......@@ -811,7 +801,7 @@ void Interpreter::DoBitwiseAnd(InterpreterAssembler* assembler) {
// before the operation. 5 lsb bits from the accumulator are used as count
// i.e. <src> << (accumulator & 0x1F).
void Interpreter::DoShiftLeft(InterpreterAssembler* assembler) {
DoBinaryOp<ShiftLeftStub>(assembler);
DoBinaryOp(CodeFactory::ShiftLeft(isolate_), assembler);
}
......@@ -822,7 +812,7 @@ void Interpreter::DoShiftLeft(InterpreterAssembler* assembler) {
// accumulator to uint32 before the operation. 5 lsb bits from the accumulator
// are used as count i.e. <src> >> (accumulator & 0x1F).
void Interpreter::DoShiftRight(InterpreterAssembler* assembler) {
DoBinaryOp<ShiftRightStub>(assembler);
DoBinaryOp(CodeFactory::ShiftRight(isolate_), assembler);
}
......@@ -833,7 +823,7 @@ void Interpreter::DoShiftRight(InterpreterAssembler* assembler) {
// uint32 before the operation 5 lsb bits from the accumulator are used as
// count i.e. <src> << (accumulator & 0x1F).
void Interpreter::DoShiftRightLogical(InterpreterAssembler* assembler) {
DoBinaryOp<ShiftRightLogicalStub>(assembler);
DoBinaryOp(CodeFactory::ShiftRightLogical(isolate_), assembler);
}
void Interpreter::DoCountOp(Callable callable,
......
......@@ -73,10 +73,6 @@ class Interpreter {
void DoBinaryOp(Runtime::FunctionId function_id,
InterpreterAssembler* assembler);
// Generates code to perform the binary operations via |Generator|.
template <class Generator>
void DoBinaryOp(InterpreterAssembler* assembler);
// Generates code to perform the count operations via |callable|.
void DoCountOp(Callable callable, InterpreterAssembler* assembler);
......
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