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

Issue 1343383003: VM: Store edge counters in one per-function array. (Closed)

Created:
5 years, 3 months ago by Florian Schneider
Modified:
5 years, 2 months ago
Reviewers:
srdjan, siva, Ivan Posva
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Base URL:
git@github.com:dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

VM: Store edge counters in one per-function array. Reserve first element in the Function's ic_data_array to hold the edge counter array. Until now we had a one-element array per edge counter. This reduces memory used by edge counters. This CL allows to optimize code without having to have the unoptimized code present. Also, save space in Instruction by making place_id_ and lifetime_position_ a union. place_id_ is exclusively needed by Load/StoreOptimizer, lifetime_position by the FlowGraphAllocator. BUG= R=asiva@google.com Committed: https://github.com/dart-lang/sdk/commit/4a653d9e17c60f00d4600afdf27b2b57283eeaed

Patch Set 1 #

Patch Set 2 : clean up comments, save space in IL Instruction class. #

Total comments: 11

Patch Set 3 : addressed comments #

Patch Set 4 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+130 lines, -420 lines) Patch
M runtime/vm/block_scheduler.cc View 1 2 3 chunks +17 lines, -56 lines 0 comments Download
M runtime/vm/code_patcher.h View 1 2 1 chunk +0 lines, -2 lines 0 comments Download
M runtime/vm/code_patcher_arm.cc View 1 2 1 chunk +0 lines, -42 lines 0 comments Download
M runtime/vm/code_patcher_arm64.cc View 1 2 1 chunk +0 lines, -42 lines 0 comments Download
M runtime/vm/code_patcher_ia32.cc View 1 2 1 chunk +0 lines, -29 lines 0 comments Download
M runtime/vm/code_patcher_mips.cc View 1 2 1 chunk +0 lines, -42 lines 0 comments Download
M runtime/vm/code_patcher_x64.cc View 1 2 1 chunk +0 lines, -32 lines 0 comments Download
M runtime/vm/compiler.cc View 1 2 3 2 chunks +3 lines, -12 lines 0 comments Download
M runtime/vm/flow_graph_compiler.h View 1 2 3 chunks +7 lines, -5 lines 0 comments Download
M runtime/vm/flow_graph_compiler.cc View 1 2 3 3 chunks +19 lines, -6 lines 0 comments Download
M runtime/vm/flow_graph_compiler_arm.cc View 1 2 3 1 chunk +5 lines, -18 lines 0 comments Download
M runtime/vm/flow_graph_compiler_arm64.cc View 1 2 3 1 chunk +5 lines, -6 lines 0 comments Download
M runtime/vm/flow_graph_compiler_ia32.cc View 1 2 3 1 chunk +4 lines, -19 lines 0 comments Download
M runtime/vm/flow_graph_compiler_mips.cc View 1 2 3 1 chunk +5 lines, -6 lines 0 comments Download
M runtime/vm/flow_graph_compiler_x64.cc View 1 2 3 1 chunk +4 lines, -19 lines 0 comments Download
M runtime/vm/flow_graph_inliner.cc View 1 chunk +0 lines, -7 lines 0 comments Download
M runtime/vm/intermediate_language.h View 1 5 chunks +11 lines, -5 lines 0 comments Download
M runtime/vm/intermediate_language.cc View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M runtime/vm/intermediate_language_arm.cc View 1 2 1 chunk +2 lines, -5 lines 0 comments Download
M runtime/vm/intermediate_language_arm64.cc View 1 2 1 chunk +2 lines, -5 lines 0 comments Download
M runtime/vm/intermediate_language_ia32.cc View 1 2 1 chunk +2 lines, -5 lines 0 comments Download
M runtime/vm/intermediate_language_mips.cc View 1 2 1 chunk +2 lines, -5 lines 0 comments Download
M runtime/vm/intermediate_language_x64.cc View 1 2 1 chunk +2 lines, -5 lines 0 comments Download
M runtime/vm/isolate.h View 1 2 3 2 chunks +0 lines, -10 lines 0 comments Download
M runtime/vm/isolate.cc View 1 2 3 1 chunk +0 lines, -1 line 0 comments Download
M runtime/vm/object.h View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M runtime/vm/object.cc View 1 2 3 2 chunks +36 lines, -34 lines 0 comments Download

Messages

Total messages: 9 (2 generated)
Florian Schneider
This should allow compiling optimized functions without having to generate unoptimized code first.
5 years, 3 months ago (2015-09-17 11:04:23 UTC) #2
srdjan
DBC https://codereview.chromium.org/1343383003/diff/20001/runtime/vm/block_scheduler.cc File runtime/vm/block_scheduler.cc (right): https://codereview.chromium.org/1343383003/diff/20001/runtime/vm/block_scheduler.cc#newcode15 runtime/vm/block_scheduler.cc:15: // Compute the edge count at the deopt ...
5 years, 3 months ago (2015-09-23 19:24:44 UTC) #4
siva
lgtm https://codereview.chromium.org/1343383003/diff/20001/runtime/vm/block_scheduler.cc File runtime/vm/block_scheduler.cc (right): https://codereview.chromium.org/1343383003/diff/20001/runtime/vm/block_scheduler.cc#newcode16 runtime/vm/block_scheduler.cc:16: static intptr_t ComputeEdgeCount(const Array& edge_counters, intptr_t edge_id) { ...
5 years, 2 months ago (2015-09-26 00:16:58 UTC) #5
siva
https://codereview.chromium.org/1343383003/diff/20001/runtime/vm/flow_graph_compiler.cc File runtime/vm/flow_graph_compiler.cc (right): https://codereview.chromium.org/1343383003/diff/20001/runtime/vm/flow_graph_compiler.cc#newcode202 runtime/vm/flow_graph_compiler.cc:202: LookupClass(Symbols::List()))), I was wondering if it make sense to ...
5 years, 2 months ago (2015-09-26 00:18:32 UTC) #6
Florian Schneider
https://codereview.chromium.org/1343383003/diff/20001/runtime/vm/block_scheduler.cc File runtime/vm/block_scheduler.cc (right): https://codereview.chromium.org/1343383003/diff/20001/runtime/vm/block_scheduler.cc#newcode15 runtime/vm/block_scheduler.cc:15: // Compute the edge count at the deopt id ...
5 years, 2 months ago (2015-09-28 09:19:43 UTC) #7
Florian Schneider
Committed patchset #4 (id:60001) manually as 4a653d9e17c60f00d4600afdf27b2b57283eeaed (presubmit successful).
5 years, 2 months ago (2015-09-28 11:28:09 UTC) #8
siva
5 years, 2 months ago (2015-09-28 17:01:29 UTC) #9
Message was sent while issue was closed.
https://codereview.chromium.org/1343383003/diff/20001/runtime/vm/flow_graph_c...
File runtime/vm/flow_graph_compiler.cc (right):

https://codereview.chromium.org/1343383003/diff/20001/runtime/vm/flow_graph_c...
runtime/vm/flow_graph_compiler.cc:202: LookupClass(Symbols::List()))),
On 2015/09/28 09:19:43, Florian Schneider wrote:
> On 2015/09/26 00:18:32, siva wrote:
> > I was wondering if it make sense to store these in the isolate instead of
here
> > because it needs to be done just once for an isolate.
> 
> Maybe. On the other hand they are only needed for compilation and cached here
to
> avoid creating too many ZoneHandles.

Agreed it is done once per compilation but we have numerous compilations that
happen in an isolate and doing it once per isolate would save a bit of the per
compilation overhead cost.

Powered by Google App Engine
This is Rietveld 408576698