Commit graph

21675 commits

Author SHA1 Message Date
Michael Thomsen 71e3dac037 Remove deprecated packageRoot API, which doesn't work in Dart 2
Bug: https://github.com/dart-lang/sdk/issues/47769
Change-Id: I1cbd7761e7119c07f2697d7624bec703ba4c4641
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221340
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2021-12-07 14:44:49 +00:00
Sergey G. Grekhov c4d5a2ed8a [co19] co19/LibTest/html/responseText_A01_t02 test enabled
Change-Id: I4ca667b2b82cb5587854686851e6f9992a1fc233
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221462
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2021-12-07 11:14:19 +00:00
Nicholas Shahan 95684da0d1 [tests] Add regression test missing super helpers
DDC compiled output is missing getter and setter helper methods when a super
field is both read and written in a constructor.

Issue: https://github.com/dart-lang/sdk/issues/47698
Change-Id: I45302aa8880a168847d72517b2cecb25e31d2b67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221742
Reviewed-by: Mark Zhou <markzipan@google.com>
2021-12-02 22:12:57 +00:00
Daco Harkes 663357209c [vm/ffi] Introduce Abi
This introduces the application binary interface (ABI) concept to
`dart:ffi` as a class with opaque instances.

We will use this for providing mappings for ABI-specific types.
Bug: https://github.com/dart-lang/sdk/issues/42563
Bug: https://github.com/dart-lang/sdk/issues/42816
Closes: https://github.com/dart-lang/sdk/issues/45254

Later, we might open up the contents of `Abi` if need be.

Some API design discussion notes:
https://github.com/dart-lang/sdk/issues/42563#issuecomment-981774001

TEST=tests/ffi/abi_test.dart

Change-Id: Iebf290fc12f37d6f4236432ddf27ab3e12bde06d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221627
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-12-01 19:19:37 +00:00
Ryan Macnak ae5def7b0d [test] Account for new locale string returned on macOS.
TEST=ci
Change-Id: I29bf54c8a75c016a11921ce78c60076009d347ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221720
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-12-01 00:22:45 +00:00
Clement Skau 7344e5e619 [test] Skip regress_47594_test in Product
Bug: https://github.com/dart-lang/sdk/issues/47811
Change-Id: I16af738c8d01c1b82052d6f1aaf55d1650143f11
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-product-arm-try,app-kernel-linux-product-x64-try,vm-ffi-android-product-arm64c-try,vm-kernel-linux-product-x64-try,vm-kernel-mac-product-x64-try,vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-win-product-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221620
Auto-Submit: Clement Skau <cskau@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2021-11-30 11:11:04 +00:00
Riley Porter fc560bab9e [package:js] Test optional default value arguments in extensions
Change-Id: Ia28d53bfca87dab143701ce0099a16580fdc14b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221560
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2021-11-30 04:45:04 +00:00
Clement Skau 034824f80e [test] Skip failing bots on regress_47594_test
- DartDev is not available on Android.
- DynamicLibrary.process() is not available on Windows.

Change-Id: I6606159168dd01e0fa0b9bc97b5316641123d42b
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-android-release-arm64c-try,vm-ffi-android-release-arm64c-try,vm-ffi-android-release-arm-try,vm-ffi-android-product-arm64c-try,vm-ffi-android-product-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,vm-kernel-win-release-x64-try,vm-kernel-win-release-ia32-try,vm-kernel-win-product-x64-try,vm-kernel-win-debug-x64c-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-precomp-win-debug-x64c-try,vm-kernel-precomp-nnbd-win-release-x64-try,vm-kernel-nnbd-win-release-x64-try,vm-kernel-nnbd-win-release-ia32-try,vm-kernel-nnbd-win-debug-x64-try,pkg-win-release-try,dart-sdk-win-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221500
Auto-Submit: Clement Skau <cskau@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-11-29 22:36:04 +00:00
Clement Skau bd4a27ff81 [vm/ffi] Adds transition information to FFI leaf calls.
This change sets `top_exit_frame_info` and `vmtag` on FFI leaf calls.
We have to set this info on the thread so that the stack walker can
interpret the frame correctly.
Without it, anyone trying to walk the stack during an FFI leaf call
- like the profiler - will misinterpret the top frame and cause
a segfault.

