Commit graph

19311 commits

Author SHA1 Message Date
Daco Harkes
a515a0c256 Reland "[vm/ffi] SimDBC on Arm64 Android"
This reverts commit 0abff7b2bb and fixes the assembly file.

Change-Id: Ibef58c932c843aebb4de227ac5fc7664d463173f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107746
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2019-07-01 13:55:02 +00:00
Stephen Adams
000cf0560c clean up type_literal_test
TBR=leafp@google.com

Change-Id: Id8eebf4893103b187e981ccaf6c671ccdf659824
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107690
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-06-29 14:44:21 +00:00
Stephen Adams
0f20911022 Improve type_literal_test
- Fix expectations for dart2js generic function types
- Split out Type canonicalization tests
- Do some partial checking for dart2js minification

Change-Id: Ifb6e38c1138311baf1a9852286e208c59aaa03fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107686
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-06-29 06:36:36 +00:00
Robert Nystrom
13b470ac46 Parse error expectations in tests.
They don't do anything yet, but the syntax is supported and tested.

Change-Id: I67e3c72babd8e272b28b434dfb0cf6028f472676
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107568
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2019-06-29 00:54:11 +00:00
Siva Annamalai
0abff7b2bb Revert "[vm/ffi] SimDBC on Arm64 Android"
This reverts commit 9e3b44b299.

Reason for revert: Breaks the Mac iOS Flutter Engine build
../../third_party/dart/runtime/vm/compiler/ffi_dbc_trampoline_arm64.S:5:1: error: unknown directive
.type FfiTrampolineCall, %function

Original change's description:
> [vm/ffi] SimDBC on Arm64 Android
> 
> Bug: https://github.com/dart-lang/sdk/issues/35773
> 
> Change-Id: I6f1f85239b0ffe5c310b9aeea4a4edcd97362bca
> Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try, app-kernel-linux-debug-x64-try, vm-kernel-linux-debug-simdbc64-try,vm-kernel-mac-debug-simdbc64-try,vm-kernel-reload-mac-debug-simdbc64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104565
> Reviewed-by: Samir Jindel <sjindel@google.com>
> Commit-Queue: Samir Jindel <sjindel@google.com>
> Commit-Queue: Daco Harkes <dacoharkes@google.com>

TBR=sjindel@google.com,dacoharkes@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: https://github.com/dart-lang/sdk/issues/35773
Change-Id: Ibc968bb2077f66da70a0034b45908e8d24e822f2
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try, app-kernel-linux-debug-x64-try, vm-kernel-linux-debug-simdbc64-try, vm-kernel-mac-debug-simdbc64-try, vm-kernel-reload-mac-debug-simdbc64-try, vm-kernel-linux-debug-ia32-try, vm-dartkb-linux-debug-simarm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107700
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-06-28 22:38:51 +00:00
Daco Harkes
9ae79e26bc [vm/ffi] Make overflow checks consistent - fix asan
Moves a test that tries to allocate a too large amount of memory to a file which is not executed on asan.

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

Change-Id: I91101c05be509b670ff9ba82ee25424554468ec5
Cq-Include-Trybots: luci.dart.try:vm-kernel-asan-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107508
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Teagan Strickland <sstrickl@google.com>
2019-06-28 09:37:35 +00:00
Stephen Adams
4ae7e2e088 Remove useless dart2js_extra test
This is a regression test for Dart 1.x behaviour on the pre-Kernel
front end.

TBR=fishythefish@google.com

Change-Id: I2cd9cb989ad70bd1765e74bb749c3f027668112b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107620
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
Auto-Submit: Stephen Adams <sra@google.com>
2019-06-28 04:59:53 +00:00
Stephen Adams
062df390e1 Remove obsolete dart2js_extra/typed_locals_test.dart
Change-Id: Ife035eccde6754e11d83ff9be0965bd6da735327
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107541
Auto-Submit: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2019-06-28 01:20:13 +00:00
Samir Jindel
db3135ab9d [vm/ffi] Fix multitests in function_callbacks_test and update raw_object_fields.cc
Change-Id: Idb969f9d3cdd58fde02e1e9fab5cbfdf7c09f1ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107507
Reviewed-by: Samir Jindel <sjindel@google.com>
2019-06-27 21:44:42 +00:00
Alexander Markov
1eb113ba27 [vm/bytecode] Support native extensions
Change-Id: I224f740db674e20d643191605d0a7463bf85d39f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107451
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-06-27 20:24:25 +00:00
Samir Jindel
496345e2e1 [vm/ffi] Update exception behavior of FFI callbacks and fix callbacks returning void
Issues dartbug.com/36856 and dartbug.com/37301

