Commit Graph

1103 Commits

Author SHA1 Message Date
Kevin Millikin 1c83d8d096 [Kernel] Allow invalid expressions in constant contexts
A simple solution is to leave them unevaluated.

Change-Id: Ic7d1237452a387180ec12f23b3a4030ff64f061d
Reviewed-on: https://dart-review.googlesource.com/c/89282
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Auto-Submit: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-01-14 13:30:00 +00:00
Kevin Millikin 1c9eb3cef8 [Kernel] Allow constant declarations without an initializer
These can arise in erroneous cases which have already been reported,
e.g., in a for-in loop with a const declaration.  The constant
evaluator should not assume a non-null initializer in this case.

Change-Id: I2540cb9c659d33e23b6c00d4a8bbf56c404d8c1d
Reviewed-on: https://dart-review.googlesource.com/c/89280
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Auto-Submit: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-01-14 11:40:10 +00:00
Dmitry Stefantsov 9157bbcf19 [kernel] Add text (de)serialization for VariableSet
Change-Id: Ib49aae4ee0f5ba1ff809dbf8b8ff0bc1c16e6838
Reviewed-on: https://dart-review.googlesource.com/c/89121
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2019-01-11 12:16:43 +00:00
Kevin Millikin 1314a6dbf7 [Kernel] Do not evaluate fromEnvironment constants
Instead of evaluating them to their default value, leave them
unevaluated.

Change-Id: Iefc7701b9993cae8f7f1eee37d904d21a89a1cd8
Reviewed-on: https://dart-review.googlesource.com/c/89002
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2019-01-11 10:23:51 +00:00
Kevin Millikin 944984f015 [Kernel] Add syntax for unevaluated constants
Add Kernel syntactic support for constants constructed by
bool.fromEnvironment, int.fromEnvironment, and String.fromEnvironment.
These values are not necessarily available at compile time.  Because
constants can depend on these values, there is also an unevaluated constant
that represents an expression depending on environment values.

This syntax is not yet produced by the Fasta compiler.

Change-Id: Ie96ea7f60a7efcd35ac802b320a00f398d41232e
Reviewed-on: https://dart-review.googlesource.com/c/88827
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-01-11 08:35:20 +00:00
Dmitry Stefantsov 59b252fa0a [kernel] Add text serializer/deserializer for VariableGet
Change-Id: I884190dffbca5eb5181f21bc12972b375e31de65
Reviewed-on: https://dart-review.googlesource.com/c/88724
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-01-10 14:20:01 +00:00
Peter von der Ahé e7495724b9 Remove TypeEnvironment.hierarchy
Change-Id: Ia32e2c0beb504e38f8dcb9bae33f4ee9f0e7daca
Reviewed-on: https://dart-review.googlesource.com/c/88825
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2019-01-10 05:21:24 +00:00
Peter von der Ahé 50ea6344f5 Use TypeEnvironment.getTypeAsInstanceOf instead of ClassHierarchy
Change-Id: I1682baeb336b8be3cb6c5874715ef8ba730561e0
Reviewed-on: https://dart-review.googlesource.com/c/88803
Commit-Queue: Peter von der Ahé <ahe@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-01-09 10:08:03 +00:00
Kevin Millikin a7b23e1cb5 [Kernel] Add text serializers for some invocations
Add serializers for instance getters, setters, and methods and for
super getters, setters, and methods.  This requires also serializing
Arguments.

