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

Issue 2853423002: Move the Kernel canonical name table into the VM's heap (Closed)

Created:
3 years, 7 months ago by Kevin Millikin (Google)
Modified:
3 years, 7 months ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Move the Kernel canonical name table into the VM's heap The canonical name table is copied into a typed data array in the VM's heap. The encoding is the same as in the binary except that the integer indexes are fixed-size. Canonical names are now integer indexes instead of objects allocated in the C++ heap. BUG= R=jensj@google.com, vegorov@google.com Committed: https://github.com/dart-lang/sdk/commit/514281b8a744222a3d1b9d196fac1b4b60b3b28e

Patch Set 1 #

Patch Set 2 : Merge a bugfix #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+378 lines, -492 lines) Patch
M runtime/vm/kernel.h View 23 chunks +47 lines, -73 lines 1 comment Download
M runtime/vm/kernel.cc View 1 chunk +0 lines, -25 lines 0 comments Download
M runtime/vm/kernel_binary.h View 6 chunks +24 lines, -26 lines 0 comments Download
M runtime/vm/kernel_binary.cc View 8 chunks +39 lines, -53 lines 0 comments Download
M runtime/vm/kernel_binary_flowgraph.h View 2 chunks +5 lines, -20 lines 0 comments Download
M runtime/vm/kernel_binary_flowgraph.cc View 3 chunks +2 lines, -82 lines 2 comments Download
M runtime/vm/kernel_reader.h View 4 chunks +13 lines, -11 lines 0 comments Download
M runtime/vm/kernel_reader.cc View 8 chunks +27 lines, -14 lines 1 comment Download
M runtime/vm/kernel_to_il.h View 1 6 chunks +41 lines, -36 lines 0 comments Download
M runtime/vm/kernel_to_il.cc View 1 51 chunks +169 lines, -152 lines 0 comments Download
M runtime/vm/object.h View 1 chunk +5 lines, -0 lines 0 comments Download
M runtime/vm/object.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M runtime/vm/raw_object.h View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 7 (2 generated)
Kevin Millikin (Google)
3 years, 7 months ago (2017-05-02 23:03:06 UTC) #2
jensj
lgtm
3 years, 7 months ago (2017-05-03 06:08:17 UTC) #3
Vyacheslav Egorov (Google)
lgtm https://codereview.chromium.org/2853423002/diff/20001/runtime/vm/kernel.h File runtime/vm/kernel.h (right): https://codereview.chromium.org/2853423002/diff/20001/runtime/vm/kernel.h#newcode381 runtime/vm/kernel.h:381: intptr_t canonical_name() { return canonical_name_; } With all ...
3 years, 7 months ago (2017-05-03 06:28:48 UTC) #4
Kevin Millikin (Google)
Committed patchset #2 (id:20001) manually as 514281b8a744222a3d1b9d196fac1b4b60b3b28e (presubmit successful).
3 years, 7 months ago (2017-05-03 17:27:20 UTC) #6
Kevin Millikin (Google)
3 years, 7 months ago (2017-05-03 17:43:52 UTC) #7
Message was sent while issue was closed.
On 2017/05/03 06:28:48, Vyacheslav Egorov (Google) wrote:
> lgtm
> 
> https://codereview.chromium.org/2853423002/diff/20001/runtime/vm/kernel.h
> File runtime/vm/kernel.h (right):
> 
>
https://codereview.chromium.org/2853423002/diff/20001/runtime/vm/kernel.h#new...
> runtime/vm/kernel.h:381: intptr_t canonical_name() { return canonical_name_; }
> With all these different indices I wonder if it worth actually having some
> wrappers for type safety?
> 
> e.g. 
> 
> class CanonicalNameIndex {
> private: 
>   intptr_t index_;
> };
> 
>
https://codereview.chromium.org/2853423002/diff/20001/runtime/vm/kernel_binar...
> File runtime/vm/kernel_binary_flowgraph.cc (right):
> 
>
https://codereview.chromium.org/2853423002/diff/20001/runtime/vm/kernel_binar...
> runtime/vm/kernel_binary_flowgraph.cc:63: intptr_t target =
builder_->ReadUInt()
> - 1;
> might be worth having a helper called ReadCanonicalNameReference similar to
one
> in the reader. 
> 
> otherwise -1 is way too confusing.
> 
>
https://codereview.chromium.org/2853423002/diff/20001/runtime/vm/kernel_binar...
> runtime/vm/kernel_binary_flowgraph.cc:422: intptr_t target = ReadUInt() - 1;
> ditto
> 
>
https://codereview.chromium.org/2853423002/diff/20001/runtime/vm/kernel_reade...
> File runtime/vm/kernel_reader.cc (right):
> 
>
https://codereview.chromium.org/2853423002/diff/20001/runtime/vm/kernel_reade...
> runtime/vm/kernel_reader.cc:103: RawClass*
> BuildingTranslationHelper::LookupClassByKernelClass(intptr_t klass) {
> I think we *do* need need named type for these indices, otherwise it is hard
to
> understand whether it is a CanonicalName or maybe a String index - just by
> looking at the signature.

Thanks for the review.

Adding classes for string indexes and canonical name indexes will definitely be
an improvement.  I will do that as a separate change.

Powered by Google App Engine
This is Rietveld 408576698