Commit 592c0fe7 authored by paul.lind's avatar paul.lind Committed by Commit bot

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

Port 5d2de78a

BUG=

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

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