This is a breaking change. Request: https://github.com/dart-lang/sdk/issues/33501
HttpHeaders use lowercase by default for all headers, since it is supposed to be case insensitive. Some servers incorrectly treat case as significant, however, and expect headers with capitalization or in uppercase. The current implementation forces headers to be lower cases when adding values. Users cannot even manually modify the headers.
This change removes this restriction here so that users can modify the headers to whatever form they want. The new behavior is backwards compatible except if class was implemented. All headers inside http.dart are written as lower cases, adding values to HttpHeaders is still receiving lower cases input.
The other cl (https://dart-review.googlesource.com/c/http_multi_server/+/121411) migrates multi_headers.dart to be compatible with this change.
Bug: https://github.com/dart-lang/sdk/issues/33501
Change-Id: I6f7f2ef907b229773c283140c07f2de4cd500981
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119100
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
If generated code refers to a constant object (which are old and canonical), a pointer
to it will be embedded in the instruction stream on ia32.
If we now reload and morph this constant object and allocate the
morph'ed copy in new space, the become operation will make RX writable
and the slot in the instruction stream gets updated to point to a new
space object and the code gets added to the remembered set.
The next scavenge operation will scan the remembered set as roots, see
the poitner to a new object, move the object and updates the pointer in
the instruction stream.
=> We hit a SEGV trying to write the RX memory
We can avoid this problem by ensuring to morph old+canonical instances
always into old space on ia32.
Change-Id: Id63eb6ee1735bbb661dbeceb1e8d0c6ac92225ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133228
Auto-Submit: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
We were printing groups of builder names, not configurations
Change-Id: Ia9a6791fbd25939f71a1aa227bc288197c838bd6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133991
Reviewed-by: Martin Kustermann <kustermann@google.com>
This was never supported by the grammar but unfortunately allowed by
both the analyzer and the CFE.
Change-Id: Id669c934fe08eda41973d6d2cef8340da2e7d72c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133591
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
When loading from dill a library with export errors in it, the errors
would be reported when setting up that scope. There it would be reported
without a location.
Then - if not recompiling it and fixing it - it would be reported again
because of problemsAsJson (with a location).
It would thus be reported twice, one better than the other.
This CL updates the scope building for dill builders to have the option
to supress such errors and then use that option in the incremental
compiler where we use problemsAsJson to reissue problems.
Change-Id: I03430bf8b9996b6e8b7571b8e4e33f3f89f832a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133235
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
By allowing a transformation to tell if it change dthe structure of a
class we can make sure to update the class hierarchy accordingly,
making sure it's up to date for the next computeDelta call in the
incremental compiler.
Change-Id: Iefed3bb1ecbd17b142266ce4a9e1e477f9d2fc87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133222
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
The least upper bound of _SyncBroadcastStreamController and
_SyncStreamController is StreamController (according to the CFE) leading
to an implicit downcast from StreamController to _StreamControllerBase.
The analyzer and CFE sometimes disagree on the hierarchy depth
computation (see https://github.com/dart-lang/sdk/issues/38377)
which is probably the root cause of this.
Change-Id: I276bdc894d3926eae603b023b29462571c620c52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133980
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
- Handle bytecode for e.g. dartkb-simarm64 does not have source position.
- Use existing GetCallerSp() instead of working across frames.
- Nit: Adds clarifying comments to test.
- Nit: Updates name of non-async-stack test to clarify flags used.
Tested:
- CQ with --lazy-async-stacks on by default.
- vm/dart/causal_stacks and language_2/vm/causal_async_exception_stack_test with current flags.
Bug: https://github.com/dart-lang/sdk/issues/39525
Change-Id: Ie6581a734cdcafbd4fb641bd86bffc03ed241532
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133063
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Generic functions with bounds on the type parameters should be allowed
to differ in that legacy type bound should be considered equivalent to
a nullable or non-nullable version of the same type bound.
Fixes test failures:
lib_2/async/async_await_zones_test
lib_2/async/stream_listen_zone_test
lib_2/async/zone_bind_callback_test
lib_2/async/zone_bind_callback_unary_test
lib_2/async/zone_debug_test
lib_2/async/zone_fork_test
lib_2/async/zone_register_callback_test
lib_2/async/zone_register_callback_unary_test
lib_2/async/zone_run_guarded_test
lib_2/async/zone_run_test
lib_2/async/zone_run_unary_test
Change-Id: I8bbb2ebae20f4e67bdaf8f321609b3307d92c6d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133245
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
The reduction 'return null;' --> 'return;' now happens only at return
statements that do not have an expression.
There is a slight increase in code size, 0.11% for flutter gallery
minified, 0.105% for acx gallery minified, 0.04% CM.
Change-Id: I0723a398267aede5e8dd04d7d45beae2f306c1be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133863
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Two minor fixes:
- Ensure that the immutable nodes `always` and `never` are always
drawn with the `shape=none` attribute. (Previously, the first time
we encountered an immutable node we would draw it in the style of a
mutable node, which made things very confusing).
- Add a space before `style=filled` in the graphviz output.
Previously we would output things like
`n21 [label="type(13) (ordinary nullable)"style=filled]`,
which graphviz seems to do ok with but seems inadvisable.
Change-Id: Iefcb4005c9bb2e24ae8d80552e5e4a23ec062c56
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133868
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Note that downcasts from dynamic may still be implicit.
Fixes#38481.
Change-Id: I35558ed3578707cc640108b85790adb042e88ee2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133865
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
This reverts commit 61b4bbcb6b.
Reason for revert: Performance regressions
Original change's description:
> [vm] Set non_nullable_flag() to true
>
> We'll leave the deletion and cleanup of this function until later, so
> that this CL is as easy to rollback as possible.
>
> Bug: https://github.com/dart-lang/sdk/issues/40179
> Change-Id: Ie583aaabd117ae06ea27a539c3bc904240a0e6bc
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133429
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Commit-Queue: Liam Appelbe <liama@google.com>
TBR=asiva@google.com,liama@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: https://github.com/dart-lang/sdk/issues/40179
Change-Id: I7e1d81286d769faeacec7dc17612ff18d157f114
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134060
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
This undoes what we did to get the sdk building earlier. Most tests in lib_2
had runtime failures because native elements were not tagged as such.
Besides re-adding dart:html et al to the list of compiled libraries, this ensures
we handle native/extension types properly.
(See #39698)
Change-Id: Ib8516c6d92d12d0f5dccdb5a6cf66e0990b52aff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133869
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
This reverts commit 9eb531bde4.
Reason for revert: Bots are red. Some tests are failing.
https://ci.chromium.org/p/dart/builders/ci.sandbox/vm-kernel-precomp-obfuscate-linux-release-x64/6039https://ci.chromium.org/p/dart/builders/ci.sandbox/vm-kernel-precomp-android-release-arm_x64/957
Original change's description:
> [vm] Add support for real unboxed floating point fields in AOT
>
> Non-nullable floating point fields (double, Float32x4, Float64x2)
> are fully unboxed in their classes.
>
> A bitmap for each class was added to the shared class table in order to keep
> track of the pointers of the classes. Since all classes in Flutter Gallery
> have less than 64 fields, the bitmap is represented by a 64 bit integer and
> fields whose offset is more than 64 words are not unboxed.
>
> The instance sizes and field offsets might change between target and host
> in cross-compilation, since the number of words used to store unboxed fields
> may differ.
>
> dart-aot Xeon
>
> SplayLatency -4.62%
> SplayHarderLatency -4.17%
> NavierStokes -2.20%
> Tracer 8.72%
> ParticleSystemPaint 2.90%
> NBodySIMD 8.35%
> NBody 25.59%
>
> With hack TFA to make doubles in Rect/Offset/Size classes in flutter non-nullable:
>
> flutter arm-v8:
>
> gallery total size: -1%
>
> matrix_utils_transform_rect_perspective -16.70% (less is better)
> matrix_utils_transform_rect_affine -31.82% (less is better)
> matrix_utils_transform_point_perspective -24.90% (less is better)
> matrix_utils_transform_point_affine) -27.26% (less is better)
> rrect_contains_bench -4.719% (less is better)
>
> Change-Id: I9ae09c9c3167d99f9efd071a92937aa51093fd1d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131824
> Commit-Queue: Victor Agnez Lima <victoragnez@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Samir Jindel <sjindel@google.com>
TBR=kustermann@google.com,rmacnak@google.com,sjindel@google.com,victoragnez@google.com
Change-Id: Ic73858f6adb7f55c4129d4f46ff4731b378cb634
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134020
Reviewed-by: Zichang Guo <zichangguo@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
With concurrent sweeping, the amount of capacity freed by a major GC is not known at the time growth is evaluated. This consistently biases the policy into growing more than it would with an accurate capacity from stop-the-world sweeping.
This is more interesting for larger heaps and when there is a tighter memory limit.
For a very large dart2js compile
Max Heap Capacity: 13.057 -> 11.861 GB
Compile Time: 545 -> 472 seconds
For dart2js self-compile
Max Heap Capacity: 1.343 -> 1.385 GB
Compile Time: 43.4 -> 43.5 seconds
Bug: https://github.com/dart-lang/sdk/issues/21364
Change-Id: If047e22a9cd9da6b34c8e499a39fde97427a69b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133660
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
The following issue can happen:
When we performa a type-test against a type parameter the TTS stub for
the type parameter will call the TTS stub for the type argument of the
parameter (by loading it from the instantiator type arguments).
The (instantiated) type argument does not yet have a specialized TTS but
rather the lazy TTS stub, which will got to the runtime.
The runtime will instantiate the type parameter using the instantiator tav,
which will give it a non-nullable 'String!'. Though the NNBD mode used
for instnatiation is kLegacy, which means the instantiation will
actually return 'String*'.
Now we generate a specialized TTS and install it on 'String*'.
=> The original 'String!' will still have the lazy TTS installed and we
will therefore always go to runtime.
Example:
This code is massively slowed down after 61b4bbcb6b "[vm] Set non_nullable_flag() to true"
main(List<String> args) {
args = args.toList();
while (args.isNotEmpty) {
args.removeAt(0);
}
}
The embedder creates the List<String> when calling main. The embedder
API uses effectively `ObjectStore::string_type`, which is initialized,
after 61b4bbcb6b to 'String!' (which might be a bug because we do
have a specific `ObjectStore::non_nullablestring_type`).
=> For now we disable lazy specialization of non-nullable types - which
makes us fall back to subtype test cache searches in this case (which is
significantly slower).
See b/148528639
Issue https://github.com/dart-lang/sdk/issues/39755
Change-Id: I715fe2a9ee22932ae2d949b5cef93d6afb3176d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133981
Reviewed-by: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
TypeRefs which are used to represent recursive types are now skipped
and removed when we need to change nullability of type after
instantiation. This change assumes that we only need to change
nullability of a top-level type and not inner types.
Change-Id: I5e92493991f0e2a1ebeb16535ef9d507054017b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133841
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
The Process class will now throw a StateError if the process is detached
upon accessing the stdin, stdout, stderr, and exitCode getters.
The Socket class will now throw a SocketException if the socket has been
destroyed or upgraded to a secure socket upon setting or getting socket
options.
Bug: https://github.com/dart-lang/sdk/issues/40040
Change-Id: I68e22873932c68a3fac549c0f742dd49d0a60dfb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133060
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Clone and update repositories. Basic end to end test and a primitive
mocking setup using dependency injection for testing.
Change-Id: I3a61f6fd86da6d5b8d79c0124a756dbfc70c4614
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133744
Commit-Queue: Janice Collins <jcollins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Non-nullable floating point fields (double, Float32x4, Float64x2)
are fully unboxed in their classes.
A bitmap for each class was added to the shared class table in order to keep
track of the pointers of the classes. Since all classes in Flutter Gallery
have less than 64 fields, the bitmap is represented by a 64 bit integer and
fields whose offset is more than 64 words are not unboxed.
The instance sizes and field offsets might change between target and host
in cross-compilation, since the number of words used to store unboxed fields
may differ.
dart-aot Xeon
SplayLatency -4.62%
SplayHarderLatency -4.17%
NavierStokes -2.20%
Tracer 8.72%
ParticleSystemPaint 2.90%
NBodySIMD 8.35%
NBody 25.59%
With hack TFA to make doubles in Rect/Offset/Size classes in flutter non-nullable:
flutter arm-v8:
gallery total size: -1%
matrix_utils_transform_rect_perspective -16.70% (less is better)
matrix_utils_transform_rect_affine -31.82% (less is better)
matrix_utils_transform_point_perspective -24.90% (less is better)
matrix_utils_transform_point_affine) -27.26% (less is better)
rrect_contains_bench -4.719% (less is better)
Change-Id: I9ae09c9c3167d99f9efd071a92937aa51093fd1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131824
Commit-Queue: Victor Agnez Lima <victoragnez@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
All handling of the opt-out features were guarded by the experimental flag.
With this CL the opt-out semantics is used irregardless of the
the experimental flag. This supports compiling with opt-out semantics
against libraries which have been compiled with the flag enabled, as will
be the case when the nnbd sdk is unforked.
Closes#40334
Change-Id: I2df5c700f97844bdd3e33bccba7e72013f0c831e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133780
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Additionally fix un-highlighting upon new highlight.
Change-Id: I4ee85371bec11ed70cc31798519cdea3061474d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133864
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>