Commit Graph

2925 Commits

Author SHA1 Message Date
John McCutchan 77e0e96b5f Revert "Remember inside an ICData if it is for a static call or an instance call"
I accidentally committed an old version of this CL.

This reverts commit 9256d49af5.

BUG=

Review URL: https://codereview.chromium.org/2062983002 .
2016-06-13 13:19:38 -07:00
John McCutchan 9256d49af5 Remember inside an ICData if it is for a static call or an instance call
- [x] Add an is static call bit to ICData
- [x] Rewrite the reset ICData iterators to rely on that bit rather than the function's ic data map

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2044423003 .
2016-06-13 13:09:48 -07:00
John McCutchan 0e286e2fdd Fix library private key stability during reload
- [x] When allocating a library private key during reload, give the reload context an opportunity to provide a private key from the original library.
- [x] In identity reload mode, ensure that we pair all libraries as well as classes.

R=turnidge@google.com

Review URL: https://codereview.chromium.org/2054833002 .
2016-06-13 12:42:17 -07:00
Florian Schneider 82fac9b30b Fix incorrect new-space allocations in the parser during background compilation
Thess place were forgotten when changing all allocations in the background
compiler to old-space. New-space allocation is not allowed in the background
compiler thread.

I added assert to places that should only be reachable during unoptimized compilation.

BUG=#26669
R=asiva@google.com

Review URL: https://codereview.chromium.org/2056813002 .
2016-06-09 13:53:42 -07:00
John McCutchan 3b2e14ab56 Fix deferred load errors
R=hausner@google.com

Review URL: https://codereview.chromium.org/2045023003 .
2016-06-08 07:12:52 -07:00
Regis Crelier 4524d15d52 Fix sed expression to substitute recalculated fingerprints after format change.
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2031153002 .
2016-06-03 14:38:16 -07:00
Ryan Macnak 3f8c0bb0a9 Don't overload FreeListElement for become.
R=asiva@google.com, johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2026643004 .
2016-06-02 10:57:34 -07:00
Ryan Macnak 2e9c5f9a91 Reapply "VM: Add result cid information for recognized methods."
- _HashVMBase._index is nullable
 - _HashVMBase._data is a regular Array
 - DBC fixes from Zach.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/2033553002 .
2016-06-02 09:59:48 -07:00
Ryan Macnak 907a6b1c3b Revert "VM: Add result cid information for recognized methods."
In Flutter, this caused

  RangeError (index): Index out of range: index should be less than null: 0
  Uint32List.[]= (dart:typed_data)
  _HashVMBase&MapMixin&&_LinkedHashMapMixin._insert (dart:collection-patch/compact_hash.dart)

This reverts commit 0ae4ae5033.

TBR=fschneider@google.com

Review URL: https://codereview.chromium.org/2023423002 .
2016-06-01 14:08:48 -07:00
Florian Schneider 0ae4ae5033 VM: Add result cid information for recognized methods.
We already had this for recognized factories. This CL adds a result cid
for the remaining recognized methods.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2018363004 .
2016-06-01 09:42:48 +02:00
Ryan Macnak e3f5760f66 Tree-shaker: drop imports/exports in a way that doesn't break the vm-service.
BUG=http://dartbug.com/26550
R=hausner@google.com

Review URL: https://codereview.chromium.org/2014913002 .
2016-05-26 11:29:27 -07:00
Vyacheslav Egorov bfa8a7a2a3 VM: Field::IsConsistentWith should check unboxing state of the field.
R=fschneider@google.com
BUG=

Review URL: https://codereview.chromium.org/2012183003 .
2016-05-26 15:14:48 +02:00
Ryan Macnak 4aaf810d25 Add --dump-megamorphic-stats. Lower megamorphic cache load factor to 50%.
R=iposva@google.com

Review URL: https://codereview.chromium.org/2007233002 .
2016-05-25 14:03:27 -07:00
Ivan Posva ff47c8ab7f Fix flaky test failure:
- Do not interpret the header as a RawObject*.

BUG=

Review URL: https://codereview.chromium.org/2005423002 .
2016-05-24 16:03:25 -07:00
Ivan Posva 5295e99d27 - Removed the kWatchedBit and the associated weak property handling
code from the GCs.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/2001713002 .
2016-05-24 13:22:49 -07:00
Vyacheslav Egorov 65f2e015ca VM: Fix race between background compiler and guarded cid update.
Rework how we check guarded state consistency in background compiler.

