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

Issue 227723002: VM: Implement closure calls as instance calls. (Closed)

Created:
6 years, 8 months ago by Florian Schneider
Modified:
6 years, 8 months ago
Reviewers:
zra, srdjan, Ivan Posva
CC:
reviews_dartlang.org, vm-dev_dartlang.org, zra
Visibility:
Public.

Description

VM: Implement closure calls as instance calls. Conceptually f() becomes f.call() where the .call method performs the actual closure call. The closure call itself is implemented without a stub. The check if the object called is a closure becomes a class-id check which can be hoisted out of loops. R=iposva@google.com, srdjan@google.com Committed: https://code.google.com/p/dart/source/detail?r=34917

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : fix optimized stack traces #

Patch Set 4 : minimal inlining tweaks #

Total comments: 8

Patch Set 5 : addressed comments #

Patch Set 6 : adjust inlining of dispatchers #

Unified diffs Side-by-side diffs Delta from patch set Stats (+223 lines, -441 lines) Patch
M runtime/vm/code_generator.h View 1 2 3 4 5 1 chunk +0 lines, -1 line 0 comments Download
M runtime/vm/code_generator.cc View 1 2 3 4 5 1 chunk +0 lines, -15 lines 0 comments Download
M runtime/vm/flow_graph_inliner.cc View 1 2 3 4 5 3 chunks +15 lines, -5 lines 0 comments Download
M runtime/vm/intermediate_language.h View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M runtime/vm/intermediate_language.cc View 1 2 3 4 5 1 chunk +7 lines, -0 lines 0 comments Download
M runtime/vm/intermediate_language_arm.cc View 1 2 3 4 5 1 chunk +39 lines, -17 lines 0 comments Download
M runtime/vm/intermediate_language_ia32.cc View 1 2 3 4 5 1 chunk +40 lines, -18 lines 0 comments Download
M runtime/vm/intermediate_language_mips.cc View 1 2 3 4 5 1 chunk +37 lines, -17 lines 0 comments Download
M runtime/vm/intermediate_language_x64.cc View 1 2 3 4 5 1 chunk +40 lines, -18 lines 0 comments Download
M runtime/vm/object.cc View 1 2 3 4 5 1 chunk +10 lines, -8 lines 0 comments Download
M runtime/vm/parser.h View 1 2 3 4 5 1 chunk +4 lines, -0 lines 0 comments Download
M runtime/vm/parser.cc View 1 2 3 4 5 5 chunks +29 lines, -14 lines 0 comments Download
M runtime/vm/stub_code.h View 1 2 3 4 5 1 chunk +0 lines, -1 line 0 comments Download
M runtime/vm/stub_code_arm.cc View 1 2 3 4 5 1 chunk +0 lines, -77 lines 0 comments Download
M runtime/vm/stub_code_arm64.cc View 1 2 3 4 5 1 chunk +0 lines, -5 lines 0 comments Download
M runtime/vm/stub_code_ia32.cc View 1 2 3 4 5 1 chunk +0 lines, -76 lines 0 comments Download
M runtime/vm/stub_code_mips.cc View 1 2 3 4 5 1 chunk +0 lines, -94 lines 0 comments Download
M runtime/vm/stub_code_x64.cc View 1 2 3 4 5 1 chunk +0 lines, -75 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
Florian Schneider
6 years, 8 months ago (2014-04-09 12:36:44 UTC) #1
srdjan
lgtm https://codereview.chromium.org/227723002/diff/60001/runtime/vm/flow_graph_inliner.cc File runtime/vm/flow_graph_inliner.cc (right): https://codereview.chromium.org/227723002/diff/60001/runtime/vm/flow_graph_inliner.cc#newcode476 runtime/vm/flow_graph_inliner.cc:476: InlineInstanceCalls(); Any reason for changing the order?
6 years, 8 months ago (2014-04-09 18:28:42 UTC) #2
srdjan
On 2014/04/09 18:28:42, srdjan wrote: > lgtm > > https://codereview.chromium.org/227723002/diff/60001/runtime/vm/flow_graph_inliner.cc > File runtime/vm/flow_graph_inliner.cc (right): > ...
6 years, 8 months ago (2014-04-09 18:29:51 UTC) #3
srdjan
6 years, 8 months ago (2014-04-09 18:31:54 UTC) #4
zra
https://codereview.chromium.org/227723002/diff/60001/runtime/vm/stub_code_arm.cc File runtime/vm/stub_code_arm.cc (left): https://codereview.chromium.org/227723002/diff/60001/runtime/vm/stub_code_arm.cc#oldcode739 runtime/vm/stub_code_arm.cc:739: void StubCode::GenerateCallClosureFunctionStub(Assembler* assembler) { Please also remove from arm64.
6 years, 8 months ago (2014-04-09 19:30:01 UTC) #5
Ivan Posva
I would like to get an answer for the decision to unconditionally dispatching in case ...
6 years, 8 months ago (2014-04-10 04:38:55 UTC) #6
Florian Schneider
On 2014/04/10 04:38:55, Ivan Posva wrote: > I would like to get an answer for ...
6 years, 8 months ago (2014-04-10 08:43:56 UTC) #7
Florian Schneider
https://codereview.chromium.org/227723002/diff/60001/runtime/vm/flow_graph_inliner.cc File runtime/vm/flow_graph_inliner.cc (right): https://codereview.chromium.org/227723002/diff/60001/runtime/vm/flow_graph_inliner.cc#newcode476 runtime/vm/flow_graph_inliner.cc:476: InlineInstanceCalls(); On 2014/04/09 18:28:43, srdjan wrote: > Any reason ...
6 years, 8 months ago (2014-04-10 08:49:25 UTC) #8
Florian Schneider
On 2014/04/09 18:29:51, srdjan wrote: > On 2014/04/09 18:28:42, srdjan wrote: > > lgtm > ...
6 years, 8 months ago (2014-04-10 08:54:38 UTC) #9
Florian Schneider
Committed patchset #6 manually as r34917 (presubmit successful).
6 years, 8 months ago (2014-04-10 10:56:36 UTC) #10
Ivan Posva
6 years, 8 months ago (2014-04-10 21:01:02 UTC) #11
Message was sent while issue was closed.
On 2014/04/10 08:43:56, Florian Schneider wrote:
> On 2014/04/10 04:38:55, Ivan Posva wrote:
> > I would like to get an answer for the decision to unconditionally
dispatching
> in
> > case of a signature function before this is ready for LGTM.
> > 
> 
> Where would I dispatch on a signature function?

