Commit 036e970d authored by Milad Fa's avatar Milad Fa Committed by Commit Bot

PPC/s390: [interpreter] Encode BytecodeSizes as uint8_t for better cache locality

Port 3965dcd5

Original Commit Message:

    This very slightly improves the performance of bytecode array visitors.

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

Change-Id: I7952fcacc72f4166c73885fd715950b319458209
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2656455Reviewed-by: 's avatarJunliang Yan <junyan@redhat.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#72406}
parent 62cdf3f9
......@@ -953,7 +953,7 @@ static void AdvanceBytecodeOffsetOrReturn(MacroAssembler* masm,
__ addi(bytecode_offset, bytecode_offset, Operand(1));
__ lbzx(bytecode, MemOperand(bytecode_array, bytecode_offset));
__ addi(bytecode_size_table, bytecode_size_table,
Operand(kIntSize * interpreter::Bytecodes::kBytecodeCount));
Operand(kByteSize * interpreter::Bytecodes::kBytecodeCount));
__ b(&process_bytecode);
__ bind(&extra_wide);
......@@ -961,7 +961,7 @@ static void AdvanceBytecodeOffsetOrReturn(MacroAssembler* masm,
__ addi(bytecode_offset, bytecode_offset, Operand(1));
__ lbzx(bytecode, MemOperand(bytecode_array, bytecode_offset));
__ addi(bytecode_size_table, bytecode_size_table,
Operand(2 * kIntSize * interpreter::Bytecodes::kBytecodeCount));
Operand(2 * kByteSize * interpreter::Bytecodes::kBytecodeCount));
// Load the size of the current bytecode.
__ bind(&process_bytecode);
......@@ -987,8 +987,7 @@ static void AdvanceBytecodeOffsetOrReturn(MacroAssembler* masm,
__ bind(&not_jump_loop);
// Otherwise, load the size of the current bytecode and advance the offset.
__ ShiftLeftImm(scratch3, bytecode, Operand(2));
__ lwzx(scratch3, MemOperand(bytecode_size_table, scratch3));
__ lbzx(scratch3, MemOperand(bytecode_size_table, bytecode));
__ add(bytecode_offset, bytecode_offset, scratch3);
__ bind(&end);
......
......@@ -1011,7 +1011,7 @@ static void AdvanceBytecodeOffsetOrReturn(MacroAssembler* masm,
__ AddS64(bytecode_offset, bytecode_offset, Operand(1));
__ LoadU8(bytecode, MemOperand(bytecode_array, bytecode_offset));
__ AddS64(bytecode_size_table, bytecode_size_table,
Operand(kIntSize * interpreter::Bytecodes::kBytecodeCount));
Operand(kByteSize * interpreter::Bytecodes::kBytecodeCount));
__ b(&process_bytecode);
__ bind(&extra_wide);
......@@ -1019,7 +1019,7 @@ static void AdvanceBytecodeOffsetOrReturn(MacroAssembler* masm,
__ AddS64(bytecode_offset, bytecode_offset, Operand(1));
__ LoadU8(bytecode, MemOperand(bytecode_array, bytecode_offset));
__ AddS64(bytecode_size_table, bytecode_size_table,
Operand(2 * kIntSize * interpreter::Bytecodes::kBytecodeCount));
Operand(2 * kByteSize * interpreter::Bytecodes::kBytecodeCount));
// Load the size of the current bytecode.
__ bind(&process_bytecode);
......@@ -1045,8 +1045,7 @@ static void AdvanceBytecodeOffsetOrReturn(MacroAssembler* masm,
__ bind(&not_jump_loop);
// Otherwise, load the size of the current bytecode and advance the offset.
__ ShiftLeftU64(scratch3, bytecode, Operand(2));
__ LoadU32(scratch3, MemOperand(bytecode_size_table, scratch3));
__ LoadU8(scratch3, MemOperand(bytecode_size_table, bytecode));
__ AddS64(bytecode_offset, bytecode_offset, scratch3);
__ bind(&end);
......
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