Commit graph

47920 commits

Author SHA1 Message Date
Siva Chandra
a23178ee77 Load vmservice from a .dill file when generating AOT snapshots.
This will happen only if --dfe option is specified along with the
--kernel-binaries option.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2949323002 .
2017-06-23 09:39:18 -07:00
Brian Wilkerson
8cd2a4924d Disable a not-yet-defined lint
R=pquitslund@google.com

Review-Url: https://codereview.chromium.org/2955583002 .
2017-06-23 09:37:34 -07:00
danrubel
b8b9e3eae4 add test for internal scanner API
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2952153003 .
2017-06-23 12:35:09 -04:00
Brian Wilkerson
55d735911b Remove the unused operations queue
R=devoncarew@google.com

Review-Url: https://codereview.chromium.org/2957643002 .
2017-06-23 09:04:13 -07:00
Paul Berry
a7ab70eb06 Move tests {list,map}_literals_can_infer_null_top_level to inference_new
These tests' expectations reflect a drawback in analyzer's type
inference--it doesn't infer the correct types lists and maps
containing `null` when those structures occur outside a method body.
The new front_end type inference engine does the right thing.

Accordingly, we have to move the test to inference_new, so that we can
update its expectations without breaking analyzer's test code.

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2951373002 .
2017-06-23 07:40:52 -07:00
Paul Berry
c4ecf098aa Move test infer_use_of_void to inference_new
This test's expectations reflect a drawback in analyzer's type
inference--it doesn't infer the correct types for calls to methods
returning `void` when those calls occur outside of a method body.  The
new front_end type inference engine does the right thing.

Accordingly, we have to move the test to inference_new, so that we can
update its expectations without breaking analyzer's test code.

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2953903002 .
2017-06-23 07:33:50 -07:00
Lasse R.H. Nielsen
c68e5cc67d Allow trailing comma in assert statements.
Fixes #28786
BUG= http://dartbug.com/28786
R=floitsch@google.com

Review-Url: https://codereview.chromium.org/2953223002 .
2017-06-23 14:45:25 +02:00
Paul Berry
6ac836fbb3 Make the kernel API for promoted type parameter bounds less error-prone.
I'm about to start introducing usages of TypeParameterType.bound, and
nearly all of the usage sites will need to fall back on
TypeParameter.bound if there is no bound stored in the
TypeParameterType.  This CL places the fallback behavior in the
TypeParameterType.bound getter so that we won't have to duplicate it
at every usage site (and risk making mistakes).  The few call sites
that don't want the fallback behavior (such as the one in
ast_to_binary.dart) can avoid it by referring to
TypeParameterType.promotedBound directly.

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2952883003 .
2017-06-23 05:44:58 -07:00
Peter von der Ahé
03aad06299 Add regression tests from Luke's bug reports. Part 2.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2959463003 .
2017-06-23 14:37:27 +02:00
Paul Berry
7b60c094d7 Implement type inference for conventional for-loops.
R=ahe@google.com

Review-Url: https://codereview.chromium.org/2951033004 .
2017-06-23 05:36:41 -07:00
Peter von der Ahé
f1b7a97744 Move testing.json and status files to more natural locations.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2957623002 .
2017-06-23 14:27:53 +02:00
Peter von der Ahé
2434dc606a Add regression tests from Luke's bug reports. Part 1.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2955443002 .
2017-06-23 14:25:26 +02:00
William Hesse
6482690781 Rebased simplify CompilerConfiguration
BUG=

Review-Url: https://codereview.chromium.org/2954113002 .
2017-06-23 14:10:03 +02:00
Vyacheslav Egorov
7887c34a29 VM(RegExp): Allow OSR optimization of RegExp :matcher functions.
Previously these functions would only contain a single CheckStackOverflowInstr
in a backtracking block and that CheckStackOverflowInstr would have a zero
loop_depth - which means it would not be considered eligable for OSR.

This change:

* adds CheckStackOverflowInstr with non-zero loop_depth in two other places
  (Boyer-Moore lookahead skip loop and greedy loop) where loops arise in the
  generated IL;
* sets non-zero loop depth on the CheckStackOverflowInstr in the backtracking
  block;
