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

Issue 10538043: Second local mirrors CL. (Closed)

Created:
8 years, 6 months ago by turnidge
Modified:
8 years, 6 months ago
Reviewers:
ahe, Ivan Posva
CC:
reviews_dartlang.org, gbracha, ahe
Visibility:
Public.

Description

Second local mirrors CL. Implement a few chunks of new mirror functionality. Many changes, notably: - Added currentIsolateMirror() to provide non-async access to the local isolate mirror. - Added mirrorOf(o) to provide access to local instance mirrors. - Fleshed out InstanceMirror, InterfaceMirror, and LibraryMirror to various degrees. - Added the MirroredError hierarchy, which lets the user handle Dart errors of various sorts from invocation, etc. - Introduce lazy resolvers for interface mirrors and library mirrors. These allow us to build the self-referential library/interface hierarchy without going mad. - Added better toStrings all around. - Extended the isolate_mirror_local_test to cover new functionality. Other changes that were required or seemed prudent: - Exposed the error hierarchy to the embedder. They need to be able to distinguish different error types in some situations. Improved the documetation around error handles and error propagation. - Added new functions to the dart embedding api as required. Added tests for all new dart api functions. Committed: https://code.google.com/p/dart/source/detail?r=8575

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Total comments: 14

Patch Set 4 : #

Total comments: 9
Unified diffs Side-by-side diffs Delta from patch set Stats (+1641 lines, -81 lines) Patch
M lib/mirrors/mirrors.dart View 1 2 3 6 chunks +174 lines, -8 lines 9 comments Download
M runtime/include/dart_api.h View 1 2 3 8 chunks +256 lines, -21 lines 0 comments Download
M runtime/include/dart_debugger_api.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M runtime/lib/mirrors.cc View 1 2 3 4 chunks +230 lines, -14 lines 0 comments Download
M runtime/lib/mirrors_impl.dart View 1 2 3 3 chunks +215 lines, -22 lines 0 comments Download
M runtime/tests/vm/dart/isolate_mirror_local_test.dart View 1 2 3 3 chunks +245 lines, -6 lines 0 comments Download
M runtime/vm/bootstrap_natives.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/dart_api_impl.cc View 1 2 3 11 chunks +238 lines, -5 lines 0 comments Download
M runtime/vm/dart_api_impl_test.cc View 1 2 3 6 chunks +279 lines, -2 lines 0 comments Download
M runtime/vm/object.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
turnidge
Ivan, Here's the next batch of mirror implemention. Please let me know if you are ...
8 years, 6 months ago (2012-06-07 20:43:40 UTC) #1
Ivan Posva
LGTM with comments. -Ivan https://chromiumcodereview.appspot.com/10538043/diff/11001/lib/mirrors/mirrors.dart File lib/mirrors/mirrors.dart (right): https://chromiumcodereview.appspot.com/10538043/diff/11001/lib/mirrors/mirrors.dart#newcode163 lib/mirrors/mirrors.dart:163: * TODO(turnidge): Gilad had this ...
8 years, 6 months ago (2012-06-11 16:45:01 UTC) #2
turnidge
Hi Ivan, I am going to try to commit this change, despite some ongoing discussion ...
8 years, 6 months ago (2012-06-12 20:51:46 UTC) #3
ahe
8 years, 6 months ago (2012-06-15 13:45:46 UTC) #4
Mirror API changes look great!

Cheers,
Peter

https://chromiumcodereview.appspot.com/10538043/diff/6014/lib/mirrors/mirrors...
File lib/mirrors/mirrors.dart (right):

https://chromiumcodereview.appspot.com/10538043/diff/6014/lib/mirrors/mirrors...
lib/mirrors/mirrors.dart:25: IsolateMirror currentIsolateMirror() {
Long term, I think it would be great if we can separate these methods from the
interfaces. This will make it easier to reuse in the compiler.

https://chromiumcodereview.appspot.com/10538043/diff/6014/lib/mirrors/mirrors...
lib/mirrors/mirrors.dart:141: final String simpleName;
Shouldn't this just be "name"?

https://chromiumcodereview.appspot.com/10538043/diff/6014/lib/mirrors/mirrors...
lib/mirrors/mirrors.dart:169: InterfaceMirror defaultFactory();
Rename to "factoryClass"?

https://chromiumcodereview.appspot.com/10538043/diff/6014/lib/mirrors/mirrors...
lib/mirrors/mirrors.dart:172: * An immutable map from from names to mirrors for
all members of
Why immutable? Do you mean read-only?

https://chromiumcodereview.appspot.com/10538043/diff/6014/lib/mirrors/mirrors...
lib/mirrors/mirrors.dart:178: * TODO(turnidge): Currently empty.
General comment. I think it would be best to move TODOs out of documentation
comments.

https://chromiumcodereview.appspot.com/10538043/diff/6014/lib/mirrors/mirrors...
lib/mirrors/mirrors.dart:180: Map<String, Mirror> members();
For example, add the TODO here using //.

https://chromiumcodereview.appspot.com/10538043/diff/6014/lib/mirrors/mirrors...
lib/mirrors/mirrors.dart:203: * An immutable map from from top-level names to
mirrors for all
Why immutable?

https://chromiumcodereview.appspot.com/10538043/diff/6014/lib/mirrors/mirrors...
lib/mirrors/mirrors.dart:264: "Uncaught exception during mirrored execution:
<${exception_string}>";
I think you can remove the <...> around the original message.

https://chromiumcodereview.appspot.com/10538043/diff/6014/lib/mirrors/mirrors...
lib/mirrors/mirrors.dart:282: return "Compile-time error during mirrored
execution: <$message>";
Ditto for <...>

Powered by Google App Engine
This is Rietveld 408576698