Change-Id: I96595b0781a3a6ddf73bba5595ed5c1aa08be257
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106352
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2019-06-27 18:26:27 +00:00
Stephen Adams
c6f708d2bf [dart2js] new-rti: Implement type literals
Emit type literals in the constant pool using recipes.

Change-Id: Ia5ea024b444596844e94afbe2a34ce33e8557604
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107454
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-06-27 16:39:36 +00:00
Daco Harkes
04c984ce3f [vm/ffi] Make overflow checks consistent
This CL changes the semantics of Pointer.allocate() to not do any range or overflow checks. This is consistent with the truncating behavior that the rest of the FFI has.

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

Change-Id: Icc2b53e229cd6a2faae99c833ea5df372eb35b74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107503
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
2019-06-27 14:26:33 +00:00
Daco Harkes
3cce6fc8d6 [vm/ffi] Fix direct interaction with Pointer<Native>
This CL changes the static checks and runtime behavior of Pointer<T>.store<T>(T v) and T Pointer<T>.load() behavior to be consistent with the way Dart handles instances methods with generics. For more details see the issue.

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

Change-Id: Ifcf89646f8e357d8592c38bb340942d522dac941
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107404
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-06-27 13:14:11 +00:00
Lasse R.H. Nielsen
9edecbc803 Add test checking that const contexts are not applied where they shouldn't.
Change-Id: I39782577b7555dc63311531ca17f61f8deec5b4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98854
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2019-06-27 12:47:31 +00:00
Todd Volkert
ddfde57069 Update File.openRead to return Stream<Uint8List>
Bug: https://github.com/dart-lang/sdk/issues/36900
Change-Id: Ib2e417f4baa0048e2d4c2156c250d0cf454fdf87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104523
Commit-Queue: Todd Volkert <tvolkert@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2019-06-27 00:22:17 +00:00
Todd Volkert
c92af46433 Update HttpRequest and HttpClientResponse to be Stream<Uint8List>
Bug: https://github.com/dart-lang/sdk/issues/36900
Change-Id: I1306b2df7c789597e49d2033b660a3ea62d6c1a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104525
Commit-Queue: Todd Volkert <tvolkert@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2019-06-27 00:21:07 +00:00
Vijay Menon
74643f65c2 [dartdevc] add unit test for subtyping op
Change-Id: I704e7b566fe76fa320c68eadd89611517c3641af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107446
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Auto-Submit: Vijay Menon <vsm@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-06-26 21:42:47 +00:00
Stephen Adams
f5892dafe6 [dart2js] new-rti: bindings
HInstanceEnvironment returns the type of an instance, which gives access to all
type variables of the supertypes. HInstanceEnvironment is currently lowered to a
call to 'instanceType', but we expect to lower to a field access in
most cases, or a constant type which can be folded into subsequent operations.

The type_builder builds a type environment for each type expression. The
environment is build from the instance type scope and the function type scopes.
GVN optimizations already introduce more sharing, but it might be advantageous to
pre-compute the environment and sink the operations instead.
Later we will pass multiple type arguments as tuples which will reduce the number
of operations, especially in factory constructors.

There are some tweaks removing types in rti.dart to avoid re-entrant code.


Change-Id: I004adf7a8a464e575b32d59476c888db46542fde
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107460
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-06-26 21:11:27 +00:00
Alexander Markov
7b50b7a8e6 [vm/bytecode] Bootstrapping VM from bytecode
Previously, core snapshot was generated from AST
(because --enable-interpreter/--use-bytecode-compiler was not specified
when building core snapshot).