Background compiler was storing original fields inside guarded fields list. This caused a race during inlining when inliner would copy guarded fields one by one from the callee function into the caller, because ParsedFunction::AddToGuardedFields looks at the guarded_cid to filter out those fields that should not be guarded.

As a result if some guarded field transitioned to unguarded (kDynamicCid) after callee graph construction but before list of guarded fields were copied then AddToGuardedFields would simply skip that field because it now has guarded_cid() == kDynamicCid.

We fix this race by always placing copies into the list of guarded fields and unwrapping them only in FinalizeCode.

Placing the copies also allows us to simplify a lot of code that was trying to verify guarded state consistency before committing the generated optimized code - now that we store copies in the list we can just compare their state to the originals and abort if the state is different.

Additionally fix deduplication check that was comparing original fields with copies - resulting in adding the same field into the list multiple times.

Add an assertion that verifies that we are not trying to access guarded_cid of original field from background compiler.

R=fschneider@google.com
BUG=

Review URL: https://codereview.chromium.org/2006793002 .
2016-05-24 14:52:02 +02:00
Ryan Macnak 4d48c341bf Include multiplication in the megamorphic cache hash to avoid cid ranges overlapping modulo table size from causing large displacements.
CompileOnceHelloHtml +7.115% x64
Dart2JSCompileAll +1.363% x64

R=iposva@google.com

Review URL: https://codereview.chromium.org/1998263002 .
2016-05-20 10:41:41 -07:00
John McCutchan 2918c91e5f Attempt to fix the linker issues by wrapping the template call with a helper
BUG=

Review URL: https://codereview.chromium.org/1990613002 .
2016-05-17 14:37:29 -07:00
Siva Annamalai 5de775a823 - Canonicalize generic types in a global isolate hash
table, this ensures that we do not linearly walk through
  a large type list in the class calling the expensive
  'Type::Equals' method (some applications have close to
  1304 generic types in them)

- Use the stand hash table implementation for TypeArguments
  canonicalization instead of a custom hash table

R=johnmccutchan@google.com, regis@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org/1965493004 .
2016-05-17 14:35:23 -07:00
John McCutchan 48c8ffa7f3 Initial isolate reload support
This is a cut of the work that Todd and I collaborated on in the reload branch.

In this CL, we've dropped the loader port hacks, in other words, on stack reloading in the standalone embedder does not work yet.

- [x] Support for hot reloading of isolate source code
- [x] Unit test harness and many tests
- [x] Service protocol and Observatory support
- [x] Product build does not include support for hot reloading.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1965823002 .
2016-05-17 12:19:06 -07:00
Harry Terkelsen 1745ba77f5 fix all instances of "the the"
BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1980573003 .
2016-05-13 12:38:25 -07:00
Matthias Hausner 68a6060794 Eliminate GrowableTokenStream
Eliminate building an intermediate array of tokens in the scanner. Build
the compressed TokenStream directly instead.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1969563002 .
2016-05-11 14:09:45 -07:00
Matthias Hausner 444665465c Small fix in Scanner
Use intptr_t instead of TokenPosition to denote the index of
a token in the token stream.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1968143002 .
2016-05-11 10:49:40 -07:00
Florian Schneider c1e6aef400 VM: Optimized code for all of [External]{One|Two}ByteString::codeUnitAt.
Added support for external string using flow graph based intrinsics
which helps with precompiled code, but also polymorphic calls in jitted code.
I also added support for the missing cases in the flow graph optimizer.

BUG=
R=vegorov@google.com

Review URL: https://codereview.chromium.org/1961393002 .
2016-05-11 09:29:28 +02:00
Ryan Macnak 1e8fdaee68 Support for taking full snapshots from 'dart', not just 'dart_bootstrap'.
- Don't create rival copies of the predefined symbols in isolates in dart_bootstrap.
 - Don't do work to save these rival copies during symbol table compaction.
 - Create unified symbol table just before writing the vm isolate.
 - Create unified list of scripts to include in the vm isolate.
 - Ignore object ids of the old vm isolate when writing a new one.
 - Ensure token stream private keys are hashed.
 - Use the type of isolate we are writing instead of an object's current isolate to decide if vm isolate objects are written symbolically.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1944213002 .
