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

Issue 18463003: Implement the invoke methods (invoke, getField, setField, newInstance, apply) as internal natives. (Closed)

Created:
7 years, 5 months ago by rmacnak
Modified:
7 years, 5 months ago
CC:
reviews_dartlang.org, ahe
Visibility:
Public.

Description

Implement the invoke methods (invoke, getField, setField, newInstance, apply) as internal natives. R=asiva@google.com Committed: https://code.google.com/p/dart/source/detail?r=25024

Patch Set 1 #

Patch Set 2 : #

Total comments: 19

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Patch Set 7 : #

Patch Set 8 : #

Total comments: 13

Patch Set 9 : #

Patch Set 10 : #

Patch Set 11 : #

Patch Set 12 : #

Total comments: 24

Patch Set 13 : #

Total comments: 6

Patch Set 14 : #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+931 lines, -349 lines) Patch
M runtime/lib/mirrors.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 7 chunks +645 lines, -256 lines 3 comments Download
M runtime/lib/mirrors_impl.dart View 1 2 3 4 5 6 7 8 9 10 11 12 13 16 chunks +125 lines, -80 lines 0 comments Download
M runtime/vm/bootstrap_natives.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +11 lines, -5 lines 0 comments Download
M runtime/vm/dart_entry.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +7 lines, -0 lines 0 comments Download
M runtime/vm/dart_entry.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +53 lines, -0 lines 0 comments Download
M runtime/vm/exceptions.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -0 lines 0 comments Download
M runtime/vm/exceptions.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +8 lines, -0 lines 0 comments Download
M runtime/vm/object.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +4 lines, -0 lines 0 comments Download
M runtime/vm/symbols.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -0 lines 0 comments Download
M tests/lib/mirrors/mirrors_test.dart View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +74 lines, -8 lines 1 comment Download

Messages