TEST=Added regression test.

Bug: https://github.com/dart-lang/sdk/issues/47594
Change-Id: If83aeab194aa0213aee82558bb9541cd7294a935
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220360
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2021-11-29 10:12:36 +00:00
Alexander Thomas ef181bbc29 [test] Skip Language/Types/Interface_Types/subtype_t27
The test is causing frequent CQ failures right now.

Bug: https://github.com/dart-lang/sdk/issues/42641
Change-Id: I46727cab95eb8da5feec7de860426e94d5875314
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221325
Auto-Submit: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2021-11-26 11:31:23 +00:00
Stephen Adams 12dae45e5a [corelib] Properly check radix in BigInt.toRadixString.
Change-Id: Ieb1b541db3c35984f4a75b618f9df1c82f4d37da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221201
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-11-25 22:53:53 +00:00
Vyacheslav Egorov 71c9c2cd83 [vm] Remove support for non-bare AOT snapshots
Every AOT user out there has been using bare instructions mode
and continuing to maintaining non-bare instructions mode simply
adds costs (both in terms of time spent making changes to work
in a mode that is not used and CI resources spent on testing it).

This change removes FLAG_use_bare_instructions and changes the code
to assume that FLAG_precompiled_mode implies bare instructions.

TEST=ci

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64c-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,app-kernel-linux-release-x64-try,app-kernel-linux-debug-x64-try
Change-Id: I5032b13bfcb613f79865f2cfa139cca8d1b42556
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220964
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-11-24 13:03:52 +00:00
Daco Harkes 00ea62f713 [cfe/ffi] Handle invalid types in Array
Closes: https://github.com/dart-lang/sdk/issues/47673

TEST=tests/ffi(_2)/regress_47673(_2)_test.dart

Change-Id: I8fdafc5378797ed071250b0caed1ab944873a218
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220760
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2021-11-19 13:38:47 +00:00
Mayank Patke 6b382a03b0 [dart2js] Add failing tests for #47691.
Bug: https://github.com/dart-lang/sdk/issues/47691
Change-Id: I14a0b5f027b6a5ed74dd22b63e3c103b380823eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220780
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-11-18 20:37:36 +00:00
Brian Quinlan 051c198bff Add a test where we attempt to rename a file.
Change-Id: I9901f8abefe1e652307e15f05ef66d033a16a02f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220420
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-11-17 21:59:20 +00:00
Brian Quinlan 0e5f3f49c3 Fix an issue where rename on Windows would delete the target directory.
TEST=tests updated
Bug: https://github.com/dart-lang/sdk/issues/35217, https://github.com/dart-lang/sdk/issues/47633, https://github.com/dart-lang/sdk/issues/47634
Change-Id: I9582c76e8eb75548ba2d67205353de63d110c294
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219501
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-11-17 19:41:50 +00:00
Simon Binder 0d6c343196 [dart:io] Add overrides for stdio
Add overrides to control the `stdin`, `stdout` and `stderr` getters in
`dart:io`.

Closes https://github.com/dart-lang/sdk/issues/33643

Change-Id: I6071ad0845df96f8508d2281a6c013f1745ca880
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219792
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-11-17 15:40:15 +00:00
Nicholas Shahan ecdcde3a83 [ddc] Ensure mixin class is emitted before use
Moves the class definition to appear before uses in compiled
code.

Change-Id: I00558040a510c7bc8668794b82fa3bd67dde64e9
Fixes: https://github.com/dart-lang/sdk/issues/47645
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220071
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2021-11-12 19:21:52 +00:00
Lasse R.H. Nielsen e1428ba911 Remove references to constructor-tearoff experiment.
TEST=Modifying existing tests.