As the result, CL
https://dart.googlesource.com/sdk/+/da8cb470cc94830a98d49532e8d5d1a5b3d80f8b
which declared libraries in bytecode also removed bytecode entirely from
core snapshot in Dart SDK.

This CL enables bytecode by default if --bytecode argument is
specified for gn.py. This enables JIT compiler from bytecode
(interpreter is still disabled by default but can be enabled
using --enable-interpreter). Core snapshot and other
snapshots now have bytecode.

This change revealed a bunch of bugs which are fixed in this CL:

* _Closure fields were treated as unboxing candidates which triggered
  assertion in LoadFieldTOS in interpreter.

* Several places should load class declarations if they are not loaded yet.

* Canonicalization of TypeRef objects which are not fully initialized
  may cause duplicate entries in the hash table of canonical
  TypeArguments. This triggers assertions when hash table is rehashed.
  The solution is to avoid canonicalization of non-root recursive types
  and recursive type arguments. Also, TypeRef::Canonicalize and
  TypeRef::Hash are reverted to assert and work only if type was set.

* Native wrapper classes are eagerly stamped as type-finalized
  which caused assertion failures when reading their class declarations
  from bytecode.

* When building flow graph for FFI trampolines kernel offset of library
  (which is now declared in bytecode) was queried. Added special case
  to Function::KernelDataProgramOffset().

* In interpreter-only mode with simulator (e.g. SIMARM64) if simulator
  is not called before code is interrupted with stack overflow check,
  simulator returns get_sp() = 0, which was treated as stack overflow.

* test standalone_2/io/platform_resolved_executable_test.dart
  spawns sub-process but it didn't pass VM options.

Change-Id: I81bc4f1a4c6725cfa246a435ebe5d8abe43abc67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107199
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2019-06-26 18:25:26 +00:00
Daco Harkes
9e3b44b299 [vm/ffi] SimDBC on Arm64 Android
Bug: https://github.com/dart-lang/sdk/issues/35773

Change-Id: I6f1f85239b0ffe5c310b9aeea4a4edcd97362bca
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try, app-kernel-linux-debug-x64-try, vm-kernel-linux-debug-simdbc64-try,vm-kernel-mac-debug-simdbc64-try,vm-kernel-reload-mac-debug-simdbc64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104565
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2019-06-26 10:43:45 +00:00
Daco Harkes
603293f92a [vm/ffi] Regression test for dartbug.com/37254
Issue: https://github.com/dart-lang/sdk/issues/37254

Change-Id: Ic8ede0f8b7a6de0a6862ef8748a7330232950239
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107281
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2019-06-26 09:24:25 +00:00
Mayank Patke
7b39dede0e [dart2js] Define canonical recipes in terms of recipe_syntax.
Change-Id: I4e5e4fea81dbef9bf0d2994d8dcbec23a4f1fb01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107309
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-06-25 22:59:24 +00:00
Mayank Patke
069d76a58e [dart2js] Split up RTI subtype tests.
Change-Id: Id0bc61d295edfc25709aa4ff1bf9fa3c9bde5691
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107221
Reviewed-by: Stephen Adams <sra@google.com>
2019-06-25 22:59:24 +00:00
Mayank Patke
9b7bcfd1ce [dart2js] Support Future/FutureOr in RTI.
Change-Id: Ib0d849947d023a421d682061920faac8e6d7d352
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107220
Reviewed-by: Stephen Adams <sra@google.com>
2019-06-25 22:59:24 +00:00
Konstantin Shcheglov
177f543fa8 Add language_2 tests covering some cases of definite assignment.
This CL is intentionally light on coverage, because we put most of
testing in analyzer unit / functional tests.

This CL intentionally does not use multi-tests, because they are
harder to read.

R=brianwilkerson@google.com, paulberry@google.com

