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:
paul.lind 2015-04-14 09:39:49 -07:00 committed by Commit bot
parent 71d3213a3f
commit 592c0fe7b6
2 changed files with 12 additions and 22 deletions

View File

@ -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);
}

View File

@ -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);
}