Change-Id: I22fa11a5f2efc4bd6d1d54a656106f40bbfeafb3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220002
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2021-11-11 14:04:43 +00:00
Lasse R.H. Nielsen 2360783808 Expire experiments released in earlier stable versions.
Remove messages referring to expired `non-nullable` experiment.
Remove occurrences of --enable-experiment with expired experiments.

TEST=Flags were expired. If existing tests still run, it's a success.

Change-Id: Id66d78eb0a3191ec5e31375faf0effd9ea7b768f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219789
Auto-Submit: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2021-11-11 08:28:31 +00:00
Lasse R.H. Nielsen 62f4712523 Don't assume that a stack overflow is an Error.
A new test captures a stack overflow error and rethrows it.
It assumed that it would be a Dart `Error`, but on dartdevk it's not.
Now just catches whatever it is and checks that it's the same
object again.

Bug: http://dartbug.com/47664
Change-Id: I2355ab1b43adf82806b0b76fc26aa5879ddb0d87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219788
Auto-Submit: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-11-10 21:36:13 +00:00
Stephen Adams 0afb365804 [dart2js] Fix #47566 by disabling optimization
The JavaScript-to-JavaScript async transform had an inconsisent
handling of switch statements that contained an await, but only in the
expression.

For now the special handling of the expression-only case is disabled.

Change-Id: Ia79ff3951d681ba933df638da7e0e518d401ed9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219746
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-11-09 00:43:02 +00:00
Sam Rawlins 8900608365 Report fewer duplicate errors for invalid superinitializers
Fixes https://github.com/dart-lang/sdk/issues/45958

Move check out of old checker.dart, into (less old) error_verifier.dart
and move test case out of old checker_test.dart. Add valid test case.

Rename INVALID_SUPER_INVOCATION to SUPER_INVOCATION_NOT_LAST, and
correct comment on that code (it has a parameter).

Do not duplicate report that code with MULTIPLE_SUPER_INVOCATIONS or
with SUPER_IN_REDIRECTING_CONSTRUCTOR.

Change-Id: I26e28b345fd8cef8ed2c9ec89ab12b56ea1c2f37
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218982
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-11-08 18:53:42 +00:00
Lasse R.H. Nielsen 20e9582106 Add Error.throwWithStackTrace function which throws an error and stack.
Allows throwing an error with an existing stack trace, instead of always
creating a new stack traces.

Fixes #30741

Bug: https://github.com/dart-lang/sdk/issues/30741
TEST=corelib/error_throw_with_stacktrace_test.dart
Change-Id: Iea77b4a8eb5e0cab4cd0d75432d033256c9f79fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219522
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-11-08 15:51:32 +00:00
Martin Kustermann 8a6e38832f [vm] Fix standalone{,_2}/io/platform_test & incorrect error handling in VM
This fixes failures of standalone{,_2}/io/platform_test in AOT / AppJIT modes
(and removes old status file markers which are ignored by approval system).

It also fixes a Crash in vm/dart{,_2}/spawn_shutdown_test - where error
handling was not correctly done - a `Dart_ExitScope()` was missing
before a return.

Issue https://github.com/dart-lang/sdk/issues/47632

TEST=standalone{,_2}/io/platform_test & vm/dart{,_2}/spawn_shutdown_test

Change-Id: Ic4a8bcaa243c514b11f5127d77ec77259d60ca68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219520
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-11-05 17:48:49 +00:00
Brian Quinlan 18d421d6d2 Better messages when error messages don't match
TEST=test-only change
Change-Id: I2cbb1611da39ca2ca0c24a2c5f2e53028026db7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219500
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2021-11-05 17:45:47 +00:00
Alexander Markov 9b7caf3b93 [vm/compiler] Fix handling of captured try_finally_return_value variable
In async/async* methods synthetic :try_finally_return_value variable
(which is used to hold return value across finally) could be
captured, so flow graph builder needs to have correct context_depth_
in order to access it using LoadLocal(finally_return_variable)
when building flow graph for return statement.

