Commit Graph

326 Commits

Author SHA1 Message Date
rmacnak@google.com 967a6c96e9 VM: Match language error when attempting to reflectively instantiate an abstract class.
R=srdjan@google.com

Review URL: https://codereview.chromium.org//114593002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31115 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-12 22:34:10 +00:00
regis@google.com fb6d24945f Introduce class TypeRef in the VM to fully support recursive types.
Fix issues 15244, 15148, 14869, 14000, and 13688 (was closed, but fragile).

Note that the current solution is not final as it may not be correct in more
complex cases not yet covered by language tests.
The final solution will require a 'trail' instead of a simple mark bit to
prevent operations involving recursive types to diverge.

R=asiva@google.com

Review URL: https://codereview.chromium.org//103913005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31087 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-11 22:51:19 +00:00
rmacnak@google.com 0bc05d6c3c VM: Make ObjectMirror.invoke support getters returning functions.
BUG=http://dartbug.com/15138
R=asiva@google.com

Review URL: https://codereview.chromium.org//112193002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31076 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-11 19:43:48 +00:00
rmacnak@google.com 314da361f0 Add demangle utility to Dartium's dart:html. Demangle typedef names in UserVisibleName.
BUG=http://dartbug.com/14892
R=asiva@google.com, vsm@google.com

Review URL: https://codereview.chromium.org//79023010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30636 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-25 18:31:20 +00:00
rmacnak@google.com 2e89f4f4d6 Drop "Impl" suffix from local mirror class names.
R=asiva@google.com

Review URL: https://codereview.chromium.org//63393003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30321 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-15 22:44:44 +00:00
regis@google.com 2a355a7bb6 Lazily format LanguageError messages (fix issue 15069).
R=iposva@google.com

Review URL: https://codereview.chromium.org//68113028

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30308 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-15 18:54:24 +00:00
rmacnak@google.com bc39a8afe8 When ClassMirrors are created by enumerating members of a LibraryMirror, have the ClassMirror use that LibraryMirror as its owner.
BUG=http://dartbug.com/14449
R=asiva@google.com

Review URL: https://codereview.chromium.org//68103016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30291 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-14 20:35:59 +00:00
regis@google.com 694401d38e Rename mixin typedef to mixin application alias in VM.
R=hausner@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org//71693003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30277 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-14 17:42:39 +00:00
rmacnak@google.com 1dcc9ea681 Ensure constructorName symbols include private manglings.
R=asiva@google.com, gbracha@google.com

Review URL: https://codereview.chromium.org//53883002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30178 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-11 23:08:38 +00:00
regis@google.com e3da5e16e4 Check type bounds of redirecting factories (issue 14699).
Add tests for malbounded redirecting factories.
Clean up bound checking code and type error reporting code.

R=hausner@google.com

Review URL: https://codereview.chromium.org//66033006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30177 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-11 22:59:48 +00:00
rmacnak@google.com cc3e05ea99 Implement VariableMirror.isConst in the VM and ParameterMirror.isConst in dart2js.
BUG=http://dartbug.com/14671
R=ahe@google.com, asiva@google.com, gbracha@google.com

Review URL: https://codereview.chromium.org//58183003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30161 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-11 17:54:58 +00:00
rmacnak@google.com 93d342b42e Use the runtime for generic subsitution of variable types, return types, parameter types.
BUG=http://dartbug.com/14613
BUG=http://dartbug.com/14156
R=gbracha@google.com, regis@google.com

Review URL: https://codereview.chromium.org//62273003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30120 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-08 17:54:59 +00:00
rmacnak@google.com f3384bf0eb Hide ClosureMirror.findInContext behind a flag for 1.0.
Test findInContext does not wildcard privates. Fix confused test and implementation that expected inheritance of static members.

BUG=http://dartbug.com/13656
R=ahe@google.com, asiva@google.com, gbracha@google.com

Review URL: https://codereview.chromium.org//52953002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29697 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-31 20:50:17 +00:00
rmacnak@google.com 05bd81f872 Align behavior of VM's ObjectMirror.setField with language semantics.
R=ahe@google.com, asiva@google.com, gbracha@google.com

Review URL: https://codereview.chromium.org//38543002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29692 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-31 20:21:01 +00:00
rmacnak@google.com bcb8707fcd Test reflecting on an object that implements Function but has no call method.
BUG=http://dartbug.com/13957
R=asiva@google.com, gbracha@google.com

Review URL: https://codereview.chromium.org//26777002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29374 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-28 17:25:47 +00:00
regis@google.com 20badfb06e Register synthesized mixin application classes in the library and reuse them
when possible (fix issue 14318).

R=asiva@google.com, hausner@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org//42723003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29276 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-25 19:46:32 +00:00
rmacnak@google.com cfa80041e9 VM: Always return immutable collections from the mirrors.
Fix assert in partial demangling. Fix inappropriate compilation when handling parameters.

BUG=http://dartbug.com/14027
R=ahe@google.com, asiva@google.com

