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

Issue 1276753002: 1. Fix the type arguments recursion problem that gets introduced when canonicalization of type argu… (Closed)

Created:
5 years, 4 months ago by siva
Modified:
5 years, 4 months ago
Reviewers:
regis, rmacnak
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

1. Fix the type arguments recursion problem that gets introduced when canonicalization of type arguments is deferred while reading a script snapshot. This problem was shows up as random stack overflow crashes when running pub 2. Patching of the type arguments field in a GrowableObjectArray was missed BUG=23930 R=regis@google.com, rmacnak@google.com Committed: https://github.com/dart-lang/sdk/commit/521dee763c95a374031e06572d3f56ceb8e8d91f

Patch Set 1 #

Patch Set 2 : fix-comment #

Patch Set 3 : fix-patch-condition #

Total comments: 6

Patch Set 4 : address-code-review #

Unified diffs Side-by-side diffs Delta from patch set Stats (+73 lines, -34 lines) Patch
M runtime/vm/dart_api_impl.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M runtime/vm/dart_api_message.cc View 1 1 chunk +15 lines, -4 lines 0 comments Download
M runtime/vm/raw_object_snapshot.cc View 1 2 3 9 chunks +33 lines, -17 lines 0 comments Download
M runtime/vm/snapshot.cc View 1 2 3 3 chunks +20 lines, -11 lines 0 comments Download
M runtime/vm/snapshot_test.cc View 2 chunks +0 lines, -2 lines 0 comments Download

Messages

Total messages: 8 (1 generated)
siva
5 years, 4 months ago (2015-08-06 00:55:45 UTC) #2
siva
5 years, 4 months ago (2015-08-06 01:19:08 UTC) #3
regis
LGTM https://codereview.chromium.org/1276753002/diff/40001/runtime/vm/raw_object_snapshot.cc File runtime/vm/raw_object_snapshot.cc (right): https://codereview.chromium.org/1276753002/diff/40001/runtime/vm/raw_object_snapshot.cc#newcode2341 runtime/vm/raw_object_snapshot.cc:2341: const intptr_t typeargs_offset = Use GrowableObjectArray::type_arguments_offset() https://codereview.chromium.org/1276753002/diff/40001/runtime/vm/snapshot.cc File ...
5 years, 4 months ago (2015-08-06 16:36:08 UTC) #4
rmacnak
lgtm
5 years, 4 months ago (2015-08-06 16:48:45 UTC) #5
siva
https://codereview.chromium.org/1276753002/diff/40001/runtime/vm/raw_object_snapshot.cc File runtime/vm/raw_object_snapshot.cc (right): https://codereview.chromium.org/1276753002/diff/40001/runtime/vm/raw_object_snapshot.cc#newcode2341 runtime/vm/raw_object_snapshot.cc:2341: const intptr_t typeargs_offset = On 2015/08/06 16:36:08, regis wrote: ...
5 years, 4 months ago (2015-08-06 17:28:45 UTC) #6
siva
Committed patchset #4 (id:60001) manually as 521dee763c95a374031e06572d3f56ceb8e8d91f (presubmit successful).
5 years, 4 months ago (2015-08-06 17:55:53 UTC) #7
regis
5 years, 4 months ago (2015-08-06 18:24:35 UTC) #8
Message was sent while issue was closed.
https://codereview.chromium.org/1276753002/diff/40001/runtime/vm/raw_object_s...
File runtime/vm/raw_object_snapshot.cc (right):

https://codereview.chromium.org/1276753002/diff/40001/runtime/vm/raw_object_s...
runtime/vm/raw_object_snapshot.cc:2341: const intptr_t typeargs_offset =
On 2015/08/06 17:28:44, siva wrote:
> On 2015/08/06 16:36:08, regis wrote:
> > Use GrowableObjectArray::type_arguments_offset()
> 
> It needs to be the offset in words and hence the pointer arithmetic, I could
use
> GrowableObjectArray::type_arguments_offset() / kWordSize;

I missed that detail.

https://codereview.chromium.org/1276753002/diff/40001/runtime/vm/snapshot.cc
File runtime/vm/snapshot.cc (right):

https://codereview.chromium.org/1276753002/diff/40001/runtime/vm/snapshot.cc#...
runtime/vm/snapshot.cc:1171: newobj = typeobj.Canonicalize();
On 2015/08/06 17:28:44, siva wrote:
> On 2015/08/06 16:36:08, regis wrote:
> > Ideally, in the case of a resursive type, Canonicalize() should return the
> input
> > node, and not a different (but equivalent) node in the cyclic graph. This
> would
> > make patching safe in all cases.
> > 
> > This would be easier to use than IsDisjoint() or IsEquivalentButDisjoint()
new
> > functions as we discussed. In other words, this new functionality should be
> > encapsulated in the Canonicalize() call.
> > 
> > I'll work on that next.
> 
> I was thinking of another approach wherein we always use TypeRef nodes in a
> recursive implementation so that it is always uniform and do not make a Type
> node be equivalent to a type ref node pointing to the type node. We can
discuss
> this in person.

We still have to make sure type tests succeed. Yes, let's talk.

Powered by Google App Engine
This is Rietveld 408576698