Skip to content

Commit

Permalink
[mips][interpreter] Encode BytecodeSizes as uint8_t for better cache …
Browse files Browse the repository at this point in the history
…locality

Port: 3965dcd

Change-Id: I84064ebcffde490a44a341f0e65a3715746ca693
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2658655
Reviewed-by: Zhao Jiazhong <[email protected]>
Commit-Queue: Zhao Jiazhong <[email protected]>
Auto-Submit: Liu yu <[email protected]>
Cr-Commit-Position: refs/heads/master@{#72419}
  • Loading branch information
LiuYu396 authored and Commit Bot committed Jan 29, 2021
1 parent f09c383 commit 0fa7161
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/builtins/mips/builtins-mips.cc
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ static void AdvanceBytecodeOffsetOrReturn(MacroAssembler* masm,
__ Addu(scratch2, bytecode_array, bytecode_offset);
__ lbu(bytecode, MemOperand(scratch2));
__ Addu(bytecode_size_table, bytecode_size_table,
Operand(kIntSize * interpreter::Bytecodes::kBytecodeCount));
Operand(kByteSize * interpreter::Bytecodes::kBytecodeCount));
__ jmp(&process_bytecode);

__ bind(&extra_wide);
Expand All @@ -921,7 +921,7 @@ static void AdvanceBytecodeOffsetOrReturn(MacroAssembler* masm,
__ Addu(scratch2, bytecode_array, bytecode_offset);
__ lbu(bytecode, MemOperand(scratch2));
__ Addu(bytecode_size_table, bytecode_size_table,
Operand(2 * kIntSize * interpreter::Bytecodes::kBytecodeCount));
Operand(2 * kByteSize * interpreter::Bytecodes::kBytecodeCount));

__ bind(&process_bytecode);

Expand All @@ -944,8 +944,8 @@ static void AdvanceBytecodeOffsetOrReturn(MacroAssembler* masm,

__ bind(&not_jump_loop);
// Otherwise, load the size of the current bytecode and advance the offset.
__ Lsa(scratch2, bytecode_size_table, bytecode, 2);
__ lw(scratch2, MemOperand(scratch2));
__ Addu(scratch2, bytecode_size_table, bytecode);
__ lb(scratch2, MemOperand(scratch2));
__ Addu(bytecode_offset, bytecode_offset, scratch2);

__ bind(&end);
Expand Down
8 changes: 4 additions & 4 deletions src/builtins/mips64/builtins-mips64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ static void AdvanceBytecodeOffsetOrReturn(MacroAssembler* masm,
__ Daddu(scratch2, bytecode_array, bytecode_offset);
__ Lbu(bytecode, MemOperand(scratch2));
__ Daddu(bytecode_size_table, bytecode_size_table,
Operand(kIntSize * interpreter::Bytecodes::kBytecodeCount));
Operand(kByteSize * interpreter::Bytecodes::kBytecodeCount));
__ jmp(&process_bytecode);

__ bind(&extra_wide);
Expand All @@ -937,7 +937,7 @@ static void AdvanceBytecodeOffsetOrReturn(MacroAssembler* masm,
__ Daddu(scratch2, bytecode_array, bytecode_offset);
__ Lbu(bytecode, MemOperand(scratch2));
__ Daddu(bytecode_size_table, bytecode_size_table,
Operand(2 * kIntSize * interpreter::Bytecodes::kBytecodeCount));
Operand(2 * kByteSize * interpreter::Bytecodes::kBytecodeCount));

__ bind(&process_bytecode);

Expand All @@ -960,8 +960,8 @@ static void AdvanceBytecodeOffsetOrReturn(MacroAssembler* masm,

__ bind(&not_jump_loop);
// Otherwise, load the size of the current bytecode and advance the offset.
__ Dlsa(scratch2, bytecode_size_table, bytecode, 2);
__ Lw(scratch2, MemOperand(scratch2));
__ Daddu(scratch2, bytecode_size_table, bytecode);
__ Lb(scratch2, MemOperand(scratch2));
__ Daddu(bytecode_offset, bytecode_offset, scratch2);

__ bind(&end);
Expand Down

0 comments on commit 0fa7161

Please sign in to comment.