Commit Graph

90 Commits

Author SHA1 Message Date
Matthew Dempsky 4ce3aa7af1 [vm] Replace ^= assignments with = where possible
Change-Id: I04ac2e9c4b8bb654b7c660e728be3867aa4e1513
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100923
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Matthew Dempsky <mdempsky@google.com>
2019-05-01 00:04:44 +00:00
Ryan Macnak 971f4845d7 [build] Remove last platform -> vm and bin -> vm dependencies. Fix some ODR violations.
Change some static_libraries to source_sets to make ODR violations link-time errors.

This is needed to enable (stop suppressing) -fvisibility=hidden in Fuchsia product builds.

Change-Id: I699cec8d4b516beab9cebf9db0a522a7ff99e004
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99822
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-04-22 20:15:43 +00:00
Ryan Macnak fba89f9f64 [vm] Don't change the content of the VM isolate's snapshot based on what was loading into a core or app snapshot.
Ensures, by default, multiple core or app snapshots are capable of being loaded into the same process. Flags that affect stub generation can still create incompatibilities. A later CL will internalize VM isolate snapshot generation to the VM build and ensure compatibility.

Change-Id: I247063d5a3a611b04963b8e8ab2ac8a1f20ea57a
Reviewed-on: https://dart-review.googlesource.com/c/93962
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-02-26 19:04:50 +00:00
Ryan Macnak 3afac84840 [vm, aot] Remove KernelProgramInfo etc before Symbols::Compact.
Eliminates some symbols that were memory-reachable but not snapshot-reachable.

Compact the canonical type and type arguments tables along with the symbol table.


flutter_gallery, Android release
Total(CodeSize): 11158045 -> 11055480 (-0.92%)

Change-Id: I63bd1353906ea66c6f82a932cff57f7c25331200
Reviewed-on: https://dart-review.googlesource.com/c/92221
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-02-08 17:16:26 +00:00
Zichang Guo 5a0dd76be0 #35222 Return null and Print Error with invalid UTF8 input
Change-Id: Ic186d8139b6466cbace3db51c662ce8951462e89
Reviewed-on: https://dart-review.googlesource.com/c/87460
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2018-12-19 22:04:45 +00:00
Ryan Macnak 1a890ff07d [test] Dump symbol and type tables in determinism test.
Bug: https://github.com/dart-lang/sdk/issues/35092
Change-Id: I0647d8e4fe14a3ea19298dbe8b839f2db28755ab
Reviewed-on: https://dart-review.googlesource.com/c/84685
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-11-19 19:03:38 +00:00
Ben Konyi 07852532e3 [ VM ] Additional cleanup in Dart_Initialize and Dart_Cleanup
Change-Id: I6dc02b3d9de16cc176eb97613bc0c7f0bb9b16eb
Reviewed-on: https://dart-review.googlesource.com/77013
Commit-Queue: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2018-09-28 23:18:59 +00:00
Ryan Macnak 9b5a931b06 [vm] Replace most runtime/vm uses of OS::Print with OS::PrintErr.
Leave --print-snapshot-sizes on stdout because it is parsed by Flutter benchmarks.

Replace all runtime/bin uses of OS::Print with Log::Print.

Bug: https://github.com/dart-lang/sdk/issues/32134
Change-Id: I74aacfb410cdfa9270d06e7f6ab0534520c7c7ba
Reviewed-on: https://dart-review.googlesource.com/60021
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-06-13 19:51:40 +00:00
Ryan Macnak 558a931409 [vm] Move some string utils from runtime/vm to runtime/platform.
Change-Id: I552086445a7e07792f9da85afa5edf23b6c450d5
Reviewed-on: https://dart-review.googlesource.com/44402
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-03-01 02:07:46 +00:00
Ryan Macnak 9174a627f5 [vm, gc] Ensure BackgroundCompiler can't be deleted during a safepoint.
Previously, the background compiler was deleted by the thread pool, which could have raced ahead of the mutator clearing its reference. Now it is deleted by the mutator.

Change-Id: Id353a96022f699131ee60fe31156cd0404dfd285
Reviewed-on: https://dart-review.googlesource.com/24342
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2017-11-30 22:59:51 +00:00
Erik Corry ae2d84e51e VM: Speed up output of UTF8 for 1-byte strings.
For 1-byte strings we don't need the full power of UTF-8 conversion with
support for 3 and 4-byte sequences and reassembly of UTF-16 surrogate pairs.

This optimization was originally intended to improve the reverse-complement
benchmark.  It also seems to have a positive effect (ca. 1% on average) on
dart2js.

After implementing this it doesn't seem worth having a special case in
ToCString for ASCII strings. That special case would allocate the string twice
for all Latin1 strings, which feels unfortunate.

