Commit 7d52258b authored by bjaideep's avatar bjaideep Committed by Commit bot

PPC/s390: [Ignition] Teach CompileLazy about interpreted functions.

Port 72c37076

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.

R=rmcilroy@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=v8:4380
LOG=N

Review-Url: https://codereview.chromium.org/2602383003
Cr-Commit-Position: refs/heads/master@{#42046}
parent 199af0ab
......@@ -1456,13 +1456,14 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
SharedFunctionInfo::kMarkedForTierUpByteOffset));
__ TestBit(r8, SharedFunctionInfo::kMarkedForTierUpBitWithinByte, r0);
__ bne(&gotta_call_runtime, cr0);
// Is the full code valid?
// If SFI points to anything other than CompileLazy, install that.
__ LoadP(entry, FieldMemOperand(entry, SharedFunctionInfo::kCodeOffset));
__ lwz(r8, FieldMemOperand(entry, Code::kFlagsOffset));
__ DecodeField<Code::KindField>(r8);
__ cmpi(r8, Operand(Code::BUILTIN));
__ mov(r8, Operand(masm->CodeObject()));
__ cmp(entry, r8);
__ beq(&gotta_call_runtime);
// Yes, install the full code.
// Install the SFI's code entry.
__ addi(entry, entry, Operand(Code::kHeaderSize - kHeapObjectTag));
__ StoreP(entry, FieldMemOperand(closure, JSFunction::kCodeEntryOffset), r0);
__ RecordWriteCodeEntryField(closure, entry, r8);
......
......@@ -1461,13 +1461,14 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
entry, SharedFunctionInfo::kMarkedForTierUpByteOffset));
__ TestBit(temp, SharedFunctionInfo::kMarkedForTierUpBitWithinByte, r0);
__ bne(&gotta_call_runtime);
// Is the full code valid?
// If SFI points to anything other than CompileLazy, install that.
__ LoadP(entry, FieldMemOperand(entry, SharedFunctionInfo::kCodeOffset));
__ LoadlW(r7, FieldMemOperand(entry, Code::kFlagsOffset));
__ DecodeField<Code::KindField>(r7);
__ CmpP(r7, Operand(Code::BUILTIN));
__ mov(r7, Operand(masm->CodeObject()));
__ CmpP(entry, r7);
__ beq(&gotta_call_runtime);
// Yes, install the full code.
// Install the SFI's code entry.
__ AddP(entry, entry, Operand(Code::kHeaderSize - kHeapObjectTag));
__ StoreP(entry, FieldMemOperand(closure, JSFunction::kCodeEntryOffset), r0);
__ RecordWriteCodeEntryField(closure, entry, r7);
......
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