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

Issue 9420038: Heartbeat implementation of dart:mirrors. (Closed)

Created:
8 years, 10 months ago by turnidge
Modified:
8 years, 9 months ago
Reviewers:
ahe, gbracha, siva, Ivan Posva
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Heartbeat implementation of dart:mirrors. Add the skeleton for the dart:mirrors library in all the appropriate places. The only thing we can do right now is ask an Isolate for its debugName. Add a few tests. Committed: https://code.google.com/p/dart/source/detail?r=5370

Patch Set 1 #

Patch Set 2 : #

Total comments: 33

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Total comments: 5

Patch Set 6 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+601 lines, -98 lines) Patch
A lib/mirrors/mirrors.dart View 1 chunk +18 lines, -0 lines 0 comments Download
M runtime/lib/double.cc View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M runtime/lib/isolate.cc View 1 2 2 chunks +1 line, -25 lines 0 comments Download
A runtime/lib/mirrors.cc View 1 2 3 4 5 1 chunk +80 lines, -0 lines 0 comments Download
A runtime/lib/mirrors_impl.dart View 1 2 1 chunk +58 lines, -0 lines 0 comments Download
A runtime/lib/mirrors_sources.gypi View 1 chunk +13 lines, -0 lines 0 comments Download
A runtime/tests/vm/src/IsolateMirrorBusyTest.dart View 1 2 1 chunk +33 lines, -0 lines 0 comments Download
A runtime/tests/vm/src/IsolateMirrorIdleTest.dart View 1 2 1 chunk +31 lines, -0 lines 0 comments Download
A runtime/tests/vm/src/IsolateMirrorSelfTest.dart View 1 2 1 chunk +25 lines, -0 lines 0 comments Download
M runtime/vm/bootstrap.h View 1 2 2 chunks +2 lines, -0 lines 0 comments Download
M runtime/vm/bootstrap.cc View 1 2 3 4 5 1 chunk +10 lines, -0 lines 0 comments Download
M runtime/vm/bootstrap_natives.h View 1 2 2 chunks +2 lines, -0 lines 0 comments Download
M runtime/vm/bootstrap_natives.cc View 1 2 3 4 5 2 chunks +9 lines, -1 line 0 comments Download
M runtime/vm/bootstrap_nocorelib.cc View 1 2 1 chunk +6 lines, -0 lines 0 comments Download
M runtime/vm/code_generator.cc View 1 2 3 4 5 3 chunks +37 lines, -1 line 0 comments Download
M runtime/vm/dart_api_impl.cc View 1 2 3 4 5 3 chunks +36 lines, -44 lines 0 comments Download
M runtime/vm/dart_entry.h View 1 2 1 chunk +20 lines, -0 lines 0 comments Download
M runtime/vm/dart_entry.cc View 1 2 1 chunk +93 lines, -0 lines 0 comments Download
M runtime/vm/isolate.cc View 1 2 3 4 5 2 chunks +26 lines, -17 lines 0 comments Download
M runtime/vm/message.h View 1 2 1 chunk +5 lines, -1 line 0 comments Download
M runtime/vm/message.cc View 1 2 2 chunks +14 lines, -5 lines 0 comments Download
M runtime/vm/native_arguments.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/object.h View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M runtime/vm/object.cc View 1 2 4 chunks +23 lines, -2 lines 0 comments Download
M runtime/vm/object_store.h View 1 2 2 chunks +6 lines, -0 lines 0 comments Download
M runtime/vm/object_store.cc View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M runtime/vm/vm.gypi View 1 2 5 chunks +48 lines, -0 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
turnidge
Ivan and/or Siva -- please take a look. Gilad -- please check to see if ...
8 years, 10 months ago (2012-02-17 01:42:10 UTC) #1
gbracha
lgtm
8 years, 10 months ago (2012-02-17 02:02:36 UTC) #2
ahe
DBC https://chromiumcodereview.appspot.com/9420038/diff/6002/lib/mirrors/mirrors.dart File lib/mirrors/mirrors.dart (right): https://chromiumcodereview.appspot.com/9420038/diff/6002/lib/mirrors/mirrors.dart#newcode11 lib/mirrors/mirrors.dart:11: interface IsolateMirror { I'd like to implement these ...
8 years, 10 months ago (2012-02-17 08:09:12 UTC) #3
Ivan Posva
https://chromiumcodereview.appspot.com/9420038/diff/6002/lib/mirrors/mirrors.dart File lib/mirrors/mirrors.dart (right): https://chromiumcodereview.appspot.com/9420038/diff/6002/lib/mirrors/mirrors.dart#newcode11 lib/mirrors/mirrors.dart:11: interface IsolateMirror { On 2012/02/17 08:09:12, ahe wrote: > ...
8 years, 10 months ago (2012-02-17 08:21:49 UTC) #4
ahe
DBC https://chromiumcodereview.appspot.com/9420038/diff/6002/lib/mirrors/mirrors.dart File lib/mirrors/mirrors.dart (right): https://chromiumcodereview.appspot.com/9420038/diff/6002/lib/mirrors/mirrors.dart#newcode11 lib/mirrors/mirrors.dart:11: interface IsolateMirror { On 2012/02/17 08:21:50, Ivan Posva ...
8 years, 10 months ago (2012-02-17 09:13:20 UTC) #5
siva
http://codereview.chromium.org/9420038/diff/6002/runtime/lib/mirrors.cc File runtime/lib/mirrors.cc (right): http://codereview.chromium.org/9420038/diff/6002/runtime/lib/mirrors.cc#newcode31 runtime/lib/mirrors.cc:31: } Integer& value = Integer::Handle(); over here instead of ...
8 years, 10 months ago (2012-02-18 01:25:55 UTC) #6
turnidge
I have synced and made this CL sane again. I have changed the Bootstrap code ...
8 years, 9 months ago (2012-03-07 20:00:14 UTC) #7
ahe
DBC https://chromiumcodereview.appspot.com/9420038/diff/13021/lib/mirrors/mirrors.dart File lib/mirrors/mirrors.dart (right): https://chromiumcodereview.appspot.com/9420038/diff/13021/lib/mirrors/mirrors.dart#newcode16 lib/mirrors/mirrors.dart:16: Future<IsolateMirror> isolateMirrorOf(SendPort port) { Any given isolate may ...
8 years, 9 months ago (2012-03-08 20:14:44 UTC) #8
ahe
Otherwise, Dart code LGTM. I totally understand if you don't want to get bogged down ...
8 years, 9 months ago (2012-03-08 20:16:16 UTC) #9
siva
lgtm https://chromiumcodereview.appspot.com/9420038/diff/6002/runtime/lib/mirrors.cc File runtime/lib/mirrors.cc (right): https://chromiumcodereview.appspot.com/9420038/diff/6002/runtime/lib/mirrors.cc#newcode31 runtime/lib/mirrors.cc:31: } In that case should you just be ...
8 years, 9 months ago (2012-03-08 22:24:01 UTC) #10
turnidge
8 years, 9 months ago (2012-03-08 22:50:50 UTC) #11
https://chromiumcodereview.appspot.com/9420038/diff/6002/runtime/lib/mirrors.cc
File runtime/lib/mirrors.cc (right):

