floitsch@google.com
279849d941
Fix sublist check, add missing methods and add tests for typed data lists.
...
Somehow these lists were still missing functions (in the VM) and the sublist check was broken (in dart2js).
R=ngeoffray@google.com
Review URL: https://codereview.chromium.org//19965003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25333 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-23 09:20:05 +00:00
mlippautz@google.com
9d367d788d
Local change to make the type getter lazy.
...
This change adds the last piece missing to inline functionality of CreateMethodMirror and its parameters. (Separate CL.)
BUG=
R=asiva@google.com
Review URL: https://codereview.chromium.org//19983003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25325 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-23 00:39:28 +00:00
regis@google.com
9581071936
Refactor resolution code in the vm to properly handle ambiguity errors.
...
Add test.
R=asiva@google.com
Review URL: https://codereview.chromium.org//19662003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25324 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-23 00:19:39 +00:00
rmacnak@google.com
6c2d006377
Fix a regression in ObjectMirror.setFieldAsync (issue 11898).
...
R=asiva@google.com
Review URL: https://codereview.chromium.org//20006003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25323 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-23 00:02:28 +00:00
rmacnak@google.com
9c4fef756b
Implement VariableMirror creation with non-API code. To break circular initialization, have them find their type lazily.
...
R=asiva@google.com
Review URL: https://codereview.chromium.org//19512003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25317 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-22 23:05:54 +00:00
mlippautz@google.com
b58e38269b
This change introduces nothing new. It only fixes the native entrypoints to use the right macros.
...
BUG=
R=asiva@google.com
Review URL: https://codereview.chromium.org//19500016
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25315 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-22 22:49:08 +00:00
mlippautz@google.com
b3cb27a829
Since returnType is represented by a mirror, we make it lazy. We do not use a lazy mirror anymore, but instead create a type mirror upon first access.
...
CreateTypeMirror is already factored out of MethodMirror_return_type since it is needed by others mirrors (future CLs). Also introduces CreateMirror() which will be used in future CLs.
BUG=
R=asiva@google.com
Review URL: https://codereview.chromium.org//19780002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25252 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-19 23:17:47 +00:00
rmacnak@google.com
f85d1df63e
Fix regression in TypedefMirror.owner introduced when making ClassMirror.owner lazy.
...
R=asiva@google.com
Review URL: https://codereview.chromium.org//19749008
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25244 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-19 21:16:29 +00:00
johnmccutchan@google.com
522a7ef504
Add all 256 shuffle methods to Float32x4
...
R=srdjan@google.com
Review URL: https://codereview.chromium.org//19564014
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25227 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-19 17:03:09 +00:00
rmacnak@google.com
448dbb1017
Make the ClassMirrors created through reflectClass() find their owners (libraries) lazily.
...
Remove an unused parameter that was threaded through a number of mirror creation functions.
R=asiva@google.com
Review URL: https://codereview.chromium.org//19188004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25193 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-19 00:44:36 +00:00
rmacnak@google.com
08e322a197
Introduce an abstract DeclarationMirror in the implementation hierarchy; add a MirrorReference reflectee to TypedefMirror and TypeVariableMirror.
...
R=asiva@google.com
Review URL: https://codereview.chromium.org//19604004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25187 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-18 22:13:55 +00:00
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