R=vegorov@google.com

Bug:
Change-Id: If852f3ecb4e06118da8357cfa2c843ad0df0edb9
Reviewed-on: https://dart-review.googlesource.com/8920
Commit-Queue: Erik Corry <erikcorry@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-10-23 10:43:59 +00:00
Zachary Anderson 09456bfb6f [vm] Reset vm isolate symbol table load factor
fixes #30371

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2999743002 .
2017-08-09 10:03:52 -07:00
Ryan Macnak 466385ceb6 [vm, gc] Require a safepoint for heap iteration.
Assert a safepoint operation can only be started from a thread in the VM state. Fix several unit tests missing a native-to-vm transition.

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

Review-Url: https://codereview.chromium.org/2995543004 .
2017-08-07 17:51:25 -07:00
Zachary Anderson c4b821cc81 [vm] Higher vm snapshot symbol table load factor
This saves a bit less than 100KB in memory footprint in hello world
on Fuchsia's content handler:  3640KB -> 3552KB

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2989283002 .
2017-08-04 09:22:40 -07:00
Zachary Anderson 6cd8a79078 VM: Re-format to use at most one newline between functions
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2974233002 .
2017-07-13 08:08:37 -07:00
Ryan Macnak dcb1d51f33 Compact the symbol table when creating core snapshots or JIT app snapshots.
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2638173002 .
2017-01-19 10:49:24 -08:00
Zachary Anderson a1bcf051d8 clang-format runtime/vm
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2481873005 .
2016-11-08 13:54:47 -08:00
Ryan Macnak 326af5e9d7 Move Zone's destructor out of a header file.
This unburdens users of StackZone from needing to include handles_impl.h. A new use of StackZone was recently added to heap.cc without a include of handles_impl.h, and this caused link-time errors on some versions of gcc.

R=asiva@google.com

Review URL: https://codereview.chromium.org/2362573002 .
2016-09-22 13:16:36 -07: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 29d79258f1 Fix precompile build issue with IsString change.
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1953803003 .
2016-05-05 12:53:02 -07:00
Siva Annamalai 65c4aaee17 - Add a new constructor to the hash table classes that allow handles to be passed in instead of creating new ones for every lookup/insertion
- Use reusable handles in Symbols::New and Symbols::Lookup with the new constructor defined above

R=hausner@google.com

Review URL: https://codereview.chromium.org/1934263003 .
2016-05-02 17:07:31 -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 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
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 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
Siva Annamalai 5322692506 Add a SafepointMutexLocker class so that it is possible to have scopes inside the MutexLocker which could potentially trigger safepoints.
R=srdjan@google.com

Review URL: https://codereview.chromium.org/1717803002 .
2016-02-19 16:03:52 -08:00
Ivan Posva 9c0c6cb5c2 Add product mode:
- Add PRODUCT define and build mode to gyp configurations.
- Add product mode to test harness.
- Start to unify list of flags.
- Allow flags to be constant for particular build configurations.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/1663863002 .
2016-02-03 21:10:30 -08:00
Ryan Macnak c7efe5a756 Precompilation: compact the symbol table.
Also, don't leak handles out of the precompiler.

dart2js/x64:
symbols 62126 -> 38668 (-37.8%)
snapshot 22534723 -> 21740838 (-3.5%)

R=asiva@google.com

Review URL: https://codereview.chromium.org/1638143002 .
2016-01-28 10:23:14 -08:00
Srdjan Mitrovic 8d618766a8 Remove isolate argument from handle allocation: Part II
BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org/1389353004 .
2015-10-12 14:06:50 -07:00
Srdjan Mitrovic 771f2dfb52 Symbols::NewFormatted and old space allocation.
BUG=
R=hausner@google.com

Review URL: https://codereview.chromium.org//1322973006 .
2015-09-04 10:59:28 -07:00
Srdjan Mitrovic d4365bc6f4 Lookup getter/setter symbols before alllocating them, thus eliminating extra String allocations in new space.
Various old space allocations, cleanups.
Add a test for Symbols concatenation.

BUG=
R=hausner@google.com

Review URL: https://codereview.chromium.org//1320673012 .
2015-09-03 14:09:34 -07:00
Ivan Posva 6446cc5096 - Do not access the first character in zero-length strings.
- Make sure to print all 64-bits of the Dart_Port if necessary.

R=ricow@google.com

