Commit Graph

9049 Commits

Author SHA1 Message Date
Ryan Macnak 6d69da223d Don't ignore result of EnsureIsFinalized in Precompiler; update helper scripts to use dart_precompiled.
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1464933002 .
2015-11-23 09:33:06 -08:00
Florian Schneider 367022b486 Update status of two flaky VM tests to make bots greener until issue is fixed.
These are expected to crash in debug mode, but time out frequently on Windows.

TBR=zra@google.com
BUG=#24596

Review URL: https://codereview.chromium.org/1470903002 .
2015-11-23 13:32:18 +01:00
Florian Schneider 166b3ddfe3 VM: Fix optimizer bug in smi-op widening.
Only consider operations that are used (have an SSA temp) for widening.

Operations without uses will be eliminated as dead code anyway later.

BUG=dartbug.com/24987
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1468433002 .
2015-11-23 09:47:45 +01:00
Siva Annamalai 4992bc72a0 Remove support for object grouping during Garbage Collection
- remove support for prolog weak persistent handles
- remove support for construction of weak reference sets

R=iposva@google.com

Review URL: https://codereview.chromium.org/1459173004 .
2015-11-20 12:36:16 -08:00
Todd Turnidge c6c6f121ed Skip isolate spawning tests on Dartium.
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1455233007 .
2015-11-20 11:10:17 -08:00
Ryan Macnak 75cd019a9c Add RPC and UI for reachable size of an object / all instances of a class.
BUG=http://dartbug.com/24945
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1453983002 .
2015-11-20 10:02:16 -08:00
Florian Schneider 64e71a0b2e VM: Make more globals constant where easily possible.
Remove -fdata-section again from the Linux build configuration: It prevented
some optimizations in gcc and clang - fewer things were recognized as constants.

Add const to pointers/arrays in some places to help compilers with determining
what is a constant.  A common pattern is strlen of a string literal const char*,
or an array of function pointers.

Tested with gcc 4.8.4 / clang 3.4 and improves code qualtiy + reduces binary size.

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

