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

Issue 206003005: Ensure PrintToJSONStream can be called on all heap objects without crashing. (Closed)

Created:
6 years, 9 months ago by koda
Modified:
6 years, 9 months ago
Reviewers:
turnidge, Cutch
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Ensure PrintToJSONStream can be called on all heap objects without crashing. R=johnmccutchan@google.com Committed: https://code.google.com/p/dart/source/detail?r=34271

Patch Set 1 #

Patch Set 2 : #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+46 lines, -8 lines) Patch
M runtime/vm/object.cc View 5 chunks +15 lines, -8 lines 4 comments Download
M runtime/vm/object_test.cc View 1 1 chunk +31 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
koda
6 years, 9 months ago (2014-03-21 18:04:19 UTC) #1
koda
FYI, here are the two other issues that were uncovered by this unit test: https://codereview.chromium.org/207303002/ ...
6 years, 9 months ago (2014-03-21 18:07:27 UTC) #2
Cutch
lgtm and thanks!
6 years, 9 months ago (2014-03-21 18:08:51 UTC) #3
koda
Committed patchset #2 manually as r34271 (presubmit successful).
6 years, 9 months ago (2014-03-21 21:12:41 UTC) #4
turnidge
I know you've committed this, but... https://codereview.chromium.org/206003005/diff/20001/runtime/vm/object.cc File runtime/vm/object.cc (right): https://codereview.chromium.org/206003005/diff/20001/runtime/vm/object.cc#newcode6328 runtime/vm/object.cc:6328: } Did you ...
6 years, 9 months ago (2014-03-23 22:24:19 UTC) #5
koda
6 years, 9 months ago (2014-03-24 17:18:34 UTC) #6
Message was sent while issue was closed.
https://codereview.chromium.org/206003005/diff/20001/runtime/vm/object.cc
File runtime/vm/object.cc (right):

https://codereview.chromium.org/206003005/diff/20001/runtime/vm/object.cc#new...
runtime/vm/object.cc:6328: }
On 2014/03/23 22:24:20, turnidge wrote:
> Did you consider grabbing an id from the object id ring but not delegating up
to
> the Object::PrintToJSONStream.  Something like:
> 
> if (id >= 0) {
>   jsobj.AddPropertyF("id", "classes/%" Pd " ... etc.
> } else {
>   jsobj.AddPropertyF("id", "objects/%" Pd "", <get a number from the obj id
> ring>);
> }
> 
> That way this will have the expected format of a Function and only the id will
> be different.  Otherwise we will have to guard against these odd functions in
> the observatory.

I wasn't sure whether all fields still work in all the special cases (e.g., will
things like "parent_function" work?), but I suppose it makes sense to try.

I'll send a follow-up CL.

https://codereview.chromium.org/206003005/diff/20001/runtime/vm/object.cc#new...
runtime/vm/object.cc:13492: }
On 2014/03/23 22:24:20, turnidge wrote:
> Ditto previous comment.  You could print an id from the object id ring but
print
> the rest of the expected properties for a Type.

Also, here: not sure whether all printed properties are even defined for a
non-finalized type, for instance.

Powered by Google App Engine
This is Rietveld 408576698