Change-Id: I36d36892bf896cd12b48f9e77395c0584daf47f1
Reviewed-on: https://dart-review.googlesource.com/c/88710
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
2019-01-09 09:43:31 +00:00
Peter von der Ahé e7c808f910 Remove unused methods
Change-Id: I782700f972b846ec0d86b671c0c9b097ca73495d
Reviewed-on: https://dart-review.googlesource.com/c/88800
Commit-Queue: Peter von der Ahé <ahe@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-01-09 09:40:51 +00:00
Kevin Moore 16f7f421df pkg:kernel - Fix three bugs identified by lints
Change-Id: I753153a9c8f5adeb9be516f60590bd3f33bc4923
Reviewed-on: https://dart-review.googlesource.com/c/88680
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
2019-01-08 14:54:05 +00:00
Kevin Moore 6f3ce5b9e9 Fixes for SDK packages
Change-Id: I544e4e085cc1e420397d6d825a93376ae586f9a4
Reviewed-on: https://dart-review.googlesource.com/c/88681
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-01-08 14:53:42 +00:00
Dmitry Stefantsov 113ca50ba3 [kernel] Add a step to fasta unit tests to check text serialization
Change-Id: I8d945fc9d75aad1c4275b6d3dd3f9e2ea884ea9f
Reviewed-on: https://dart-review.googlesource.com/c/88451
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2019-01-08 10:31:42 +00:00
Dmitry Stefantsov 6b8826f336 [kernel] Rename failure classes for TextSerializationVerifier
Change-Id: I51240e069a1a518fe35d25d2a44e8d7a84343946
Reviewed-on: https://dart-review.googlesource.com/c/88562
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-01-08 10:31:42 +00:00
Dmitry Stefantsov c76c5a023d [kernel] Rename 'errors' to 'failures' in TextSerializationVerifier
Change-Id: I9886e1c7ba4fbacff18f79a627f8e75b50c960c7
Reviewed-on: https://dart-review.googlesource.com/c/88561
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-01-08 10:31:42 +00:00
Dmitry Stefantsov cebd469ecd [kernel] Move RoundTripVerifier to pkg/kernel/lib/text and rename it
Change-Id: Icb61feab76be161e99b8c2fd316e41271470182a
Reviewed-on: https://dart-review.googlesource.com/c/88560
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-01-08 10:31:42 +00:00
Kevin Millikin a2844bdfd4 [Kernel] Add serializers for public names
This will enable serialization of expressions blocked on names.
Supporting private names requires a map from from serialized library
ID to library.  More generally, we need to support something like the
dill file's canonical names.

Change-Id: I7d470e6a49b167f7755d130ea6c3e543e188da65
Reviewed-on: https://dart-review.googlesource.com/c/88703
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2019-01-08 10:28:42 +00:00
Dmitry Stefantsov 5e609d7946 [kernel] Implement serialization round-trip check for dart types
Change-Id: Ie97439e6f822eb1e94c17cc4a5f3c04f1f58a4bc
Reviewed-on: https://dart-review.googlesource.com/c/88444
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-01-04 16:05:26 +00:00
Dmitry Stefantsov 39539773bb [kernel] Implement serialization round-trip check for expressions
Change-Id: Ibf3766f5325a9bf0b1016232319e0b308eca188c
Reviewed-on: https://dart-review.googlesource.com/c/88442
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-01-04 16:05:26 +00:00
Dmitry Stefantsov 3b728c0a04 [kernel] Wire round-trip verification down to expressions and types
Change-Id: Iab7a41fced28c58ea1280b5a8960d3440bc29e23
Reviewed-on: https://dart-review.googlesource.com/c/88441
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-01-04 16:05:26 +00:00
Dmitry Stefantsov 1cbae9fe48 [kernel] Start implementing verifier for serialization round trips
Change-Id: I907e92cf7b7f791a4bc64cac6739489d38d2c224
Reviewed-on: https://dart-review.googlesource.com/c/88322
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-01-04 16:05:26 +00:00
Jens Johansen d53f02aa8a Remove writeOptionalReference
References can be null --- it's written as the byte [0].
Thus in the null case it would before be [0] and now be [0].
In the non-null case it would before be [1, xyz] (1 for Tag.Something
and xyz for the actual, now positive, uint30). Now it would be [xyz].