Review URL: https://codereview.chromium.org//34533003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29030 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-22 19:53:14 +00:00
rmacnak@google.com bd284f7262 Generic typedefs and their referents.
BUG=http://dartbug.com/12282
R=regis@google.com

Review URL: https://codereview.chromium.org//27728004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28972 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-22 00:00:08 +00:00
rmacnak@google.com a5fd049d73 Hide MirroredCompilationErrror behind a flag until post-1.0. Remove VM reference to MirroredUncaughtExceptionError.
R=asiva@google.com, gbracha@google.com

Review URL: https://codereview.chromium.org//28053005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28946 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-21 20:12:49 +00:00
rmacnak@google.com addba00bd7 Fix VM crash when ClosureMirror.findInContext operates on a fake function.
R=asiva@google.com, gbracha@google.com

Review URL: https://codereview.chromium.org//29413003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28937 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-21 17:10:21 +00:00
rmacnak@google.com 0d23dbc1e2 Make TypedefMirror a direct descendant of TypeMirror.
BUG=http://dartbug.com/11616
R=ahe@google.com, asiva@google.com

Review URL: https://codereview.chromium.org//24005002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28862 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-18 16:59:55 +00:00
rmacnak@google.com 58c1759454 Generic instantiations of mixins and interfaces. Equality of type parameters.
BUG=http://dartbug.com/14113
BUG=http://dartbug.com/14114
R=regis@google.com

Review URL: https://codereview.chromium.org//27610002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28768 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-17 00:16:34 +00:00
rmacnak@google.com e8d030b338 Do not hide membership of implementation classes in dart:core.
BUG=http://dartbuc.com/12141
R=ahe@google.com, asiva@google.com, gbracha@google.com

Review URL: https://codereview.chromium.org//27226003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28695 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-16 00:15:10 +00:00
rmacnak@google.com 564fbb68dd Add proper API for creating private symbols wrt a library.
BUG=http://dartbug.com/13355
BUG=http://dartbug.com/12358
R=ahe@google.com, asiva@google.com, gbracha@google.com

Review URL: https://codereview.chromium.org//24631003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28551 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-11 20:56:14 +00:00
rmacnak@google.com 8a0d62f5f9 Substitution for type variables in mirrors on instantiated generics.
BUG=http://dartbug.com/12282
BUG=http://dartbug.com/13808
R=gbracha@google.com, regis@google.com

Review URL: https://codereview.chromium.org//26344006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28495 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-11 01:51:11 +00:00
rmacnak@google.com 6ed9f2c17f Implement constructor kinds in the VM mirrors.
BUG=http://dartbug.com/13798
R=asiva@google.com, hausner@google.com

Review URL: https://codereview.chromium.org//26436004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28416 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-09 20:40:11 +00:00
rmacnak@google.com 41f0d0e0f1 Correctly report the type of initializing formals declared without an explicit type to be the type of the corresponding field.
BUG=http://dartbug.com/11281
R=gbracha@google.com, hausner@google.com

Review URL: https://codereview.chromium.org//26346002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28349 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-08 01:08:59 +00:00
srdjan@google.com 1676113897 Fix runtimeType for strings, integers and double: return their interface type.
R=asiva@google.com

Review URL: https://codereview.chromium.org//25674017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28286 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-04 22:08:55 +00:00
rmacnak@google.com b56528fd99 Make the implementations of InstanceMirror.hashCode use dart:core's identityHashCode.
R=ahe@google.com, lrn@google.com

Review URL: https://codereview.chromium.org//25099003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28229 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-03 16:38:19 +00:00
srdjan@google.com b6b3e1f400 Factor out throwing of argument error.
R=asiva@google.com

Review URL: https://codereview.chromium.org//25566002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28109 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-01 18:48:37 +00:00
rmacnak@google.com ab2d2fc25b Make ClassMirror.newInstance deal with reordered etc type arguments for redirecting factories.
BUG=http://dartbug.com/11781
BUG=http://dartbug.com/13365
R=regis@google.com

Review URL: https://codereview.chromium.org//25097005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28106 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-01 18:23:24 +00:00
mlippautz@google.com 19763aae4d Implementation for ClosureMirror.findInContext.
Fixes issue 5897.

BUG=https://code.google.com/p/dart/issues/detail?id=5897
R=asiva@google.com, gbracha@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org//23633002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27982 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-27 01:28:12 +00:00
rmacnak@google.com 753af9b01b Implement closurization of regular methods in ObjectMirror.getField in the VM.
BUG=http://dartbug.com/13001
BUG=http://dartbug.com/13002
R=asiva@google.com

Review URL: https://codereview.chromium.org//23441073

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27916 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-25 21:42:13 +00:00
mlippautz@google.com b09bbf706b Add metadata to type parameters. Reflective access is provided by TypeVariableMirror.
Addresses issue 10906.

BUG=https://code.google.com/p/dart/issues/detail?id=10906
R=asiva@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org//23872010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27523 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-16 16:53:24 +00:00
iposva@google.com f1583dec18 - More use of pre-allocated read-only handles.
R=zra@google.com

