Commit 41c297fc authored by Milad Fa's avatar Milad Fa Committed by V8 LUCI CQ

PPC/s390: [wasm] Execution budget based dynamic tiering

Port 7a93bd64

Original Commit Message:

    Temporarily behind a new flag: --new-wasm-dynamic-tiering
    The plan is to merge this into the existing --wasm-dynamic-tiering
    flag once it's been confirmed to be generally beneficial.

R=jkummerow@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
BUG=
LOG=N

Change-Id: I1ba28b60e628dc2ded33b267be62debcf1b03099
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3250936
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Reviewed-by: 's avatarJunliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/main@{#77628}
parent e982374c
...@@ -34,11 +34,12 @@ namespace liftoff { ...@@ -34,11 +34,12 @@ namespace liftoff {
// -1 | 0xa: WASM | // -1 | 0xa: WASM |
// -2 | instance | // -2 | instance |
// -3 | feedback vector | // -3 | feedback vector |
// -4 | tiering budget |
// -----+--------------------+--------------------------- // -----+--------------------+---------------------------
// -4 | slot 0 (high) | ^ // -5 | slot 0 (high) | ^
// -5 | slot 0 (low) | | // -6 | slot 0 (low) | |
// -6 | slot 1 (high) | Frame slots // -7 | slot 1 (high) | Frame slots
// -7 | slot 1 (low) | | // -8 | slot 1 (low) | |
// | | v // | | v
// -----+--------------------+ <-- stack ptr (sp) // -----+--------------------+ <-- stack ptr (sp)
// //
...@@ -48,6 +49,8 @@ constexpr int32_t kInstanceOffset = ...@@ -48,6 +49,8 @@ constexpr int32_t kInstanceOffset =
(FLAG_enable_embedded_constant_pool ? 3 : 2) * kSystemPointerSize; (FLAG_enable_embedded_constant_pool ? 3 : 2) * kSystemPointerSize;
constexpr int kFeedbackVectorOffset = constexpr int kFeedbackVectorOffset =
(FLAG_enable_embedded_constant_pool ? 4 : 3) * kSystemPointerSize; (FLAG_enable_embedded_constant_pool ? 4 : 3) * kSystemPointerSize;
constexpr int kTierupBudgetOffset =
(FLAG_enable_embedded_constant_pool ? 5 : 4) * kSystemPointerSize;
inline MemOperand GetHalfStackSlot(int offset, RegPairHalf half) { inline MemOperand GetHalfStackSlot(int offset, RegPairHalf half) {
int32_t half_offset = int32_t half_offset =
...@@ -219,7 +222,7 @@ void LiftoffAssembler::AbortCompilation() { FinishCode(); } ...@@ -219,7 +222,7 @@ void LiftoffAssembler::AbortCompilation() { FinishCode(); }
// static // static
constexpr int LiftoffAssembler::StaticStackFrameSize() { constexpr int LiftoffAssembler::StaticStackFrameSize() {
return liftoff::kFeedbackVectorOffset; return liftoff::kTierupBudgetOffset;
} }
int LiftoffAssembler::SlotSizeForType(ValueKind kind) { int LiftoffAssembler::SlotSizeForType(ValueKind kind) {
...@@ -1595,6 +1598,13 @@ void LiftoffAssembler::emit_i32_cond_jumpi(LiftoffCondition liftoff_cond, ...@@ -1595,6 +1598,13 @@ void LiftoffAssembler::emit_i32_cond_jumpi(LiftoffCondition liftoff_cond,
b(cond, label); b(cond, label);
} }
void LiftoffAssembler::emit_i32_subi_jump_negative(Register value,
int subtrahend,
Label* result_negative) {
SubS64(value, value, Operand(subtrahend), r0, LeaveOE, SetRC);
blt(result_negative, cr0);
}
void LiftoffAssembler::emit_i32_eqz(Register dst, Register src) { void LiftoffAssembler::emit_i32_eqz(Register dst, Register src) {
Label done; Label done;
CmpS32(src, Operand(0), r0); CmpS32(src, Operand(0), r0);
......
...@@ -74,17 +74,18 @@ inline constexpr bool UseSignedOp(LiftoffCondition liftoff_cond) { ...@@ -74,17 +74,18 @@ inline constexpr bool UseSignedOp(LiftoffCondition liftoff_cond) {
// -1 | 0xa: WASM | // -1 | 0xa: WASM |
// -2 | instance | // -2 | instance |
// -3 | feedback vector | // -3 | feedback vector |
// -4 | tiering budget |
// -----+--------------------+--------------------------- // -----+--------------------+---------------------------
// -4 | slot 0 (high) | ^ // -5 | slot 0 (high) | ^
// -5 | slot 0 (low) | | // -6 | slot 0 (low) | |
// -6 | slot 1 (high) | Frame slots // -7 | slot 1 (high) | Frame slots
// -7 | slot 1 (low) | | // -8 | slot 1 (low) | |
// | | v // | | v
// -----+--------------------+ <-- stack ptr (sp) // -----+--------------------+ <-- stack ptr (sp)
// //
constexpr int32_t kInstanceOffset = 2 * kSystemPointerSize; constexpr int32_t kInstanceOffset = 2 * kSystemPointerSize;
constexpr int kFeedbackVectorOffset = 3 * kSystemPointerSize; constexpr int kFeedbackVectorOffset = 3 * kSystemPointerSize;
constexpr int kTierupBudgetOffset = 4 * kSystemPointerSize;
inline MemOperand GetStackSlot(uint32_t offset) { inline MemOperand GetStackSlot(uint32_t offset) {
return MemOperand(fp, -offset); return MemOperand(fp, -offset);
} }
...@@ -199,7 +200,7 @@ void LiftoffAssembler::AbortCompilation() { AbortedCodeGeneration(); } ...@@ -199,7 +200,7 @@ void LiftoffAssembler::AbortCompilation() { AbortedCodeGeneration(); }
// static // static
constexpr int LiftoffAssembler::StaticStackFrameSize() { constexpr int LiftoffAssembler::StaticStackFrameSize() {
return liftoff::kFeedbackVectorOffset; return liftoff::kTierupBudgetOffset;
} }
int LiftoffAssembler::SlotSizeForType(ValueKind kind) { int LiftoffAssembler::SlotSizeForType(ValueKind kind) {
...@@ -2126,6 +2127,13 @@ void LiftoffAssembler::emit_i32_cond_jumpi(LiftoffCondition liftoff_cond, ...@@ -2126,6 +2127,13 @@ void LiftoffAssembler::emit_i32_cond_jumpi(LiftoffCondition liftoff_cond,
bind(&done); \ bind(&done); \
} }
void LiftoffAssembler::emit_i32_subi_jump_negative(Register value,
int subtrahend,
Label* result_negative) {
SubS64(value, value, Operand(subtrahend));
blt(result_negative);
}
void LiftoffAssembler::emit_i32_eqz(Register dst, Register src) { void LiftoffAssembler::emit_i32_eqz(Register dst, Register src) {
EMIT_EQZ(ltr, src); EMIT_EQZ(ltr, src);
} }
......
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