Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(368)

Unified Diff: src/compiler/ppc/code-generator-ppc.cc

Issue 1075303003: PPC: [turbofan] Load immortal heap objects from the heap roots. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698