Change-Id: Ibc08d3afb7275b0429a4d6c5e667fbd381121489
Reviewed-on: https://dart-review.googlesource.com/c/85394
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-01-04 13:31:03 +00:00
Jens Johansen c3b0ebd391 dill serialization: Specialize some writeNodes
Golem says:

x64
AstToBinaryP90 (Intel Core i5)	-1.995% (0.0 noise)
AstToBinaryP90 (Intel Xeon)	-4.005% (0.1 noise)
AstToBinaryP50 (Intel Core i5)	-2.209% (0.2 noise)
AstToBinary (Intel Core i5)	-2.551% (0.3 noise)
AstToBinaryP50 (Intel Xeon)	-3.982% (0.4 noise)
AstToBinary (Intel Xeon)	-4.184% (0.4 noise)


ia32
AstToBinaryP90 (Intel Core i5)	-2.417% (0.2 noise)
AstToBinaryP50 (Intel Core i5)	-2.445% (0.2 noise)
AstToBinary (Intel Core i5)	-2.491% (0.2 noise)
AstToBinary (Intel Xeon)	-2.666% (0.2 noise)
AstToBinaryP90 (Intel Xeon)	-2.611% (0.2 noise)
AstToBinaryP50 (Intel Xeon)	-2.690% (0.2 noise)


Change-Id: I5e864fb9a8cf3aece1c4ad279cb5a1192dae4a07
Reviewed-on: https://dart-review.googlesource.com/c/85364
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2019-01-04 10:12:28 +00:00
Jens Johansen 6c909a0efa Be explicit about whether a reference is allowed to be null or not
Before this change we allowed to serialize some references as null,
and would only complain when trying to read the dill back in.
This CL changes that so it complains up front.

It is unknown if any of this would ever occur in practise.

Change-Id: Id5e1af89abfb88a2d4249bd439b53b062d7aeffa
Reviewed-on: https://dart-review.googlesource.com/c/85392
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-01-04 08:39:36 +00:00
Aske Simon Christensen 8170d27b99 Flag on target to indicate set literal support
Change-Id: Ide5f2c32a3f1a6709142f1144ebff12fd62de141
Reviewed-on: https://dart-review.googlesource.com/c/88331
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2019-01-03 18:35:35 +00:00
Kevin Millikin 9f866c8696 [Kernel] Do not serialize list lengths
The length is redundant if the list is delimited.  Serializing the
length had the slight advantage of preallocating a list of the correct
size and the disadvantages of being harder to maintain by hand and
ugly to read.

Instead, delimit lists.  The empty list is naturally ().

Change-Id: I17c14f4e0ca4934cfd3dcdf2a0047f87df80bb79
Reviewed-on: https://dart-review.googlesource.com/c/88320
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2019-01-03 10:16:14 +00:00
Kevin Millikin 66fa918fd3 [Kernel] Add text serializers for Let expressions
Serializing Let requires us to serialize variable declarations which are
complicated.  They require us to support optional values because they
have an optional initializer.  This is done by using a _ for none.

Having support for Let will allow us to support variable get and set.

Change-Id: I207183730389de70409ae6ca5017510420e36830
Reviewed-on: https://dart-review.googlesource.com/c/88182
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2019-01-02 15:49:49 +00:00
Kevin Millikin 01b23e23a4 [Kernel] Add text serializers for lists, sets, and maps
Use separate tags for the non-const and const versions of these
literals, just like the binary serializer does.

Change-Id: I3fabf02ce758a46ce55ff258723dd3ae11e6d497
Reviewed-on: https://dart-review.googlesource.com/c/88181
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2019-01-02 12:12:49 +00:00
Kevin Millikin 94e77946a0 [Kernel] Add text serializers for some DartTypes
Add serializers for some simple DartTypes and some expressions that
were blocked on being able to serializer DartTypes.

