I thought that getSourceKind() might be not the best API. We are moving
away from Source, and it seems that we should stop using SourceKind as well.
R=brianwilkerson@google.com
Change-Id: I0fcff8dc8cefcd6d8fb899badab8037bf8d67775
Reviewed-on: https://dart-review.googlesource.com/58442
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Rewrite _checkLength to avoid weaknesses in type inference.
Change-Id: I1a254d021ff966fa51da7f8258c5cba7b3b10336
Reviewed-on: https://dart-review.googlesource.com/58542
Reviewed-by: Emily Fortuna <efortuna@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
In most cases the correct fix is to simply drop the generic comment
syntax (e.g. replace "List/*<Map>*/" with "List"). We can't use the
more precise type because the runtime type is actually more general
(e.g. when processing an object that came from the JSON parser, all
lists have runtime type List<dynamic>, even if their elements happen
to be uniform). But we can introduce more precise types when handling
substructures.
Exception: all JSON-derived maps have type Map<String, dynamic> (since
JSON maps always have string keys), so we can use a more precise type
when dealing with JSON maps.
Change-Id: I48c9dbdda97c11530978212146f74db7b43f5197
Reviewed-on: https://dart-review.googlesource.com/58320
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Instance::Evaluate was replaced with EvaluateCompiledExpression. This fixes the test.
Change-Id: Ie5aba0a7ef25209a3319a07d45d76f347f6f3e95
Reviewed-on: https://dart-review.googlesource.com/58440
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Rationale:
Always inline int convertors that don't do
much more than testing and anding.
For example, force inline
v26 <- StaticCall:66( _toUint8@6027147<0> v4 T{Type: class 'int'?}) T{Type: class 'int'?}
to
v47 <- Constant(#255)
..
CheckSmi:10(v4 T{Type: class 'int'?})
v45 <- BinarySmiOp:10(&, v4 T{_Smi}, v47 T{_Smi}) T{_Smi}
https://github.com/dart-lang/sdk/issues/33205
Change-Id: I595d9a64365e16ae244480b5e27f8be23c43d164
Reviewed-on: https://dart-review.googlesource.com/58061
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
This is the first CL in a series aimed at removing the need to reparse type variables in
https://github.com/dart-lang/sdk/blob/master/pkg/front_end/lib/src/fasta/kernel/body_builder.dart#L3669
and ultimately improving recovery by removing parseType.
* Move calls to listener.beginTypeVariable after parsing metadata and identifier
* Pass variable name via beginTypeVariable rather than via handleIdentifier
* Add additional check in test for issue 31846
Change-Id: I983b9d17675fc899c83df69fa1777059903e3f52
Reviewed-on: https://dart-review.googlesource.com/58300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
Post a5e41681e5, the method Instance::Evaluate is now redundant in dart2 mode. Instead Instance::EvaluateCompiledExpression should be used.
The https://dart-review.googlesource.com/c/sdk/+/58440 should fix the test.
Change-Id: I18ee49174f51b46a87a56324be054ebc832a04df
Reviewed-on: https://dart-review.googlesource.com/58441
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
If there is registered expression compiler, VM debugger uses it to compile expressions. Otherwise, it will fallback to use kernel service compiler.
This is needed to support Flutter use case where compiler is running on developer's host machine, not on the device where VM is running.
Bug: dartbug.com/31981
Change-Id: I8bdfc8ab45a57c306169abe189f1e24e1b0bcf40
Reviewed-on: https://dart-review.googlesource.com/57520
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
- Remove a level of indirection when accessing code units.
- Require a finalizer when constructing an external string.
Change-Id: I3f65246bf0ac50ffad900e2c338623a7684a9d3d
Reviewed-on: https://dart-review.googlesource.com/54300
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
IntelliJ sends us the file and offset of the declaration of the element,
not the file and offset where the element is referenced (and where the
user actually requested search). It uses navigation information to do
this. Unfortunately this means that in the most case the unit that
defines the element is not a priority one, so we have to resolse it
from scratch. But we know that we are always given the name offset,
so we can look first into the element model and avoid performing
expensive unit resolution.
If the search is not successful, or the file is a priority one,
we use resolved unit anyway.
R=brianwilkerson@google.com
Change-Id: Ic6a32d3d8f9e61b245b1dd9f7fdf626c809f5fd5
Reviewed-on: https://dart-review.googlesource.com/58322
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Saw this assert hit on the bots, so switching back to max with 0.
Change-Id: Idafcd55d99dd441131dd3ac9aeb57ec102f28569
Reviewed-on: https://dart-review.googlesource.com/58323
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
In 4fb0c60938
active class was set in StreamingDartTypeTranslator, but it turns out
this is not enough. This CL sets active class in StreamingFlowGraphBuilder;
all dependent helper objects should pick it automatically.
Fixes https://github.com/dart-lang/sdk/issues/33259
Change-Id: If16afff35de32cbdba23f6260dac0e0fd7e9786a
Reviewed-on: https://dart-review.googlesource.com/57524
Reviewed-by: Samir Jindel <sjindel@google.com>
- Track mark-compact as a GC type instead of a GC reason.
- Track external allocation as a GC reason.
Change-Id: Id79bf6a582109e3ebb97954822aefeffe68959e2
Reviewed-on: https://dart-review.googlesource.com/58002
Reviewed-by: Zach Anderson <zra@google.com>
Previously, GC would only be triggered by external allocations on
reaching a limit indicated by a flag. This limit was too large
and not set thoughtfully by anyone.
This CL triggers GC when external allocations in old gen grow
larger than some limit based on results of previous GC, similar
to how Dart heap growth triggers GC. GC is triggered for new gen
when external allocations reach 4x the current new gen
capacity.
FL-61
Change-Id: I1d4da467bc2aab64058f25296aefdd73eebc38e6
Reviewed-on: https://dart-review.googlesource.com/58100
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
Previously there were places in the code where an API accepted a
`bool validate_frames` and call sites passed an enum value (which
implicitly got converted to a bool).
By changing the APIs to require an enum, the compiler will tell us if a
caller doesn't pass one.
Change-Id: I29fcd0b018e6cdd7e00b5bb03e83b9636d1345d4
Reviewed-on: https://dart-review.googlesource.com/57823
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Previously, FunctionTypeImpl.elementWithNameAndArgs was used for two
purposes: (1) when creating a FunctionTypeImpl for an executable
element, to initialize _typeArguments to the types of the type
parameters that are in scope, and (2) when creating a FunctionTypeImpl
for a typedef, to supply the type arguments necessary to instantiate
the typedef. (1) turns out to be unnecessary, since the
FunctionTypeImpl.typeArguments getter automatically gathers type
arguments from enclosing elements if necessary, and (2) makes more
sense to do as part of the .forTypedef constructor. So this CL
removes FunctionTypeImpl.elementWithNameAndArgs and updates its
callers to use the unnamed constructor or the .forTypedef constructor,
as appropriate.
Also, a check is added to make sure that the unnamed constructor is
never accidentally used for typedefs. So now FunctionTypeImpl has
just three public constructors, each with a clear use case, enforced
either by an assertion or by the type system:
- The unnamed constructor (for executable elements, not typedefs)
- The .forTypedef constructor (for typedefs only)
- The .fresh constructor (for creating one FunctionTypeImpl from
another by binding fresh type parameters)
Finally, the public constructors for FunctionTypeImpl are all changed
to factories so that client code can't inadvertently FunctionTypeImpl.
(It shouldn't anyway, since FunctionTypeImpl is defined inside src/,
but this gives an extra level of safety).
Change-Id: I5f7abc1ca114eb612cbf539c1d61fc0cace5a4dd
Reviewed-on: https://dart-review.googlesource.com/58043
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Change-Id: I954debb9f258eb94de227f6772ff08b53daba322
Reviewed-on: https://dart-review.googlesource.com/57623
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
They are passing since 315a186
Change-Id: Iee40f0c50160b87763fb031bb74d2499ef578807
Reviewed-on: https://dart-review.googlesource.com/58181
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
This makes the task itself 1.4 times faster, and search 15% faster.
R=brianwilkerson@google.com
Change-Id: I35444d46ee220fdb960d299f007739f044a20813
Reviewed-on: https://dart-review.googlesource.com/58143
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>