[mips][wasm] Implement patching of far jump table

Port 0a8ddb134c

Original Commit Message:

    If the jump is too large for a near jump, we patch the far jump table
    instead, and patch the (near) jump table to jump to the far jump table
    slot.

Change-Id: Id9f12dee885b369a4946642301720d110dfe4f31
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1803641
Auto-Submit: Mu Tao <pamilty@gmail.com>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63781}
This commit is contained in:
Mu Tao 2019-09-16 14:06:52 +08:00 committed by Commit Bot
parent bb0d4eda0f
commit f97f266d92

View File

@ -234,14 +234,20 @@ void JumpTableAssembler::EmitLazyCompileJumpSlot(uint32_t func_index,
for (int i = 0; i < nop_bytes; i += kInstrSize) nop();
}
void JumpTableAssembler::EmitJumpSlot(Address target) {
bool JumpTableAssembler::EmitJumpSlot(Address target) {
Jump(target, RelocInfo::NONE);
return true;
}
void JumpTableAssembler::EmitFarJumpSlot(Address target) {
JumpToInstructionStream(target);
}
// static
void JumpTableAssembler::PatchFarJumpSlot(Address slot, Address target) {
UNREACHABLE();
}
void JumpTableAssembler::NopBytes(int bytes) {
DCHECK_LE(0, bytes);
DCHECK_EQ(0, bytes % kInstrSize);