Commit eb89a753 authored by zhengxing.li's avatar zhengxing.li Committed by Commit bot

X87: [Interpreter] Make dispatch table point to code entry instead of code objects.

  port 0c05e02f (r35480)

  original commit message:
  Modifies Ignition to store code entry addresses in the dispatch table
  rather than code objects. This allows the interpreter to avoid
  calculating the code entry address from the code object on every
  dispatch and provides a ~5-7% performance improvement on Octane with
  Ignition.

  This change adds ArchOpcode::kArchTailCallAddress to TurboFan to enable
  tail call dispatch using these code addresses. It also adds a Dispatch
  linkage creator (distinct from the stub linkage type used previously) to
  allow targetting a code address target (which will diverge further from
  the stub linkage type when we remove the context machine register in
  Ignition).

BUG=

Review URL: https://codereview.chromium.org/1893243002

Cr-Commit-Position: refs/heads/master@{#35561}
parent 1ff65e99
......@@ -506,6 +506,15 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
frame_access_state()->ClearSPDelta();
break;
}
case kArchTailCallAddress: {
int stack_param_delta = i.InputInt32(instr->InputCount() - 1);
AssembleDeconstructActivationRecord(stack_param_delta);
CHECK(!HasImmediateInput(instr, 0));
Register reg = i.InputRegister(0);
__ jmp(reg);
frame_access_state()->ClearSPDelta();
break;
}
case kArchCallJSFunction: {
EnsureSpaceForLazyDeopt();
Register func = i.InputRegister(0);
......
......@@ -607,9 +607,6 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
kInterpreterBytecodeOffsetRegister, times_1, 0));
__ mov(ebx, Operand(kInterpreterDispatchTableRegister, ebx,
times_pointer_size, 0));
// TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging
// and header removal.
__ add(ebx, Immediate(Code::kHeaderSize - kHeapObjectTag));
__ call(ebx);
// Even though the first bytecode handler was called, we will never return.
......@@ -768,10 +765,6 @@ static void Generate_EnterBytecodeDispatch(MacroAssembler* masm) {
kInterpreterBytecodeOffsetRegister, times_1, 0));
__ mov(ebx, Operand(kInterpreterDispatchTableRegister, ebx,
times_pointer_size, 0));
// TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging
// and header removal.
__ add(ebx, Immediate(Code::kHeaderSize - kHeapObjectTag));
__ jmp(ebx);
}
......
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