Commit Graph

1092 Commits

Author SHA1 Message Date
rmacnak@google.com 9c105f7c9c Handle creating ParameterMirrors for the parameters of forwarding constructors.
BUG=http://dartbug.com/17823
R=hausner@google.com, regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34494 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-28 01:22:03 +00:00
hausner@google.com ed24226376 Support deferred library prefix syntax
First step towards deferred library support:
- Parse the “deferred as” import clause.
- Implement p.loadLibrary() which returns a future that
  completes when the library is loaded.
- Treat type annotations of deferred types as malformed.
- Throw NoSuchMethodError when calling functions from
  unloaded libraries.
- Libraries are still read synchronously, but items in the
  library won’t be visible through the deferred prefix until
  the future returned by loadLibrary() completes.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34481 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-27 21:20:47 +00:00
iposva@google.com 0977a3bf2b - First step in refactoring ports with the goal of moving
them closer into the VM implementation.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34438 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-26 17:30:39 +00:00
ajohnsen@google.com a9f357b4b6 Speed up toLowerCase, by manually inlining the upper-case part.
Some benchmarks show up to 25% faster toLowerCase.

BUG=
R=lrn@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34423 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-26 12:19:55 +00:00
lrn@google.com 249d09fd82 Optimize String.fromCharCode.
BUG= http://dartbug.com/17781
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34419 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-26 11:37:01 +00:00
rmacnak@google.com 78ab60a0de Implement MethodMirror.location in the VM.
R=gbracha@google.com, hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34400 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-26 00:44:54 +00:00
ajohnsen@google.com fbdb9a85d8 Add optimized _OneByteString.toLowerCase.
BUG=
R=sgjesse@google.com, sra@google.com, srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34393 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-25 21:44:09 +00:00
ajohnsen@google.com 38bfed114d Fix memory-issue String::fromCharCodes, where a GC could invalidate an address.
The constructions is now reordered, so the address is not extracted
until after allocation of the new string.

BUG=https://code.google.com/p/dart/issues/detail?id=17602
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34320 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-24 18:56:36 +00:00
lrn@google.com cb3e82c2f8 Optimize VM parsing of JSON String and number literals.
Extracted from https://codereview.chromium.org/181543004/