Change-Id: Ib16aa59e5782bddc820ea88e0885f258fc17bbd0
Reviewed-on: https://dart-review.googlesource.com/c/88180
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2019-01-02 10:45:35 +00:00
Kevin Millikin da0216e92d [Kernel] add serializers for more simple expressions
Support the rest of the expressions that do not require serializing
DartType, Name, Arguments, or references to other parts of the AST.

Change-Id: Icef3c2824354add1b13fa8c34fa7ff7c48bd2148
Reviewed-on: https://dart-review.googlesource.com/c/87963
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2018-12-21 14:00:10 +00:00
Kevin Millikin aeb873187d [Kernel] Add text serializers for lists
Add a serializer for lists that writes the length and then the elements.
Use it for serializing/deserializing StringConcatenation.

Change-Id: I61eb0ec319b0dbf94a2f3965b392a7ad12ce01dc
Reviewed-on: https://dart-review.googlesource.com/c/87962
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2018-12-21 10:46:00 +00:00
Kevin Millikin d0c2cdcd4c [Kernel] Remove the syncAsync flag
This flag was always true so we can remove it and specialize the
remaining code that used it.  The only code that used it was in the
Dart VM's async transformation.

Specializing that code led to some unused fields in the async helper
class which were removed.  This triggered me to look at core types
which seems to have a lot of unused stuff.

Change-Id: I7da800ca17ac05478149f4c90337a38d2c2b1459
Reviewed-on: https://dart-review.googlesource.com/c/87960
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2018-12-21 10:07:04 +00:00
Alexander Markov 8dea340fda [vm/kernel] Ensure alignment of metadata in case of concatenated kernel files
Alignment of metadata sections in kernel binary files was introduced in
https://dart-review.googlesource.com/c/sdk/+/83543 in order to
keep bytecode instructions aligned without copying them from kernel
binaries.

When multiple kernel files are concatenated, metadata sections
could become unaligned if sizes of kernel files are not aligned.

This change adds padding into kernel binaries (before component index)
to make sure that size of kernel binaries is a multiple of 8.

Fixes https://github.com/dart-lang/sdk/issues/35443

Change-Id: Ic7dc0da66c699ef406a325e69fe277e9d9e3b836
Reviewed-on: https://dart-review.googlesource.com/c/87741
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2018-12-21 00:12:01 +00:00
asiva dff358223e [VM/Runtime] Delete flag --sync-async and it's uses.
Remove all references to the --sync-async flag which was added as a transition step
when the feature was being introduced.

Change-Id: Ic5b1c8c8b3e2d92a70d954d401afeddfd43f5e92
Reviewed-on: https://dart-review.googlesource.com/c/87381
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-12-20 23:37:45 +00:00
Peter von der Ahé e45e334548 Rename strong mode to legacy mode in package:kernel
Change-Id: Ia4a8a9cac7817a8db5771ec82541b556c705f7c8
Reviewed-on: https://dart-review.googlesource.com/c/86353
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-12-20 18:06:34 +00:00
Kevin Millikin 9d77f18784 [Kernel] Serialize logical expressions
Use the operator string as the tag.  This requires us to be able to
serialize a sequence of (two) things.  Homogeneous lists don't give us
static typing so we introduce a pair class.

This requires allocating a pair (serializing a list would require
allocating a list anyway).  When we start generating and optimizing
the combinator applications we expect to eliminate the pair allocation
overhead.

Change-Id: I5a00c6973b9065ac8a91f1a69b52d97554f1e823
Reviewed-on: https://dart-review.googlesource.com/c/87840
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2018-12-20 15:24:15 +00:00
Kevin Millikin 091e38afcb [Kernel] Implement more text serialization
Begin serializing expressions.  Fairly quickly you encounter the cyclic
dependency between class Expression and any subclass that contains
nested expressions.  It isn't possible to implement this with immutable
values in Dart.

