Commit 34cb1ccf authored by Zhao Jiazhong's avatar Zhao Jiazhong Committed by V8 LUCI CQ

[loong64][mips][wasm] Execution budget based dynamic tiering

Port commit 7a93bd64

Change-Id: I3d1793154b1d69fcc0dcde7b7d731cbbb326f05d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3255208
Auto-Submit: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Reviewed-by: 's avatarLiu yu <liuyu@loongson.cn>
Commit-Queue: Liu yu <liuyu@loongson.cn>
Cr-Commit-Position: refs/heads/main@{#77635}
parent 21157d25
......@@ -59,9 +59,10 @@ inline constexpr Condition ToCondition(LiftoffCondition liftoff_cond) {
// -1 | 0xa: WASM |
// -2 | instance |
// -3 | feedback vector|
// -4 | tiering budget |
// -----+--------------------+---------------------------
// -4 | slot 0 | ^
// -5 | slot 1 | |
// -5 | slot 0 | ^
// -6 | slot 1 | |
// | | Frame slots
// | | |
// | | v
......@@ -71,6 +72,7 @@ inline constexpr Condition ToCondition(LiftoffCondition liftoff_cond) {
constexpr int kInstanceOffset = 2 * kSystemPointerSize;
constexpr int kFeedbackVectorOffset = 3 * kSystemPointerSize;
constexpr int kTierupBudgetOffset = 4 * kSystemPointerSize;
inline MemOperand GetStackSlot(int offset) { return MemOperand(fp, -offset); }
......@@ -293,7 +295,7 @@ void LiftoffAssembler::AbortCompilation() {}
// static
constexpr int LiftoffAssembler::StaticStackFrameSize() {
return liftoff::kFeedbackVectorOffset;
return liftoff::kTierupBudgetOffset;
}
int LiftoffAssembler::SlotSizeForType(ValueKind kind) {
......@@ -1327,6 +1329,13 @@ void LiftoffAssembler::emit_i32_cond_jumpi(LiftoffCondition liftoff_cond,
TurboAssembler::Branch(label, cond, lhs, Operand(imm));
}
void LiftoffAssembler::emit_i32_subi_jump_negative(Register value,
int subtrahend,
Label* result_negative) {
TurboAssembler::Sub_d(value, value, Operand(subtrahend));
TurboAssembler::Branch(result_negative, less, value, Operand(zero_reg));
}
void LiftoffAssembler::emit_i32_eqz(Register dst, Register src) {
sltui(dst, src, 1);
}
......
......@@ -56,11 +56,12 @@ inline constexpr Condition ToCondition(LiftoffCondition liftoff_cond) {
// -1 | 0xa: WASM |
// -2 | instance |
// -3 | feedback vector |
// -4 | tiering budget |
// -----+--------------------+---------------------------
// -4 | slot 0 (high) | ^
// -5 | slot 0 (low) | |
// -6 | slot 1 (high) | Frame slots
// -7 | slot 1 (low) | |
// -5 | slot 0 (high) | ^
// -6 | slot 0 (low) | |
// -7 | slot 1 (high) | Frame slots
// -8 | slot 1 (low) | |
// | | v
// -----+--------------------+ <-- stack ptr (sp)
//
......@@ -74,6 +75,7 @@ constexpr int32_t kHighWordOffset = 4;
constexpr int kInstanceOffset = 2 * kSystemPointerSize;
constexpr int kFeedbackVectorOffset = 3 * kSystemPointerSize;
constexpr int kTierupBudgetOffset = 4 * kSystemPointerSize;
inline MemOperand GetStackSlot(int offset) { return MemOperand(fp, -offset); }
......@@ -422,7 +424,7 @@ void LiftoffAssembler::AbortCompilation() {}
// static
constexpr int LiftoffAssembler::StaticStackFrameSize() {
return liftoff::kFeedbackVectorOffset;
return liftoff::kTierupBudgetOffset;
}
int LiftoffAssembler::SlotSizeForType(ValueKind kind) {
......@@ -1606,6 +1608,13 @@ void LiftoffAssembler::emit_i32_cond_jumpi(LiftoffCondition liftoff_cond,
TurboAssembler::Branch(label, cond, lhs, Operand(imm));
}
void LiftoffAssembler::emit_i32_subi_jump_negative(Register value,
int subtrahend,
Label* result_negative) {
TurboAssembler::Subu(value, value, Operand(subtrahend));
TurboAssembler::Branch(result_negative, less, value, Operand(zero_reg));
}
void LiftoffAssembler::emit_i32_eqz(Register dst, Register src) {
sltiu(dst, src, 1);
}
......
......@@ -59,9 +59,10 @@ inline constexpr Condition ToCondition(LiftoffCondition liftoff_cond) {
// -1 | 0xa: WASM |
// -2 | instance |
// -3 | feedback vector|
// -4 | tiering budget |
// -----+--------------------+---------------------------
// -4 | slot 0 | ^
// -5 | slot 1 | |
// -5 | slot 0 | ^
// -6 | slot 1 | |
// | | Frame slots
// | | |
// | | v
......@@ -71,6 +72,7 @@ inline constexpr Condition ToCondition(LiftoffCondition liftoff_cond) {
constexpr int kInstanceOffset = 2 * kSystemPointerSize;
constexpr int kFeedbackVectorOffset = 3 * kSystemPointerSize;
constexpr int kTierupBudgetOffset = 4 * kSystemPointerSize;
inline MemOperand GetStackSlot(int offset) { return MemOperand(fp, -offset); }
......@@ -409,7 +411,7 @@ void LiftoffAssembler::AbortCompilation() {}
// static
constexpr int LiftoffAssembler::StaticStackFrameSize() {
return liftoff::kFeedbackVectorOffset;
return liftoff::kTierupBudgetOffset;
}
int LiftoffAssembler::SlotSizeForType(ValueKind kind) {
......@@ -1455,6 +1457,13 @@ void LiftoffAssembler::emit_i32_cond_jumpi(LiftoffCondition liftoff_cond,
TurboAssembler::Branch(label, cond, lhs, Operand(imm));
}
void LiftoffAssembler::emit_i32_subi_jump_negative(Register value,
int subtrahend,
Label* result_negative) {
TurboAssembler::Dsubu(value, value, Operand(subtrahend));
TurboAssembler::Branch(result_negative, less, value, Operand(zero_reg));
}
void LiftoffAssembler::emit_i32_eqz(Register dst, Register src) {
sltiu(dst, src, 1);
}
......
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