Commit Graph

6356 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 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
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
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
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
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 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
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
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
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 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
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
Lasse R.H. Nielsen ed0b187d58 Add data-URI support class to dart:core (next to Uri).
R=floitsch@google.com, fschneider@google.com

Committed: https://github.com/dart-lang/sdk/commit/bbc66c2c41e61d82d6b85fdd16e2b0f1204c2a33

Review URL: https://codereview.chromium.org/1381033002 .
2015-11-12 13:02:20 +01:00
John McCutchan c6a8c44eae Include field reference with implicit getter / setter functions
- When printing implicit getter or setter functions, include the field that the implicit functions were generated for.
- Display field on function view in Observatory.
- Service unit test.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1440753002 .
2015-11-11 14:13:45 -08:00
Matthias Hausner 8d03d9a575 Remove dead code
BUG=
R=srdjan@google.com

Review URL: https://codereview.chromium.org/1441473002 .
2015-11-11 13:16:09 -08:00
John McCutchan 291befa1cd Redo TimelineTask API
A TimelineTask represents an asynchronous track of operations on the timeline.

The old API allowed multiple isolates to emit events simultaneously on the same task or to start / finish events in any order. This isn't supported by our UI and probably many other tools that consume trace-event.

With this change, operations within a TimelineTask must complete in the reverse order of their start calls (aka a stack). You can pass a TimelineTask from one isolate to another but you must first complete all open operations before passing it.

Example:

var task = new TimelineTask();

task.start('Some phase');
await someFuture;
task.finish();

Also: Add support for instant events.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1412183008 .
2015-11-11 10:59:38 -08:00
John McCutchan f5e63ba792 Make profiler work without Instructions -> Code pointer
- Do one eager pass over both the vm and current isolate's heaps to populate the live code table instead of lazily sampling the heap for code objects.
- Remove Instructions -> Code pointer

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1435533003 .
2015-11-10 11:33:53 -08:00
John McCutchan 43b0ae00e7 Timeline service protocol support with Observatory UI
Service Protocol:
- _clearVMTimeline (clear timeline)
- _getVMTimeline (fetch timeline)
- _setVMTimelineFlag (control recording)
- _getVMTimelineFlag (...)
- _getVMTimeline service unit test

Observatory:
- timeline page with record on/off, clear timeline, and refresh buttons.
- trace-viewer based timeline view that runs in an iframe driven by a small javascript program

Misc:
- Fix default enable logic bugs
- Add 'Debugger Pause' timeline event
- Threads can have a name and that name will be displayed in Observatory
- Tighten up locking when printing JSON

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1406413006 .
2015-11-10 08:02:22 -08:00
Srdjan Mitrovic c4aee38224 Pass type argument to Field construction, thus freezing that field, denoting it cannot be changed later.
BUG=
R=regis@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org/1406943006 .
2015-11-09 13:54:57 -08:00
Srdjan Mitrovic fa3c485001 Queueing fix, cleanups.
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1414333014 .
2015-11-06 15:19:59 -08:00
Siva Annamalai 9dee5b7a15 Minor cleanup
- remove ThreadInterruptCallback typedef as it is not used anymore
 - move InterruptedThreadState to thread_interrupter.h

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1428373003 .
2015-11-06 14:15:16 -08:00
Ryan Macnak ab77310444 Don't register code for CHA or field guard deopt when precompiling.
dart2js ARM -0.5% size

R=srdjan@google.com

Review URL: https://codereview.chromium.org/1430973005 .
2015-11-05 12:55:28 -08:00
Srdjan Mitrovic 720e67ea1a Redo background compilation queues to allocate queue and its element in the C-heap
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1419533011 .
2015-11-05 12:13:37 -08:00
Zachary Anderson 59b9f02307 Add creation message flag to Debugger
Don't send the shutdown event if we never sent the creation event.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1415603013 .
2015-11-05 11:27:40 -08:00
Ryan Macnak 165c21026a Add test precompiling dart2js.
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1430993003 .
2015-11-05 10:43:15 -08:00
Ryan Macnak 7e2e9cb949 ARM: Fix double use of IP when storing object fields with large offsets.
TEST=language/large_class_declaration --noopt
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1409733009 .
2015-11-05 09:54:50 -08:00
Srdjan Mitrovic 9dcd1fd076 Background compilation fixes
BUG=
R=hausner@google.com

Review URL: https://codereview.chromium.org/1426513006 .
2015-11-05 09:53:13 -08:00
Ryan Macnak 862307ccac Output precompiled snapshot size.
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1414083004 .
2015-11-04 15:13:16 -08:00
Florian Schneider f6b96b3d07 Start remove dependencies on compiler-related files.
Minimize the number of dependencies of compiler-related files.

This is needed to remove whole .cc/.h files from a compiler-less VM binary which
can be used for running precompiled code.

* removed dependencies of object.cc on flow_graph_compiler.h and flow_graph_builder.h

* removed unnecessary includes from object.h

BUG=
R=srdjan@google.com

Review URL: https://codereview.chromium.org/1411873005 .
2015-11-05 00:08:35 +01:00
Zachary Anderson ca7c39d8d2 Turn off shutdown
BUG=

Review URL: https://codereview.chromium.org/1403293007 .
2015-11-04 12:56:02 -08:00
Zachary Anderson a0c51df0ce Turn on shutdown
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1419333008 .
2015-11-04 12:19:11 -08:00