In this case we should use a dotted package name, similar to other
packages outside third_party.
Previously, restoreAbsolute() didn't return a package URI at all,
which would result in a relative path being suggested for a
missing import.
BUG=
R=brianwilkerson@google.com
Review-Url: https://codereview.chromium.org/2771323002 .
Currently Fasta translates cascade of indexed assignments into a cascade of
let-statements.
For example code like
```dart
indices
..[0] = 0
..[_schemeEndIndex] = start - 1
..[_hostStartIndex] = start - 1
..[_notSimpleIndex] = start - 1
..[_portStartIndex] = start
..[_pathStartIndex] = start
..[_queryStartIndex] = end
..[_fragmentStartIndex] = end;
```
gets translated to
```
let final dynamic #t826 = indices in
let final dynamic #t827 = #t826.[]=(0, 0) in
let final dynamic #t828 = #t826.[]=(core::_schemeEndIndex, start.-(1)) in
let final dynamic #t829 = #t826.[]=(core::_hostStartIndex, start.-(1)) in
let final dynamic #t830 = #t826.[]=(core::_notSimpleIndex, start.-(1)) in
let final dynamic #t831 = #t826.[]=(core::_portStartIndex, start) in
let final dynamic #t832 = #t826.[]=(core::_pathStartIndex, start) in
let final dynamic #t833 = #t826.[]=(core::_queryStartIndex, end) in
let final dynamic #t834 = #t826.[]=(core::_fragmentStartIndex, end) in
#t826;
```
This later becomes in IL (on the example of `#t826.[]=(0, 0)`):
```
t0 <- InstanceCall:120( []=, t0, t0, t0)
StoreLocal(:var1 @-19, t0)
```
After SSA construction if locals liveness analysis is disabled
(`--no-prune-dead-locals`) we get essentially redundant phis constructed for
temporary let-variables which actually use result of the instance call:
```
v25 <- InstanceCall:120( []=, v22, v24, v24)
...
v629 <- phi(v636, v25)
```
These phis are redundant because their values can never be observed by the
program because they correspond to dead stores. In fact these phis only have
environment uses.
However subsequent optimization passes assume that result of a `v.[]=(...)`
invocation can never be used and replace `v.[]=(...)` with IL sequences that
don't actually produce any value - leading to malformed graphs where phis
refer to instructions outside of the graph.
To workaround the issue we explicitly drop the actual result of `v.[]=(...)`
and push a null-value to be used instead.
Fixes https://github.com/dart-lang/sdk/issues/29135R=kmillikin@google.com, kustermann@google.com
Review-Url: https://codereview.chromium.org/2769313004 .
* cleanup defaultRecoveryStrategy next/previous and eof
* add SymbolToken.eof() constructor to ensure that EOF tokens
are correctly self referencing
* add fasta.scanString method to match scan method
* add fasta.ScannerResult.hasErrors field
so that scan and scanString callers can quickly check for errors
* new scanner replacement test
which scans using fasta then asserts as if it were from analyzer
* improve SymbolToken.toString() for EOF
* update analyzer test :: fasta scanner considers "<" to be an opener
* extract and move translateErrorToken into front_end
* address comments in https://codereview.chromium.org/2763833002R=ahe@google.com, paulberry@google.com
Review-Url: https://codereview.chromium.org/2767083002 .
In the long run, this shadow hierarchy is intended to be used both for
kernel and analyzer ASTS; this should allow a single BodyBuilder class
to build either a kernel or an analyzer AST depending on which factory
it's connected to.
For now we only have a kernel shadow hierarchy, and it's incomplete,
so the code is not yet used. I intend to follow up with CLs that
complete the implementation and hook it up to BodyBuilder.
R=ahe@google.com, scheglov@google.com
Review-Url: https://codereview.chromium.org/2769723004 .