A quick solution is to break the cycle somewhere.  Here, the cycle is
broken by late initialization of the serializer for Expression.
Serializers are still immutable (either const or with all final fields)
and still singleton instances (by virtue of being static fields).

Change-Id: I9886bcd57041744e0ef9e95f7b901fcb94b5e042
Reviewed-on: https://dart-review.googlesource.com/c/87801
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2018-12-20 13:45:04 +00:00
Kevin Millikin ff44e27c5a Implement text serialization of strings
Use json.encode/json.decode.  This gets some strings wrong but it
should be enough to make more progress.

Testing with hardcoded strings is already getting awkward.

Change-Id: Ie0b168bec611ed93da13fff90f86232bb56c713f
Reviewed-on: https://dart-review.googlesource.com/c/87663
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2018-12-20 11:12:49 +00:00
Peter von der Ahé cbe30dc0d5 Remove Target.disableTypeInference
Change-Id: I440b07258a79796092e14abf816f257d9af40427
Reviewed-on: https://dart-review.googlesource.com/c/86357
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-12-19 17:21:51 +00:00
Peter von der Ahé a6e37888ee Merge legacy and disable inference modes
Change-Id: I05d402414e63cd70675b39e5a5976a4d97dd9d0d
Reviewed-on: https://dart-review.googlesource.com/c/85956
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-12-19 17:21:51 +00:00
Kevin Millikin 612b6884c4 Split the text serializer into libraries
Move the combinators and the reader into their own libraries.

Change-Id: I85042a3f319c0fc945d658dd23a3959c74b7cbca
Reviewed-on: https://dart-review.googlesource.com/c/87660
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2018-12-19 14:24:22 +00:00
Kevin Millikin 4283735fa1 First pieces of Kernel text serialization
Combinator-based serialization of Kernel basic literals.

Change-Id: I6d08c80f47f233b178aa57ee6fc887ac91ed9e9c
Reviewed-on: https://dart-review.googlesource.com/c/87320
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-12-19 12:16:24 +00:00
Paul Berry 6ece9f910c Prepare to publish analyzer version 0.34.1.
Change-Id: I81a9053e4ab3dacd1dcbb8e72d2b80f19752b758
Reviewed-on: https://dart-review.googlesource.com/c/87609
Commit-Queue: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-12-18 23:02:44 +00:00
Kevin Millikin a8493e1b50 Flip the default value of the Kernel syncAsync flag
In Kernel's TargetFlags, this flag still defaulted to false.  Flip the
default to true and update all client code in the SDK.  The
expectation is that many of the places that now pass false explicitly
really just want the default, but that will be verified separately and
then the flag will be removed.

Change-Id: I2a38eb53f280f21f59bb1d2e88c42516f827fd39
Reviewed-on: https://dart-review.googlesource.com/c/85448
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2018-12-12 14:23:54 +00:00
Aske Simon Christensen 05fb37a808 Add SetLiteral node to kernel.
Change-Id: I2f12662efc8ae3f064674bba03c333e0c23ffa0d
Reviewed-on: https://dart-review.googlesource.com/c/85681
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-12-06 14:46:58 +00:00
Paul Berry 0a4873bb35 Merge commit '191a09f540ac0516c4088fb8454c693743be8b3f' into analyzer 2018-12-04 09:41:55 -08:00
Alexander Markov 9f49b47823 [vm/bytecode] Revise representation of objects and strings in bytecode
This is a major revamp of bytecode metadata format. Now bytecode has
its own serialization mechanisms.

This CL adds 'bytecode component' metadata, which contains bytecode
object table and string table. All references from bytecode (constant
pools) to libraries, classes, members, types and strings now have a new
format. References to frequently used objects are represented as indices
in object table, while rarely used objects are written inline.
This allows VM to cache frequently used objects while reading bytecode.

Representation of strings is aligned with VM - string characters are
stored in separate pools of one-byte and two-byte strings. This allows
VM to avoid UTF-8 decoding and extra copying.

