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

Issue 19579006: Adding proper handling for MethodMirror.owner (Closed)

Created:
7 years, 5 months ago by Michael Lippautz (Google)
Modified:
7 years, 5 months ago
Reviewers:
rmacnak, siva
CC:
reviews_dartlang.org
Visibility:
Public.

Description

If we have the owner mirror at creation time (which right now is a lazy mirror), we will use it. Eventually lazy mirrors will go away and we will not have to resolve() in dart code anymore. If we don't have it, for example for a nested closure, we set it null and construct it lazily at access time. Example: outer() { inner() {} var closureMirror = reflect(inner); print(closureMirror.function.owner); // Should be a MethodMirror on outer, that is constructed lazily. } Since we need to be able to construct the chain of owners (back up to library), we need to handle all cases in the lazy creation. The CL also adds wrappers that can be called with native objects. At some point these wrapper will create the mirrors without referring to the ones using embedded API. BUG= R=asiva@google.com Committed: https://code.google.com/p/dart/source/detail?r=25186

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Total comments: 10

Patch Set 6 : #

Patch Set 7 : Added missing Dart_Scopes. #

Patch Set 8 : #

Total comments: 14

Patch Set 9 : Final signatures for non-api functions; Renamed old ones #

Total comments: 4

Patch Set 10 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+113 lines, -17 lines) Patch
M runtime/lib/mirrors.cc View 1 2 3 4 5 6 7 8 9 11 chunks +103 lines, -17 lines 0 comments Download
M runtime/lib/mirrors_impl.dart View 1 2 3 4 5 6 7 8 9 2 chunks +9 lines, -0 lines 0 comments Download
M runtime/vm/bootstrap_natives.h View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Michael Lippautz (Google)
7 years, 5 months ago (2013-07-17 21:07:38 UTC) #1
rmacnak
https://codereview.chromium.org/19579006/diff/7001/runtime/lib/mirrors.cc File runtime/lib/mirrors.cc (right): https://codereview.chromium.org/19579006/diff/7001/runtime/lib/mirrors.cc#newcode20 runtime/lib/mirrors.cc:20: static RawObject* CreateClassMirror(const Class& cls); RawInstance* --- we know ...
7 years, 5 months ago (2013-07-17 22:27:50 UTC) #2
Michael Lippautz (Google)
Also fixed the call to CreateMethodMirror using handles to include the provided owner_mirror. (Was Dart_Null().) ...
7 years, 5 months ago (2013-07-17 22:43:19 UTC) #3
siva
https://codereview.chromium.org/19579006/diff/15001/runtime/lib/mirrors.cc File runtime/lib/mirrors.cc (right): https://codereview.chromium.org/19579006/diff/15001/runtime/lib/mirrors.cc#newcode1028 runtime/lib/mirrors.cc:1028: static RawInstance* CreateClassMirror(const Class& cls) { Change the signature ...
7 years, 5 months ago (2013-07-18 20:32:34 UTC) #4
siva
lgtm https://codereview.chromium.org/19579006/diff/17001/runtime/lib/mirrors.cc File runtime/lib/mirrors.cc (right): https://codereview.chromium.org/19579006/diff/17001/runtime/lib/mirrors.cc#newcode24 runtime/lib/mirrors.cc:24: const Instance& owner_mirror); Why are these forward declarations ...
7 years, 5 months ago (2013-07-18 20:38:45 UTC) #5
Michael Lippautz (Google)
https://codereview.chromium.org/19579006/diff/15001/runtime/lib/mirrors.cc File runtime/lib/mirrors.cc (right): https://codereview.chromium.org/19579006/diff/15001/runtime/lib/mirrors.cc#newcode1028 runtime/lib/mirrors.cc:1028: static RawInstance* CreateClassMirror(const Class& cls) { On 2013/07/18 20:32:34, ...
7 years, 5 months ago (2013-07-18 22:01:23 UTC) #6
Michael Lippautz (Google)
7 years, 5 months ago (2013-07-18 22:05:10 UTC) #7
Message was sent while issue was closed.
Committed patchset #10 manually as r25186 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698