Flutter is compiling us with C++11 so we can't use C++14 features anyway.
Change-Id: I259e70f80442910dd7bf230f5f4e5025bea28802
Reviewed-on: https://dart-review.googlesource.com/c/85202
Auto-Submit: Samir Jindel <sjindel@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
A field/function annotated with this pragma must be guaranteed to not
return `null` at runtime.
Make use of this non-nullable annotation in the VM's type propagator.
Annotates the "_TypedListView._typedData" field to ensure the VM knows it
returns a non-nullable _TypedListView.
Furthermore annotates methods on the integer implementation. Those particular
methods are recognized methods with a "dynamic" return type. This caused
the type propagator to use CompileType::Dynamic() as result type. Since a
previous CL started to only utilize the annotated type if it is better than
"dynamic" more integer operations got handled in-line, though with null-checks.
Annotating those methods to return non-null improves the in-line handling of
integer operations.
This improves dart-aot
On arm7hf:
SHA256: +5%, SHA: +6%, JsonObjectRoundTrip: +7%, ...
On arm8:
SHA1: +28%, MD5: +25%, SHA256: +15%, TypedData.Int16ListViewBench: +18.5%, StringInterpolation: +18%, ...
Issue https://github.com/dart-lang/sdk/issues/31954
Issue https://github.com/dart-lang/sdk/issues/35154
Change-Id: Ia4263a37241a36c9dc35e8a48893297effa6f4b2
Reviewed-on: https://dart-review.googlesource.com/c/84421
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Until now a typed data view was first constructed and then afterwards the
constructor body validated that the offsetInBytes/length are non-null
and in range.
This CL moves the range check to the call sites of the constructor,
thereby guarenteeing that we will never initialize the
_TypedListView.{offsetInBytes,length} fields with non-_Smi values. (The
views are constructed only within the "dart:typed_data" library. Neither the
embedder nor the runtime construct them.)
Further more this CL removes the redundant _defaultIfNull() call, since
the call sites already handled the `length == null` case.
This CL also starts annotating _TypedListView.{offsetInBytes,length}
with @pragma("vm:exact-result-type", "dart:core#_Smi") to ensure any
[LoadFieldInstr] will have the right type attached, thereby avoiding any
null-checks and mint-handling.
This improves dart-aot
On arm7hf:
MD5: +38%, SHA256: +87%, SHA1: +89% (plus various typed data microbenchmarks)
JsonParseDefaultReviver/StringBuffer/StringIdiomatic/JsonParseCustomReviver: -5-8% (probably due to not inlining static calls, will find out)
On arm8:
MD5: +6.5%, SHA256: +12%, SHA1: 3.6%, JsonUtf8RoundTrip: 8% (plus various typed data microbenchmarks)
DeltaBlue: -6.7% (probably due to not inlining static calls, will find out)
Issue https://github.com/dart-lang/sdk/issues/35154
Issue https://github.com/dart-lang/sdk/issues/31954
Change-Id: I37c822e6879f5a2d17fd9650a68cf2eee4326b01
Reviewed-on: https://dart-review.googlesource.com/c/84241
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Also updated spec on the static and dynamic types of functions literals
and static functions along with the function objects obtained from
closurizations of them.
Introduced a separate notion of what it means to be a correct override
relation (where the old text used subtyping, which won't suffice, for
several reasons).
Introduced the notion of interfaces as a separate kind of entity that
contains method signatures (again, a new kind of entity), thus
clarifying exactly which pieces of information is available during
static analysis of member accesses, e.g., instance method invocations.
Introduced 'combined' interfaces; they are needed for `mixin`
declarations, and we will specify them soon (so it should be OK to
have them now, even though they are unused).
Change-Id: I6347df49b1aa7a81d74e25904ee75c19e8ac6930
Reviewed-on: https://dart-review.googlesource.com/c/81263
Reviewed-by: Leaf Petersen <leafp@google.com>
When @pragma('vm:exact-result-type') was introduced, the return types
specified in the recognized method lists were **duplicated** (they were
in the method recognizer macro lists as well as in the dart source code).
This CL removes this duplication by removing the result types from the
method recognizer lists.
Change-Id: I2082110cf77fc3b97d1a541cb153abb8c17990d0
Reviewed-on: https://dart-review.googlesource.com/c/84220
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Change-Id: I718a5d70874e7090cb42f1d452cd8dcf020d337e
Reviewed-on: https://dart-review.googlesource.com/c/84631
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Currently the @pramga('vm:exact-result-type') annotation only works if
the function is a recognized method. This change changes that to make
the VM just look if a function has the annotation (no matter if it's
also in the list of recognized methods or not).
Furthermore this CL lets the type propgagator use
@pragma('vm:exact-result-type') annotations to narrow the [CompileType]
set on [LoadFieldInstr]s.
Since the @pragma is a general feature, this CL moves the
`Function::FindPragma()` to `Library::FindPragma` (which is where any
other metadata lookup happens). We also let the `FindPragma` accept any
of Class/Function/Field objects.
Furthermore the `FindPragma()` function is fixed to handle the case
when the evaluation of the metadata results in an error.
In this case we simply claim to not have found a pragma annotation.
Issue https://github.com/dart-lang/sdk/issues/31954
Change-Id: If03f566e334cd53549985823ee3dd6b5e9672969
Reviewed-on: https://dart-review.googlesource.com/c/85163
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
For all other "debugPath.add"s we've wrapped it in assert to avoid
doing it in the general case.
One apparently have slipped through.
Change-Id: Ib0dfc4a671428993e393d57a75db6612785e37b4
Reviewed-on: https://dart-review.googlesource.com/c/85161
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
This would have made it easier to debug internal bug #119875658.
Change-Id: I71a5e61602187b44923ca6f9b0ec254efe376f87
Reviewed-on: https://dart-review.googlesource.com/c/85143
Commit-Queue: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Once we remove the frontend strategy object, we might want to remove some additional dependencies on KernelResult
Change-Id: I27ef1fbb12e671748b59a87d2dd249100501e02a
Reviewed-on: https://dart-review.googlesource.com/c/85060
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
DDC was incorrectly re-linking transitive dependencies, so build times
continued to increase as the build progressed, with the application
itself performing the worst. With this fix, DDC is not on the critical
path and compiles are all very short.
Change-Id: Ia05bfb9f1a041fc979bc4bc0ee3bff9a0609b4b7
Reviewed-on: https://dart-review.googlesource.com/c/84966
Auto-Submit: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
The dependency was added in cb88347087.
Change-Id: I33bd532211ed0f60e665ce6c4017ac22805a039a
Reviewed-on: https://dart-review.googlesource.com/c/84967
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>
This happened because for-of printed using EXPRESSION precedence
for the iteration expression, but it should be ASSIGNMENT per the spec
(https://tc39.github.io/ecma262/#sec-for-in-and-for-of-statements).
Change-Id: I869ad3f1181cfb33c57fe79aebfa3699f66a0712
Reviewed-on: https://dart-review.googlesource.com/c/84833
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Auto-Submit: Jenny Messerly <jmesserly@google.com>
We can't rely on resolution to do this, because resolution only
operates in the compilation unit currently being analyzed, and
constant values may be needed from other compilation units.
Fixes#35230.
Change-Id: I11fa5597110bc13164ca5dc9846836848120cd08
Reviewed-on: https://dart-review.googlesource.com/c/84964
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Both the mutator as well as the background compiler are accessing constants
arrays attached to [Script] objects, which can cause races where mutator is
modifying the hashmap while the background compiler is reading.
This CL adds locking around those accesses.
Change-Id: Iac7bbbe242d13b964698ae95fe1653fb4ce28a36
Reviewed-on: https://dart-review.googlesource.com/c/84903
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
During VM shutdown generally, or during killing isolate more
specifically, OOB messages will be sent to the isolate which cause an
[UnwindError] to be raised.
This error has to be propgated through as many dart frames and runtime
frames there are **until the very end**, namely to the event loop.
Currently the constant evaluator was sometimes wrapping [UnwindError]s
into [LanguageError]s which caused unwinding to stop, leaving us
kernel-isolate/service-isolate hanging around instead of shutting down.
Change-Id: Iade46aff3ca3459ec53f155b4f40305050380a7b
Reviewed-on: https://dart-review.googlesource.com/c/84904
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
This particular device sometimes fails with errors such as:
* "protocol error"
* "protocol error (no status)"
* "device not found"
Change-Id: Iced97ae8f5e891c43436a3d745004517dc59b42c
Reviewed-on: https://dart-review.googlesource.com/c/84905
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
This:
- exposes the feature as an experiment flag
- cleans up the code to prevent issues with strong-mode checks
- provides only a single implementation, but lets users use a hook to tailor the feature to their needs.
Change-Id: I3bf277b76b7503235c35bfbf83356c953405ff6f
Reviewed-on: https://dart-review.googlesource.com/c/84880
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
This adds a test that asserts the analysis_server_client version
matches the version specified in the dartfix pubspec.
In addition, this remove code that reads the version
from dartfix pubspec.yaml because the pubspec.yaml is not present
when dartfix is activated and run via pub global activate.
Change-Id: I6deed00428afb8844d03a9604699e0c089d7ce6f
Reviewed-on: https://dart-review.googlesource.com/c/84940
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
This is a reland of 1a4cff1bd4
Original change's description:
> [VM] Remove unused flags
>
> Remove the following flags which are always ON
> --strong
> --reify_generic_functions
>
> and these flags which are not applicable anymore
> --error-on-bad-override
> --error-on-bad-type
> --enable-type-checks
>
> Change-Id: I6e1aeb68e663953f4ae49ca94ea0daa87b661900
> Reviewed-on: https://dart-review.googlesource.com/c/79431
> Commit-Queue: Siva Annamalai <asiva@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
> Reviewed-by: Régis Crelier <regis@google.com>
Change-Id: Ib4452c22fb05eed38820708abb648939e03b1df0
Reviewed-on: https://dart-review.googlesource.com/c/84923
Reviewed-by: Siva Annamalai <asiva@google.com>
This makes it easier to access and safer to use.
Change-Id: Ida12708975a250a57faf71007a0d9ebb65c23dd2
Reviewed-on: https://dart-review.googlesource.com/c/84020
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>