Commit 9a6f23c2 authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by Commit Bot

[CSA] TNodified methods related to Jump

TNodified:
 * Jump (both versions)
 * JumpBackward
 * JumpIfTaggedEqual
 * JumpIfTaggedNotEqual
 * JumpConditional
 * LoadOsrNestingLevel

Removed slopiness from Advance's parameter.

Renamed "delta" to jump_offset for JumpXXX arguments. They were called
jump_offset in .h and delta in .cc.

Bug: v8:6949
Change-Id: I6b34391dcb2ee881670d04edac9382258f6bcb51
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1782821
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63578}
parent ff24879a
......@@ -1330,7 +1330,7 @@ TNode<IntPtrT> InterpreterAssembler::Advance(int delta) {
return Advance(IntPtrConstant(delta));
}
TNode<IntPtrT> InterpreterAssembler::Advance(SloppyTNode<IntPtrT> delta,
TNode<IntPtrT> InterpreterAssembler::Advance(TNode<IntPtrT> delta,
bool backward) {
#ifdef V8_TRACE_IGNITION
TraceBytecode(Runtime::kInterpreterTraceBytecodeExit);
......@@ -1341,39 +1341,45 @@ TNode<IntPtrT> InterpreterAssembler::Advance(SloppyTNode<IntPtrT> delta,
return next_offset;
}
void InterpreterAssembler::Jump(Node* delta, bool backward) {
void InterpreterAssembler::Jump(TNode<IntPtrT> jump_offset, bool backward) {
DCHECK(!Bytecodes::IsStarLookahead(bytecode_, operand_scale_));
UpdateInterruptBudget(TruncateIntPtrToInt32(delta), backward);
TNode<IntPtrT> new_bytecode_offset = Advance(delta, backward);
UpdateInterruptBudget(TruncateIntPtrToInt32(jump_offset), backward);
TNode<IntPtrT> new_bytecode_offset = Advance(jump_offset, backward);
TNode<RawPtrT> target_bytecode =
UncheckedCast<RawPtrT>(LoadBytecode(new_bytecode_offset));
DispatchToBytecode(target_bytecode, new_bytecode_offset);
}
void InterpreterAssembler::Jump(Node* delta) { Jump(delta, false); }
void InterpreterAssembler::Jump(TNode<IntPtrT> jump_offset) {
Jump(jump_offset, false);
}
void InterpreterAssembler::JumpBackward(Node* delta) { Jump(delta, true); }
void InterpreterAssembler::JumpBackward(TNode<IntPtrT> jump_offset) {
Jump(jump_offset, true);
}
void InterpreterAssembler::JumpConditional(Node* condition, Node* delta) {
void InterpreterAssembler::JumpConditional(TNode<BoolT> condition,
TNode<IntPtrT> jump_offset) {
Label match(this), no_match(this);
Branch(condition, &match, &no_match);
BIND(&match);
Jump(delta);
Jump(jump_offset);
BIND(&no_match);
Dispatch();
}
void InterpreterAssembler::JumpIfTaggedEqual(TNode<Object> lhs,
TNode<Object> rhs, Node* delta) {
JumpConditional(TaggedEqual(lhs, rhs), delta);
TNode<Object> rhs,
TNode<IntPtrT> jump_offset) {
JumpConditional(TaggedEqual(lhs, rhs), jump_offset);
}
void InterpreterAssembler::JumpIfTaggedNotEqual(TNode<Object> lhs,
TNode<Object> rhs,
Node* delta) {
JumpConditional(TaggedNotEqual(lhs, rhs), delta);
TNode<IntPtrT> jump_offset) {
JumpConditional(TaggedNotEqual(lhs, rhs), jump_offset);
}
TNode<WordT> InterpreterAssembler::LoadBytecode(
......@@ -1520,10 +1526,9 @@ void InterpreterAssembler::UpdateInterruptBudgetOnReturn() {
UpdateInterruptBudget(profiling_weight, true);
}
Node* InterpreterAssembler::LoadOsrNestingLevel() {
return LoadObjectField(BytecodeArrayTaggedPointer(),
BytecodeArray::kOsrNestingLevelOffset,
MachineType::Int8());
TNode<Int8T> InterpreterAssembler::LoadOsrNestingLevel() {
return LoadObjectField<Int8T>(BytecodeArrayTaggedPointer(),
BytecodeArray::kOsrNestingLevelOffset);
}
void InterpreterAssembler::Abort(AbortReason abort_reason) {
......
......@@ -221,28 +221,28 @@ class V8_EXPORT_PRIVATE InterpreterAssembler : public CodeStubAssembler {
int return_size = 1);
// Jump forward relative to the current bytecode by the |jump_offset|.
void Jump(compiler::Node* jump_offset);
void Jump(compiler::TNode<IntPtrT> jump_offset);
// Jump backward relative to the current bytecode by the |jump_offset|.
void JumpBackward(compiler::Node* jump_offset);
void JumpBackward(compiler::TNode<IntPtrT> jump_offset);
// Jump forward relative to the current bytecode by |jump_offset| if the
// word values |lhs| and |rhs| are equal.
void JumpIfTaggedEqual(compiler::TNode<Object> lhs,
compiler::TNode<Object> rhs,
compiler::Node* jump_offset);
compiler::TNode<IntPtrT> jump_offset);
// Jump forward relative to the current bytecode by |jump_offset| if the
// word values |lhs| and |rhs| are not equal.
void JumpIfTaggedNotEqual(compiler::TNode<Object> lhs,
compiler::TNode<Object> rhs,
compiler::Node* jump_offset);
compiler::TNode<IntPtrT> jump_offset);
// Updates the profiler interrupt budget for a return.
void UpdateInterruptBudgetOnReturn();
// Returns the OSR nesting level from the bytecode header.
compiler::Node* LoadOsrNestingLevel();
compiler::TNode<Int8T> LoadOsrNestingLevel();
// Dispatch to the bytecode.
void Dispatch();
......@@ -376,12 +376,13 @@ class V8_EXPORT_PRIVATE InterpreterAssembler : public CodeStubAssembler {
// Jump relative to the current bytecode by the |jump_offset|. If |backward|,
// then jump backward (subtract the offset), otherwise jump forward (add the
// offset). Helper function for Jump and JumpBackward.
void Jump(compiler::Node* jump_offset, bool backward);
void Jump(compiler::TNode<IntPtrT> jump_offset, bool backward);
// Jump forward relative to the current bytecode by |jump_offset| if the
// |condition| is true. Helper function for JumpIfTaggedEqual and
// JumpIfTaggedNotEqual.
void JumpConditional(compiler::Node* condition, compiler::Node* jump_offset);
void JumpConditional(compiler::TNode<BoolT> condition,
compiler::TNode<IntPtrT> jump_offset);
// Save the bytecode offset to the interpreter frame.
void SaveBytecodeOffset();
......@@ -395,7 +396,7 @@ class V8_EXPORT_PRIVATE InterpreterAssembler : public CodeStubAssembler {
// Updates and returns BytecodeOffset() advanced by delta bytecodes.
// Traces the exit of the current bytecode.
TNode<IntPtrT> Advance(int delta);
TNode<IntPtrT> Advance(SloppyTNode<IntPtrT> delta, bool backward = false);
TNode<IntPtrT> Advance(TNode<IntPtrT> delta, bool backward = false);
// Load the bytecode at |bytecode_offset|.
compiler::TNode<WordT> LoadBytecode(compiler::TNode<IntPtrT> bytecode_offset);
......
......@@ -2387,7 +2387,7 @@ IGNITION_HANDLER(JumpIfJSReceiverConstant, InterpreterAssembler) {
IGNITION_HANDLER(JumpLoop, InterpreterAssembler) {
TNode<IntPtrT> relative_jump = Signed(BytecodeOperandUImmWord(0));
TNode<Int32T> loop_depth = BytecodeOperandImm(1);
Node* osr_level = LoadOsrNestingLevel();
TNode<Int8T> osr_level = LoadOsrNestingLevel();
// Check if OSR points at the given {loop_depth} are armed by comparing it to
// the current {osr_level} loaded from the header of the BytecodeArray.
......
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