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

Issue 8506001: Finalize all classes (fix issue 364). (Closed)

Created:
9 years, 1 month ago by regis
Modified:
9 years, 1 month ago
Reviewers:
srdjan
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Finalize all classes (fix issue 364). Committed: https://code.google.com/p/dart/source/detail?r=1380

Patch Set 1 #

Total comments: 14
Unified diffs Side-by-side diffs Delta from patch set Stats (+304 lines, -219 lines) Patch
M runtime/vm/class_finalizer.h View 4 chunks +11 lines, -1 line 2 comments Download
M runtime/vm/class_finalizer.cc View 16 chunks +122 lines, -57 lines 8 comments Download
M runtime/vm/class_finalizer_test.cc View 3 chunks +3 lines, -0 lines 0 comments Download
M runtime/vm/code_generator_ia32.cc View 1 chunk +1 line, -2 lines 0 comments Download
M runtime/vm/object.h View 2 chunks +13 lines, -0 lines 0 comments Download
M runtime/vm/object.cc View 11 chunks +136 lines, -154 lines 4 comments Download
M runtime/vm/object_store.h View 1 chunk +0 lines, -1 line 0 comments Download
M runtime/vm/object_test.cc View 2 chunks +3 lines, -0 lines 0 comments Download
M runtime/vm/parser.cc View 5 chunks +15 lines, -4 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
regis
9 years, 1 month ago (2011-11-09 05:22:40 UTC) #1
srdjan
LGTM with suggestions http://codereview.chromium.org/8506001/diff/1/runtime/vm/class_finalizer.cc File runtime/vm/class_finalizer.cc (right): http://codereview.chromium.org/8506001/diff/1/runtime/vm/class_finalizer.cc#newcode21 runtime/vm/class_finalizer.cc:21: void ClassFinalizer::ExpectPendingClasses() { Do you want ...
9 years, 1 month ago (2011-11-09 21:22:43 UTC) #2
regis
9 years, 1 month ago (2011-11-09 23:31:01 UTC) #3
Thanks!

http://codereview.chromium.org/8506001/diff/1/runtime/vm/class_finalizer.cc
File runtime/vm/class_finalizer.cc (right):

http://codereview.chromium.org/8506001/diff/1/runtime/vm/class_finalizer.cc#n...
runtime/vm/class_finalizer.cc:21: void ClassFinalizer::ExpectPendingClasses() {
On 2011/11/09 21:22:43, srdjan wrote:
> Do you want to allow ExpectPendingClasses several times before finalizing?
I.e.,
> do you need to assert !AllClassFinalized().

Good question!
Currently, there may be several calls to ExpectPendingClasses (e.g.
Object::Init() and Parser::ParseTopLevel()) before a call to
FinalizePendingClasses. We could force proper pairing of these calls, but we
would probably need to use a counter rather than a binary flag to allow proper
nesting.
I prefer to allow multiple calls for now.

http://codereview.chromium.org/8506001/diff/1/runtime/vm/class_finalizer.cc#n...
runtime/vm/class_finalizer.cc:35: }
On 2011/11/09 21:22:43, srdjan wrote:
> Why the code above?

Left over debugging code. Removed.

http://codereview.chromium.org/8506001/diff/1/runtime/vm/class_finalizer.cc#n...
runtime/vm/class_finalizer.cc:274: "cannot resolve name '%s'\n",
On 2011/11/09 21:22:43, srdjan wrote:
> Maybe be more specific -> cannot resolve library prefix.

Done.

http://codereview.chromium.org/8506001/diff/1/runtime/vm/class_finalizer.cc#n...
runtime/vm/class_finalizer.cc:607: if (type.IsSignatureType() &&
!AllClassesFinalized()) {
On 2011/11/09 21:22:43, srdjan wrote:
> Maybe have a interim method: CollectingClassesToFinalize ->
> !AllClassesFinalized?

Done. Renamed these calls to:
ExpectClassesToFinalize
IsExpectingClassesToFinalize
AddClassesToFinalize
AllClassesFinalized
FinalizeAllClasses

http://codereview.chromium.org/8506001/diff/1/runtime/vm/class_finalizer.h
File runtime/vm/class_finalizer.h (right):

http://codereview.chromium.org/8506001/diff/1/runtime/vm/class_finalizer.h#ne...
runtime/vm/class_finalizer.h:41: // Notify finalizer to expect classes to be
finalized.
On 2011/11/09 21:22:43, srdjan wrote:
> Maybe add somewhere the comment that we are flagging the interval between
> ExpectPendingClasses and FinalizePendingClasses.

Done.

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

http://codereview.chromium.org/8506001/diff/1/runtime/vm/object.cc#newcode344
runtime/vm/object.cc:344: GrowableArray<const Class*>* classes) {
On 2011/11/09 21:22:43, srdjan wrote:
> I think it would be clearer if classes->Add() would be done at call site and
> 'classes' would not be a n argument. 

Done.

http://codereview.chromium.org/8506001/diff/1/runtime/vm/object.cc#newcode358
runtime/vm/object.cc:358: GrowableArray<const Class*>* classes) {
On 2011/11/09 21:22:43, srdjan wrote:
> Ditto

Done.

Powered by Google App Engine
This is Rietveld 408576698