VM treats instantiated function types with NumParentTypeArguments() != 0
as non-instantiated (as they potentially depend on the numbering of
enclosing type parameters) and would explicitly instantiate such types.
So bytecode generator needs to make sure that instantiated types,
instantiated type arguments and types used in constants always have
NumParentTypeArguments() == 0, so they would not need unnecessary
instantiation.
TEST=ci
Change-Id: I3ea54a0b535655611893d28edb54ffd50dcda1f0
Cq-Include-Trybots: luci.dart.try:vm-aot-dyn-linux-debug-x64-try,vm-aot-dyn-linux-product-x64-try,vm-dyn-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/443630
Reviewed-by: Tess Strickland <sstrickl@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Extract the text of assert condition and put it into bytecode
instead of relying on runtime to find the source text
(which is most likely unavailable for a dynamic module).
TEST=ci (language/vm/regress_27671_test, vm/dart/asserts_test)
Change-Id: Id6643333164b37c5046fa1dfecdbe9338f53c93d
Cq-Include-Trybots: luci.dart.try:vm-aot-dyn-linux-debug-x64-try,vm-aot-dyn-linux-product-x64-try,vm-dyn-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/442244
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Hot reload needs to run instance field initializers for all newly
added fields except fields initialized with null.
TEST=ci (vm/cc/IsolateReload_RunNewFieldInitializers)
Change-Id: I3ead726aa12b9d6c5aa515c7297deca0ddd9eb9f
Cq-Include-Trybots: luci.dart.try:vm-aot-dyn-linux-debug-x64-try,vm-aot-dyn-linux-product-x64-try,vm-dyn-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/441861
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Under the hood, there is no difference between
`isSubtypeWhenUsingNullabilities` and
`isSubtypeWhenIgnoringNullabilities` by now. This CL makes the
corresponding renames and removals in the CFE and its clients.
TEST=existing
Change-Id: I22060c29834179c30ba62562aa254146b1d7530d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/433480
Reviewed-by: Ömer Ağacan <omersa@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
dart2bytecode can optionally add source position information
(including line starts) to the generated bytecode
(when '--bytecode-options=source-positions' flag is specified).
If bytecode has source positions, they are now shown in stack traces
involving interpreter frames.
TEST=ci
Change-Id: I1ae3326bac21201040be32c712514e71e96f51e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/433760
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Bytecode generator needs to know the runtime semantics of Dart types,
but TypeEnvironment.isTop predicate does not use erasure of extension
types and does not return true for extension types based on other top
types (e.g. dynamic).
TEST=language/dot_shorthands/member/static_method_cascade_test
Change-Id: If8323d11293498fb39d8d936c406bc9bb7e85ce9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426983
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
When creating function types, VM takes number of parent function type
arguments into account. So function types with distinct number of
parent function type arguments should not be merged in the bytecode
object table and should be represented as distinct types.
TEST=language/mixin/type_parameter_inference_test
Fixes https://github.com/dart-lang/sdk/issues/59633
Change-Id: I9c8b0923c52b1b95628ff8daa3bbfa135c559912
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/398500
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
* Switch UInt32 from big-endian to little-endian encoding.
* Reorder object kinds, constant tags, type tags and constant pool tags.
* Reorder field and function flags.
* Cleanup yield point marker from source positions.
TEST=ci
Change-Id: I05ee940b6393a478831af11ac93fee9ec1441c4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384040
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
* Use AllocateClosure instruction for closure instantiations in order
to initialize closure entry point.
* Fix null handling in operator== to be before argument type checks.
* Add _InvocationMirror._withType to dynamic interface as it is
implicitly used by noSuchMethod forwarders.
* Fix AssertAssignable for null objects.
TEST=language tests in vm-aot-dyn-linux-debug-x64 configuration
Change-Id: I7b1a037d4fde4d22ed32969e0f099b31ea4432ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382500
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Add dart2bytecode tool which takes Dart sources and produces
Dart bytecode. The tool uses common front-end (CFE) to parse Dart
source code and contains bytecode generator which translates
kernel AST to bytecode.
Change-Id: I90bd6e72c619cf0edc556da0640760b30e81091d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/378560
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>