* adds a flag on CheckStackOverflowInstr that allows optimizing compiler to
  optimize away those checks that were inserted solely to serve as OSR entries.
* ensures that IR generated by IRRegExpMacroAssembler is OSR compatible:
  * GraphEntryInstr has correct osr_id;
  * GraphEntry and normal entry have different block ids (B0 and B1 - instead of B0 and B0);
  * unreachable blocks are pruned and GraphEntry is rewired to point to OSR entry;
  * IRRegExpMacroAssembler::GrowStack should not assume that  stack_array_cell and :stack
    are always in sync, because :stack can come from OSR or deoptimization why stack_array_cell
    is a constant associated with a particular Code object.
* refactors the way the RegExp stack was growing: instead of having a special instruction
  just emit a call to a Dart function;
* refactors the way block pruning for OSR is done by consolidating duplicated code
  in a single function.

We allow the optimizing compiler to remove preemption checks from
non-backtracking loops in the regexp code because those loops
unlike backtracking have guaranteed O(input_length) time
complexity.

Performance Implications
------------------------

This change improves performance of regexps in cases where regexp spends a lot
of time in the first invocation (either due to backtracking or due to long non
matching prefix) by allowing VM to optimize the :matcher while :matcher is
running.

For example on regex-redux[1] benchmark it improves Dart performance by 3x
(from ~18s to ~6s on my Mac Book Pro).

CL history
----------

This relands commit d87cc52c3e.

Original code review: https://codereview.chromium.org/2950783003/

[1] https://benchmarksgame.alioth.debian.org/u64q/program.php?test=regexredux&lang=dart&id=2

R=erikcorry@google.com

Review-Url: https://codereview.chromium.org/2951053003 .
2017-06-23 12:51:53 +02:00
Kevin Millikin
23083fdee1 Mark a crashing test
A recent VM change is triggering an assertion in the VM's snapshot
writer in the ahead-of-time compiler.  Since things seem to be
otherwise working, I've filed an issue and disabled the test for now.

BUG=
R=sortie@google.com

Review-Url: https://codereview.chromium.org/2957613002 .
2017-06-23 12:11:14 +02:00
William Hesse
c01c51d195 Update co19 browser status for flaky tests
BUG=
R=sortie@google.com

Review-Url: https://codereview.chromium.org/2945423004 .
2017-06-23 11:20:29 +02:00
Kevin Moore
239b0c088c Fix a couple of doc comment references - and many spelling mistakes
Review-Url: https://codereview.chromium.org/2946283002 .
2017-06-22 17:32:29 -07:00
Vijay Menon
daf960d5a4 Fix Object method tearoffs
R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2953933002 .
2017-06-22 15:59:45 -07:00
Ben Konyi
89eda8a533 Updated status file to fix kernel bot failures.
TBR=zra@google.com
BUG=

Review-Url: https://codereview.chromium.org/2953933003 .
2017-06-22 15:09:49 -07:00
Vijay Menon
7d73159017 Fix ddc build
Not sure why this just started breaking.  I don't think Ben added this
param - just a use of it.  Our patch script might not be catching the
mismatch.

TBR=jmesserly@google.com,bkonyi@google.com

Review-Url: https://codereview.chromium.org/2954513003 .
2017-06-22 14:27:22 -07:00
Jennifer Messerly
635d95fccf cleanup unused useDisplayName parameter
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2953883002 .
2017-06-22 14:17:44 -07:00
Ben Konyi
143baba8fc Reintroducing parser changes to cause compile-time errors when trying to reinitialize a final field. Updated status files to hopefully address the test failures. Issue 29658.
This reverts commit 12e93cc41e.

BUG=
R=zra@google.com

Review-Url: https://codereview.chromium.org/2953843003 .
2017-06-22 13:48:57 -07:00
Ben Konyi
06456e83d8 Added timeout parameter to RawSecureSocket and SecureSocket connect methods. Also updated CHANGELOG and SecureSocket tests to reflect this change. Issue 19120.
BUG=
R=zra@google.com

Review-Url: https://codereview.chromium.org/2950413002 .
2017-06-22 13:45:26 -07:00
Alexander Aprelev
4f9b25e410 Fix previous CL where dart_bootstrap was accidently changed to dart_bootstrap_host_arch.
Also fix two missed places where host_toolchain should be replaced with dart_host_toolchain.

