MIPS: [turbofan] Load immortal heap objects from the heap roots.
Port 5d2de78a77
BUG=
Review URL: https://codereview.chromium.org/1085693003
Cr-Commit-Position: refs/heads/master@{#27825}
This commit is contained in:
parent
71d3213a3f
commit
592c0fe7b6
@ -1140,17 +1140,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.
|
||||
__ lw(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.
|
||||
__ lw(dst,
|
||||
MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
|
||||
Heap::RootListIndex index;
|
||||
int offset;
|
||||
if (IsMaterializableFromFrame(src_object, &offset)) {
|
||||
__ lw(dst, MemOperand(fp, offset));
|
||||
} else if (IsMaterializableFromRoot(src_object, &index)) {
|
||||
__ LoadRoot(dst, index);
|
||||
} else {
|
||||
__ li(dst, src_object);
|
||||
}
|
||||
|
@ -1206,17 +1206,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.
|
||||
__ ld(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.
|
||||
__ ld(dst,
|
||||
MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
|
||||
Heap::RootListIndex index;
|
||||
int offset;
|
||||
if (IsMaterializableFromFrame(src_object, &offset)) {
|
||||
__ ld(dst, MemOperand(fp, offset));
|
||||
} else if (IsMaterializableFromRoot(src_object, &index)) {
|
||||
__ LoadRoot(dst, index);
|
||||
} else {
|
||||
__ li(dst, src_object);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user