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

Issue 10825035: Add an explicit push-argument instruction to the IL. (Closed)

Created:
8 years, 4 months ago by Florian Schneider
Modified:
8 years, 4 months ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Add an explicit push-argument instruction to the IL. It is used in ClosureCall and CreateClosure. Refactoring the other call-instruction will be done in a separate CL. These instructions do not have their arguments as input operands anymore since they are really call-arguments passed on the stack. This allows us to optimize a function with closure calls with SSA. For example: foo() { bar() { return 42; } return bar(); } Committed: https://code.google.com/p/dart/source/detail?r=9935

Patch Set 1 #

Total comments: 8

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+146 lines, -39 lines) Patch
M vm/flow_graph_builder.h View 1 chunk +2 lines, -0 lines 0 comments Download
M vm/flow_graph_builder.cc View 1 4 chunks +32 lines, -8 lines 0 comments Download
M vm/flow_graph_compiler.cc View 1 1 chunk +3 lines, -1 line 0 comments Download
M vm/flow_graph_compiler_ia32.h View 1 chunk +3 lines, -0 lines 0 comments Download
M vm/flow_graph_compiler_x64.h View 1 chunk +3 lines, -0 lines 0 comments Download
M vm/il_printer.cc View 1 4 chunks +18 lines, -6 lines 0 comments Download
M vm/intermediate_language.h View 1 6 chunks +41 lines, -18 lines 0 comments Download
M vm/intermediate_language.cc View 1 4 chunks +44 lines, -6 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Florian Schneider
8 years, 4 months ago (2012-07-26 12:38:03 UTC) #1
Kevin Millikin (Google)
LGTM. https://chromiumcodereview.appspot.com/10825035/diff/1/vm/flow_graph_builder.cc File vm/flow_graph_builder.cc (right): https://chromiumcodereview.appspot.com/10825035/diff/1/vm/flow_graph_builder.cc#newcode1394 vm/flow_graph_builder.cc:1394: ReturnComputation(new CreateClosureComp(node, owner()->try_index())); I imagine we'll also want ...
8 years, 4 months ago (2012-07-26 13:03:18 UTC) #2
Florian Schneider
8 years, 4 months ago (2012-07-26 13:45:22 UTC) #3
https://chromiumcodereview.appspot.com/10825035/diff/1/vm/flow_graph_builder.cc
File vm/flow_graph_builder.cc (right):

https://chromiumcodereview.appspot.com/10825035/diff/1/vm/flow_graph_builder....
vm/flow_graph_builder.cc:1394: ReturnComputation(new CreateClosureComp(node,
owner()->try_index()));
On 2012/07/26 13:03:18, kmillikin wrote:
> I imagine we'll also want a list of the push argument instructions here (e.g.,
> for inlining) so we don't have to go searching for them or simulate the
argument
> stack.

Done.

https://chromiumcodereview.appspot.com/10825035/diff/1/vm/flow_graph_compiler.cc
File vm/flow_graph_compiler.cc (right):

https://chromiumcodereview.appspot.com/10825035/diff/1/vm/flow_graph_compiler...
vm/flow_graph_compiler.cc:602: if (!instr->IsPushArgument()) Pop(reg,
instr->InputAt(i));
On 2012/07/26 13:03:18, kmillikin wrote:
> This deserves some small comment like: "Inputs are consumed immediately at
their
> use except for outgoing arguments, which are consumed after the call is
> completed."

Done.

https://chromiumcodereview.appspot.com/10825035/diff/1/vm/intermediate_langua...
File vm/intermediate_language.cc (left):

https://chromiumcodereview.appspot.com/10825035/diff/1/vm/intermediate_langua...
vm/intermediate_language.cc:1118: ASSERT(VerifyCallComputation(this));
On 2012/07/26 13:03:18, kmillikin wrote:
> We can still do this, can't we?  Or do you think it's not useful anymore?

With the new way of handling arguments, the argument expressions won't have
consecutive temp-indices anymore.

https://chromiumcodereview.appspot.com/10825035/diff/1/vm/intermediate_langua...
File vm/intermediate_language.cc (right):

https://chromiumcodereview.appspot.com/10825035/diff/1/vm/intermediate_langua...
vm/intermediate_language.cc:1334: // where PushArgument is handled in
EmitInstructionPrologue.
On 2012/07/26 13:03:18, kmillikin wrote:
> Comment is a bit off.  It's not handled in EmitInstructionPrologue but in
> FrameRegisterAllocator::AllocateRegisters.  There it's handled by leaving its
> input on the (simulated) frame and relying on the call to spill all registers.

Done.

Powered by Google App Engine
This is Rietveld 408576698