Commit Graph

1601 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
Ryan Macnak 87e8bc2c96 VM: Evaluate-in-frame should happen in the scope of the method class, not the receiver class.
BUG=http://dartbug.com/26161
R=hausner@google.com

Review URL: https://codereview.chromium.org/1854243002 .
2016-04-04 15:22:57 -07:00
Siva Annamalai 78a6b46155 Provide ability to patch external functions in a class that has already been finalized. The following restrictions are in place:
- No new fields or patching of existing fields can be done
 - Only external methods that have not already executed (i.e code for it has been   generated) can be patched

This change enables patching of JS Interop methods into a class and provides close to 5 sec drop in start up times for Green Tea app.

R=hausner@google.com, regis@google.com

Review URL: https://codereview.chromium.org/1850653003 .
2016-03-31 20:06:44 -07:00
Ryan Macnak e228e78264 Precompilation: Don't look at embedder allocated pages when finalizing the VM isolate.
On precompiled Space Blast on an iTouch 6, reduces finalizing the vm isolate from 60ms to <1 ms, but loading the isolate snapshot doesn't happen any sooner.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/1834333002 .
2016-03-29 16:49:33 -07:00
Srdjan Mitrovic 40d8eee81e Remove unnecessary isolate argument from some visitors
BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org/1838373002 .
2016-03-29 14:47:51 -07:00
Ryan Macnak f0d4f3151c Precompilation:
- Fix crash sending full class responses.
  - Don't wait for service isolate startup.
  - Add timeline events for deserializing and premarking the VM isolate.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1835633002 .
2016-03-29 12:30:47 -07:00