https://chromiumcodereview.appspot.com/9420038/diff/6002/runtime/lib/mirrors....
runtime/lib/mirrors.cc:31: }
On reflection, I was wrong when I said never.

This case can occur if we happen to be in the PortGetId call when another
isolate sends us a (terminating) interrupt.  So it is just very very rare.

In any case, I'll move the handle.

On 2012/03/08 22:24:02, asiva wrote:
> In that case should you just be asserting that result is not an Error?
> 
> On 2012/03/07 20:00:14, turnidge wrote:
> > On 2012/02/18 01:25:55, asiva wrote:
> > > Integer& value = Integer::Handle();
> > > 
> > > over here instead of the current location.
> > 
> > Are you suggesting this to save a handle allocation in the case that
PortGetId
> > fails?  That will never happen if the system is properly configured.
>

https://chromiumcodereview.appspot.com/9420038/diff/6002/runtime/vm/dart_api_...
File runtime/vm/dart_api_impl.cc (right):

https://chromiumcodereview.appspot.com/9420038/diff/6002/runtime/vm/dart_api_...
runtime/vm/dart_api_impl.cc:666: ASSERT(result.IsNull());
On 2012/03/08 22:24:02, asiva wrote:
> On 2012/03/07 20:00:14, turnidge wrote:
> > On 2012/02/18 01:25:55, asiva wrote:
> > > There seems to be some duplication here and in code_generator.cc.
> > > 
> > > Why not have a
> > > RawObject* DartLibraryCalls::HandleMessage(Message* message, bool
> > > oob_messages_only);
> > > which can be then used at both places.
> > 
> > Yes.  There is duplication.  Can I clean it up during my ThreadPool work? 
> I'll
> > be completely rewhacking message send/receive then.
> 
> Ok (maybe add a TODO at the duplication points).

Done.

https://chromiumcodereview.appspot.com/9420038/diff/13021/runtime/vm/bootstra...
File runtime/vm/bootstrap.cc (right):

https://chromiumcodereview.appspot.com/9420038/diff/13021/runtime/vm/bootstra...
runtime/vm/bootstrap.cc:76: }
On 2012/03/08 22:24:02, asiva wrote:
> InitLibrary is a static function in this file and I don't see any references
to
> it, dead code?

Done.

https://chromiumcodereview.appspot.com/9420038/diff/13021/runtime/vm/bootstra...
File runtime/vm/bootstrap_natives.cc (right):

https://chromiumcodereview.appspot.com/9420038/diff/13021/runtime/vm/bootstra...
runtime/vm/bootstrap_natives.cc:68:
reinterpret_cast<Dart_NativeEntryResolver>(NativeLookup));
On 2012/03/08 22:24:02, asiva wrote:
> Did you change Library::CoreLibrary(), Library::CoreImplLibrary etc. to this
> expanded form to avoid access to isolate?
> 
> In that case why not also change Library::IsolateLibrary() also below?
> 

This is debris from before I added Library::MirrorsLibrary.  Fixed.

Powered by Google App Engine
This is Rietveld 408576698