Review URL: https://codereview.chromium.org/1462953002 .
2015-11-20 10:52:07 +01:00
Siva Annamalai f0ad800700 Fix architecture.
Review URL: https://codereview.chromium.org/1459913003 .
2015-11-19 17:13:11 -08:00
Siva Annamalai 59ddaa02f7 Update status file to indicate failure in vm/cc/TestObjectCompare under asan
(Issue https://github.com/dart-lang/sdk/issues/25002 has been filed to investigate this)

Review URL: https://codereview.chromium.org/1462253003 .
2015-11-19 16:58:17 -08:00
John McCutchan aaf37ad035 Landing patch set 7 from https://codereview.chromium.org/1450113003/
Review URL: https://codereview.chromium.org/1466523002 .
2015-11-19 14:18:52 -08:00
Siva Annamalai 8ce6b085a9 Fix build break.
Review URL: https://codereview.chromium.org/1462193002 .
2015-11-19 14:00:15 -08:00
Siva Annamalai 9e19d236ca - Add an OSThread structure which is the generic TLS structure for all C++
fields in a thread (i.e fields that are not Dart VM related)
- Split the Thread structure to be a pure Dart per thread structure and add
  a pointer to os_thread which points to the OSThread structure
- Change Schedule/UnSchedule to set the Dart Thread structure as the TLS of
  the thread when it is inside the Dart world and reset the TLS back to the
  OSThread strcuture when is exits the Dart World.
- Moved the stack_base and few stack size related functions to OSThread from Isolate

R=johnmccutchan@google.com, zra@google.com

Review URL: https://codereview.chromium.org/1439483003 .
2015-11-19 13:45:10 -08:00
Srdjan Mitrovic a9961f8f0a Various cleanups
BUG=
R=zra@google.com

Review URL: https://codereview.chromium.org/1464593002 .
2015-11-19 13:15:01 -08:00
Todd Turnidge b243fa53cf Redo the interface for capture stdio.
Flutter doesn't care to import tons of our include files.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1460863002 .
2015-11-19 09:24:23 -08:00
Florian Schneider f0a35b3260 VM: Add dart_precompiled build target, a standalone VM without the JIT compiler.
This removes most of the compiler-related code from dart_precompiled:
x64 stripped binary size 13M -> 9.1M
ARM stripped binary size 12M -> 8.3M

The precompiled build defines the DART_PRECOMPILED macro. This
stubs out the public interface to the compiler/parser with empty
function bodies.

Use gcc options -ffunction-sections and --gc-sections to make the linker remove
unused functions/symbols.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1459443002 .
2015-11-19 10:13:16 +01:00
Srdjan Mitrovic bad39686a4 Revert "Enable deferred deoptimization always."
This reverts commit 94754bee29.

BUG=

Review URL: https://codereview.chromium.org/1462703002 .
2015-11-18 15:28:34 -08:00
Ryan Macnak df72a27f23 Intrinsify _StringBase._substringMatches to speedup indexOf/startsWith/endsWith under precompilation.
Fix some Smi checks in other intrinsics on MIPS.

Raspberry Pi 2
Before
JIT StarryStrings(RunTime): 1851875.5 us.
noopt StarryStrings(RunTime): 23655235.0 us.

After
JIT StarryStrings(RunTime): 1829766.5 us.
noopt StarryStrings(RunTime): 8660442.0 us. (2.7x)

R=fschneider@google.com

Review URL: https://codereview.chromium.org/1450663002 .
2015-11-18 14:38:39 -08:00
Srdjan Mitrovic 94754bee29 Enable deferred deoptimization always.
Deferred deoptimization being moved ahead of entering field dependencies, attempt to use it for non-background-compilation as well. Previous failures not reproducible on Linux ia32 any longer.

BUG=

Review URL: https://codereview.chromium.org/1450973002 .
2015-11-18 14:30:48 -08:00
Ryan Macnak a6e8abfeb6 Deal with missing deopt_table under precompilation.
E.g., the InlinedFunctionsIterator used to build stacktraces.

Broken by 73b6080a6b.

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

Review URL: https://codereview.chromium.org/1458973002 .
2015-11-18 13:02:23 -08:00
Todd Turnidge 1d2d1ce0fc Don't use global variables for capturing stdio.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1458983002 .
2015-11-18 12:47:34 -08:00
Srdjan Mitrovic 1b17e78f38 Create code and instruction object, and install them in the background compilation thread while bringing mutator thread to a saferpoint.
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1454553004 .
2015-11-18 11:32:17 -08:00
Todd Turnidge 71b3d5aba8 Start isolates in a separate thread.
R=asiva@google.com

Review URL: https://codereview.chromium.org/1447353002 .
2015-11-18 11:02:32 -08:00
Florian Schneider 72bd5adf00 Fix running standalone-precompiled when passing a package-root/-file/-map.
These are missing embedder entry points for standalone VM and
are needed when e.g. passing --package-root to a precompiled snapshot.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1462533002 .
2015-11-18 19:00:47 +01:00
Florian Schneider dce89b9b5b VM: Speculative inlining in precompiled code.
Enable inlining of certain smi- and array-operations based on propagated
types and range analysis:

If bounds checks and class checks can not be eliminated, bail out of the
current optimization and retry without speculative inlining using the same
mechanism as we use for far jumps on MIPS.

Allow more speculative inlining attempts with up to n deopt ids black-listed.
For now set n=1 since precompilation time will be proportional to n.

BUG=
R=srdjan@google.com

Review URL: https://codereview.chromium.org/1423063005 .
2015-11-18 14:56:06 +01:00
John McCutchan 28e416b1f4 Revert "Avoid strerror_r portability issues"
This reverts commit ca81c1732b.
2015-11-17 16:34:25 -08:00
Ivan Posva f28afad353 - Do not include the sources as part of the generated files on
Windows to avoid creating string literals that are too large.

BUG=

Review URL: https://codereview.chromium.org/1453353002 .
2015-11-17 16:11:26 -08:00
Matthias Hausner 648e52baa8 Collect closure functions in isolate
Instead of collecting closures functions in each class object, maintain one list per isolate. This is a step towards getting rid of top-level classes.

I'd appreciate if John could take a look at the service isolate and coverage related change.

I'd appreciate if Ryan could take a look at the precompilation related change.

When compiling all of corelib, the list of closures in the isolate is about 600 entries long. If this linear list should become a bottleneck, I'll deal with it later. (Sadly, some code relies on the fact that a closure can be identified with a list index, so making it a hash table instead of an array does not work.)

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1436243005 .
2015-11-17 15:40:27 -08:00
John McCutchan ca81c1732b Avoid strerror_r portability issues
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1450113003 .
2015-11-17 15:23:47 -08:00
Ivan Posva d97c7bdbde - Include sources in gen_snapshot and dart_no_snapshot to allow
creating full snapshots without having a full Dart SDK checkout.

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

Review URL: https://codereview.chromium.org/1449163003 .
2015-11-17 14:58:09 -08:00
Zachary Anderson 157cbe9738 Use a List for outstanding load requests
Saves another ms during Isolate startup.

BUG=
R=hausner@google.com

Review URL: https://codereview.chromium.org/1452053003 .
2015-11-17 13:57:12 -08:00
Todd Turnidge b9af3683fd Don't unsubscribe to streams we aren't subscribed to.
Gets rid of some stray uncaught exceptions when running Flutter.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1456643002 .
2015-11-17 11:29:39 -08:00
Ryan Macnak 5eb3bccaf1 Switch dominator algorithm from [1] to [2].
[1] has worse upper bound complexity than [2] but has lower
overhead. With [1] dart2js heaps would converge in ~10 iterations, but
with analyzer heaps would take ~10k iterations.

This reduces the time to analyze the final heap of the analyzer
analyzing dart2js from ~30 minutes to 26 seconds.

Increases peak memory usage by 21N bytes plus O(2N) words.

[1] "A Simple, Fast Dominance Algorithm." Keith D. Cooper, Timothy
J. Harvey, and Ken Kennedy.
[2] "A Fast Algorithm for Finding Dominators in a Flowgraph."
T. Lengauer and R. E. Tarjan.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1449243002 .
2015-11-17 11:20:38 -08:00
Zachary Anderson 871e4a2788 Uses a HashMap to complete deferred library loads.
HashMap.forEach is a few ms faster to compile than LinkedHashMap.forEach,
and iteration order appears not to matter for _outstandingLoadRequests.

BUG=
R=hausner@google.com

Review URL: https://codereview.chromium.org/1453513002 .
2015-11-17 10:52:44 -08:00
Ryan Macnak f1391c7841 Observatory: handle the case where package:foo imports are canonicalized as packages/foo.
BUG=http://dartbug.com/24925
R=floitsch@google.com

Review URL: https://codereview.chromium.org/1447383002 .
2015-11-16 17:55:39 -08:00
Todd Turnidge 5817a6f187 Remove some prototype code that snuck into one of my commits.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1435943003 .
2015-11-16 15:07:16 -08:00
Srdjan Mitrovic d61498374b Fix disassembly output for background compilation; modify some tests to run long enough for background compiler to install code.
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1447203002 .
2015-11-16 14:43:56 -08:00
Florian Loitsch 31c73aef7c Fix ambigous typos.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1443723004 .
2015-11-16 22:06:44 +01:00
Srdjan Mitrovic 354fcb12cf Cleanups. More mutator thread asserts.
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1448463004 .
2015-11-16 10:29:01 -08:00
Ryan Macnak 816e665ae1 Use the new Base64 support from dart:convert in Observatory.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1374113006 .
2015-11-13 15:36:27 -08:00
Ryan Macnak 73b6080a6b Omit nonessential code metadata from precompiled snapshots.
dart2js ARM -9.9% size

Before
VMIsolate(CodeSize): 2627828
Isolate(CodeSize): 11977642
Instructions(CodeSize): 12908480
Total(CodeSize): 27513950

After
VMIsolate(CodeSize): 2627206
Isolate(CodeSize): 9247198
Instructions(CodeSize): 12908512
Total(CodeSize): 24782916

BUG=
R=srdjan@google.com

Review URL: https://codereview.chromium.org/1413763018 .
2015-11-13 13:56:22 -08:00
Ryan Macnak c315da5a06 ARM: Don't generate memory instructions with writeback where the data and address registers are the same.
BUG=http://dartbug.com/24855
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1434323003 .
2015-11-13 12:13:55 -08:00
Ryan Macnak f3759dedd3 Report iOS as iOS rather than OS X.
R=iposva@google.com

Review URL: https://codereview.chromium.org/1417013011 .
2015-11-13 11:15:04 -08:00
Srdjan Mitrovic 6f73461202 Making bots greener
BUG=

Review URL: https://codereview.chromium.org/1441743004 .
2015-11-13 09:40:05 -08:00
John McCutchan 5725b0a0a0 Fast path Dart Timeline events with no arguments to avoid calling JSON.encode
BUG=
R=zra@google.com

Review URL: https://codereview.chromium.org/1441683005 .
2015-11-13 07:47:22 -08:00
Lasse R.H. Nielsen 50aa43569d Add "growable" parameter to List.filled constructor.
Fixes issue #24884
BUG= http://dartbug.com/24884
R=floitsch@google.com

Review URL: https://codereview.chromium.org/1440663003 .
2015-11-13 09:30:46 +01:00
Ryan Macnak 8be0d4aca1 Save the native name on the function instead of finding it in the token stream to resolve lazily-linked natives. Drop token streams from precompiled snapshots.
dart2js ARM -7.0% size

Before
VMIsolate(CodeSize): 4663679
Isolate(CodeSize): 11970519
Instructions(CodeSize): 12904384
Total(CodeSize): 29538582

After
VMIsolate(CodeSize): 2611555
Isolate(CodeSize): 11965825
Instructions(CodeSize): 12906464
Total(CodeSize): 27483844

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1412633007 .
2015-11-12 17:24:42 -08:00
Ryan Macnak df64bb1619 - Annotate instructions that load objects from the ObjectPool or Thread.
- Remove disassembly tooltips.
- Surface whether a function has an intrinsic or is recognized.
- Mark intrinsified or ffi functions in the profile.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1439893002 .
2015-11-12 15:18:31 -08:00
Srdjan Mitrovic baf0ac7e63 Attempt to fix dart2js crashes
BUG=

Review URL: https://codereview.chromium.org/1436293002 .
2015-11-12 13:41:35 -08:00
Srdjan Mitrovic 4600d37dc1 Background compilation work:
- Defer deoptimization from optimizing compiler to code installation in mutator thread.
- Defer registration of field and leaf class dependency until code is installed in mutator thread.
- Cleanup.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1433243003 .
2015-11-12 11:25:58 -08:00
Florian Schneider 97e48123d8 VM: Fix imprecision in array bounds check elimination.
Don't eagerly canonicalize the index boundary before getting
the constant value for comparison. Canonicalization may drop more
precise boundaries defined by already inserted constraints.

This enables eliminating the bounds-check in the following example:

test() {
  var a = new Float64List(4);
  for (var i = 0; i < 4; ++i) {
    a[i] = 1.0;
  }
  return a;
}

Also, add pass of flow-graph canonicalization after load-optimization.
This enables more opportunities for ABCE in examples like:

o.f = new List(4);
o.f[0] = ...

BUG=
R=vegorov@google.com

Review URL: https://codereview.chromium.org/1434213005 .
2015-11-12 15:18:24 +01:00