R=rmacnak@google.com

BUG:flutter/flutter#10841
Review-Url: https://codereview.chromium.org/2953873002 .
2017-06-22 13:17:53 -07:00
Alexander Aprelev
8cd713bed3 Introduce dart_host_toolchain argument for generate_patch_sdk.gni. This allows for Flutter build to make sure that host_toolchain used for patched_sdk generation word size matches target platform.
Flutter Dart in product configuration doesn't allow --checked option. So remove '--checked' from invocation.

R=rmacnak@google.com

BUG:https://github.com/flutter/flutter/issues/10841
Review-Url: https://codereview.chromium.org/2944103003 .
2017-06-22 12:41:31 -07:00
Paul Berry
dd0a00f581 Infer the return types of local functions where appropriate.
Note that we do this in order to be consistent with type inference of
function expressions.  See https://codereview.chromium.org/2209293002.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2950213002 .
2017-06-22 12:17:10 -07:00
Brian Wilkerson
ec8505fc79 Fix hints and clean-up obsolete comment syntax (TBR)
Review-Url: https://codereview.chromium.org/2952233002 .
2017-06-22 10:59:26 -07:00
Siva Chandra
8b40507be3 Reland "Load service isolate from a .dill file."
This reverts commit e90aa9cb5f.

Because of 2883d7f416, it is expected that
this change will do better on the bots.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2952913002 .
2017-06-22 10:10:45 -07:00
Devon Carew
ae80af3abb Add a missing comma.
BUG=
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2949243002 .
2017-06-22 09:58:52 -07:00
Ryan Macnak
bcb4fcfa11 [vm-service] Encode ticks directly as integers, since they are expect to stay in JS integer range.
Fixes #29957

R=cbernaschina@google.com

Review-Url: https://codereview.chromium.org/2951803004 .
2017-06-22 09:50:36 -07:00
Ryan Macnak
1daac1c651 [vm-service] Use consistent success response for _requestHeapSnapshot.
Fixes #29956

R=cbernaschina@google.com

Review-Url: https://codereview.chromium.org/2951903002 .
2017-06-22 09:47:07 -07:00
William Hesse
5aef1e640b Update browser statuses for co19 roll
BUG=
R=kustermann@google.com

Review-Url: https://codereview.chromium.org/2951273003 .
2017-06-22 18:14:47 +02:00
Zachary Anderson
ac16656161 Remove MIPS support
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2858623002 .
2017-06-22 08:49:22 -07:00
Brian Wilkerson
a420a1fbb5 Remove more dead code from analysis server
R=devoncarew@google.com

Review-Url: https://codereview.chromium.org/2949103003 .
2017-06-22 08:21:03 -07:00
Brian Wilkerson
e28064f405 Restore partial analysis of analysis options files
R=devoncarew@google.com

Review-Url: https://codereview.chromium.org/2946313003 .
2017-06-22 08:00:50 -07:00
Martin Kustermann
ca6c60f447 More status file updates after co19 roll
R=whesse@google.com

Review-Url: https://codereview.chromium.org/2953813002 .
2017-06-22 16:00:52 +02:00
danrubel
ebdc0eda11 add Parser.withoutFasta constructor
This renames an existing private Parser constructor as a short term fix
so that the angular plugin can extend the Parser.

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2952113002 .
2017-06-22 09:41:46 -04:00
Martin Kustermann
42e2ae40e8 Update status file for dartk-checked (status files are out-dated due to builder being on FYI)
Closes https://github.com/dart-lang/sdk/issues/29225

R=jensj@google.com

Review-Url: https://codereview.chromium.org/2948153005 .
2017-06-22 15:36:30 +02:00
Erik Corry
8378b8fdbf VM: Reland Inline instance object hash code into object header on 64bit.
Inline instance object hash code into object header on 64 bit.

64 bit objects have 32 bits of free space in the header word.
This is used for the hash code in string objects. We take it
for the default hash code on all objects that don't override
the hashCode getter.

This is both faster and a memory reduction. Eg it makes the
MegaHashCode part of the Megamorphic benchmark 6 times faster.