R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34297 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-24 10:24:20 +00:00
asiva@google.com d302dc431a Auto delete persistent weak handles during finalization after invoking the callback associated with the weak handle.
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34208 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-20 21:45:43 +00:00
rmacnak@google.com e88d2a11cd Also remove Dart native method.
Review URL: https://codereview.chromium.org//199863005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33793 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-18 00:11:44 +00:00
rmacnak@google.com f8c59de4d6 Clean up ClosureMirror.invoke(#call, ...).
R=asiva@google.com, gbracha@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33790 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-17 23:43:32 +00:00
iposva@google.com 383f9c03c2 - Avoid exposing the 64-bit state of the PRNG to Dart code.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33778 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-17 21:27:24 +00:00
fschneider@google.com 37b30ab2ac Alternative fix for .call invocation of closures.
This also covers "closurization" of the .call method.
This relies on the fact that f.call === f if f is a closure.
This means that adding a simple getter to _FunctionImpl that
 returns this is enough. No need for a separate dispatch.

This CL reverts the previous fix for issue 12602 (modulo the
additional tests).

BUG=dartbug.com/17473, dartbug.com/12602
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33736 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-17 10:31:33 +00:00
iposva@google.com 214ecc0e2a - Do not rely on time to seed the default PRNG.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33704 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-14 17:30:05 +00:00
rmacnak@google.com 8c0e1a602e Fix LibraryMirror.invoke to call through the contents of an implicit getter.
BUG=http://dartbug.com/17452
R=asiva@google.com, gbracha@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33682 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-14 01:14:06 +00:00
lrn@google.com f95e190651 Add string.trimLeft/trimRight.
BUG= http://dartbug.com/5589
R=floitsch@google.com, sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33638 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-13 07:16:51 +00:00
srdjan@google.com 714acd1944 Recognize _TypedListBase._cid native. Use Lists.copy instead of native _setRange if list is small. Restore performance of HttpServeStrings.
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33624 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-12 23:10:23 +00:00
rmacnak@google.com 10ecef7968 Remove ObjectMirror.[].
R=ahe@google.com, gbracha@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33543 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-11 18:21:13 +00:00
srdjan@google.com 8de0c6eb8e Fix performance of setRange by avoiding going to Lists.copy which can become polymorphic.
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33540 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-11 16:56:55 +00:00
rmacnak@google.com 57dd1321d1 Reapply "Access to imports in the VM's runtime mirrors. Extend test coverage of the source mirrors."
Regenerate snapshot test due to change in the size of Namespace. Relate the types source mirror libraries dependencies to the runtime library dependencies.

BUG=http://dartbug.com/10360

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33441 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-07 19:00:20 +00:00
lrn@google.com 13d8eae15a Faster _Smi.toString()
Add tests.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33416 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-07 09:31:53 +00:00
rmacnak@google.com 62ad4b82ce Revert "Access to imports in the VM's runtime mirrors. Extend test coverage of the source mirrors."
Review URL: https://codereview.chromium.org//189293002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33402 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-06 22:45:29 +00:00
rmacnak@google.com 2d0e54a94d Access to imports in the VM's runtime mirrors. Extend test coverage of the source mirrors.
BUG=http://dartbug.com/10360
R=gbracha@google.com, hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33397 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-06 22:02:29 +00:00
ajohnsen@google.com b26561d41d Fix last commit.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33364 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-06 09:24:54 +00:00
ajohnsen@google.com c3dfdbe772 Fix fromEnvironment when called from isolates.
BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33363 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-06 09:16:41 +00:00
lrn@google.com fd4b12a479 Fix file still using old Isolate constructor.
Review URL: https://codereview.chromium.org//187793002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33329 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-05 14:25:15 +00:00
rmacnak@google.com 42e8c08b3c Match existing expectation that delegate returns unwrapped values.
TBR

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33306 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-04 21:56:57 +00:00
rmacnak@google.com d515f61a35 Work around bug where closures are missing #call to support delegation of #call to closures.
BUG=http://dartbug.com/16995
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33303 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-04 21:10:04 +00:00
rmacnak@google.com d3a92a0f3d Hoist hasReflectedType and reflectedType from ClassMirror to TypeMirror.
R=gbracha@google.com, regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33291 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-04 19:01:26 +00:00
asiva@google.com e380b175f8 Pass in the isolate parameter to the weak persistent callback handler so that
there is no need to access the current isolate in the callback and delete
path (this code is run while a GC is in progress).

See https://codereview.chromium.org/185643003/ for corresponding changes
in dartium

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33282 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-04 18:11:19 +00:00
ajohnsen@google.com 1ce402ec78 Revert "Re-apply 'Fix fromEnvironment when called from isolates.'"
This reverts commit 1f2ddd083424a93dc0822c2ae86be971d5a97e21.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33278 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-04 16:05:21 +00:00
ajohnsen@google.com fb97ee0fe1 Re-apply 'Fix fromEnvironment when called from isolates.'
Old Review URL: https://codereview.chromium.org//186393004

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33274 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-04 14:22:54 +00:00
ajohnsen@google.com e8ad108bec Revert "Fix fromEnvironment when called from isolates."
This reverts commit f5886c3a1fe96580c13d83d6422a6bb6931ae95a.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33266 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-04 11:06:39 +00:00
ajohnsen@google.com 7e55a59ce4 Fix fromEnvironment when called from isolates.
BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33264 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-04 10:26:17 +00:00
rmacnak@google.com 7c4a84d130 Remove LibraryMirror.topLevelMembers.
R=gbracha@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33256 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-04 01:35:07 +00:00
hausner@google.com ad3fb79210 Better error message for assignment to final local variables
“No top-level getter found” becomes “cannot assign to final variable xxx”.

Fixes issue 16782.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33028 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-25 18:01:35 +00:00
fschneider@google.com 16857e0b13 Revert r32930 (Add more timing information in the VM to track time...)
It caused severe performance regressions that should be addressed.

TBR=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32959 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-24 12:15:55 +00:00
asiva@google.com 6d313d3797 Add more timing information in the VM to track time spent is dart code Vs native code.
R=johnmccutchan@google.com, turnidge@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32930 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-21 21:30:29 +00:00
lrn@google.com 0dbb989cb8 Add internal operation that converts a growable list to a fixed list.
The conversion breaks the original list, but doesn't copy data.
Currently only used in List.from(Iterable).

BUG= http://dartbug.com/9458
R=floitsch@google.com, iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32896 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-21 13:15:16 +00:00
lrn@google.com 69145994de Allow multi-codeunit padding in String.padLeft/padRight.
Also allow negative repeats.

Based on suggestions from Stephen.

R=sra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32843 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-20 07:17:11 +00:00
iposva@google.com f2a6f1b4b6 Another round of cleanups for http://www.dartbug.com/15922
- Address warnings about 64-bit to 32-bit conversions.

R=ajohnsen@google.com, asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32831 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-19 23:35:55 +00:00
lrn@google.com a3ad46de0d Add String.repeat, String.padLeft, String.padRight.
We keep seeing reimplementations everywhere, and reimplementing it ourselves.

BUG= http://dartbug.com/16919
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32784 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-19 12:32:56 +00:00
iposva@google.com f3906bde8b Fix http://dartbug.com/16308
- Replace "non-extendable array" with "fixed-length list" when throwing
  UnsupportedError.
- Reword the error messages where needed.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32733 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-17 23:54:58 +00:00
lrn@google.com b23f5d0327 Add 'startPaused' option to Isolate.spawn*.
Initial implementation of startPaused in dart2js.

R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32722 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-17 13:06:06 +00:00
rmacnak@google.com 0c821b2457 Fix getField/setField optimization for private members.
BUG=http://dartbug.com/16773
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32634 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-12 23:44:34 +00:00
rmacnak@google.com 1c7fecac7e Add TypeMirror.isSubtypeOf, TypeMirror.isAssignableTo, ClassMirror.isSubclassOf to the API, the VM runtime mirrors and the source mirrors.
BUG=http://dartbug.com/12439
BUG=http://dartbug.com/13856
R=gbracha@google.com, johnniwinther@google.com, regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32577 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-11 20:41:32 +00:00
rmacnak@google.com d354d73609 Avoid printing the full token stream and doing line/column position calculations when extracting the source of a function where we don't have the original source.
Brings mirrors_reader_test from 2 minutes to 11 seconds on the standalone VM.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32461 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-08 01:18:18 +00:00
rmacnak@google.com 41b3ac826d Adjust assertions in MethodMirror.source not to expect source for implicit constructors or signature functions.
BUG=http://dartbug.com/16588
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32454 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-07 21:46:01 +00:00
regis@google.com 7830430adf Implement eager instantiation and canonicalization of type arguments at run
time using a cache in uninstantiated type arguments.
Remove InstantiatedTypeArguments class.
Fix a bug in optimized code: do not update unused type test cache for Smi.
Fix a bug in optimized code on ARM and MIPS in type test cache lookup.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32447 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-07 19:54:33 +00:00