Commit Graph

776 Commits

Author SHA1 Message Date
mlippautz@google.com 58beb194dc Hoist .simpleName and .qualifiedName up to _LocalDeclarationMirrorImpl.
Current tests already cover this change.

BUG=
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25647 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-30 22:22:17 +00:00
mlippautz@google.com 8bfc72b1b9 Inline CreateLibraryMirror.
BUG=
R=asiva@google.com, rmacnak@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25640 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-30 20:52:44 +00:00
srdjan@google.com d75a60f4af Remove unnecessary, performance degrading equality override in class bool.
R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25627 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-30 18:09:23 +00:00
rmacnak@google.com b68bc10c6c Create the local MirrorSystem with internal code.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25601 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-30 01:09:05 +00:00
rmacnak@google.com 47f7d23626 Ensure FunctionTypeMirrors have a proper reflectee and implement ClassMirror.superinterfaces with internal code. Remove some unnecessary fields and constructor arguments.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25599 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-30 00:29:52 +00:00
rmacnak@google.com 844a406c8a Implement reflect() with Dart code, InstanceMirror.type and ClosureMirror.function with internal code.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25594 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-29 23:57:31 +00:00
johnmccutchan@google.com 2e4754ecf5 Add Float32x4List.fromList to runtime implementation and some tests
R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25586 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-29 21:32:06 +00:00
mlippautz@google.com 5f4e6e6000 Remove dead code from native mirrors library.
BUG=
R=rmacnak@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25576 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-29 17:49:04 +00:00
rmacnak@google.com bd07e14c9a Make ClassMirror.constructors an internal native and lazy.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25533 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-26 18:29:38 +00:00
rmacnak@google.com b0cd678f0c Implement ClassMirror.superclass with internal code for ordinary (but not function type) classes. Resolves issue 5794 and issue 9434.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25508 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-25 22:45:07 +00:00
mlippautz@google.com 4415c965d1 BUG=
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25499 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-25 21:10:09 +00:00
rmacnak@google.com 670a0345ca Wrap lazy compilation errors when parsing metadata. Addresses the poor error reporting in issue 12027.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25498 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-25 20:49:59 +00:00
asiva@google.com dcb6850f87 Fix for issue 11680
- implicitly store a full stack trace in Error objects when they are thrown.
- the shlFromInt on Mints and Bigints was trying to allocate a new OutOfMemory
  exception objects instead of using the pre-allocated exception object.
  Made the implementation of these methods native so that they can use the
  pre-allocated object.
- Ensure that it is not possible to allocate new OutOfMemory or StackOverflow
  exception objects.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25492 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-25 19:28:53 +00:00
rmacnak@google.com 6ee2707fc6 Address some drive-by comments: equality without hash, types in the instantiation expression.
R=ahe@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25478 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-25 16:37:05 +00:00
rmacnak@google.com 4a98a91696 Change the return value of setField to be in line with non-reflective assignments. Complete unwrapping of exceptions for the InstanceMirror invokes. Resolves issue 11219 and issue 11943.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25457 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-25 00:18:42 +00:00
rmacnak@google.com 8ebdd7f9d8 Make LibraryMirror.members an internal native and lazy.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25451 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-24 23:51:15 +00:00
mlippautz@google.com db8354cd4b Inline CreateParameterMirrorList() functionality.
BUG=
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25450 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-24 23:35:15 +00:00
johnmccutchan@google.com cebd147b39 Add two argument shuffle operations to Float32x4
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25443 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-24 21:29:45 +00:00
rmacnak@google.com 1a0b3c7871 Make reflective invocations raise NoSuchMethodErrors in the cases where non-reflective invocations do so. Resolves issues 11187 and 11957.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25387 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-24 00:29:17 +00:00
rmacnak@google.com c745da73af Make ClassMirror.members internal-native and lazy.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25384 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-23 23:54:16 +00:00
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