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

Issue 1308073005: Introduce per-isolate cache for compile time constants (Closed)

Created:
5 years, 4 months ago by hausner
Modified:
5 years, 3 months ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Base URL:
https://github.com/dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Introduce per-isolate cache for compile time constants Compile-time constant values are maintained in a cache, keyed by script and token position. When the same code is compiled again later, e.g. by the optimizing compiler, the value is found in the cache and does not need to be computed again. In this version, the key is a string concatenated from the script url and the token position. That’s probably more overhead than we want. Added two compiler stat counters for number of cached constants and number of cache hits. Running dart2js to compile a hello world program results in about 1400 cached values and 85 cache hits. BUG= R=srdjan@google.com Committed: https://github.com/dart-lang/sdk/commit/62e9d056681308fef71540300643db1a63639bc4

Patch Set 1 #

Total comments: 12

Patch Set 2 : Addressing review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+141 lines, -38 lines) Patch
M runtime/vm/compiler_stats.h View 1 chunk +2 lines, -0 lines 0 comments Download
M runtime/vm/compiler_stats.cc View 2 chunks +4 lines, -0 lines 0 comments Download
M runtime/vm/object.h View 1 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/object.cc View 1 1 chunk +5 lines, -0 lines 0 comments Download
M runtime/vm/object_store.h View 2 chunks +9 lines, -1 line 0 comments Download
M runtime/vm/object_store.cc View 1 chunk +2 lines, -1 line 0 comments Download
M runtime/vm/parser.h View 1 chunk +2 lines, -0 lines 0 comments Download
M runtime/vm/parser.cc View 1 8 chunks +116 lines, -35 lines 0 comments Download

Messages

Total messages: 14 (4 generated)
hausner
5 years, 4 months ago (2015-08-25 18:02:54 UTC) #2
koda
https://codereview.chromium.org/1308073005/diff/1/runtime/vm/parser.cc File runtime/vm/parser.cc (right): https://codereview.chromium.org/1308073005/diff/1/runtime/vm/parser.cc#newcode11905 runtime/vm/parser.cc:11905: String& suffix = String::Handle(String::NewFormatted("_%" Pd "", token_pos)); Add TODO: ...
5 years, 4 months ago (2015-08-25 18:27:12 UTC) #4
hausner
Thanks for taking a look. https://codereview.chromium.org/1308073005/diff/1/runtime/vm/parser.cc File runtime/vm/parser.cc (right): https://codereview.chromium.org/1308073005/diff/1/runtime/vm/parser.cc#newcode11905 runtime/vm/parser.cc:11905: String& suffix = String::Handle(String::NewFormatted("_%" ...
5 years, 4 months ago (2015-08-25 19:48:52 UTC) #5
srdjan
DBC https://codereview.chromium.org/1308073005/diff/1/runtime/vm/parser.cc File runtime/vm/parser.cc (right): https://codereview.chromium.org/1308073005/diff/1/runtime/vm/parser.cc#newcode11905 runtime/vm/parser.cc:11905: String& suffix = String::Handle(String::NewFormatted("_%" Pd "", token_pos)); String::NewFormatted ...
5 years, 4 months ago (2015-08-25 22:16:19 UTC) #7
Florian Schneider
DBC: As I suggested before my idea would be to try a different approach - ...
5 years, 4 months ago (2015-08-26 08:27:32 UTC) #9
Florian Schneider
https://codereview.chromium.org/1308073005/diff/1/runtime/vm/parser.cc File runtime/vm/parser.cc (right): https://codereview.chromium.org/1308073005/diff/1/runtime/vm/parser.cc#newcode12936 runtime/vm/parser.cc:12936: CacheConstantValue(literal_pos, const_instance); Are cached constants ever GCed? What if ...
5 years, 4 months ago (2015-08-26 08:58:09 UTC) #10
hausner
https://codereview.chromium.org/1308073005/diff/1/runtime/vm/parser.cc File runtime/vm/parser.cc (right): https://codereview.chromium.org/1308073005/diff/1/runtime/vm/parser.cc#newcode12936 runtime/vm/parser.cc:12936: CacheConstantValue(literal_pos, const_instance); On 2015/08/26 08:58:09, Florian Schneider wrote: > ...
5 years, 3 months ago (2015-08-26 17:46:14 UTC) #11
hausner
PTAL I think I addressed the allocation issue.
5 years, 3 months ago (2015-08-26 21:22:57 UTC) #12
srdjan
LGTM
5 years, 3 months ago (2015-08-26 21:39:41 UTC) #13
hausner
5 years, 3 months ago (2015-08-26 23:17:38 UTC) #14
Message was sent while issue was closed.
Committed patchset #2 (id:20001) manually as
62e9d056681308fef71540300643db1a63639bc4 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698