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

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

Issue 1072743002: [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 | « src/compiler/arm64/code-generator-arm64.cc ('k') | src/compiler/x64/code-generator-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/ia32/code-generator-ia32.cc
diff --git a/src/compiler/ia32/code-generator-ia32.cc b/src/compiler/ia32/code-generator-ia32.cc
index 447a8e3b1c75d7302a76c97ccf30543b44efbc57..298f53cca6337bcbba9f3cf6182f4a256555aa1f 100644
--- a/src/compiler/ia32/code-generator-ia32.cc
+++ b/src/compiler/ia32/code-generator-ia32.cc
@@ -1273,6 +1273,19 @@ void CodeGenerator::AssembleMove(InstructionOperand* source,
__ push(Operand(ebp, StandardFrameConstants::kContextOffset));
__ pop(dst);
}
+ } else if (info()->IsOptimizing() &&
+ src.is_identical_to(info()->closure())) {
+ // Loading the JSFunction from the frame is way cheaper than
+ // materializing the actual JSFunction heap object address.
+ if (destination->IsRegister()) {
+ Register dst = g.ToRegister(destination);
+ __ mov(dst, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
+ } else {
+ DCHECK(destination->IsStackSlot());
+ Operand dst = g.ToOperand(destination);
+ __ push(Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
+ __ pop(dst);
+ }
} else if (destination->IsRegister()) {
Register dst = g.ToRegister(destination);
__ LoadHeapObject(dst, src);
« no previous file with comments | « src/compiler/arm64/code-generator-arm64.cc ('k') | src/compiler/x64/code-generator-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698