Previously, flow graph builder left context in an unspecified state
and depth after TranslateFinallyFinalizers(NULL, -1), which caused
incorrect code being generated for LoadLocal(finally_return_variable).

This change fixes this problem by
* passing correct target_context_depth to TranslateFinallyFinalizers
  so context is adjusted to a known depth regardless of context
  depth which is used by finally;
* setting context_depth_ for LoadLocal(finally_return_variable)
  and then restoring it (to be able to continue building flow graph
  for the enclosing AST nodes).

TEST=tests/language/async_star/regression_47610_test.dart
Fixes https://github.com/dart-lang/sdk/issues/47610

Change-Id: Id15ea719ddda892eaff0b06f6450b1a8de36e8da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219283
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2021-11-05 16:24:27 +00:00
Brian Quinlan b2d8916539 Add extra tests for directory renames.
TEST=Lots of new tests!
Bug: https://github.com/dart-lang/sdk/issues/35217
Change-Id: Id475ae1133e761ec4ba757ac769e2b2e144c5acf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219129
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2021-11-04 23:55:56 +00:00
Martin Kustermann 96d40d1caa [vm/concurrency] Remove --(no-)enable-isolate-groups flag usage in tests
This is a preparation CL to remove the --enable-isolate-groups flag in
the VM.

The following tests were only running in --no-enable-isolate-groups and
are therefore obsolete now:

  - runtime/tests/vm/dart/regress_47468_test.dart
  - runtime/tests/vm/dart_2/regress_47468_test.dart
  - tests/lib/isolate/illegal_msg_function_test.dart
  - tests/lib_2/isolate/illegal_msg_function_test.dart

TEST=Changes tests only.

Change-Id: I6257cb667eebca66a649614d3010139dd2cdd3ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219100
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-11-04 18:57:21 +00:00
Erik Ernst d420995bd6 Adjust typedef_test, cf. SDK issue #47561
Change-Id: I9e7455838cf9e13a223221255196515690280e56
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219042
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2021-11-04 09:13:03 +00:00
Sigmund Cherem 05aecf5bac [dart2js] delete dummy_compiler_test.
This test has been failing for years. The test was meant to
ensure the compiler could run in the browser, but that's not
a priority for the team at the moment.

Fixes #47257

Change-Id: I89b7ddfb51a3a7375526eb4f321f5d9f31a6a405
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219124
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2021-11-03 20:08:53 +00:00
Ryan Macnak 778242fdb6 [vm, compiler] Remove --fields_may_be_reset.
This is true everywhere by default. It can only be false when isolate groups are disabled, and the ability to disable isolate groups will be removed.

TEST=ci
Change-Id: I8ce12883a6128a6c6c1883605b5e3889952ce76c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217153
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2021-11-01 17:41:41 +00:00
Brian Quinlan 5e990591b9 Fix a bug where windows would not currently follow symlinks in stat() calls.
Also clarify documentation.

TEST=Updated tests to cover stats() calls on symlinks.
Bug: https://github.com/dart-lang/sdk/issues/20389
Change-Id: I8555bacc2f83cad024ad8ef7c2f23aa97069ed2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218671
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2021-11-01 16:33:01 +00:00
Brian Quinlan d1d2adb5dc Fix a bug where setAccessTime would also set the modified time on Windows.
TEST=issue_35112_test.dart
Bug: https://github.com/dart-lang/sdk/issues/35112
Change-Id: I4c7a1795250447888ec1cbde71bf2799c3467b55
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218182
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-10-29 18:19:49 +00:00
Johnni Winther 44e35b1daa [cfe] Check for misplaced type arguments on implicit creation expression
Change-Id: Ic3436f2bce0369d0efad9946cbbdae7c6bf334b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218400
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2021-10-28 19:21:39 +00:00
Chloe Stefantsova d62a1e859d Add language tests for "named-arguments-anywhere" experiment
Part of https://github.com/dart-lang/sdk/issues/47451.

