Commit 65b0b2d7 authored by bjaideep's avatar bjaideep Committed by Commit bot

PPC/s390: Reland "[turbofan] Discard the shared code entry in the optimized code map."

Port ec132e05

Original commit message:

    (GcStress failure was unrelated.)

    At one time, we hoped to generate the same code for different
    native contexts. But in truth, much performance comes from optimizing
    on the native context. Now we abandon this pathway.

R=mvstanton@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com, mbrandy@us.ibm.com

BUG=
LOG=N

Review-Url: https://codereview.chromium.org/2401043002
Cr-Commit-Position: refs/heads/master@{#40092}
parent b072d014
......@@ -1398,7 +1398,6 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
// -----------------------------------
// First lookup code, maybe we don't need to compile!
Label gotta_call_runtime;
Label maybe_call_runtime;
Label try_shared;
Label loop_top, loop_bottom;
......@@ -1460,14 +1459,11 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
FieldMemOperand(array_pointer,
SharedFunctionInfo::kOffsetToPreviousCachedCode));
__ LoadP(entry, FieldMemOperand(entry, WeakCell::kValueOffset));
__ JumpIfSmi(entry, &maybe_call_runtime);
__ JumpIfSmi(entry, &try_shared);
// Found literals and code. Get them into the closure and return.
// Store code entry in the closure.
__ addi(entry, entry, Operand(Code::kHeaderSize - kHeapObjectTag));
Label install_optimized_code_and_tailcall;
__ bind(&install_optimized_code_and_tailcall);
__ StoreP(entry, FieldMemOperand(closure, JSFunction::kCodeEntryOffset), r0);
__ RecordWriteCodeEntryField(closure, entry, r8);
......@@ -1502,19 +1498,6 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
// We found neither literals nor code.
__ b(&gotta_call_runtime);
__ bind(&maybe_call_runtime);
// Last possibility. Check the context free optimized code map entry.
__ LoadP(entry,
FieldMemOperand(map, FixedArray::kHeaderSize +
SharedFunctionInfo::kSharedCodeIndex));
__ LoadP(entry, FieldMemOperand(entry, WeakCell::kValueOffset));
__ JumpIfSmi(entry, &try_shared);
// Store code entry in the closure.
__ addi(entry, entry, Operand(Code::kHeaderSize - kHeapObjectTag));
__ b(&install_optimized_code_and_tailcall);
__ bind(&try_shared);
// Is the full code valid?
__ LoadP(entry,
......
......@@ -1401,7 +1401,6 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
// -----------------------------------
// First lookup code, maybe we don't need to compile!
Label gotta_call_runtime;
Label maybe_call_runtime;
Label try_shared;
Label loop_top, loop_bottom;
......@@ -1463,14 +1462,11 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
FieldMemOperand(array_pointer,
SharedFunctionInfo::kOffsetToPreviousCachedCode));
__ LoadP(entry, FieldMemOperand(entry, WeakCell::kValueOffset));
__ JumpIfSmi(entry, &maybe_call_runtime);
__ JumpIfSmi(entry, &try_shared);
// Found literals and code. Get them into the closure and return.
// Store code entry in the closure.
__ AddP(entry, entry, Operand(Code::kHeaderSize - kHeapObjectTag));
Label install_optimized_code_and_tailcall;
__ bind(&install_optimized_code_and_tailcall);
__ StoreP(entry, FieldMemOperand(closure, JSFunction::kCodeEntryOffset), r0);
__ RecordWriteCodeEntryField(closure, entry, r7);
......@@ -1505,19 +1501,6 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
// We found neither literals nor code.
__ b(&gotta_call_runtime);
__ bind(&maybe_call_runtime);
// Last possibility. Check the context free optimized code map entry.
__ LoadP(entry,
FieldMemOperand(map, FixedArray::kHeaderSize +
SharedFunctionInfo::kSharedCodeIndex));
__ LoadP(entry, FieldMemOperand(entry, WeakCell::kValueOffset));
__ JumpIfSmi(entry, &try_shared);
// Store code entry in the closure.
__ AddP(entry, entry, Operand(Code::kHeaderSize - kHeapObjectTag));
__ b(&install_optimized_code_and_tailcall);
__ bind(&try_shared);
// Is the full code valid?
__ LoadP(entry,
......
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