not used anywhere
Enabling of the timeline streams is done using command line flags
during initialization and no embedder uses this API function
(It was added when Mojo was supported).
TEST=ci
Change-Id: Ide9205b9ecd703e2ccdab7a85e8a79c48d98f180
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209850
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
With this change, the analyzer logic for performing scope lookups is
now fully separated from the logic for doing type analysis and flow
analysis (ResolverVisitor now only does the latter; the former is done
by ScopeResolverVisitor and ResolutionVisitor). The analyzer now has
a similar separation of concerns between scope lookups and type/flow
analysis as the CFE does; this should help pave the way for sharing
resolution logic between the analyzer and the CFE in the future.
Change-Id: Ie006dfe1b5943bb361dc0aec4525e21572e21e5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209381
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This is another step toward removing scope tracking from ResolverVisitor.
Change-Id: I76c45601b8cf7a3fa30f6f6ca43b044e5aaf6dc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209721
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
The new class, ResolverBase, will eventually take the place of
ScopedVisitor as the common base class between ResolverVisitor and
ScopeResolverVisitor. Unlike ScopedVisitor, it won't maintain any
scope information (since we are migrating all scope handling out of
ResolverVisitor); all it needs to do is keep track of some information
that is needed by all resolution stages, such as the library element,
the type provider, and the error reporter.
Change-Id: I00f80457d368489d6df9736713fd3caddd5f917f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209720
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
To unblock optimizations in hopes of reducing the overhead, we're
planning to make X509 opaque in BoringSSL. This aligns with upstream
OpenSSL, which has made most of these structs opaque.
Instead, use an estimate. The sizeof-based estimate was undercounting
the overhead anyway because there are many structures underneath X509,
some of which are already opaque. I just rounded sizeof(X509) +
sizeof(X509_CINF) up.
(Even this is likely still undercounting it because X509 objects are
very malloc-heavy and duplicate large chunks of the certificate. They're
not a very efficient representation and can't be made efficient without
first hiding the structs. In Chrome, we stopped using them altogether
and just retain the byte string, parsing as needed.)
TEST=ci
Change-Id: Icdc729ceba7eadf002bec5e080fc3e0adf7c4b56
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209920
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Auto-Submit: David Benjamin <davidben@google.com>
language/covariant/type_parameter_test.dart performed a tearoff which
should incur a run-time error (because the dynamic type of the
tearoff is not a subtype of the static type, so it would be a
soundness violation to pass that value on to the next step of
evaluation).
Change-Id: Ia4ec813606e711cab0bdcc68d24bbac3c9a2d8c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209910
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
This change enables use of roundsd instruction on x64 if SSE4.1 is
detected (in JIT mode).
Also, XMM register is cleared before roundsd to avoid false dependency
due to partial register access in roundsd.
Microbenchmark results on JIT/x64:
Before: BenchFloor(RunTime): 303.81512987999395 us.
After: BenchFloor(RunTime): 135.00067499156262 us.
Custom floor implementation in Dart:
BenchFastFloor(RunTime): 147.609889298893 us.
TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/46650
Change-Id: I13502f5d40edf32916edec14cfab027758a22457
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209764
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This CL changes the test
language/generic_methods/explicit_instantiated_tearoff_test.dart
such that it no longer expects a generic instantiation of a local
function tearoff to be notEqual to another function object which is
the same local function, same enclosing invocation, same type
arguments.
The rationale is that we should not preclude an optimization whereby
these function objects are canonicalized (at run time, or if they
can be lifted to the top level even possibly at compile time).
Change-Id: I5845a19ce9ccf931c4d3abe4ab619f3ed2a2fbc4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209860
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2021-08-09 sgrekhov@unipro.ru 1126. Different roll failures fixed
2021-08-09 sgrekhov@unipro.ru 1100. Fix Link.watch() test to avoid flakiness
2021-08-09 sgrekhov@unipro.ru Fixes 1128. Remove check for '!identical(v1, v2)'
2021-08-06 sgrekhov@unipro.ru 1126. Some of the roll failures fixed or issue numbers added
2021-08-06 sgrekhov@unipro.ru 1127. Expect compile-time errors in CFE for cyclic redirecting factories participating in a loop
2021-08-06 sgrekhov@unipro.ru 1126. Some of the roll failures fixed
2021-08-04 irina.arkhipets@gmail.com Useless libraries removed.
2021-08-04 sgrekhov@unipro.ru 993. PointerPointer tests added
2021-08-03 sgrekhov@unipro.ru 993. IntPtrPointer tests added
2021-08-03 sgrekhov@unipro.ru 993. Work with memory fixed in FFI tests
2021-08-02 sgrekhov@unipro.ru 993. Int64Pointer tests added for FFI library
2021-07-30 sgrekhov@unipro.ru Fixes 993. IntXXPointer tests added for FFI library
2021-07-30 sgrekhov@unipro.ru 1087. More tests for tearing-off constructor of an abstract class
2021-07-29 sgrekhov@unipro.ru Fixes 993. DoublePointer tests added for FFI library
2021-07-29 sgrekhov@unipro.ru Fixes 993. More Union tests for FFI library added
2021-07-28 sgrekhov@unipro.ru Fixes 1125. Test for cascades contained explicitly instantiated tearoffs added
2021-07-28 sgrekhov@unipro.ru 1087. Header comment style fixes
2021-07-27 sgrekhov@unipro.ru 1087. Add tests for tearing-off constructor of an abstract class
2021-07-27 sgrekhov@unipro.ru Fixes 1124. Constructor tear-off tests fixed
2021-07-26 sgrekhov@unipro.ru 1124. Numerous errors and typos in Constructor tear-off tests fixed
2021-07-21 irina.arkhipets@gmail.com Issue 1119: test corrected.
2021-07-20 irina.arkhipets@gmail.com Issue 1109: Libraries_and_Scripts test updated, new tests added.
2021-07-20 sgrekhov@unipro.ru 1123. Constructor tear-off tests fixed to expect syntax errors
2021-07-20 sgrekhov@unipro.ru 1123. Expect syntax errors in tests which check syntax
2021-07-19 sgrekhov@unipro.ru Missed checks added to Language/Generics/syntax_t31 test
2021-07-19 sgrekhov@unipro.ru 1123. Expect syntax errors in tests which check syntax
2021-07-19 sgrekhov@unipro.ru 1123. Syntax error fixed in unnamed constructor tear-off tests
2021-07-19 sgrekhov@unipro.ru 1122. nonfunction-type-aliases tests moved out of type-aliases directory
2021-07-16 sgrekhov@unipro.ru 1122. nonfunction-type-aliases experimental flag removed
2021-07-16 sgrekhov@unipro.ru 1122. nonfunction-type-aliases experimental flag removed
2021-07-15 sgrekhov@unipro.ru Fixes 1121. Update Symbol tests according to the changed specification
2021-07-14 sgrekhov@unipro.ru 932. Issue number added
2021-07-14 irina.arkhipets@gmail.com Fixes 1109: test expectations corrected according to dart-lang/sdk44161, dart-lang/sdk44163 evaluations.
2021-07-14 sgrekhov@unipro.ru 1120. Added test which uses type aliases
2021-07-13 sgrekhov@unipro.ru 993. NativeFunction test added
2021-07-12 sgrekhov@unipro.ru Fixes 1107. Replace multitests by static errors tests
2021-07-12 sgrekhov@unipro.ru 1120. Tests for mixin static members added
2021-07-09 sgrekhov@unipro.ru Fixes 1120. Tests for function object canonicalization added
2021-07-08 sgrekhov@unipro.ru Fixes 1087. More constructor tear-offs tests added
2021-07-07 sgrekhov@unipro.ru 1087. More constructor tear-offs tests added
2021-07-06 sgrekhov@unipro.ru 1087. Added tests that checks factory constructor tear-offs and use of tear-offs in a factory constructors
2021-07-06 sgrekhov@unipro.ru Fixes 1118. Expect an error for Union/Struct subclasses created by generative constructor
2021-07-05 sgrekhov@unipro.ru Fixes 1111. Expect an error for zero-sized arrays
2021-07-05 sgrekhov@unipro.ru Fixes 1116. Expect a compile error for empty setOrMapLiteral for Iterable<Object> context type
2021-07-05 sgrekhov@unipro.ru Fixes 1112. Expect a compile error if mixin is derived from a class other than Object
2021-07-05 sgrekhov@unipro.ru Fixes 1105. Function tear-offs tests fixed
2021-07-05 sgrekhov@unipro.ru Fixes 1106. Use runtime check 'is int' VS 'is String' to check that runtime type is 'int', not 'dynamic'
2021-07-01 irina.arkhipets@gmail.com Fixes 1113: Method signature corrected.
2021-07-01 irina.arkhipets@gmail.com Fixed Issue 1115: test expectation corrected.
2021-07-01 irina.arkhipets@gmail.com Fixes Issue 1117: test corrected.
2021-06-29 irina.arkhipets@gmail.com Issue 1094: Merge changes from pre-nnbd branch.
2021-06-25 sgrekhov@unipro.ru 1087. Added tests for static invocations and type object member ambiguity
2021-06-25 sgrekhov@unipro.ru 1104. Fix type used in onError
2021-06-24 sgrekhov@unipro.ru 1087. Added more tests for resolving ambiguities
2021-06-23 sgrekhov@unipro.ru 1087. Added more tests for resolving ambiguities
2021-06-22 sgrekhov@unipro.ru 1087. Added more tests for resolving ambiguities
2021-06-22 sgrekhov@unipro.ru Fixes 1103. Change expected error range for analyzer according to the changed behaviour
2021-06-22 sgrekhov@unipro.ru Fixes 1102. Change test expected results according to the changed behavior
2021-06-21 sgrekhov@unipro.ru 1087. Added more tests for resolving ambiguities
2021-06-21 sgrekhov@unipro.ru Issue number added to the failing test
2021-06-21 sgrekhov@unipro.ru Fixes 1101. Expect less compile errors
2021-06-18 sgrekhov@unipro.ru 1087. Resolving ambiguities tests added
2021-06-17 sgrekhov@unipro.ru 1087. Resolving ambiguities tests added
2021-06-17 sgrekhov@unipro.ru 1087. Call-method tests added
2021-06-15 sgrekhov@unipro.ru Fixes 1100. Expect file system event not on link itself but on directory it points to
2021-06-15 sgrekhov@unipro.ru 1099. Fixed co19 roll failures
Cq-Include-Trybots: dart/try:analyzer-nnbd-linux-release-try,dart2js-nnbd-linux-x64-chrome-try,ddc-nnbd-linux-release-chrome-try,front-end-nnbd-linux-release-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-nnbd-linux-release-simarm64-try,vm-kernel-nnbd-linux-release-x64-try,vm-kernel-nnbd-mac-release-arm64-try,vm-kernel-nnbd-win-release-x64-try,vm-kernel-precomp-nnbd-linux-release-simarm64-try,vm-kernel-precomp-nnbd-linux-release-x64-try,vm-kernel-precomp-nnbd-win-release-x64-try
Change-Id: Ib18e48d31771b2b70e607951577b9ac90d0b40a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209547
Reviewed-by: William Hesse <whesse@google.com>
It currently fails because pkg/dart2js_info isn't wired up, yet.
Change-Id: I10a2d43385fe3d900a62fa7438ed37b9e366dffb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209902
Reviewed-by: William Hesse <whesse@google.com>
pkg/dart2js_info will soon contain a checked-in version of dart2js_info
that will eventually replace third_party/pkg/dart2js_info. Until that
happens, pkg/dart2js_info should be ignored.
Change-Id: I337d69b6ee58b1ec0f436a199c81828dfd391ec8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209900
Auto-Submit: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Two remaining test files are modified to use the TestCases structure.
In each case, the tests are unchanged, but the classes are renamed.
Additionally, each file had a *WtihNonFunctionTypes variant. Each of
these classes just specified more test cases that include some form of
"typeAlias" in the name, and can be safely merged with the null safety
test cases.
Fixes https://github.com/dart-lang/sdk/issues/44666
Bug: https://github.com/dart-lang/sdk/issues/44666
Change-Id: Id7db1038e64f8bbc12764cb558670b23427a5a86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209763
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Looks like fidlgen generated the copy constructor
but not the assignment operator which is resulting
in build failures for the SDK roll.
Bug: https://github.com/flutter/flutter/issues/88004
Change-Id: I1b919eb318d9afb6952af4905db7f183c84e8a7d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209800
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
This should handle all cases of constructor reference w/ explicit type
args; there aren't too many cases:
* named and unnamed constructors
* referencing class and referencing type alias
* prefixed class names and not-prefixed
* null-aware access (weird)
* bound on type parameter of class, and on type parameter of alias
error cases:
* cascade
* wrong number of type arguments
Bug: https://github.com/dart-lang/sdk/issues/46020
Change-Id: If257eb561a9ad854709b6e9a7d81faa9d084d6ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209622
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This moves the algorithm comment to be more visible at the top of the library,
and expands it with more details about how the algorithm works.
Change-Id: I74eeec52e71c55ba77df8d7d35473570c9d1f6e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209441
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
TEST=Ran all service tests in parallel, was no longer able to reproduce
assertion failure
Change-Id: I884f160ce267ca2b7c4684ace901caa88ce19924
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209762
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Dead since ff2fd8fe54.
TEST=Deleted code, no new functionality added. Regular CI runs.
Change-Id: I95716abfe9807eba48dbbc7fa3efc7f58cd1b11d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209760
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
The diffs may look large, but only due to sorting. No tests were added,
removed, or altered.
Change-Id: Id126e9a08056f6d3f99bad32d7060d65b07e4e90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209722
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
The instantiation at runtime implies non-constant type expressions
but canonicalization is unspecified so backends should be allowed
to optimize by canonicalizing types.
Change-Id: I2f1cab6ac68a1ce156b15af0b99e02d03b7b3dca
Issue: https://github.com/dart-lang/sdk/issues/46837
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209663
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
From the spec:
> We do not allow dynamic explicit instantiation. If an
expression _e_ has type `dynamic` (or `Never`), then
`e.foo<int>` is a compile-time error for any name `foo`.
Bug: https://github.com/dart-lang/sdk/issues/46020
Change-Id: I041c3fcac77fe8edf64633a8d23dbaa89cf42f77
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209623
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Initial changes to add functionality to the dart:html generation
script to generate classes with the JSInterop static extension pattern
Change-Id: I9dca21db7500ab25ac96b16eda11fe605f915abe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208461
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Gabriel Castro <gabrielmcastro@google.com>
This fixes a huge performance regression (introduced in [0]) of a
synthetic microbenchmark - MicroClosureCreateTearoffClassSecondTime -
that happens to have a gigantic function with a large number of call
sites in them.
All of those call sites stay monomorphic but all of them will have to
go to runtime for miss handler because the target code was disabled (the
unoptimized code got disabled, since optimized target code was
installed). The particular target function in question is
`_GrowableArray.add()`.
The cause for the regression is that the miss handler will lookup the
ICData based on linearly walking PcDescriptors to find deopt-id which it
uses to get ICData from function's ic-data array.
Interestingly enough it only regresses ia32 but not x64 (the only two
architectures this benchmark is run on). The reason for that is that
x64 uses exactness tracking and therefore doesn't switch to
monomorphic calls.
This CL:
If a monomorphic call site had a miss because the cached old target
was disabled, we go to runtime to find the real target. Another thread
may have transitioned the call site already from monomorphic to
polymorphic.
When resolving the target function we take advantage of a back reference
from the `ICData::entries()` back to the `ICData` to avoid the O(N)
lookups.
[0] https://dart-review.googlesource.com/c/sdk/+/206373
TEST=Existing test suite.
Change-Id: Ia066a846f5f50e5a575f0734c9453d2368f80780
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207133
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
This does not handle more specific function types (those represented
using FunctionType objects), but just Type::DartFunctionType().
TEST=vm/cc/TTS_Function
Change-Id: I42ddd8818da5331eed748784b051cd2c78547b5b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209703
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
This allows user code to stand out better in the stack trace when debugging SDK/External packages is disabled.
Change-Id: I1740001f2aa085e3bc2069d788e1c53e71386866
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209641
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Of the two classes that inherit from ScopedVisitor (ResolverVisitor
and ScopeResolverVisitor), only ResolverVisitor needs to know about
the currently enclosing class, extension, and function. So we move
this tracking logic to the ResolverVisitor itself. This will help
pave the way for a cleaner separation between the ResolverVisitor and
ScopeResolverVisitor.
(The ScopeResolverVisitor *does* need to know the currently enclosing
closure, so that it can detect improper break/continue statements and
so that it can detect when a local variable is mutated in a closure,
but the tracking logic needed for this is much simpler than what the
ResolverVisitor needs for the "enclosing function". So a new
_enclosingClosure member has been added to ScopeResolverVisitor to
track this.)
Change-Id: I768c15ff4ffcabf564388f5471a6e8f88e677148
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209665
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
This is part of a long term arc of work to consolidate all scope
lookup into a single analyzer visitor.
Change-Id: Ifc483a94173e05672b659348a3f37dd1c5b4468e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208662
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
This is the beginning of an arc of work to move the responsibility of
all the analyzer's scope-based resolution into a single class.
VariableResolverVisitor will become that class, so accordingly it's
being renamed to ScopeResolverVisitor.
In the long term, this shift of responsibility will bring the analyzer
and the CFE into better alignment by removing scope resolution logic
from the type analysis phase (the CFE performs all scope resolution
during parsing, and then has a single visit pass to do type analysis).
This should allow analyzer and CFE logic to be more readily shared.
Also, it should improve the performance of the analyzer by allowing
Scope objects to be built up in just a single visitor pass rather than
in multiple visitor passes.
Change-Id: I037346d28de6485cac783e2bc65e0de9d3a2ada6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208661
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This CL refactors the scope lookup logic for simple identifiers so
that it happens in three phases:
- The actual lookup, handled by Scope.lookup
- Choosing which element is being referred to, handled by the
LexicalLookup class
- If lexical lookup failed, falling back on implicit `this` lookup,
handled by the ThisLookup class
In a future CL, this will allow us to consolidate the first phase,
along with all other scope-related operations, into a single visitor
so that the ResolverVisitor no longer needs to maintain scopes. This
should simplify the analyzer's scoping logic and help prepare for
sharing more code with the CFE (since it will make the analyzer's
visitors more closely parallel the analysis phases of the CFE).
Change-Id: I0c8a2aa60bfc5a935b6060adf64e5a4504bc268f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209664
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Document that only `const` invocations are guaranteed to work.
(But leave open the door that some platforms might allow `new`.)
Thanks to @irvine5k for the initial work (see #46846).
Change-Id: I16ad26186e91898cf1dc2922a492ce4eb0dac207
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209543
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Previously, the code in the TypeCheck runtime entry assumed that if a
lazily specialized type testing stub (TTS) returned a false negative in
JIT mode, that it should always be regenerated and that regeneration
would always result in different code. In AOT mode, false negatives
instead always cause the stub to go to runtime, even if that false
negative had been seen before, because the assumption is that false
negatives shouldn't happen when the whole class hierarchy is known at
compile time.
However, even in the current implementation of optimized TTSes, there
are cases where this assumption is false. For example, the code
generated by BuildOptimizedSubclassRangeCheckWithTypeArguments allows
for provided type arguments to be type parameters. When this happens,
the type parameter is instantiated at runtime using the instantiator or
function type arguments, and the instantiated type parameter must be
identical to the result retrieved from the type arguments of the
instance. That means that if the instantiated type parameter is not the
same type, but a supertype, of the result, then a false negative is
generated.
This CL changes TypeCheck's handling of false negatives from lazily
specialized TTSes as follows: in JIT, if the regenerated stub is the
same as the old stub, or in AOT, a false negative causes the same fall
back to SubtypeTestCaches as unoptimized stubs. This way, further
checks with the same false negative will be caught via the STC before
going to runtime, assuming the STC hasn't already filled up with false
negatives.
Currently, we only generate false negatives for reasons that will not
change when respecialization occurs due to additions to the hierarchy,
so we do not need to clear affected STCs during respecialization.
However, the previous approach to resetting STCs on reload (in
CallSiteResetter::ResetCaches) is insufficient, since there may be
caches containing reloaded types in non-reloaded code (like the TTS
invoker stub created by the TTS testing framework). Instead, clear
all caches on reload using the same ObjectVisitor as deoptimizing type
testing stubs.
Since we now have to check instruction equality to determine whether
to add to the STC, we now only replace the existing stub if the
instructions are different. This makes it easier to test whether a
TTS invocation on a false positive caused respecialization or not.
This CL also reworks the testing framework for type testing stubs,
1) creating a test case object that stores the particulars of a given
invocation, including expectations, and 2) moving most checks and
access to appropriate data structures into a state object that handles
setup and performing invocations given test cases.
TEST=vm/cc/TTS_Partial
Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-release-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try,vm-kernel-nnbd-linux-release-x64-try,vm-kernel-tsan-linux-release-x64-try,vm-kernel-linux-product-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try
Change-Id: I139608c5a0f2442a85a1cf39d1c04104db7a5593
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208653
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
For instance members we do this because this is the best that we
know about the result, and any successful override will be more
specific. But static members never can be invoked this way. So, we
don't do recovery for recovery.
Bug: https://github.com/dart-lang/sdk/issues/46472
Change-Id: Ifbd274011e159c3c8ae35d343603c02bb7599d8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209420
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>