Commit graph

6897 commits

Author SHA1 Message Date
Vyacheslav Egorov ee0f608ce4 Dart Byte Code interpreter.
This version is Clang/GCC only and does not support Windows because it uses computed goto's.

Only unoptimized mode is supported.

Architecture is described in constants_dbc.h and stack_frame_dbc.h.

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

Review URL: https://codereview.chromium.org/1858283002 .
2016-04-18 23:02:01 +02:00
Ryan Macnak 8a14e75885 Precompilation: Local functions may be the only survivors in a library.
R=regis@google.com

Review URL: https://codereview.chromium.org/1893403002 .
2016-04-18 13:05:39 -07:00
Regis Crelier bab552edaf Fix mirrors to keep typedef as scope class of function types (fixes #26187).
Add mirror regression test.
Adjust expectation of a mirror test.
Fix parser to mark current class as typedef before parsing signature.
Fix canonicalization of typedef function types (a typedef class can be the scope
class of more than one function type, even if not generic).

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1890013002 .
2016-04-15 13:21:22 -07:00
Stephen Adams d57599e6d1 x64: Decode more objects for code view.
In particular, the cmpq for parsing named optional arguments has the
object recognized.

BUG=
R=fschneider@google.com, johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1888353002 .
2016-04-15 12:19:10 -07:00
Srdjan Mitrovic ad6d0bc8a8 Fix a crash in debugger, add flag --stress-test-background-compilation, add asserts.
Fix a crash in debugger: in background compilation check if the function is still marked as optimizable; setting breakpoints at runtime can change that.

Add flag --stress-test-background-compilation which re-feeds compiled functions into the compilation queue.

Add various asserts related to background compilation.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1884213004 .
2016-04-15 12:12:35 -07:00
Ryan Macnak 0555b799cd Timeline: Copy event labels of embedder events.
Fixes use-after-free of the label for the 'SkyActivity.onSkyReady' event.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1882313002 .
2016-04-15 09:48:07 -07:00
Ryan Macnak b63dc021ea Remove timeline events for Dart_GetNativeX, etc.
These are common leaf functions.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1887203004 .
2016-04-15 09:31:35 -07:00
Florian Schneider 78217dc393 VM: Always start switchable calls with IC stub.
This generalizes the use of switchable calls to the case where
the number of arguments checked is > 1 and improves performance
of calls to the various operator methods.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1888783002 .
2016-04-15 13:55:56 +02:00
Ryan Macnak 7293be3403 Add event for script snapshot reading with the snapshot size and resulting heap size.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1885503005 .
2016-04-14 15:39:36 -07:00
Srdjan Mitrovic b741c098bf GC Experiment: move GC call from background compiler thread to the mutator thread
BUG=

Review URL: https://codereview.chromium.org/1887123002 .
2016-04-14 11:08:31 -07:00
Florian Loitsch bcd8ef3dea Enable conditional directives by default.
R=brianwilkerson@google.com, iposva@google.com, sigmund@google.com

Review URL: https://codereview.chromium.org/1851753002 .
2016-04-14 19:02:41 +02:00
Ryan Macnak 6304582145 Shuffle fields to make simarm and arm agree on the offset of Heap::new_space_.top_.
Fix non-simulated mips build.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1883053002 .
2016-04-14 09:50:33 -07:00
Srdjan Mitrovic 898aa67b43 Do not trigger background compilation while top level parsing in mutator thread
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1881383004 .
2016-04-13 19:42:41 -07:00
Siva Annamalai 8ce7b6291a Revert "- Use a hash table to canonicalize instances/arrays to avoid having to iterate over a linear list and search for canonical instances."
This reverts commit 95a2b02a9e.

Once the tree shaker in precompiled code is fixed to treat the constants array in a class as a hash table this CL can be re-applied.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1888593003 .
2016-04-13 18:49:53 -07:00
Srdjan Mitrovic 8a1072e3e6 Fix background compilation disassembly: allocate string in old space instead of new space.
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1889603003 .
2016-04-13 13:48:37 -07:00
Siva Annamalai 5491e7caa4 Fix build.
Review URL: https://codereview.chromium.org/1889583002 .
2016-04-13 11:43:52 -07:00
Siva Annamalai 95a2b02a9e - Use a hash table to canonicalize instances/arrays to avoid having to iterate over a linear list and search for canonical instances.
- Some minor cleanups
  - Return an empty array right away in the parser instead of creating an
    empty array and canonicalizing it
  - The canonical bit was not being set for some of the singleton objects.

R=regis@google.com

Review URL: https://codereview.chromium.org/1873143003 .
2016-04-13 10:26:17 -07:00
Regis Crelier b8bcb5587b Properly handle unfinalized type parameters of generic mixins (fixes #26230).
Finalize upper bounds of unfinalized classes earlier in order to reduce the
number of BoundedType allocations.
Add regression test.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/1886633002 .
2016-04-13 10:04:53 -07:00
Siva Annamalai fc3156db11 Add usage and collision details to the hash table data structure in order to determine effectiveness of the hash function.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1882763002 .
2016-04-13 09:08:52 -07:00
Ivan Posva dacf846df0 - Avoid calling % in a loop when probing.
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1884583004 .
2016-04-12 16:26:43 -07:00
Srdjan Mitrovic 4465fc3492 Address Siva's comments from https://codereview.chromium.org/1877973002/
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1880233002 .
2016-04-12 15:44:50 -07:00
Siva Annamalai 8311c49799 Add a temporary timeout and print in the safepoint waiter to log if we are stuck waiting for a thread to safepoint, this will help detect if some timeouts in the build bots is because of this.
R=srdjan@google.com

Review URL: https://codereview.chromium.org/1886583002 .
2016-04-12 15:35:15 -07:00
Ivan Posva 80f0f13fcd - Streamline comparisons in symbol table.
- Avoid String::Equals method which considers the canonical bit.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1885433002 .
2016-04-12 15:03:24 -07:00
Siva Annamalai 5828e3eb6f Provide a mechanism for naming a hash table so that it can be used in DumpStats to identify the table.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1873283003 .
2016-04-12 13:38:08 -07:00
Srdjan Mitrovic 80ba69dfdb Print messages when aborting background compilation (--trace-compiler); turn on background compilation; mark a slow test.
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1879033002 .
2016-04-12 11:19:56 -07:00
Ivan Posva 23a4e3da53 - Ensure that we do not enter symbols twice: Set the canonical bit
on a String once we know it is canonical.
- Bug fix in hash set implementation.

BUG=

Review URL: https://codereview.chromium.org/1876363003 .
2016-04-11 22:05:43 -07:00
Ivan Posva 5be5d54529 - Refactor Symbol allocation to expect a thread parameter.
- Preallocate all tokens as symbols to avoid repeated lookups.
- Pass thread/zone where useful while doing this change.
- Avoid allocating symbols for error messages.

BUG=
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1870343002 .
2016-04-11 16:28:29 -07:00
Srdjan Mitrovic cb63ed46fe Invalidate background compilation only if relevant fields were invalidated.
BUG=
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1877973002 .
2016-04-11 15:34:59 -07:00
Ryan Macnak e048774776 Precompilation: Specialize instance calls when the call receiver is the method receiver and the method class has a small number of concrete subclasses (currently 5).
CompileOnceHelloHtml (ARMv7HF) +17.194%
DeltaBlueClosures (ARMv7HF) +28.379%
DeltaBlue (ARMv7HF) +30.190%

precompiled dart2js arm 19071745 -> 19504726 (+2.3%)

R=fschneider@google.com

Review URL: https://codereview.chromium.org/1867913004 .
2016-04-11 12:52:28 -07:00
Srdjan Mitrovic ef87bb2e40 Test:turn off background compilation
BUG=

Review URL: https://codereview.chromium.org/1879593002 .
2016-04-11 09:50:05 -07:00
Florian Schneider be298b60e9 VM: Remove unnecessary _Num class from runtime/lib.
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1874853002 .
2016-04-08 16:25:52 -07:00
Ryan Macnak 260ea83950 Disable string externalization by default.
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1875733003 .
2016-04-08 10:56:14 -07:00
Srdjan Mitrovic cb2cd17332 Turn background compilation on
BUG=

Review URL: https://codereview.chromium.org/1870153002 .
2016-04-08 09:32:50 -07:00
Kevin Millikin 6f3707f3c1 Dart VM: Fix an order-of-evaluation bug in async code.
Reading and writing local and static variables is a side effect that
might be observable from a Future, so such reads and writes cannot be
scheduled after the Future completes when they should be performed
before.

The same is true for throwing an exception.

Closes https://github.com/dart-lang/sdk/issues/26175

R=hausner@google.com
BUG=

Review URL: https://codereview.chromium.org/1861963007 .
2016-04-08 09:40:14 +02:00
Matthias Hausner 35627e082c Fix precompiled after field lookup change
BUG=

Review URL: https://codereview.chromium.org/1867203003 .
2016-04-07 17:29:32 -07:00
Matthias Hausner 425b9a36b9 Use symbols when looking up fields in a class
The slow string comparison is only necessary when looking up
non-symbols or untangled private names.

Compiling all of dart2js seems to be about 1% faster, but it's really in the noise.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1868803002 .
2016-04-07 16:36:35 -07:00
Ivan Posva c434931517 - Remove --coverage_dir flag and old-style coverage service requests.
BUG=

Review URL: https://codereview.chromium.org/1846443002 .
2016-04-07 16:24:49 -07:00
Srdjan Mitrovic 1e601fb467 Do not block for safepoint when transitioning from generated code to VM, otherwise the result may not be GC'd.
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1869933002 .
2016-04-07 15:58:54 -07:00
John McCutchan 1c4f63df6c Print the isolate's sticky error if it has one.
- Bump protocol version to 3.4 to match service.md.
- Added note in changelog about 'none' pause event.
- Print the isolate's sticky error if it has one.

Fixes #26203

Review URL: https://codereview.chromium.org/1862903003 .
2016-04-07 15:31:50 -07:00
Ryan Macnak 34e4107c0d Add flag to disable string externalization, allowing the compiler to rely on string class checks remaining valid across calls.
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1859273002 .
2016-04-07 13:24:44 -07:00
Srdjan Mitrovic e4d0b3b88d Clear background compilation queue and abort background compilation when stopping the background compiler. No need to delay isolate shutdown
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1870753002 .
2016-04-07 12:42:03 -07:00
Srdjan Mitrovic 314bb44ea3 Fix background compilation queue access. Some cleanups.
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1863273002 .
2016-04-07 09:12:56 -07:00
Siva Annamalai 95f37e03af Minor cleanup.
R=hausner@google.com

Review URL: https://codereview.chromium.org/1868783002 .
2016-04-06 16:03:28 -07:00
Siva Annamalai 07d0c715ff - Restructure Canonicalization of instances in preparation for adding a
HashMap to store the Canonical constants of Instances/Arrays. The goal is
  to continue to use an array for Numbers (Mint, Bigint, Double) and use a
  HashMap for other Instances/Arrays.

- Check first for the array length and elements being same before checking
  if the TypeArguments are equivalent

- Removed some unused code

R=regis@google.com

Review URL: https://codereview.chromium.org/1866713003 .
2016-04-06 15:47:42 -07:00
Matthias Hausner 728faf448b Fix full snapshot writer code
When no vm isolate snapshot buffer is specified, write the vm isolate
symbols into the full snapshot.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1867653003 .
2016-04-06 15:22:00 -07:00
Srdjan Mitrovic 3d23c82d94 Fixes crashes in inliner: do not inline if icdata was cleared. Add some asserts.
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1863733004 .
2016-04-06 14:43:56 -07:00
Srdjan Mitrovic cef337f8c7 Add instruction tags to saved ICData (debug mode only).
When restoring ICData in optimizing compiler, we can verify that the ICData/deopt-id matches an instruction. This should help catch non-deterministic graph generation.

BUG=
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1864143002 .
2016-04-06 11:01:46 -07:00
Ryan Macnak 27c1a6c900 Propogate types from arguments to parameters early during inlining.
BUG=
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1860833002 .
2016-04-05 14:46:24 -07:00
Srdjan Mitrovic c87181af57 Fix detection if a function was compiled,
Background compilation requires that a function was run through parser in mutator thread at least once. Because snapshots can/could preload ICData and code they are not reliable signals if the function was compiled or not. Add a bit to function object.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1857273002 .
2016-04-05 13:32:14 -07:00
Srdjan Mitrovic 706ea55404 Fix background compilation issues when creating snapshots.
- Stop background compilation early enough
- Restore symbol table after completing snapshot writing.
- Create symbols instead fo strinfs (error caught with --no-use_lib_cache)

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1852393004 .
2016-04-04 16:40:46 -07:00