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

Issue 11778028: Fix confusion over on-disk object id sizes during instance serialization. (Closed)

Created:
7 years, 11 months ago by cshapiro
Modified:
7 years, 11 months ago
Reviewers:
siva
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Fix confusion over on-disk object id sizes during instance serialization. To avoid confusion in the future the WritePointer methods have been renamed to the more descriptive WriteObjectId. Committed: https://code.google.com/p/dart/source/detail?r=16782

Patch Set 1 #

Total comments: 2

Patch Set 2 : address review comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+34 lines, -30 lines) Patch
M runtime/vm/heap_profiler.h View 3 chunks +4 lines, -2 lines 0 comments Download
M runtime/vm/heap_profiler.cc View 1 14 chunks +30 lines, -28 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
cshapiro
7 years, 11 months ago (2013-01-07 22:59:08 UTC) #1
siva
lgtm https://codereview.chromium.org/11778028/diff/1/runtime/vm/heap_profiler.cc File runtime/vm/heap_profiler.cc (right): https://codereview.chromium.org/11778028/diff/1/runtime/vm/heap_profiler.cc#newcode599 runtime/vm/heap_profiler.cc:599: sub.Write32(num_instance_fields * kObjectIdSize); I am assuming that Write32 ...
7 years, 11 months ago (2013-01-08 02:18:01 UTC) #2
siva
lgtm
7 years, 11 months ago (2013-01-08 02:18:02 UTC) #3
cshapiro
7 years, 11 months ago (2013-01-08 02:53:04 UTC) #4
https://codereview.chromium.org/11778028/diff/1/runtime/vm/heap_profiler.cc
File runtime/vm/heap_profiler.cc (right):

https://codereview.chromium.org/11778028/diff/1/runtime/vm/heap_profiler.cc#n...
runtime/vm/heap_profiler.cc:599: sub.Write32(num_instance_fields *
kObjectIdSize);
That will not quite work :-)

Write32 takes a uint32_t argument so kMaxInt32 needs to be a kMaxUint32 and the
check needs to be <= not < as above.  It is, of course, legal for the value to
range up to and including the limit.

Also, it is always true that an uint32_t is going to be less than 0xFFFFFFFF so
to make this check work the multiply needs to be done in higher precision.

Anyway, I fixed the code to do that.  Presumably all we care about is having the
product be in range so I did not bother with the possibility of overflow above
where the fields are counted.

Powered by Google App Engine
This is Rietveld 408576698