Change-Id: Ib48cd02fc93a9d7f8cfa3803d0c51e96c013a99f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107197
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-25 20:43:24 +00:00
Konstantin Shcheglov
1f992408c8 Report NOT_INITIALIZED_NON_NULLABLE_STATIC_FIELD.
Change-Id: I0e2b46df212d2534498a181b36066cd05f635700
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107260
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-25 17:41:22 +00:00
Dmitry Stefantsov
5948a2419f Update status files after CL 100580
Change-Id: I01efd49885e4c8cca81e2521cbcd45f1a79ba035
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100849
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-06-25 08:02:46 +00:00
Ryan Macnak
5c1d5444d6 [vm, bytecode] Fix some source position discrepancies.
Fix most cases of accessing metadata; parameter annotations still missing.

Change-Id: Ie78c3d817a86a656548cdc5775f837250a710095
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106967
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-06-25 00:57:26 +00:00
Konstantin Shcheglov
bc9a6a74e0 Rename the error code for not assigned potentially non-nullable local variable.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: Id377fc7693975137c72593fa76dd50df6ef1d5db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107189
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-24 21:05:49 +00:00
Mayank Patke
637cae2486 [dart2js] Add ability to check if RTIs are Object, Function, or Null.
Change-Id: Ia893c688fa619a87fd9ab97cf881f35763a48bdf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107080
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-06-24 20:36:59 +00:00
Konstantin Shcheglov
c13752442c Fix isNullable / isNonNullable, expand tests.
This addresses the issue in a previous CL.
https://dart-review.googlesource.com/c/sdk/+/106620/3/tests/language_2/nnbd/static_errors/equals_parameter_made_nullable_at_invoke_test.dart#30

Change-Id: Ib510ddbfe42c8e6d7cb0c4793a30e050b7e56bd0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106962
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2019-06-24 16:53:36 +00:00
Nate Bosch
cf03e96b90 Remove appJit and precompiled compiler options
Towards #37318

- appJit has been replaced by appJitk and is no longer.
- precompiled has been replaced by dartkp and is no longer used.
- For the precompiled runtime, default to dartkp.
- Remove status file references to these compiler options and normalize
  status files.

Change-Id: I48728db13dc84737092a92314e2f474a9309f4d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106942
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-06-24 16:07:27 +00:00
Daco Harkes
714234525b [vm/ffi] Tests for aliasing
Issue: https://github.com/dart-lang/sdk/issues/36247
Change-Id: I81f4cb1d34bc25efe6bc4c2d14615356ac52262f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106906
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-06-24 15:45:33 +00:00
Samir Jindel
f03ddc496b [vm/ffi] Don't make force-optimized code masquerade as unoptimized code.
Instead, we set a bit on force-optimized code so that deoptimization knows to skip it and exception
handling will execute catch-entry moves.

In addition we don't throw away deoptimization info for these codes, so that exception handling
works.

Bug: dartbug.com/37311
Change-Id: If5bcff41a98c0053c581648a9ee22b3302ceea04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106740
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-06-24 15:25:53 +00:00
Daco Harkes
0400593d1c [vm/ffi] DynamicLibrary.handle
Issue: https://github.com/dart-lang/sdk/issues/35881

Change-Id: I67ff49fef950c7c507f5006c357909cd09914c5f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106903
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
2019-06-24 09:29:54 +00:00
Konstantin Shcheglov
a5d6b81da8 Use flow analysis to report potentially non-nullable local variables that are used before definitely assigned.
Not done yet:
1. Switching all unit tests to `performFlowAnalysis()`.
2. Updating the error code and renaming tests.
3. Writing more language_2/ tests.

R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I0936f2daa4ab1cd91edeaca3eef9544eced5b443
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106982
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-23 22:08:43 +00:00
Konstantin Shcheglov
32df04a5ef Fix nnbd/syntax/required_modifier_error_test
There were compilation errors reported because of missing default
values for non-required optional non-nullable parameters.

R=brianwilkerson@google.com, danrubel@google.com

Change-Id: If0454988219a7fece317c86124a81a2a8ce8bea4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106963
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-21 17:29:17 +00:00
Johnni Winther
639cff0ec0 [dart2js] Detect non-trivial substitution between type and this-type in optimization
Closes #37267