This is a reland of https://codereview.chromium.org/2912863006/
It fixes issues with the 32 bit compare-swap instruction on
ARM64 and fixes a fragile tree shaking test that is sensitive
to which private methods are in the core libraries.

R=kustermann@google.com, vegorov@google.com
BUG=

Review-Url: https://codereview.chromium.org/2954453002 .
2017-06-22 14:56:24 +02:00
William Hesse
3078734ff7 Correct merge errors in co19 roll
This corrects merge errors found in the commit of
https://codereview.chromium.org/2954443002/

BUG=
R=kustermann@google.com

Review-Url: https://codereview.chromium.org/2948153004 .
2017-06-22 13:47:43 +02:00
Peter von der Ahé
94a44e0290 Refactor parseType in preparation for bigger changes.
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2951463002 .
2017-06-22 12:47:53 +02:00
William Hesse
232684aac0 Update co19 to revision dec2b67aaab3bb7339b9764049707e71e601da3d
BUG=
R=kustermann@google.com

Review-Url: https://codereview.chromium.org/2954443002 .
2017-06-22 11:46:13 +02:00
William Hesse
d8ec6450d0 Fix compiler==none case in browser testing (Dartium case)
Error was introduced in https://codereview.chromium.org/2947473002/

BUG=
R=kustermann@google.com

Review-Url: https://codereview.chromium.org/2950173004 .
2017-06-22 11:30:23 +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
Erik Corry
847cd093ba Revert "Inline instance object hash code into object header on 64 bit."
This reverts commit ac6310d5f3 because
of test failures on real ARM64 hardware as opposed to the DartVM
simulator.  Original review: https://codereview.chromium.org/2912863006/

R=kustermann@google.com
BUG=

Review-Url: https://codereview.chromium.org/2953753002 .
2017-06-22 10:22:48 +02:00
Erik Corry
ac6310d5f3 Inline instance object hash code into object header on 64 bit.
64 bit objects have 32 bits of free space in the header word.
This is used for the hash code in string objects. We take it
for the default hash code on all objects that don't override
the hashCode getter.

This is both faster and a memory reduction.  Eg it shaves about
70% off the running time of this microbenchmark:

List list = [];

class Thing {
  get hashCode => 42;
}

class Thing2 {
  get hashCode => 42;
}

class Thing3 { }
class Thing4 { }

main() {
  int sum = 103;
  for (int i = 0; i < 10000000; i++) {
    list = [];
    list.add("foo");
    list.add(123);
    list.add(1.23);
    list.add(new Object());
    list.add(new Thing());
    list.add(new Thing2());
    list.add(new Thing3());
    list.add(new Thing4());
    for (int j = 0; j < 2; j++) {
      sum ^= biz(list);
    }
  }
  print(sum);
}

int biz(List list) {
  int sum = 103;
  for (var x in list) {
    sum ^= x.hashCode;
  }
  return sum;
}

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

Review-Url: https://codereview.chromium.org/2912863006 .
2017-06-22 09:25:52 +02:00
Vijay Menon
febded6052 Fix mocked operator methods
R=jacobr@google.com

Review-Url: https://codereview.chromium.org/2949123002 .
2017-06-21 16:54:08 -07:00
Vijay Menon
ecca1e1c2a Add FallThroughError patch
TBR=jensj@google.com,rnystrom@google.com

Review-Url: https://codereview.chromium.org/2953693002 .
2017-06-21 16:33:31 -07:00
Siva Chandra
2883d7f416 Remove API_TIMELINE_DURATION from Dart_ReadKernelBinary.
This allows Dart_ReadKernelBinary to be called before Dart_Initialize.

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2951213002 .
2017-06-21 16:15:50 -07:00
Ryan Macnak
1eee6d8af3 Mostly revert "[fuchsia] Prepare for setting the Dart target architecture appropriately in the host binaries."
This reverts commit 9ab39ae099.

Keep removal of bad assert in loader.dart.  Keep using script snapshot in cross builds.

We expect to use a checked-in SDK in the Fuschia build instead.

R=zra@google.com

Review-Url: https://codereview.chromium.org/2951133002 .
2017-06-21 15:19:21 -07:00