Review URL: https://codereview.chromium.org//23510006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27490 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-13 16:55:57 +00:00
rmacnak@google.com aa8d63aeea Properly handle exceptions that arise when reflectively invoking a constructor/factory.
R=asiva@google.com

Review URL: https://codereview.chromium.org//23994007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27439 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-12 17:42:08 +00:00
rmacnak@google.com 07c4d9d0c6 Fill in type arguments when creating an object from the mirrors or embedding API.
BUG=http://dartbug.com/13186
BUG=http://dartbug.com/12921
R=regis@google.com

Review URL: https://codereview.chromium.org//23983026

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27417 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-12 00:48:16 +00:00
mlippautz@google.com 1cf1806f29 Remove unreachable code in mirrors.
The only case where we do not set the name in the constructor is for anonymous
mixin applications.

BUG=
R=asiva@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org//23531037

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27390 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-11 16:10:43 +00:00
hausner@google.com fd57843900 Update handling of ambiguous name references
Update VM to latest spec. Referencing a name that is imported
from more than one library is no longer a compile-time error.
If one of the sources of an ambiguous reference is a dart library,
the dart library declaration is automatically hidden.

Also fixes a bug where looking up a getter name in a library
found the getter even though the name is filtered out in the
'hide' combinator.

Long-term we should fix the need for repeatedly convert between
the mangled getter and setter names and the untangled name.

Fixes 12915, 12913, 12724.

R=regis@google.com

Review URL: https://codereview.chromium.org//23484020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27312 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-09 21:52:40 +00:00
regis@google.com 765aac1496 Keep track of the application of a mixin type to a mixin application class,
which includes setting up its type parameters (fix issue 12871).

R=asiva@google.com

Review URL: https://codereview.chromium.org//23453024

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27157 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-04 22:21:36 +00:00
srdjan@google.com 7fb4b62586 Fix build breakage.
R=rmacnak@google.com

Review URL: https://codereview.chromium.org//23658019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27135 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-04 17:46:53 +00:00
rmacnak@google.com d7d3588a55 Support named and optional positional arguments in reflective invocation.
R=ahe@google.com, regis@google.com

Review URL: https://codereview.chromium.org//23604003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27134 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-04 17:12:28 +00:00
rmacnak@google.com 865ef54309 Implement ParameterMirror.metadata.
BUG=http://dartbug.com/10906
BUG=http://dartbug.com/11418
R=asiva@google.com

Review URL: https://codereview.chromium.org//23224016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27082 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-03 22:50:15 +00:00
rmacnak@google.com 64fd5a5079 Implement InstanceMirror.== in dart2js and InstanceMirror.hashCode in the VM and dart2js.
BUG=http://dartbug.com/12909
BUG=http://dartbug.com/12919
R=ahe@google.com, asiva@google.com

Review URL: https://codereview.chromium.org//23460013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27075 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-03 20:11:11 +00:00
rmacnak@google.com 919eae46a1 Ensure class mirrors on non-generic classes always have their runtime type set. Add a test for class mirror equality.
BUG=http://dartbug.com/12800
R=ahe@google.com, asiva@google.com

Review URL: https://codereview.chromium.org//23657002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26951 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-30 21:51:31 +00:00
rmacnak@google.com ac705b02a7 More reflection of mixin applications in the VM.
*Provide ClassMirror.mixin
*Hide extra class on the inheritance chain introduced in mixin typedefs
*Give mixin applications a simpleName that matches the source language syntax
*Update mixin_test to distinguish between members and constructors
*Update mixin_test for the mixin application naming scheme

BUG=http://dartbug.com/12464
R=ahe@google.com, asiva@google.com

Review URL: https://codereview.chromium.org//23190003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26824 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-28 22:55:53 +00:00
kmillikin@google.com 4f80ef09df Change Bool::Get to return a handle instead of a pointer to a raw object.
Replace occurrences of 'expr ? Bool::True() : Bool::False()' with simply
'Bool::Get(expr)' and analogously for its negation.  The pointer to the raw
object can still be extracted with 'Bool::Get(expr).raw()'.

R=iposva@google.com, srdjan@google.com

Review URL: https://codereview.chromium.org//23480005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26770 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-28 08:38:56 +00:00
mlippautz@google.com 817a6fff3a Implement ParameterMirror.{isFinal,hasDefaultValue,defaultValue}.
Fixes issue 12196 and partially addresses issue 12430.

BUG=
R=ahe@google.com, asiva@google.com, gbracha@google.com

Review URL: https://codereview.chromium.org//23020025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26730 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-27 17:31:09 +00:00
mlippautz@google.com b708a455d1 Fix Function.end_token_pos() and implement MethodMirror.source getter.
Move .source getter from ClosureMirror to MethodMirror (as the TODO already suggested) and provide an implementation.

BUG=
R=asiva@google.com, hausner@google.com

Review URL: https://codereview.chromium.org//23038010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26659 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-26 17:14:07 +00:00
rmacnak@google.com 7ed3644358 Make reflectClass(dynamic) throw an illegal argument exception.
BUG=
R=gbracha@google.com, iposva@google.com

Review URL: https://codereview.chromium.org//22633005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26550 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-22 20:05:51 +00:00