mlippautz@google.com
61bae883ed
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
Review URL: https://codereview.chromium.org//19579006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25186 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-18 22:04:57 +00:00
rmacnak@google.com
3421cfe092
Interpose an Expando cache on reflectClass().
...
R=iposva@google.com
Review URL: https://codereview.chromium.org//19462008
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25181 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-18 20:54:45 +00:00
floitsch@google.com
06493c3460
Revert "Introduce StackTraceOnThrowMixin."
...
This reverts commit r24951.
R=lrn@google.com
Review URL: https://codereview.chromium.org//19579002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25142 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-18 10:39:56 +00:00
rmacnak@google.com
31145d5478
Implement metadata as an internal native. Be honest about which mirrors don't yet support metadata introspection.
...
R=asiva@google.com
Review URL: https://codereview.chromium.org//19235015
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25126 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-17 21:50:54 +00:00
mlippautz@google.com
8b65384ede
Moved some MethodMirror getters from embedded API to lazy native calls.
...
The more complex ones (creating LazyXXXMirror) are still left and will be handled in a separate CL.
Tests are (still) excluded from dart2js, because of one regression test in the same file.
BUG=
R=asiva@google.com
Review URL: https://codereview.chromium.org//19299003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25081 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-17 00:42:30 +00:00
fschneider@google.com
dfd21c06e0
Change resolving of instance methods to check early for name mismatch.
...
The names of actual arguments are checked at resolving time
for a mismatch instead of deferring this check to the function
prologue (emitted as part of the CopyParameters() prologue).
For example:
class A {
foo({a:42}) => null;
}
main() {
var a = new A();
a.foo(b:123); // noSuchMethod: no named parameter named "b".
}
This enables e.g. fast noSuchMethod invocation in the case
of a named argument mismatch.
It also makes the function prologue for instance functions that
use optional parameters shorter by omitting the check for a
name mismatch there.
R=regis@google.com
Review URL: https://codereview.chromium.org//19200002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25041 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-16 09:38:13 +00:00
iposva@google.com
7e7d898b75
Fix dartbug.com/11757:
...
- Ensure that the entry is not cleared while we are adding the key/value pair
during a rehashing operation.
R=asiva@google.com
Review URL: https://codereview.chromium.org//19280006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25039 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-16 00:48:12 +00:00
rmacnak@google.com
87ddfa603f
Fix the build on 64-bit.
...
Review URL: https://codereview.chromium.org//19289002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25025 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-15 21:27:59 +00:00
rmacnak@google.com
39bf0aca44
Implement the invoke methods (invoke, getField, setField, newInstance, apply) as internal natives.
...
R=asiva@google.com
Review URL: https://codereview.chromium.org//18463003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25024 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-15 21:14:43 +00:00
rmacnak@google.com
183c94e250
Implement dynamicType and voidType as TypeMirrors not ClassMirrors. Issue 11743.
...
R=asiva@google.com
Review URL: https://codereview.chromium.org//18343005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25010 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-15 16:32:11 +00:00
floitsch@google.com
3c45bbcbe0
Cleanup VM error handling.
...
Unify the way the runtime throws errors. With this patch the VM goes through one location and always invokes the constructor of the errors.
It also makes it easier to rename fields in the error classes.
R=asiva@google.com
Committed: https://code.google.com/p/dart/source/detail?r=24995
Reverted: https://code.google.com/p/dart/source/detail?r=24997
Review URL: https://codereview.chromium.org//18531003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25000 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-15 10:32:37 +00:00
floitsch@google.com
f14e6b4975
Revert "Cleanup VM error handling."
...
This reverts commit r24995.
Review URL: https://codereview.chromium.org//19172002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24997 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-15 10:18:50 +00:00
floitsch@google.com
ef1afc7f91
Cleanup VM error handling.
...
Unify the way the runtime throws errors. With this patch the VM goes through one location and always invokes the constructor of the errors.
It also makes it easier to rename fields in the error classes.
R=asiva@google.com
Review URL: https://codereview.chromium.org//18531003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24995 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-15 09:28:28 +00:00
srdjan@google.com
cbb9d76c4b
Fix wrong type test optimization when testing against a signature class: we must always consider the instance type arguments as well. FIxes failing tests when run with --optimization-counter-threshold=5.
...
R=regis@google.com
Review URL: https://codereview.chromium.org//18807007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24961 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-12 17:31:19 +00:00
floitsch@google.com
e5cade9e88
Introduce StackTraceOnThrowMixin.
...
R=ahe@google.com , lrn@google.com
Review URL: https://codereview.chromium.org//18259021
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24951 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-12 15:30:53 +00:00
zarah@google.com
93bcd6baf7
Move toString() to collection classes.
...
R=floitsch@google.com
Committed: https://code.google.com/p/dart/source/detail?r=24836
Review URL: https://codereview.chromium.org//18837002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24913 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-11 12:59:12 +00:00
mlippautz@google.com
3b5ba678cd
Add a MirrorReference reflectee to MethodMirrors. Name getter now refers to
...
internal function object, providing a name for for all cases and not only for
the ones a name has been provided in the constructor.
Fixes http://dartbug.com/6335
R=asiva@google.com , rmacnak@google.com
Review URL: https://codereview.chromium.org//18473005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24872 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-10 01:08:19 +00:00
zarah@google.com
a0c76e6d43
Revert "Move toString() to collection classes."
...
This reverts commit 24836
Review URL: https://codereview.chromium.org//18282008
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24837 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-09 09:36:47 +00:00
zarah@google.com
8ed47ae514
Move toString() to collection classes.
...
R=floitsch@google.com
Review URL: https://codereview.chromium.org//18837002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24836 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-09 08:35:54 +00:00
rmacnak@google.com
bba532bc7d
Add a MirrorReference reflectee for ClassMirrors. Rewrite the name accessor in terms of it, at least for the non-special cases.
...
(This is a continuation of 18562005.)
R=asiva@google.com
Review URL: https://codereview.chromium.org//18465006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24826 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-08 22:05:15 +00:00
iposva@google.com
56b0fc10a7
Reland r24563 and r24564 with fixes cumbersome API leading to leaks.
...
- Add a WeakTable to the VM. This is used to remember the
native peers registered through the Dart C API as well
as assigning identity hashcodes to objects when needed.
- Use the hashcode to lookup entries in the Expando.
Review URL: https://codereview.chromium.org//18826007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24822 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-08 21:41:05 +00:00
fschneider@google.com
965819aed9
Inline native setters for length and data in the optimizer.
...
R=srdjan@google.com
Review URL: https://codereview.chromium.org//18292003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24801 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-08 16:27:46 +00:00
hausner@google.com
98883150d6
Partial solution to analyze potentially constant expressions
...
This change adds code that detects if an expression can definitively
never be constant. We use this to analyze the initializer expressions
in const constructors. This check is not entirely water tight, but
together with the checks in canonicalization code catches most
illegal initializer expressions.
The const constructor of class Symbol turns out to be illegal. The
name verification check can't be part of the constructor code.
R=iposva@google.com
Review URL: https://codereview.chromium.org//18649003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24749 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-03 20:47:14 +00:00
floitsch@google.com
438767ca3a
Add stackTrace to Error object.
...
BUG=
R=lrn@google.com
Review URL: https://codereview.chromium.org//18529003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24726 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-03 14:51:30 +00:00
rmacnak@google.com
04e9e1fe56
Add a VM defined class VMReference as an opaque pointer for Dart code to VM internal objects.
...
R=asiva@google.com
Review URL: https://codereview.chromium.org//18242003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24694 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-02 16:17:25 +00:00
iposva@google.com
fb06bcdff3
- Revert r24564 and r24563 due to unexplained malloc corruption.
...
Review URL: https://codereview.chromium.org//18051007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24565 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-28 00:27:25 +00:00
iposva@google.com
9c9989d2f6
- Add a WeakTable to the VM. This is used to remember the
...
native peers registered through the Dart C API as well
as assigning identity hashcodes to objects when needed.
- Use the hashcode to lookup entries in the Expando.
R=asiva@google.com
Review URL: https://codereview.chromium.org//17992002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24563 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-28 00:01:47 +00:00
asiva@google.com
e16291b973
Convert implementation in mirrors.cc to use Dart_GetType instead of Dart_GetClass.
...
R=regis@google.com
Review URL: https://codereview.chromium.org//17582016
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24491 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-26 21:30:18 +00:00
floitsch@google.com
48b1656690
Allow Object when doing lookups.
...
According to our typing rules a Set<Apple> is a Set<Fruit>. However, before this change, we couldn't use it as a Set<Fruit>:
===
bool foo(Set<Fruit> fruits) {
// Would yield a type-error since we actually got a Set<Apple>.
return fruits.contains(new Banana());
}
foo(new Set<Apple>());
===
R=ajohnsen@google.com , blois@google.com , lrn@google.com
Review URL: https://codereview.chromium.org//14246008
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24326 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-24 12:45:10 +00:00
lrn@google.com
64553c2774
Fix expectation for 53-bit-overflow.
...
Make variable in error private.
R=floitsch@google.com
Review URL: https://codereview.chromium.org//17527003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24274 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-21 09:11:14 +00:00
lrn@google.com
0c90061029
Move FiftythreeBitOverflowError to VM-only patch file.
...
The class is not meaningful in the core library, and should go away once
dart2js has integers.
R=floitsch@google.com , srdjan@google.com
Review URL: https://codereview.chromium.org//17361004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24265 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-21 07:31:48 +00:00
lrn@google.com
e73a721d8e
Make String.startsWith take an optional start index.
...
R=floitsch@google.com , ngeoffray@google.com , srdjan@google.com
Review URL: https://codereview.chromium.org//17281002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24142 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-18 13:59:19 +00:00
ahe@google.com
4509912981
Improve toString on mirrors and align VM and dart2js.
...
R=ngeoffray@google.com
Review URL: https://codereview.chromium.org//15679024
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24081 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-17 09:39:12 +00:00
floitsch@google.com
2ae198d527
Reapply "Zone support for Futures, Timer, Streams."
...
This reapplies commit r24034.
This reapplies commit r24035.
This reapplies commit r24036.
This reapplies commit r24037.
+ some status file updates and fixes.
Review URL: https://codereview.chromium.org//17098007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24064 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-15 11:28:38 +00:00
asiva@google.com
51651ee00b
Split dart_api.h into multiple parts:
...
dart_api.h - Has the core API functions
dart_mirrors_api.h - Has API functions to support Mirrors or reflection
dart_native_api.h - Has parts which support the native message handling,
profilling and other internal tools
R=sgjesse@google.com , vsm@google.com
Review URL: https://codereview.chromium.org//16973003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24062 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-14 23:47:40 +00:00
gbracha@google.com
c78462c2ad
Changes to mirrors in support of metadata access at runtime.
...
R=iposva@google.com
Review URL: https://codereview.chromium.org//16757007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24050 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-14 21:12:58 +00:00
floitsch@google.com
bcba9d5c8c
Revert "Zone support for Futures."
...
Revert "Add Zone support for Timers."
Revert "Add zone support to streams."
Revert "catchErrors and waitForCompletion now based on runZonedExperimental."
This reverts commit r24034.
This reverts commit r24035.
This reverts commit r24036.
This reverts commit r24037.
Review URL: https://codereview.chromium.org//17064008
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24042 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-14 17:17:16 +00:00
floitsch@google.com
96c6330215
Add Zone support for Timers.
...
R=lrn@google.com
Review URL: https://codereview.chromium.org//15764003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24035 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-14 16:27:35 +00:00
iposva@google.com
287f80bb1f
- Make sure BoundedType and MixinAppType have a name.
...
- Reenable test from r23964.
Review URL: https://codereview.chromium.org//16924005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23975 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-13 13:02:46 +00:00
lrn@google.com
9b67f92679
Use Pattern.matchAsPrefix to let String.indexOf/lastIndexOf/startsWith accept Pattern.
...
Rearranged co19-runtime.status to only have one section for each configuration,
and tried to keep them in a logical order.
BUG=http://dartbug.com/11129
R=floitsch@google.com
Review URL: https://codereview.chromium.org//16957002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23974 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-13 12:49:44 +00:00
lrn@google.com
9614a603bb
Proof-of-concept matchPrefix on Pattern.
...
Can be used to implement startsWith (and endsWith with a loop).
R=floitsch@google.com
Review URL: https://codereview.chromium.org//15709018
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23897 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-12 08:37:36 +00:00
asiva@google.com
937da3dd4a
Delete some dead code
...
Strings.concatAll
Strings.join
R=srdjan@google.com
Review URL: https://codereview.chromium.org//16654007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23882 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-11 21:13:27 +00:00
asiva@google.com
6f350f1808
Fix exception type to ArgumentError instead of out of memory when checking the length argment of typed data constructors. Change the error message to be similar to that issued from regular list constructors.
...
R=hausner@google.com
Review URL: https://codereview.chromium.org//16347017
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23879 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-11 20:36:37 +00:00
hausner@google.com
bf5835d89e
BREAKING CHANGE: Remove === and !== in the VM compiler
...
This change is long overdue. Fixed the last places where we
still used ===.
R=iposva@google.com
Review URL: https://codereview.chromium.org//16398006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23751 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-07 16:31:33 +00:00
lrn@google.com
7dd35ed656
Better documentation on Sets and Maps.
...
Small updates on other documentation too.
BUG= http://dartbug.com/474 , http://dartbug.com/1289 , http://dartbug.com/5516 , http://dartbug.com/10902 , http://dartbug.com/10315
R=floitsch@google.com , ngeoffray@google.com
Review URL: https://codereview.chromium.org//16285004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23734 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-07 08:51:35 +00:00
lrn@google.com
9ed56a1a56
Make VM's RegExp.allMatches lazy.
...
R=floitsch@google.com
Review URL: https://codereview.chromium.org//16147003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23731 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-07 08:08:46 +00:00
lrn@google.com
450e0f64d9
Fix-up RegExp implementations.
...
VM _JSRegExpMatch didn't have correct "pattern" getter and exposed
too many members. Also didn't allow matching an empty match at the
end of the string with .allMatches.
JS RegExp didn't advance the position correctly after an empty match.
BUG=http://dartbug.com/1301 , http://dartbug.com/6554
R=floitsch@google.com , ngeoffray@google.com
Review URL: https://codereview.chromium.org//16206008
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23675 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-06 11:44:04 +00:00
asiva@google.com
703bad2d2a
Revert change 23636 as it is causing issues on dartium. Will resubmit after investigating the dartium failure.
...
Review URL: https://codereview.chromium.org//16378004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23641 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-05 17:28:01 +00:00
zra@google.com
78ed504ed0
Adds a flag to the standalone vm to throw an exception on 53-bit integer overflow.
...
R=asiva@google.com , srdjan@google.com
Review URL: https://codereview.chromium.org//15743017
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23640 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-05 17:18:07 +00:00
asiva@google.com
bd14296eb7
Fix for issue 1755.
...
Use 'new' in all the snapshot reallocation functions instead of realloc.
This would result in program termination when allocation fails and will
ensure that a NULL will not be returned.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//16271010
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23636 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-05 16:21:04 +00:00