Change-Id: I317c2b8e5fb3f1df10691bdaf9c10f20b8042b8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106347
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-06-21 17:07:57 +00:00
Johnni Winther
77668f4e58 [CFE] Preserve errors in unevaluated and unused arguments and locals
Change-Id: If8c23ac2f374ee863fd8df4c241195c0a115e69d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104980
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-06-21 13:53:17 +00:00
Mayank Patke
089a435344 [dart2js] Add subtyping for identical interface names without explicit type rule.
Change-Id: I0db1ff88e6fcb6a5e3f7615aa588afb473a77a16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106820
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-06-20 21:24:27 +00:00
Mayank Patke
f4903989bb [dart2js] Refactor RTI type rules and streamline test harness.
Change-Id: I8c32ec329d26babcfccc3e06f4d3a7ead9257201
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106780
Reviewed-by: Stephen Adams <sra@google.com>
2019-06-20 21:24:27 +00:00
Alexander Markov
0ae10fa68d [vm/bytecode] Support --causal_async_stacks in bytecode generator
Also, standalone_2/causal_async_stack_test is updated to actually
test --causal_async_stacks after Dart 2 sync-async.

Change-Id: I28a7a281963828707461652f19494ff54bdd21c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106760
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-06-20 20:23:37 +00:00
Alexander Markov
da8cb470cc [vm/bytecode] Represent classes, libraries, scripts and recursive types in bytecode
Size of a large application:
Before: 26628600
After: 21480120 (-19.3%)

Size of snapshots:

isolate_snapshot_framework.bin
Before: 9322496
After: 6782976 (-27.2%)

isolate_snapshot_product_framework.bin
Before: 9166848
After: 6602752 (-27.9%)

Regressions in tests:

1) Test language_2/type_alias_equality_test/04 fails similarly to default mode, as VM
does not implement comparison of function types according to the specification.
Previously this test was passing as function types were canonicalized in bytecode,
which was not always correct. This CL fixes the problem with canonicalization of
function types in bytecode and the test starts failing again.

2) Tests standalone_2/entrypoints_verification_test, standalone_2/io/test_extension_test,
standalone_2/io/test_extension_fail_test fail as native extensions are not supported
in bytecode yet. These tests start passing after df5e7aac17,
which switched bytecode tests to kernel service (on x64), because kernel service doesn't
drop ASTs. This CL switches from reading AST library declarations to bytecode even if
AST is not removed, so tests fail again.

Change-Id: I8b7ba44bfa49d0b1599b2509553ff7c831a4e244
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104700
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-06-20 18:27:21 +00:00
Konstantin Shcheglov
85a4fdb81a Report an error when a non-nullable top-level variable is not initialized.
Change-Id: I2e5e33c01d5f2c10d41b7e2f76e93eaacadffff6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106762
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-06-20 18:25:11 +00:00
Konstantin Shcheglov
a600e97cae Don't compare typeArguments for FunctionType(s) equality.
Change-Id: I9245de1cc16f912af2141dee34b03f401d89a534
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106240
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-20 06:07:37 +00:00
Nate Bosch
2b56c2c58a Normalize status files
Run `pkg/status_file/bin/normalize.dart` across all status files.

This should solve most presubmit warnings about "existing and possibly
new status file issues".

There are remaining issues in pkg/front_end/testcases/strong.status and
pkg/front_end/testcases/text_serialization.status which will need to be
fixed manually.

Change-Id: Iceae8992c4907442481590d75c1b0a84ce29521b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106726
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
2019-06-19 23:04:01 +00:00
Robert Nystrom
1734133f2c Migrate tests off the ancient multitest marker syntax.
Change-Id: Iae025d9c544831e24debf0a670202ced8f252a97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106201
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2019-06-19 21:15:30 +00:00
Mayank Patke
0fae370538 [dart2js] Add subtyping rules to new RTI.
Change-Id: I9b70e2ccfc2dbac768fdccf4449b0f551a4fb5cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106486
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-06-19 20:01:16 +00:00
Konstantin Shcheglov
3c596e802b Report an error when a potentially non-nullable local variable is not initialized.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: Ie1d148ff584c202edc334659eeb4f792bb8773d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106620
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-06-19 18:07:56 +00:00