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

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

Issue 1078183002: PPC: [turbofan] Materialize JSFunction from frame if possible. (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 8644c36941776acc47c62446a25b9a00c4697016..2ebb840a9d290c6fbd748357920e9dba12b28f4d 100644
--- a/src/compiler/ppc/code-generator-ppc.cc
+++ b/src/compiler/ppc/code-generator-ppc.cc
@@ -1348,9 +1348,25 @@ void CodeGenerator::AssembleMove(InstructionOperand* source,
case Constant::kExternalReference:
__ mov(dst, Operand(src.ToExternalReference()));
break;
- case Constant::kHeapObject:
- __ Move(dst, src.ToHeapObject());
+ 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));
+ } else {
+ __ Move(dst, src_object);
+ }
break;
+ }
case Constant::kRpoNumber:
UNREACHABLE(); // TODO(dcarney): loading RPO constants on PPC.
break;
« 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