Commit 98c4c44f authored by Victor Gomes's avatar Victor Gomes Committed by V8 LUCI CQ

[maglev] Support Abort bytecode

Bug: v8:7700
Change-Id: Ibd40e7bf3f0681f358bb2ed0785fce9a50f8b617
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3784599Reviewed-by: 's avatarJakob Linke <jgruber@chromium.org>
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81921}
parent d261567f
......@@ -1940,7 +1940,11 @@ MAGLEV_UNIMPLEMENTED_BYTECODE(ResumeGenerator)
MAGLEV_UNIMPLEMENTED_BYTECODE(GetIterator)
MAGLEV_UNIMPLEMENTED_BYTECODE(Debugger)
MAGLEV_UNIMPLEMENTED_BYTECODE(IncBlockCounter)
MAGLEV_UNIMPLEMENTED_BYTECODE(Abort)
void MaglevGraphBuilder::VisitAbort() {
AbortReason reason = static_cast<AbortReason>(GetFlagOperand(0));
AddNewNode<Abort>({}, reason);
}
void MaglevGraphBuilder::VisitWide() { UNREACHABLE(); }
void MaglevGraphBuilder::VisitExtraWide() { UNREACHABLE(); }
......
......@@ -60,6 +60,7 @@ class MaglevGraphVerifier {
void Process(NodeBase* node, const ProcessingState& state) {
switch (node->opcode()) {
case Opcode::kAbort:
case Opcode::kConstant:
case Opcode::kConstantGapMove:
case Opcode::kCreateEmptyArrayLiteral:
......
......@@ -852,6 +852,17 @@ void CreateClosure::PrintParams(std::ostream& os,
os << ")";
}
void Abort::GenerateCode(MaglevCodeGenState* code_gen_state,
const ProcessingState& state) {
__ Push(Smi::FromInt(static_cast<int>(reason())));
__ CallRuntime(Runtime::kAbort, 1);
__ Trap();
}
void Abort::PrintParams(std::ostream& os,
MaglevGraphLabeller* graph_labeller) const {
os << "(" << GetAbortReason(reason()) << ")";
}
void CheckMaps::AllocateVreg(MaglevVregAllocationState* vreg_state) {
UseRegister(receiver_input());
}
......
......@@ -162,6 +162,7 @@ class CompactInterpreterFrameState;
V(GapMove)
#define NODE_LIST(V) \
V(Abort) \
V(CheckMaps) \
V(CheckSmi) \
V(CheckHeapObject) \
......@@ -1994,6 +1995,22 @@ class CreateClosure : public FixedInputValueNodeT<1, CreateClosure> {
const bool pretenured_;
};
class Abort : public FixedInputNodeT<0, Abort> {
using Base = FixedInputNodeT<0, Abort>;
public:
explicit Abort(uint64_t bitfield, AbortReason reason)
: Base(bitfield), reason_(reason) {}
AbortReason reason() const { return reason_; }
void AllocateVreg(MaglevVregAllocationState*) {}
void GenerateCode(MaglevCodeGenState*, const ProcessingState&);
void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
private:
const AbortReason reason_;
};
class CheckMaps : public FixedInputNodeT<1, CheckMaps> {
using Base = FixedInputNodeT<1, CheckMaps>;
......
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