Commit 8ad33d6d authored by mbrandy's avatar mbrandy Committed by Commit bot

PPC: [turbofan] Load immortal heap objects from the heap roots.

Port 5d2de78a

Original commit message:
It's cheaper to materialize heap constants by loading from the roots
array instead of embedding the constant into the instruction stream, at
least on x64, arm and arm64.

Drive-by-fix: Also cleanup the materialize constant from frame
optimization.

R=michael_dawson@ca.ibm.com
BUG=

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

Cr-Commit-Position: refs/heads/master@{#27823}
parent 3eb277f2
......@@ -1350,18 +1350,12 @@ void CodeGenerator::AssembleMove(InstructionOperand* source,
break;
case Constant::kHeapObject: {
Handle<HeapObject> src_object = src.ToHeapObject();
if (info()->IsOptimizing() &&
src_object.is_identical_to(info()->context())) {
// Loading the context from the frame is way cheaper than
// materializing the actual context heap object address.
__ LoadP(dst,
MemOperand(fp, StandardFrameConstants::kContextOffset));
} else if (info()->IsOptimizing() &&
src_object.is_identical_to(info()->closure())) {
// Loading the JSFunction from the frame is way cheaper than
// materializing the actual JSFunction heap object address.
__ LoadP(dst,
MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
Heap::RootListIndex index;
int offset;
if (IsMaterializableFromFrame(src_object, &offset)) {
__ LoadP(dst, MemOperand(fp, offset));
} else if (IsMaterializableFromRoot(src_object, &index)) {
__ LoadRoot(dst, index);
} else {
__ Move(dst, src_object);
}
......
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