Change-Id: I0c865a6a37c6e31e57df037f65c298c449f297bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217013
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2021-10-28 13:01:38 +00:00
Irina Arkhipets d570cf7b9c [co19_2] Status files updated according to Issue 523: tests which use mirrors moved to LibTest/mirrors
Change-Id: I7a539bdd3bd8d16b3eb4049ec1ba788bbe5cf938
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216663
Reviewed-by: Alexander Thomas <athom@google.com>
2021-10-27 09:26:05 +00:00
Sergey G. Grekhov b9a5a4a320 [co19] Enable co19_2/Language/Libraries_and_Scripts/Scripts/top_level_main_t01 and _06 on precompiled environment
Change-Id: I6f5c7fb1e1bfb43a390fa6a8ffbc30fd01d1fd91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216901
Reviewed-by: Alexander Thomas <athom@google.com>
2021-10-27 09:26:05 +00:00
Kevin Moore 5108837e5c dart:_http - no need to ship base64 twice
Change-Id: I0f76f1264e1e067790efc5feabfb97f7cd0f6094
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217801
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-10-25 16:14:59 +00:00
Brian Quinlan d0e56020f3 Disable Unix socket test on Windows.
TEST=included vm-kernel-linux-release-x64-try and vm-fuchsia-release-x64-try.

Change-Id: I0d2902f4bb9d794934a28dc688aaf72dcf5ec425
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217560
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2021-10-21 14:59:26 +00:00
Brian Quinlan f1af54b3b0 Fix a bug where an abort would occur if the sourceAddress did not match the host address type.
TEST=socket_source_address_test.dart

Bug: 47447
Change-Id: I7e70393c0edb4c5d51edcafe2568f95f8ceb85c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217448
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2021-10-20 22:18:25 +00:00
Ahmed Ashour d041cf0478 Remove extra the, be and of
Fixes #https://github.com/dart-lang/sdk/issues/47504

TEST=No tests needed, only comments affected.

Change-Id: Ie096307b5ce314d328fea6780f396aaa226ad3b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216182
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-10-20 09:29:01 +00:00
Stephen Adams d49d5a96f7 [dart2js] Rti-need fix for generic instantiations
The rti-need of an instantiation is not the same as the rti-need of the
instantiated generic function. The generic function might not use its
type arguments but the instantiation still needs the type arguments for
equality.

dart2js implements generic function instantiation by creating instances
of a helper class that is a subclass of `Closure`. The helper class needs
its type parameters since they are used in `==` and `toString()` methods.
The fix for #47054 is to add the dependency of the helper class type
parameters on the instantiation type arguments.

Change-Id: I9ecb18e1b61a8ad6549f35b572476b1ed7ebb88d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212037
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-10-19 23:48:31 +00:00
Brian Quinlan 8462f1da74 Fix a bug where Platform.operatingSystemVersion was incorrect in the iOS
simulator.

Also changes the MacOS implementation of that property.

TEST=platform_os_version_test.dart

Bug: 47138
Change-Id: I9134845a216423c8a383b804986af1ebb3c8d3d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214863
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Chinmay Garde <chinmaygarde@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-10-19 21:25:43 +00:00
Lasse R.H. Nielsen 2c36db9b0a Deprecate IntegerDivisionByZeroException.
Deprecates the class and makes it implement `Error` (more specifically
`UnsupportedError`).
Code throwing `IntegerDivisionByZeroException` should be migrated to
throwing `unsupportedError` directly, code catching the exception class
should start catching `UnsupportedError` immediately (or reconsider why
they are catching at all).

Integer division by zero also covers other ways that a double division
can give a non-number result (any infinity or NaN result of the division prior to calling `truncate()` on the result, will cause `~/` to throw).

Fixes #46776

Bug: https://github.com/dart-lang/sdk/issues/46776
Change-Id: Idf2657153dd16542e72c6ba921f587dd9fc9032a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208643
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-10-19 16:07:52 +00:00
Sigmund Cherem 38b5a841de [dart-web] Remove dart:web_sql library.
The WebSQL standard was abandoned more than 10 years ago and is not
supported by many browsers.