2016-05-10 10:13:33 -07:00
Siva Annamalai 48700fca66 Change Type::signature to not allocate a handle and instead use the cid value.
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1956453002 .
2016-05-05 15:12:37 -07:00
Ivan Posva b2ac279269 - Use a map to lookup libraries by URL.
- Ensure the uniqueness of private keys without having to
  search the existing key space.
- Pass a thread parameter where useful to library methods.

BUG=

Review URL: https://codereview.chromium.org/1947393003 .
2016-05-05 10:42:28 -07:00
Ryan Macnak 257b3a82b8 JIT precompilated snapshots.
(Precompiled snapshots with unoptimized code.)

+ ./out/ReleaseX64/dart --package-root=./out/ReleaseX64/packages ./pkg/compiler/lib/src/dart2js.dart /usr/local/google/home/rmacnak/hello.dart
Dart file (/usr/local/google/home/rmacnak/hello.dart) compiled to JavaScript: out.js

real	0m3.299s
user	0m3.197s
sys	0m0.831s

+ ./out/ProductX64/dart_bootstrap --full-snapshot-after-run=/usr/local/google/home/rmacnak/dart3/sdk/app --package-root=./out/ReleaseX64/packages ./pkg/compiler/lib/src/dart2js.dart /usr/local/google/home/rmacnak/hello.dart
Dart file (/usr/local/google/home/rmacnak/hello.dart) compiled to JavaScript: out.js
+ ./out/ProductX64/dart --run-full-snapshot=/usr/local/google/home/rmacnak/dart3/sdk/app --package-root=./out/ReleaseX64/packages ./pkg/compiler/lib/src/dart2js.dart /usr/local/google/home/rmacnak/hello.dart
vm-service: Isolate creation error: (null)
Dart file (/usr/local/google/home/rmacnak/hello.dart) compiled to JavaScript: out.js

real	0m1.979s
user	0m1.806s
sys	0m0.581s

+ ./out/ReleaseX64/dart_bootstrap --use_blobs --gen-precompiled-jit-snapshot=/usr/local/google/home/rmacnak/dart3/sdk --package-root=./out/ReleaseX64/packages ./pkg/compiler/lib/src/dart2js.dart /usr/local/google/home/rmacnak/hello.dart
Dart file (/usr/local/google/home/rmacnak/hello.dart) compiled to JavaScript: out.js
VMIsolate(CodeSize): 2699304
Isolate(CodeSize): 5930097
Instructions(CodeSize): 9440176
Total(CodeSize): 18069577
+ ./out/ReleaseX64/dart --use_blobs --run-precompiled-jit-snapshot=/usr/local/google/home/rmacnak/dart3/sdk --package-root=./out/ReleaseX64/packages ./pkg/compiler/lib/src/dart2js.dart /usr/local/google/home/rmacnak/hello.dart
Dart file (/usr/local/google/home/rmacnak/hello.dart) compiled to JavaScript: out.js

real	0m0.994s
user	0m1.259s
sys	0m0.229s

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

Review URL: https://codereview.chromium.org/1938653002 .
2016-05-04 18:47:36 -07:00
Siva Annamalai 95904322e7 Minor cleanup based on profiler output of CompileParseFunction.
- Add a zone parameter to TokenStream::Iterator
- Add IsXXXX() functions in raw_object.h using GetClassId()
- Modify
    - Function::owner
    - Function::origin
    - Type::IsMalformed
    - Type::IsMalbounded
    - Type::error
  to not create a Handle in the common path

R=regis@google.com

Review URL: https://codereview.chromium.org/1952023002 .
2016-05-04 15:30:56 -07:00
Regis Crelier 6fcb857f00 Remove temporary code used to debug issue #26101.
R=hausner@google.com

