Index: src/compiler/ppc/code-generator-ppc.cc |
diff --git a/src/compiler/ppc/code-generator-ppc.cc b/src/compiler/ppc/code-generator-ppc.cc |
index 2ebb840a9d290c6fbd748357920e9dba12b28f4d..8498a175ac466d9170eb95590176ed900507d57d 100644 |
--- a/src/compiler/ppc/code-generator-ppc.cc |
+++ b/src/compiler/ppc/code-generator-ppc.cc |
@@ -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); |
} |