Review URL: https://codereview.chromium.org//1326853003 .
2015-09-02 23:22:16 -07:00
Srdjan Mitrovic df29a93b0d Fix Dartium by supporting external strings as well in Symbols::FromConcatAll
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org//1323063004 .
2015-09-02 11:25:19 -07:00
Srdjan Mitrovic 59db5010a9 More elimination of new space allocation, fix bugs in Symbols::FromConcatAll
BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org//1322043002 .
2015-09-01 10:30:03 -07:00
Srdjan Mitrovic dd5410209f Added {Zone}GrowableHandlePtrArray types: simplifies code, makes code safer
BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org//1312833009 .
2015-08-31 09:24:00 -07:00
Srdjan Mitrovic b5c256b85f Use zone allocated C-strings instead of String heap objects to construct signature symbols
BUG=
R=koda@google.com

Review URL: https://codereview.chromium.org//1313363005 .
2015-08-26 13:30:55 -07:00
Srdjan Mitrovic 4280716656 Remove new space allocation in optimizing compiler, use Symbols::FromConcat where appropriate
BUG=
R=hausner@google.com

Review URL: https://codereview.chromium.org//1303923002 .
2015-08-20 15:13:06 -07:00
Daniel Andersson 00ef260503 Enable concurrent optimization test after migrating scopes to Thread*
Also move static call target table allocation into old space.

Note that stats are not thread-safe, so running two compilers concurrently may lead to inaccurate stats.

BUG=https://github.com/dart-lang/sdk/issues/24109

Review URL: https://codereview.chromium.org//1291803009 .
2015-08-19 15:16:47 -07:00
Daniel Andersson f722d4d2b2 Migrate to Zone-based handle allocation interface in hash table and symbol table.
This is used by the compiler through "NewSymbol".

BUG=https://github.com/dart-lang/sdk/issues/24109
R=srdjan@google.com

Review URL: https://codereview.chromium.org//1292433004 .
2015-08-19 09:35:01 -07:00
Daniel Andersson c089a152ac Migrate most uses of Isolate::current_zone to Thread::zone.
After https://codereview.chromium.org/1204303003/ is submitted, the last remaining uses can go.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org//1220193009 .
2015-07-08 09:59:32 -07:00
asiva@google.com 05d7eb5dfa Move symbol table from per isolate snapshot to vm isolate snapshot, this reduces the per isolate initial heap size
from New space (0k of 1024k) Old space (1274k of 1536k)
to New space (0k of 1024k) Old space (756k of 1280k)

R=hausner@google.com

Review URL: https://codereview.chromium.org//1123813002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45795 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-14 20:14:37 +00:00
asiva@google.com b5336c5726 Unify processing of Keywords and predefined symbols in the same loop and add accessors for keyword symbol handles.
R=hausner@google.com

Review URL: https://codereview.chromium.org//1130843002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45602 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-07 17:28:02 +00:00
iposva@google.com 39703863c4 - Add a separate step to finalize the VM isolate explicitly.
- Allocate the method extractor parameter types and names
  only once, namely in the VM isolate.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//664593002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41173 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-17 17:02:19 +00:00
asiva@google.com 98c5d02664 Ensure that hash for a symbol is not set to 0 when it is made external.
R=iposva@google.com

Review URL: https://codereview.chromium.org//474033002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39268 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-14 21:17:40 +00:00
koda@google.com 2d67774537 Avoid redundant allocation of accessor names.
Support prefixed lookup in symbol table.
Startup new gen usage after "hello world" startup is reduced by ~15%.

R=iposva@google.com

Review URL: https://codereview.chromium.org//442483002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38884 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-04 23:04:52 +00:00
koda@google.com 50bb605a6a Handle-like interface for HashTable.
A combination of two independent interface changes:
1. Constructor takes a RawArray* and allocates its own Array handle.
2. Release provides access to the entire handle, rather than just the raw.

This results in a very clean usage pattern, like:
  FooTable table(get_foo_table());
  table.Insert(obj);
  ...
  set_foo_table(table.Release());

Having the isolate inside HashTable also allows faster allocation of temporary handles.

R=iposva@google.com

Review URL: https://codereview.chromium.org//428273002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38794 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-31 19:50:23 +00:00
koda@google.com 3ddcda9ab8 Reimplement Symbols using hash table template.
In the process, add hash table support for materializing an Object key from a lookup key on demand.

Also use this to simplify CompressedTokenStream.

R=iposva@google.com

Review URL: https://codereview.chromium.org//397413002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38710 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-29 22:47:56 +00:00
ajohnsen@google.com ed29c2b81f Speed up identifying keywords in scanner, by using extra table.
The table maps the first character of a identifier, to the first keyword
intry in the sorted token-list. If no keyword exists that starts with a
given character, we don't enter the loop at all.

BUG=
R=hausner@google.com

Review URL: https://codereview.chromium.org//316633002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36934 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-03 20:14:24 +00:00