The `dart:web_sql` library was marked as deprecated in Dart 2.14. This
CL makes the library inaccesible, removes support for `dart:web_sql` imports,
and removes the `Window.openDatabase` API. The old code for `dart:web_sql` is
still generated by the html generators. Removing that will be handled by a
separate change.

Closes https://github.com/dart-lang/sdk/issues/46316

Change-Id: I892107396b3b227b4f33344377585aa5e5328288
Bug: https://github.com/dart-lang/sdk/issues/46316
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216080
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2021-10-19 01:00:08 +00:00
Erik Ernst ace8c34996 Adjust language{,_2}/regress/regress31596_covariant_declaration_test
These tests are updated to match the behavior which was specified in
dart-lang/language#1833. The change is valid for both language_2 and
language because it isn't tied to a language version. This should not
break any existing code because it only changes programs with
compile-time errors into programs with no errors.

(If we agree on this change then I'll approve the failures.)

Change-Id: I49f41fd1b1575c237c9c619c912de3e8de53356f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217016
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2021-10-18 15:58:09 +00:00
Daco Harkes 757c2b82ce [vm/ffi] Add Bool
This CL adds the `Bool` `NativeType` with support for loading/storing
from `Pointer<Bool>`, `Array<Bool>`, and `Struct` and `Union` fields,
and support for passing booleans through FFI calls and callbacks.

The assumption is that `bool` is always treated as `uint8_t` in the
native ABIs. Including: (1) whether there can be garbage in the upper
bytes in CPU registers, (2) stack alignment, and (3) alignment in
compounds.

The conversion from `bool` to `uint8_t` is implemented as follows:
- bool to int: `value ? 1 : 0`
- int to bool: `value != 0`
The conversion is implemented in Dart in patch files for memory loads
and stores (pointer, array, and struct fields) and kernel_to_il for
FFI call and callback arguments and return value.

TEST=runtime/vm/compiler/ffi/native_type_vm_test.cc
TEST=tests/ffi/bool_test.dart
TEST=tests/ffi/function_callbacks_structs_by_value_generated_test.dart
TEST=tests/ffi/function_structs_by_value_generated_test.dart

Closes: https://github.com/dart-lang/sdk/issues/36855

Change-Id: I75d100340ba41771abfb41c598ca92066a89370b
Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-debug-x64-try,vm-ffi-android-debug-arm-try,vm-kernel-mac-debug-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-ffi-android-debug-arm64c-try,vm-kernel-mac-release-arm64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-precomp-android-release-arm64c-try,vm-kernel-precomp-android-release-arm_x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216900
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2021-10-18 10:44:11 +00:00
Paul Berry 189aeead47 Fix reporting of INSTANCE_ACCESS_TO_STATIC_MEMBER from within an extension.
Previously, if a piece of code inside an extension tried erroneously
to refer to a static class member using instance access, the error
CompileTimeError.UNQUALIFIED_ACCESS_TO_STATIC_MEMBER_OF_EXTENDED_TYPE
would be reported.  This change corrects the error to
CompileTimeError.INSTANCE_ACCESS_TO_STATIC_MEMBER.

In addition, the responsibility to report the error
CompileTimeError.INSTANCE_ACCESS_TO_STATIC_MEMBER is shifted fully to
the resolver (previously, it was split between the resolver and the
error verifier).

Change-Id: Idcd1a3b8a1e226fed692900838c3d2d3c0585d4f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217020
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-10-17 06:22:30 +00:00
Daco Harkes be195ad329 [analyzer/ffi] Report non-const fromFunction argument
* Adds missing error to analyzer.
* Adds analyzer test.
* Adds analyzer/cfe negative test.
* Formats the analyzer/cfe negative tests file.

TEST=pkg/analyzer/lib/src/generated/ffi_verifier.dart
TEST=tests/ffi/vmspecific_static_checks_test.dart

Bug: https://github.com/dart-lang/sdk/issues/36780

Change-Id: Ibc2a3d1c3b4b4d8b2285605f084237a55253fb20
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217007
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2021-10-15 11:21:23 +00:00