Bad terminology on my part. I meant to say an invoke field dispatcher in
signature classes. It looks to me as if your commit now does check for the
dispatcher being named call before assuming closure calls.

-Ivan

> 
> > Thanks,
> > -Ivan
> > 
> > https://codereview.chromium.org/227723002/diff/60001/runtime/vm/object.cc
> > File runtime/vm/object.cc (right):
> > 
> >
>
https://codereview.chromium.org/227723002/diff/60001/runtime/vm/object.cc#new...
> > runtime/vm/object.cc:18044: } else if (function.is_visible() ||
> > FLAG_verbose_stacktrace) {
> > What if the function is not visible, but it has inlined a couple of frames
> that
> > are visible? Wouldn't we start dropping visible functions below?
> > 
> > Please fix in a separate CL.
> > 
> > https://codereview.chromium.org/227723002/diff/60001/runtime/vm/parser.cc
> > File runtime/vm/parser.cc (right):
> > 
> >
>
https://codereview.chromium.org/227723002/diff/60001/runtime/vm/parser.cc#new...
> > runtime/vm/parser.cc:1430: result = new ClosureCallNode(token_pos,
> getter_call,
> > args);
> > You might want to add a comment that this is where the call() method is
being
> > synthesized. Maybe even add that the function name is "call", no?
> > 
> > Actually, what if you end up dispatching on a different field from the
> signature
> > class?

Powered by Google App Engine
This is Rietveld 408576698