Closure declarations are now explicit. Type parameters no longer require
enslosing scopes when reading/writing them.

Benchmarks:
GenKernelKernelReadAllBytecode (Intel Core i5) +29.84%
GenKernelKernelReadAllBytecode (Intel Xeon) +28.74%
Change-Id: I4b80009733a8f8c038264af74f97c4e094b9e311
Reviewed-on: https://dart-review.googlesource.com/c/85469
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2018-12-03 19:08:42 +00:00
Paul Berry 6f5d6db9c2 Cherry-pick analyzer CHANGELOG and pubspec from analyzer-0.33 branch.
Also includes changes to the kernel and front_end pubspecs, since
those packages are tightly coupled to the analyzer.

These changes were made on the analyzer-0.33 branch in preparation for
previous releases of the analyzer.  Merging them to the master branch
makes it easier to keep the pubspec and CHANGELOG files up to date on
that branch.

Change-Id: I08a7bdcd49b6b2396166953131927656eca2c563
Reviewed-on: https://dart-review.googlesource.com/c/85727
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-12-01 17:23:47 +00:00
Paul Berry 63770042aa Merge commit '80c23f87a3e3123d7e337c1fc8bc3b5ec49b34a0' into analyzer 2018-11-30 08:12:45 -08:00
Jens Johansen 7f8e6f8bb6 Be more verbose in loops etc in kernel
Benchmarks have shown that old-style for-loops are faster than for-in
for instance.

Golem says

ia32

whole stack (i.e. including utf8 and change to VariableIndexer)

AstToBinaryP90 (Intel Core i5)	6.617% (0.4 noise)
AstToBinary (Intel Xeon)	5.158% (0.4 noise)
AstToBinaryP90 (Intel Xeon)	5.104% (0.4 noise)
AstToBinaryP50 (Intel Xeon)	5.148% (0.4 noise)
AstToBinary (Intel Core i5)	6.579% (0.4 noise)
AstToBinaryP50 (Intel Core i5)	6.741% (0.4 noise)

by itself (i.e. compared to a build with utf8 and change to VariableIndexer)

AstToBinaryP90 (Intel Core i5)	0.7724% (0.0 noise)
AstToBinaryP50 (Intel Core i5)	0.7848% (0.0 noise)
AstToBinary (Intel Core i5)	0.8559% (0.0 noise)
AstToBinaryP90 (Intel Xeon)	0.7730% (0.1 noise)
AstToBinaryP50 (Intel Xeon)	0.8195% (0.1 noise)
AstToBinary (Intel Xeon)	0.9319% (0.1 noise)



x64

whole stack (i.e. including utf8 and change to VariableIndexer)

AstToBinaryP90 (Intel Core i5)	5.555% (0.2 noise)
AstToBinaryP50 (Intel Xeon)	6.352% (0.4 noise)
AstToBinaryP50 (Intel Core i5)	5.395% (0.5 noise)
AstToBinary (Intel Xeon)	6.928% (0.5 noise)
AstToBinaryP90 (Intel Xeon)	7.180% (0.5 noise)
AstToBinary (Intel Core i5)	5.824% (0.5 noise)

by itself  (i.e. compared to a build with utf8 and change to VariableIndexer)

AstToBinaryP90 (Intel Core i5)	0.1039% (0.0 noise)
AstToBinaryP50 (Intel Core i5)	0.6154% (0.0 noise)
AstToBinary (Intel Core i5)	0.7640% (0.1 noise)
AstToBinaryP50 (Intel Xeon)	1.268% (0.1 noise)
AstToBinary (Intel Xeon)	1.457% (0.1 noise)
AstToBinaryP90 (Intel Xeon)	1.512% (0.1 noise)



Change-Id: If091a3a01f2fe6574712946a01644413033739b6
Reviewed-on: https://dart-review.googlesource.com/c/85341
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-11-30 13:15:47 +00:00