Commit Graph

165 Commits

Author SHA1 Message Date
Samir Jindel 8db489cb10 [vm/aot] Remove unnecessary closurization of some entry-points.
Change-Id: Ie84529ef3d41d55c29c9a4bf2c84a69e3dbcaa0f
Reviewed-on: https://dart-review.googlesource.com/c/93429
Auto-Submit: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-02-20 10:44:21 +00:00
Samir Jindel 267e91a0ea Re-land "[vm] Prevent access to non-annotated members through native API."
Two fixes:

  - Make entrypoints_verification_test work on configurations where CFE compilation
    is separate from execution.
  - Add missing entry-point annotation for Windows.

The original revision is in patchset 1.

Change-Id: I6c4b52b1bae7bc730546dad6a3e31d8625f850b1
Cq-Include-Trybots: luci.dart.try:vm-kernel-optcounter-threshold-linux-release-x64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-linux-release-x64-try, vm-kernel-precomp-mac-release-simarm64-try, vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/90942
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-01-29 15:10:34 +00:00
Régis Crelier 27316cc97b Revert "[vm] Prevent access to non-annotated members through native API."
This reverts commit 0203243381.

Reason for revert: breaking several bots

Original change's description:
> [vm] Prevent access to non-annotated members through native API.
> 
> We will issue warnings and throw an API error when the native API is used to access members which were not appropriately
> annotated as entry-points, if the flag "--verify-entry-points" is passed.
> 
> Also, fixes Class::Invoke against fields (isn't allowed through native API but
> could be allowed with mirrors, and is inconsistent with Library::Invoke behavior).
> 
> I've checked locally that this would have caught the bug in
> "Wrap the user entrypoint function in a zone with native exception callback. (#7512)".
> 
> Change-Id: I617c71e1965457c956c97761359765bb9bb18c1c
> Cq-Include-Trybots: luci.dart.try:vm-kernel-optcounter-threshold-linux-release-x64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-linux-release-x64-try, vm-kernel-precomp-mac-release-simarm64-try, vm-kernel-precomp-win-release-x64-try
> Reviewed-on: https://dart-review.googlesource.com/c/90060
> Commit-Queue: Samir Jindel <sjindel@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>

TBR=alexmarkov@google.com,sjindel@google.com

Change-Id: I554b389780e4ba652183c044b040b0c524beb5c2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Cq-Include-Trybots: luci.dart.try:vm-kernel-optcounter-threshold-linux-release-x64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-linux-release-x64-try, vm-kernel-precomp-mac-release-simarm64-try, vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/90841
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2019-01-23 20:37:22 +00:00
Samir Jindel 0203243381 [vm] Prevent access to non-annotated members through native API.
We will issue warnings and throw an API error when the native API is used to access members which were not appropriately
annotated as entry-points, if the flag "--verify-entry-points" is passed.

Also, fixes Class::Invoke against fields (isn't allowed through native API but
could be allowed with mirrors, and is inconsistent with Library::Invoke behavior).

I've checked locally that this would have caught the bug in
"Wrap the user entrypoint function in a zone with native exception callback. (#7512)".

Change-Id: I617c71e1965457c956c97761359765bb9bb18c1c
Cq-Include-Trybots: luci.dart.try:vm-kernel-optcounter-threshold-linux-release-x64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-linux-release-x64-try, vm-kernel-precomp-mac-release-simarm64-try, vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/90060
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-01-23 19:04:26 +00:00
Kevin Moore bc03bd3805 Cleanup unused vars in VM patch files
Change-Id: Ibc548921113d979df5b0ed8eb7f6ad48a553fc86
Reviewed-on: https://dart-review.googlesource.com/c/84121
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2018-11-13 22:56:54 +00:00
Samir Jindel cbd17b535f Re-land "[vm/precomp] Use @pragma("vm:exact-result-type") to specify method behavior."
We need to block interrupts while evaluating pragmas to prevert reentrant class finalization.
Original revision is in patchset 0.

Change-Id: I872cec4eaf4ca85567c9657c458ed39c8b2e30de
Cq-Include-Trybots: luci.dart.try:vm-kernel-win-release-x64-try, vm-kernel-optcounter-threshold-linux-release-x64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-linux-release-x64-try, vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/73160
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-09-11 18:14:51 +00:00
Samir Jindel f8575698af Revert "[vm/precomp] Use @pragma("vm:exact-result-type") to specify method behavior."
This reverts commit ade6742ee9.