Total messages: 15 (0 generated)
rmacnak
https://codereview.chromium.org/18463003/diff/5002/runtime/lib/mirrors.cc File runtime/lib/mirrors.cc (right): https://codereview.chromium.org/18463003/diff/5002/runtime/lib/mirrors.cc#newcode1399 runtime/lib/mirrors.cc:1399: // object.h/.c is questionable. Questionable https://codereview.chromium.org/18463003/diff/5002/runtime/lib/mirrors.cc#newcode1466 runtime/lib/mirrors.cc:1466: static RawObject* ...
7 years, 5 months ago (2013-07-09 21:04:53 UTC) #1
rmacnak
Handle attempting a setter on null. Ensure all exceptions are catchable. The wrapped exception is ...
7 years, 5 months ago (2013-07-11 21:27:56 UTC) #2
siva
Here is my initial comment list, some of these might have already been addressed by ...
7 years, 5 months ago (2013-07-11 22:53:37 UTC) #3
siva
https://chromiumcodereview.appspot.com/18463003/diff/5302669702856704/runtime/lib/mirrors.cc File runtime/lib/mirrors.cc (right): https://chromiumcodereview.appspot.com/18463003/diff/5302669702856704/runtime/lib/mirrors.cc#newcode1312 runtime/lib/mirrors.cc:1312: static RawError* CreateMirroredError(const Error& error) { Why can't this ...
7 years, 5 months ago (2013-07-11 23:50:59 UTC) #4
rmacnak
https://chromiumcodereview.appspot.com/18463003/diff/5002/runtime/lib/mirrors.cc File runtime/lib/mirrors.cc (right): https://chromiumcodereview.appspot.com/18463003/diff/5002/runtime/lib/mirrors.cc#newcode1395 runtime/lib/mirrors.cc:1395: } On 2013/07/11 22:53:37, siva wrote: > This seems ...
7 years, 5 months ago (2013-07-11 23:59:23 UTC) #5
rmacnak
https://chromiumcodereview.appspot.com/18463003/diff/5302669702856704/runtime/lib/mirrors.cc File runtime/lib/mirrors.cc (right): https://chromiumcodereview.appspot.com/18463003/diff/5302669702856704/runtime/lib/mirrors.cc#newcode1312 runtime/lib/mirrors.cc:1312: static RawError* CreateMirroredError(const Error& error) { On 2013/07/11 23:50:59, ...
7 years, 5 months ago (2013-07-12 00:04:09 UTC) #6
rmacnak
Now there are no uses of ApiError in the new natives.
7 years, 5 months ago (2013-07-12 16:49:21 UTC) #7
rmacnak
Added the internal native for ClosureMirror_apply, which follows the same pattern as the other invokes. ...
7 years, 5 months ago (2013-07-12 20:12:46 UTC) #8
siva
This CL is becoming too big. Can we not add more new functionality into this ...
7 years, 5 months ago (2013-07-15 05:42:57 UTC) #9
rmacnak
https://chromiumcodereview.appspot.com/18463003/diff/70001/runtime/lib/mirrors.cc File runtime/lib/mirrors.cc (right): https://chromiumcodereview.appspot.com/18463003/diff/70001/runtime/lib/mirrors.cc#newcode1158 runtime/lib/mirrors.cc:1158: exc_string ^= Instance::null(); On 2013/07/15 05:42:58, siva wrote: > ...
7 years, 5 months ago (2013-07-15 19:53:22 UTC) #10
siva
lgtm https://chromiumcodereview.appspot.com/18463003/diff/86001/runtime/lib/mirrors.cc File runtime/lib/mirrors.cc (right): https://chromiumcodereview.appspot.com/18463003/diff/86001/runtime/lib/mirrors.cc#newcode1271 runtime/lib/mirrors.cc:1271: // exceptions. Wrap and propgrate any compilation errors. ...
7 years, 5 months ago (2013-07-15 20:52:52 UTC) #11
rmacnak
On 2013/07/15 20:52:52, siva wrote: > lgtm > > https://chromiumcodereview.appspot.com/18463003/diff/86001/runtime/lib/mirrors.cc > File runtime/lib/mirrors.cc (right): > ...
7 years, 5 months ago (2013-07-15 21:14:30 UTC) #12
rmacnak
Committed patchset #14 manually as r25024 (presubmit successful).
7 years, 5 months ago (2013-07-15 21:14:49 UTC) #13
Florian Schneider
dbc: https://chromiumcodereview.appspot.com/18463003/diff/99001/runtime/lib/mirrors.cc File runtime/lib/mirrors.cc (right): https://chromiumcodereview.appspot.com/18463003/diff/99001/runtime/lib/mirrors.cc#newcode1321 runtime/lib/mirrors.cc:1321: args.SetAt((i + num_receiver), arg); Please don't over-parenthesize. I ...
7 years, 5 months ago (2013-07-16 09:39:56 UTC) #14
ahe
7 years, 5 months ago (2013-07-16 10:40:46 UTC) #15
Message was sent while issue was closed.
DBC

I'd really appreciate if you could CC me on future CLs that add new mirror
tests.

https://codereview.chromium.org/18463003/diff/99001/tests/lib/mirrors/mirrors...
File tests/lib/mirrors/mirrors_test.dart (right):

https://codereview.chromium.org/18463003/diff/99001/tests/lib/mirrors/mirrors...
tests/lib/mirrors/mirrors_test.dart:40: expect(instMirror.invoke(const
Symbol("notDefined"), []).reflectee,
It would be great if you could avoid making further modifications to this test.

Instead, prefer writing small tests that test a specific part of the mirror API,
much like the tests I have added to this directory.

Big tests tend to take longer to run.  Eventually, a large test will test so
much that it starts timing out.  Also, if a part of a big test is broken, you
lose all test coverage when you mark it as failing.  So in general, we prefer
small tests.

Also, you should avoid using the unittest framework in new tests.  It is likely
that the unittest framework will start relying more and more on reflection. 
This means we will have a hard time testing the mirror API.

Also, when you modified this test, something unexpected happened: it started
passing in dart2js' CSP mode.  I have no idea why that is, but clearly there was
something in the old version that caused problems.  That is another reason to
avoid modifying existing tests.

Powered by Google App Engine
This is Rietveld 408576698