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

X87: [Ignition] Teach CompileLazy about interpreted functions.

  port 72c37076(r42034)

  original commit message:
  Currently the CompileLazy builtin checks the SFI expliciltly for FCG code. This means
  if the SFI has bytecode we have to go through to the runtime to install the
  interpreter entry trampoline into the JSFunction object.

  Modify the builtin to always put the SFI code object into the JSFunction unless it's
  the lazy compile stub on the SFI as well.

BUG=

Review-Url: https://codereview.chromium.org/2614533003
Cr-Commit-Position: refs/heads/master@{#42081}
parent 07a6449f
......@@ -1123,14 +1123,14 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
__ test_b(FieldOperand(entry, SharedFunctionInfo::kMarkedForTierUpByteOffset),
Immediate(1 << SharedFunctionInfo::kMarkedForTierUpBitWithinByte));
__ j(not_zero, &gotta_call_runtime_no_stack);
// Is the full code valid?
// If SFI points to anything other than CompileLazy, install that.
__ mov(entry, FieldOperand(entry, SharedFunctionInfo::kCodeOffset));
__ mov(ebx, FieldOperand(entry, Code::kFlagsOffset));
__ and_(ebx, Code::KindField::kMask);
__ shr(ebx, Code::KindField::kShift);
__ cmp(ebx, Immediate(Code::BUILTIN));
__ Move(ebx, masm->CodeObject());
__ cmp(entry, ebx);
__ j(equal, &gotta_call_runtime_no_stack);
// Yes, install the full code.
// Install the SFI's code entry.
__ lea(entry, FieldOperand(entry, Code::kHeaderSize));
__ mov(FieldOperand(closure, JSFunction::kCodeEntryOffset), entry);
__ RecordWriteCodeEntryField(closure, entry, 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