Reason for revert: Some service tests are broken.

Original change's description:
> [vm/precomp] Use @pragma("vm:exact-result-type") to specify method behavior.
> 
> Cq-Include-Trybots: luci.dart.try:vm-kernel-win-release-x64-try,vm-kernel-optcounter-threshold-linux-release-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try
> Change-Id: I6eeafeea734efb2e876c5e03f12092b5229ad2bc
> Reviewed-on: https://dart-review.googlesource.com/70284
> Commit-Queue: Samir Jindel <sjindel@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>

TBR=vegorov@google.com,alexmarkov@google.com,sjindel@google.com

Change-Id: If95f68704737b1da7553c68eb4e22a4c554d3a4b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Cq-Include-Trybots: luci.dart.try:vm-kernel-win-release-x64-try, vm-kernel-optcounter-threshold-linux-release-x64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-linux-release-x64-try, vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/72200
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2018-08-30 19:02:45 +00:00
Samir Jindel ade6742ee9 [vm/precomp] Use @pragma("vm:exact-result-type") to specify method behavior.
Cq-Include-Trybots: luci.dart.try:vm-kernel-win-release-x64-try,vm-kernel-optcounter-threshold-linux-release-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try
Change-Id: I6eeafeea734efb2e876c5e03f12092b5229ad2bc
Reviewed-on: https://dart-review.googlesource.com/70284
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-08-30 15:30:40 +00:00
Samir Jindel 5572df1458 [vm/precomp] Fix name of vm:entry-point.
Change-Id: I907e59a9df9407f924c0518a185d5b28ab46e381
Cq-Include-Trybots: luci.dart.try:vm-kernel-win-release-x64-try,vm-kernel-optcounter-threshold-linux-release-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/69971
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-08-16 15:07:51 +00:00
Samir Jindel 4b704f234e [vm/precomp] Remove part of the generated entry points JSON list.
Change-Id: I2ae71b0ef35e8e009d1ff4d5917974748dfd6f05
Cq-Include-Trybots: luci.dart.try:vm-kernel-win-release-x64-try,vm-kernel-optcounter-threshold-linux-release-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/69961
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2018-08-14 19:32:55 +00:00
Vyacheslav Egorov cc35ba4a1e [vm] Split _List&_GrowableList []= into checked and unchecked parts
This allows us to avoid going into runtime even if strong mode is
enabled: type checking is handled in the []= operator itself and
_setIndexed does not need to check types and thus can be intrinsified.

This CL also removes inline type checking done in ia32 version,
not other platform had it.

# Performance Impact

Mostly noticable on Dart v2 AOT configuration where AOT compiler
did not inline []=:

Richards  +26.27%
Meteor  +33.63%
BuildTableInterpolation +68.98%
DeltaBlueClosures +46.43%
StarryStrings +22.08%
NavierStokes  +94.81%
JsonParseCustomReviver  +45.22%
DeltaBlue +56.44%
BuildTableBufferWithCodes +84.40%
JsonParseDefaultReviver +46.13%
BuildTableBuffer  +125.8%
BuildTableIdiomatic +125.8%
StringBuffer  +127.3%
StringIdiomatic +127.2%
JsonObjectRoundTrip +95.42%
JsonStringifyFinancialOnce  +125.7%
JsonRoundTrip +96.01%

Bug:
Change-Id: Ie6d33ac55b5a0c0909ca06e0c88a60d8e0d2604e
Reviewed-on: https://dart-review.googlesource.com/26800
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2017-12-07 13:09:55 +00:00
Vyacheslav Egorov faff8765c4 [VM] Fix typing issues in _List and _GrowableList
Bug: https://github.com/dart-lang/sdk/issues/31052
Change-Id: I4ef4d1f1fbaefa1a39b56a7ad00c8b365a5e5202
Reviewed-on: https://dart-review.googlesource.com/14842
Reviewed-by: Erik Corry <erikcorry@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2017-10-19 15:27:15 +00:00
Peter von der Ahé e8aef37eac Clean up patches so they can be compiled by Fasta.
Change-Id: Ie436375c78496366accf0ba82938e54cbe30b143
Reviewed-on: https://dart-review.googlesource.com/3001
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-10-05 14:05:50 +00:00
Vyacheslav Egorov d24040af02 VM(CoreLib): Work around JIT optimization issue revealed by cec963f028
Array Bounds Check Generalization pass attempts to hoist CheckArrayBound
instructions out of loops by generalizing them: for example in the loop
like

  for (var i = 0; i < L; i++) {
    // a[i]
    CheckArrayBound(i, a.length)
    LoadIndexed(a, i)
  }