Review URL: https://codereview.chromium.org/1948173002 .
2016-05-04 12:55:46 -07:00
Regis Crelier 4eb2144956 Fix cloning of generic function types when applying mixin members to mixin
application class (fixes #26387).

R=hausner@google.com

Review URL: https://codereview.chromium.org/1950133002 .
2016-05-04 11:34:00 -07:00
Regis Crelier 5294523c20 More efficient identification of dynamic and void types.
R=asiva@google.com

Review URL: https://codereview.chromium.org/1947753002 .
2016-05-03 16:08:37 -07:00
Ryan Macnak f7a3e215a5 Undo "Don't include an object header for instructions in the text section."
This undoes most of b2f3e8efe1.

This optimization prevents precompiled code from being disabled and re-enabled, because disabling causes the code to lose its only reference to its own instructions. This was okay for precompilated code that ran without a JIT because it is never disabled, but precompiled code that runs in a JIT will become disabled when corresponding optimized code is compiled and re-abled after a deopt.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/1925153003 .
2016-05-03 11:22:28 -07:00
Siva Annamalai d5583d6a79 Use a reusable handle in SubString instead of creating one as this path is now used when creating Symbols of identifiers.
R=hausner@google.com

Review URL: https://codereview.chromium.org/1933933002 .
2016-04-29 14:53:07 -07:00
Ryan Macnak 1995651559 Don't include dependent code arrays in snapshots.
Full snapshots never include code that can deopt.

R=asiva@google.com

Review URL: https://codereview.chromium.org/1930263002 .
2016-04-29 14:48:12 -07:00
Regis Crelier 664f8e1e03 Dump more info before crashing.
Review URL: https://codereview.chromium.org/1926333002 .
2016-04-28 16:53:47 -07:00
Srdjan Mitrovic 4ea8b39157 Added flag --inline_smi_string_hashcode and --inline_smi_string_hashcode_ratio to decide when/if should Smi/OnebyteString hashcode be inlined before calling megamorphic. Improve code as suggested by zra.
Added flag --display_sorted_ic_data which displays ICData as sorted by count, unary ICData (e.g., in disassembly).

BUG=
R=zra@google.com

Review URL: https://codereview.chromium.org/1920103004 .
2016-04-27 13:27:43 -07:00
Regis Crelier b633e09ad2 Dump more info before crashing.
Review URL: https://codereview.chromium.org/1914343002 .
2016-04-26 17:33:30 -07:00
Siva Annamalai 9069cb88a2 Cleanup some handle creation code, was showing up in the CompileAll testing that we are doing with large applications.
R=regis@google.com

Review URL: https://codereview.chromium.org/1914293002 .
2016-04-26 16:59:11 -07:00
Siva Annamalai 4547165abe Fix product build compile and ensure all tests run cleanly again.
R=srdjan@google.com

Review URL: https://codereview.chromium.org/1921343002 .
2016-04-26 16:45:17 -07:00
John McCutchan 14ec00f86b Disable a call to the profiler in product mode
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1917233002 .
2016-04-26 11:12:48 -07:00
Srdjan Mitrovic 4a920397c0 Print only native stack trace when crashing in IsInstantiated (debugging code)
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1920263002 .
2016-04-26 09:44:17 -07:00
Srdjan Mitrovic c46fe8c23f Quick step 1: dump stack in AbstractType::IsInstantiated
Later: attempt to tie it in with all FATALs

BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org/1916143003 .
2016-04-25 16:29:30 -07:00
Srdjan Mitrovic d109b17ead Turn off background compilation when running with --verify_gc, since the background compilation constantly forces mutator thread to reach safepoint and vice versa. This can take too much time. Add a different source-code position for UNREACHABLE in AbstractType::IsInstantiated to analyze very rare crashes
BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org/1913313002 .
2016-04-22 15:37:52 -07:00
Matthias Hausner 3c37d20d6a Fix export cache invalidation
Stumbled on this bug in my recent export cache CL. The fix has no
impact on the time savings.

Review URL: https://codereview.chromium.org/1908123002 .
2016-04-21 13:27:49 -07:00
Matthias Hausner b4ac99a412 Add per-library cache of exported names
Speeds up name resolution of code that uses extensive
“exports” clauses. The pathological example in the bug report
compiles about 50 times faster.

Introduces a trail of visited libraries to detect cycles when following the exports directives. This works better with the background compiler.

BUG= 26145

Review URL: https://codereview.chromium.org/1902563002 .
2016-04-19 09:10:46 -07:00
Ryan Macnak f731dd0615 Reapply "- Use a hash table to canonicalize instances/arrays to avoid having to iterate over a linear list and search for canonical instances."
- Rehash constants table during tree-shaking.
 - Rehash constants table on snapshot load.

R=regis@google.com

Review URL: https://codereview.chromium.org/1900863002 .
2016-04-18 16:46:26 -07:00
Srdjan Mitrovic e334f2628c Simple fixes
BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org/1897053003 .
2016-04-18 15:48:02 -07:00
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
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