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

Issue 178233003: Allocate instance closures similarly to regular closures, i.e. without a (Closed)

Created:
6 years, 10 months ago by regis
Modified:
6 years, 9 months ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Allocate instance closures similarly to regular closures, i.e. without a specific stub and runtime call. R=fschneider@google.com Committed: https://code.google.com/p/dart/source/detail?r=33074

Patch Set 1 #

Total comments: 6

Patch Set 2 : #

Total comments: 1

Patch Set 3 : #

Total comments: 3

Patch Set 4 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+125 lines, -984 lines) Patch
M runtime/vm/code_generator.h View 1 2 3 1 chunk +0 lines, -2 lines 0 comments Download
M runtime/vm/code_generator.cc View 1 2 3 1 chunk +0 lines, -47 lines 0 comments Download
M runtime/vm/flow_graph_builder.cc View 1 2 3 1 chunk +115 lines, -117 lines 0 comments Download
M runtime/vm/flow_graph_inliner.cc View 1 2 3 1 chunk +0 lines, -5 lines 0 comments Download
M runtime/vm/flow_graph_optimizer.cc View 1 2 3 1 chunk +0 lines, -6 lines 0 comments Download
M runtime/vm/flow_graph_type_propagator.cc View 1 2 3 1 chunk +0 lines, -9 lines 0 comments Download
M runtime/vm/il_printer.cc View 1 2 3 2 chunks +6 lines, -9 lines 0 comments Download
M runtime/vm/intermediate_language.h View 1 2 3 3 chunks +2 lines, -38 lines 0 comments Download
M runtime/vm/intermediate_language_arm.cc View 1 2 3 1 chunk +0 lines, -19 lines 0 comments Download
M runtime/vm/intermediate_language_ia32.cc View 1 2 3 1 chunk +0 lines, -19 lines 0 comments Download
M runtime/vm/intermediate_language_mips.cc View 1 2 3 1 chunk +0 lines, -20 lines 0 comments Download
M runtime/vm/intermediate_language_x64.cc View 1 2 3 1 chunk +0 lines, -19 lines 0 comments Download
M runtime/vm/object.h View 1 2 3 2 chunks +0 lines, -8 lines 0 comments Download
M runtime/vm/object.cc View 1 2 3 2 chunks +0 lines, -28 lines 0 comments Download
M runtime/vm/raw_object.h View 1 2 3 1 chunk +2 lines, -5 lines 0 comments Download
M runtime/vm/stub_code.h View 1 2 3 2 chunks +0 lines, -3 lines 0 comments Download
M runtime/vm/stub_code.cc View 1 2 3 1 chunk +0 lines, -19 lines 0 comments Download
M runtime/vm/stub_code_arm.cc View 1 2 3 1 chunk +0 lines, -150 lines 0 comments Download
M runtime/vm/stub_code_ia32.cc View 1 2 3 1 chunk +0 lines, -153 lines 0 comments Download
M runtime/vm/stub_code_mips.cc View 1 2 3 1 chunk +0 lines, -154 lines 0 comments Download
M runtime/vm/stub_code_x64.cc View 1 2 3 1 chunk +0 lines, -154 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
Florian Schneider
https://codereview.chromium.org/178233003/diff/1/runtime/vm/flow_graph_builder.cc File runtime/vm/flow_graph_builder.cc (right): https://codereview.chromium.org/178233003/diff/1/runtime/vm/flow_graph_builder.cc#newcode2389 runtime/vm/flow_graph_builder.cc:2389: node->receiver()->Visit(&for_receiver); Is there a dependency on the evaluation order ...
6 years, 10 months ago (2014-02-24 18:50:23 UTC) #1
regis
https://codereview.chromium.org/178233003/diff/1/runtime/vm/flow_graph_builder.cc File runtime/vm/flow_graph_builder.cc (right): https://codereview.chromium.org/178233003/diff/1/runtime/vm/flow_graph_builder.cc#newcode2389 runtime/vm/flow_graph_builder.cc:2389: node->receiver()->Visit(&for_receiver); On 2014/02/24 18:50:23, Florian Schneider wrote: > Is ...
6 years, 10 months ago (2014-02-24 19:01:30 UTC) #2
regis
Next draft uploaded. The corresponding flow graph is below. I do not see anything obviously ...
6 years, 10 months ago (2014-02-24 22:09:03 UTC) #3
Florian Schneider
https://codereview.chromium.org/178233003/diff/50001/runtime/vm/flow_graph_builder.cc File runtime/vm/flow_graph_builder.cc (right): https://codereview.chromium.org/178233003/diff/50001/runtime/vm/flow_graph_builder.cc#newcode2389 runtime/vm/flow_graph_builder.cc:2389: Value* context_tmp_val = Bind(new LoadLocalInstr(*context_tmp_var)); In StoreVMFieldInstr the order ...
6 years, 10 months ago (2014-02-25 09:21:15 UTC) #4
regis
On 2014/02/25 09:21:15, Florian Schneider wrote: > https://codereview.chromium.org/178233003/diff/50001/runtime/vm/flow_graph_builder.cc > File runtime/vm/flow_graph_builder.cc (right): > > https://codereview.chromium.org/178233003/diff/50001/runtime/vm/flow_graph_builder.cc#newcode2389 ...
6 years, 10 months ago (2014-02-25 17:35:12 UTC) #5
regis
Now ready for review. Thanks, Regis
6 years, 10 months ago (2014-02-25 23:40:02 UTC) #6
Ivan Posva
-Ivan https://codereview.chromium.org/178233003/diff/70001/runtime/vm/flow_graph_builder.cc File runtime/vm/flow_graph_builder.cc (right): https://codereview.chromium.org/178233003/diff/70001/runtime/vm/flow_graph_builder.cc#newcode2287 runtime/vm/flow_graph_builder.cc:2287: const Field& function_field = In a separate CL ...
6 years, 10 months ago (2014-02-26 05:16:02 UTC) #7
Florian Schneider
LGTM. https://codereview.chromium.org/178233003/diff/70001/runtime/vm/flow_graph_builder.cc File runtime/vm/flow_graph_builder.cc (right): https://codereview.chromium.org/178233003/diff/70001/runtime/vm/flow_graph_builder.cc#newcode2287 runtime/vm/flow_graph_builder.cc:2287: const Field& function_field = On 2014/02/26 05:16:02, Ivan ...
6 years, 10 months ago (2014-02-26 11:46:06 UTC) #8
regis
On 2014/02/26 11:46:06, Florian Schneider wrote: > LGTM. > > https://codereview.chromium.org/178233003/diff/70001/runtime/vm/flow_graph_builder.cc > File runtime/vm/flow_graph_builder.cc (right): ...
6 years, 10 months ago (2014-02-26 18:38:14 UTC) #9
regis
Committed patchset #4 manually as r33074 (presubmit successful).
6 years, 10 months ago (2014-02-26 18:38:58 UTC) #10
Ivan Posva
Filed http://dartbug.com/17160 -Ivan https://codereview.chromium.org/178233003/diff/70001/runtime/vm/flow_graph_builder.cc File runtime/vm/flow_graph_builder.cc (right): https://codereview.chromium.org/178233003/diff/70001/runtime/vm/flow_graph_builder.cc#newcode2287 runtime/vm/flow_graph_builder.cc:2287: const Field& function_field = On 2014/02/26 ...
6 years, 9 months ago (2014-02-27 18:12:33 UTC) #11
Florian Schneider
6 years, 9 months ago (2014-02-28 10:46:51 UTC) #12
Message was sent while issue was closed.
On 2014/02/27 18:12:33, Ivan Posva wrote:
> Filed http://dartbug.com/17160
> 
> -Ivan
> 
>
https://codereview.chromium.org/178233003/diff/70001/runtime/vm/flow_graph_bu...
> File runtime/vm/flow_graph_builder.cc (right):
> 
>
https://codereview.chromium.org/178233003/diff/70001/runtime/vm/flow_graph_bu...
> runtime/vm/flow_graph_builder.cc:2287: const Field& function_field =
> On 2014/02/26 11:46:07, Florian Schneider wrote:
> > On 2014/02/26 05:16:02, Ivan Posva wrote:
> > > In a separate CL we should make these singletons in the isolate or even
> better
> > > in the VM isolate.
> > 
> > I would just allocate one instance per compilation and attach them to the
flow
> > graph for example.
> > 
> > Why make them permanent in the VM isolate? Since they are only attached to
the
> > IL during compilation and used for load elimination and allocation sinking,
> they
> > can be GCed after compilation finished.
> 
> Florian, the code below is technically wrong. The field it is referencing are
> not part of the class it is using to define them alloc-cls() is the signature
> class, but the fields are really defined in the super class. So I still say
> these two fields could be pre-allocated at startup and added to the object
store
> without having to ever allocate them again.

How is it technically wrong? I think it would be _ok_ to add them to
FunctionImpl, but it is not needed for correctness of code generation - If you
want those fields to detected by reflection, then they should be real fields
linked to the FunctionImpl class.

Otherwise, if that is not needed they really just serve for memory
disambiguation in load elimination, so one instance per compilation unit would
be fine. For the compiler, they are just a wrapper for an offset and some
properties (like immutability for finals, etc.) Instead we could actually just
do LoadField from the corresponding offset without ever allocating a field.

Powered by Google App Engine
This is Rietveld 408576698