we hoist CheckArrayBound(i, a.length) by turning it into
CheckArrayBound(L - 1, a.length):

  CheckArrayBound(L - 1, a.length)
  for (var i = 0; i < L; i++) {
    // a[i]
    LoadIndexed(a, i)
  }

However this leads to deoptimizations if the loop never executes: e.g. if
L = 0 then L - 1 is -1 which does not pass generalized bounds check.

We prevent repeated deoptimizations by disabling this optimization if any
of the generalized bounds checks deoptimizes. However this does not work
as intended because we only check this flag on an outermost function, so
if function with a problematic bounds check get inlined into a lot of places
it ends up causing a lot of deoptimizations in different places.

This is why cec963f028 caused performance issues
in dartdoc: _GrowableList._grow is now called with length == 0 whenever we
add an element to an empty list. This causes deoptimization in a lot of different
functions in dartdoc because _GrowableList._grow ends up inlined into a lot
of different places.

Fixes https://github.com/dart-lang/sdk/issues/30090

This CL will be reverted once a better solution for the underlying problem is in place (tracked by https://github.com/dart-lang/sdk/issues/30102)

BUG=
R=askesc@google.com, erikcorry@google.com

Review-Url: https://codereview.chromium.org/2971303002 .
2017-07-07 14:34:52 +02:00
Aske Simon Christensen cec963f028 The current growth strategy for growable arrays allocates a backing array of size 2 at (empty) creation and doubles the size whenever the capacity is insufficient while adding elements.
I collected statistics for the sizes and capacities of growable arrays which are promoted to old-space or survive an old-space gc when running dart2js and Fasta. For these applications, the vast majority of arrays stay empty. More than half of the total object size of promoted backing arrays is backing for empty growable arrays.

Furthermore, since the overhead for an array is 3 words (header, type parameters and length), and object sizes are rounded up to an even number of words, we waste one word for all even-sized arrays.

This CL changes the growth strategy so that empty growable arrays are created with a shared, zero-sized array as backing, avoiding the allocation of a backing array if no elements are added. When the array needs to grow, it starts out at 3 and grows to double size plus one each time: 7, 15, 31, ...

A few places in the VM code need to handle these shared, zero-sized arrays specially. In particular, the Array::MakeArray function needs to allocate a new, empty array if its result is to be returned to Dart code.

Benchmarks suggest that the change improves memory usage by a few percent overall and does not significantly affect run time.

BUG=
R=erikcorry@google.com

Review-Url: https://codereview.chromium.org/2949803002 .
2017-06-22 10:51:54 +02:00
Jacob Richman 4360e99d18 Revert "Fix observatory tests broken by running dartfmt."
This reverts commit b1f7e6d94673b098c93c187fe3efc45c15f27edc.

BUG=

Committed: https://github.com/dart-lang/sdk/commit/62be0eacfbb36bdc92a05c7c35bb4506621b6a3a
Review-Url: https://codereview.chromium.org/2767533002 .
2017-03-21 10:07:26 -07:00
Jacob Richman 62be0eacfb Revert "Fix observatory tests broken by running dartfmt."
This reverts commit b1f7e6d94673b098c93c187fe3efc45c15f27edc.

BUG=

Review-Url: https://codereview.chromium.org/2767533002 .
2017-03-20 22:19:22 -07:00
Jacob Richman 88f8aacd5f Re-apply rolled back CL to apply dartfmt to runtime.
Fix observatory tests broken by running dartfmt due to line and column changes.
Temporarily reverted formatting for evaluate_activation_test.dart as dartfmt doesn't yet handle multitests.

BUG=
R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2759973004 .
2017-03-20 21:44:59 -07:00
Ryan Macnak ea4744a06f Revert "Run dartfmt on all files under runtime."
This reverts commit 15f393f189.

The change caused many service test failures due to changed line numbers.

TBR=jacobr@google.com

Review-Url: https://codereview.chromium.org/2762583003 .
2017-03-20 13:42:55 -07:00
Jacob Richman 15f393f189 Run dartfmt on all files under runtime.
I've omitted files where the formatter output is significantly uglier
than the original code and I'll send those files in a separate CL
with options for how to make the code look reasonable while still
taking advantage of the formatter.

BUG=
R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2751423005 .
2017-03-20 13:13:50 -07:00
Lasse Reichstein Holst Nielsen 7957a1c256 Make EfficientLength extend Iterable.
This should help least-upper-bound computations to not think of EfficientLength
as completely separate from Iterable even though they are always used together.

It doesn't solve all problems with the least-upper-bound computation,
but at least some of the more often occuring ones.

R=floitsch@google.com

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

Committed: https://github.com/dart-lang/sdk/commit/b08fb1373f88121bb4056adce9b71849a5bede2a
2016-11-28 08:04:04 +01:00
Ryan Macnak 6cf5c3baa3 Revert "Make EfficientLength extend Iterable."
This reverts commit b08fb1373f.

TBR=lrn@google.com

Review URL: https://codereview.chromium.org/2467283003 .
2016-11-02 13:20:41 -07:00
Lasse R.H. Nielsen b08fb1373f Make EfficientLength extend Iterable.
This should help least-upper-bound computations to not think of EfficientLength
as completely separate from Iterable even though they are always used together.

It doesn't solve all problems with the least-upper-bound computation,
but at least some of the more often occuring ones.

R=floitsch@google.com

Review URL: https://codereview.chromium.org/2467113003 .
2016-11-02 14:05:35 +01:00
Siva Annamalai cb36467568 - Fix for issue 27054 (leak when removing element from _GrowableList)
- _GrowableList.removeLast was not shrinking the backing array

BUG=27054
R=johnmccutchan@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org/2240313002 .
2016-08-12 16:06:12 -07:00
Vyacheslav Egorov 2a8581a238 VM: Remove _GrowableList.from which was never called.
It contained a bug anyway: _GrowableList does not have a 0 arguments constructor.

R=fschneider@google.com
BUG=

Review URL: https://codereview.chromium.org/2163173003 .
2016-07-21 16:13:37 +02:00
John McCutchan 5590ba31be Shrink growable arrays
Fixes #25778

Review URL: https://codereview.chromium.org/1701213002 .
2016-02-17 13:20:53 -08:00
Lasse R.H. Nielsen d755dd65b9 Update range errors to agree on the numbers.
Also ensure that typed-data errors are consistent with other lists.

Fixes issue #24295
BUG= http://dartbug.com/24295
R=floitsch@google.com, iposva@google.com, sra@google.com

Review URL: https://codereview.chromium.org//1318943005 .
2015-09-11 13:05:36 +02:00
Lasse R.H. Nielsen babcd4e9c0 Revert "Make EfficientLength public, as EfficientLengthIterable."
It's still not a good solution for detecting an Iterable with an efficient
length. It's not inherited by, e.g., a DelegatingIterable wrapper or similar
generic Iterable transformers.

Keep this as an internal optimization for quickly detecting the most common
efficient-length Iterable classes (List, Set, Queue, Map.keys/values), but
don't make it public.

A *real* solution would be adding a hasEfficientLength getter to Iterable, or
adding an efficientLength getter that may return null if it's not efficient.
This would something that a wrapper can attach to.

R=sgjesse@google.com

Review URL: https://codereview.chromium.org//1154263003
2015-05-29 12:52:45 +02:00
lrn@google.com 92c526b2a2 Make EfficientLength public, as EfficientLengthIterable.
R=iposva@google.com, sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45556 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-06 09:00:45 +00:00
srdjan@google.com 0b094880cc Improve performance of addAll for internallt known lists.
Review URL: https://codereview.chromium.org//873863002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43154 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-26 21:50:40 +00:00
turnidge@google.com 92211b622a Minor optimization in _GrowableList.removeAt.
BUG=
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42214 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-09 19:11:41 +00:00
fschneider@google.com a49870e721 VM: Remove use of IterableMixinWorkaround from _List, _ImmutableList and _GrowableList.
_List, _ImmutableList and _GrowableList now extend ListBase which uses ListMixin.

Note that typed data lists are still using IterableMixinWorkaround for now.
They will be changed in a separate CL since it involves a few more changes
to the VM.

BUG=dartbug.com/13647
R=lrn@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42061 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-02 10:38:51 +00:00
lrn@google.com 28937c86ae Optimize _GrowableArray._join and _StringBase._interpolate.
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40800 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-30 08:28:00 +00:00
ajohnsen@google.com f75e71d95c Remove unused string interpolations.
BUG=
R=lrn@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39802 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-03 12:35:50 +00:00
lrn@google.com 7947f84054 Optimize List.toList/.sublist and List.from on lists.
R=fschneider@google.com, srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39579 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-27 08:00:48 +00:00
lrn@google.com 729de01f79 Make IterableMixinWorkaround using classes return correctly typed Iterables.
BUG= http://dartbug.com/13646
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38372 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-18 08:08:16 +00:00
srdjan@google.com 97021b5861 Add class id constants fields to dart:_internal class 'ClassID'. Use the fields in the library (more uses to come).
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37628 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-23 22:41:59 +00:00
srdjan@google.com d44423b766 Add VM internal Dart class 'ClassID' used to manage class-ids of known classes. Next CL: add constant fields corresponding to each class id (smiCid, oneByteStringCid, etc).
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37567 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-20 20:56:55 +00:00
srdjan@google.com ee210974f6 Reduce default capacity of growable list from 4 to 2 elements. Improves performance.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37421 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-17 20:49:47 +00:00
lrn@google.com 1ec6c5c1db Revert "Add "last" setter to List."
After discussion, we decided not to change the List interface for something that is just a convenience.

Also revert "Mark pkgbuild/pkg/collection as failing when using repository packages"

R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37307 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-13 09:40:22 +00:00
lrn@google.com f528beb9f2 Add "last" setter to List.
This allows assigning directly as `list.last = value` instead of
having to use the longer `list[list.length - 1] = value`.
It's just an abbreviation, like `list.last` is for reading.

If you use a List as a stack (which is a perfectly good use of it),
modifying the last element like this is a natural operation.

R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37255 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-12 08:11:22 +00:00
lrn@google.com 989709f3a8 Reinstall previous behavior for Set and Queue toString.
A previous change made these omit elements to keep the toString length down.
That could break code that expects the original behavior.

This still avoids using IterableMixinWorkaround.

Add static toString methods on ListBase, SetBase, IterableBase so that users can
get the same behavior as our toString methods, and with the same cycle detection
safety.

Unify all collection toString methods in two methods:
- IterableBase.iterableToShortString
- IterableBase.iterableToFullString

R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36616 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-26 06:08:20 +00:00
iposva@google.com 5a469c41b3 - Remove unnecessary is-check.
- Other formatting cleanup.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36192 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-14 22:21:48 +00:00
lrn@google.com f449a85d1e Unify error messages for iterables and lists.
Add factory methods that generate the errors thrown for unmodifiable lists,
non-growable lists and iterations with the wrong number of elements.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35733 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-05 09:26:56 +00:00
ngeoffray@google.com 2015e5f204 Fix an old TODO.
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31253 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-19 10:40:53 +00:00
hausner@google.com c96bc29ab5 Compile time error if name is used before variable is declared
Implement proper semantics if a name has been referenced in a
block and later a variable with that same name is declared.

Fix library code that was wrong.

Add new language test, delete a couple of tests that are
outdated, file co19 bug 649.

Dart2js and dart2dart are not yet implementing these compile-time
errors.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29770 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-01 21:28:31 +00:00
lrn@google.com e3713a08d4 Make List.shuffle take an optional Random object to use.
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28305 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-07 12:07:30 +00:00
lrn@google.com 55a8a72ca6 Add List.shuffle().
Will add tests too.

R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28206 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-03 11:09:01 +00:00
iposva@google.com e7e2e4bf03 - Rename arrays to lists:
_ObjectArray -> _List
  _GrowableObjectArray -> _GrowableList
  _ImmutableArray -> _ImmutableList

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28189 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-03 00:15:14 +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