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

Issue 25569002: Do not share type arguments of mixin types, but clone them to avoid finalization (Closed)

Created:
7 years, 2 months ago by regis
Modified:
7 years, 2 months ago
Reviewers:
hausner, siva, Ivan Posva
CC:
reviews_dartlang.org, vm-dev_dartlang.org, dgrove, asandholm
Visibility:
Public.

Description

Do not share type arguments of mixin types, but clone them to avoid finalization errors when cycles are involved (issue 13688). Add regression test. R=hausner@google.com Committed: https://code.google.com/p/dart/source/detail?r=28107

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+145 lines, -14 lines) Patch
M runtime/vm/class_finalizer.cc View 4 chunks +22 lines, -8 lines 0 comments Download
M runtime/vm/object.h View 7 chunks +20 lines, -1 line 0 comments Download
M runtime/vm/object.cc View 7 chunks +84 lines, -5 lines 2 comments Download
M tests/language/language_dart2js.status View 1 chunk +1 line, -0 lines 0 comments Download
A tests/language/mixin_regress_13688_test.dart View 1 chunk +18 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
regis
7 years, 2 months ago (2013-10-01 17:37:47 UTC) #1
regis
Adding Matthias as reviewer, since Ivan may be busy.
7 years, 2 months ago (2013-10-01 17:40:00 UTC) #2
regis
7 years, 2 months ago (2013-10-01 17:40:14 UTC) #3
hausner
LGTM.
7 years, 2 months ago (2013-10-01 18:20:51 UTC) #4
regis
Committed patchset #1 manually as r28107 (presubmit successful).
7 years, 2 months ago (2013-10-01 18:26:29 UTC) #5
Ivan Posva
Please explain why we are not using the reusable handles. We cannot see the recursion ...
7 years, 2 months ago (2013-10-01 18:50:03 UTC) #6
regis
7 years, 2 months ago (2013-10-01 19:11:57 UTC) #7
Message was sent while issue was closed.
The number of type arguments depends on the number of type parameters, which, in
case of a mixin application class, depends on the type parameters of the mixin
types.

In other words, NumTypeArguments() calls NumTypeParameters(), which calls
ApplyMixinType(), which will finalize the mixin types. Add some fun declarations
to the mix, and NumTypeArguments() ends up being called recursively.

https://codereview.chromium.org/25569002/diff/1/runtime/vm/object.cc
File runtime/vm/object.cc (right):

https://codereview.chromium.org/25569002/diff/1/runtime/vm/object.cc#newcode1712
runtime/vm/object.cc:1712: Class& cls = Class::Handle(isolate);
On 2013/10/01 18:50:04, Ivan Posva wrote:
> Why was this changed?

We were just lucky before. NumTypeArguments() is reentrant.

Powered by Google App Engine
This is Rietveld 408576698