Some of these is checks can be optimized away by dart2js.
Change-Id: I76b5b253a24a4ded2394664985665fc875b60f52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321750
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Adds JSSymbol and JSBigInt and erases to either their respective
interceptor types in the JS backends or JSValue in dart2wasm.
CoreLibraryReviewExempt: Backend-specific library.
Change-Id: Ib2c70d22a70c6308733cd170b91eafa8ec3b3aeb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321749
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Adds the same interceptors from dart2js as JsPeerInterfaces
and handles typeof differences in getReifiedType. These must
be JsPeerInterfaces so that Object members can be stored in
their prototype. Tests are added so that dart2js and ddc are
consistent.
Change-Id: Iadc3dd26957c0a21b4039c49c1c1ff162ae286e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321748
Reviewed-by: Stephen Adams <sra@google.com>
Duplications introduced in
cfa03ed971
Change-Id: I9720822611aacefb9b1538d9fc59e234f96475bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321842
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Fix allowed it to accept null but it should never be called with a
nullable value.
Change-Id: I03b5d9b4906e9e4557a4f2720350c0c8176fec53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/320841
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Auto-Submit: Nicholas Shahan <nshahan@google.com>
- Consolidates "related to" section to what users are familiar with.
- Adds some other related repositories.
- Switches to `dart info` instead of `dart --version` for more information
Change-Id: I70eb03293e5946b51cee7d5a7f02634a593f3bc2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/320901
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
`DartType.VOID` and `DartType.VOID_NULLABLE` are the same constant,
therefore only one of them should be listed in
`DartLib.typeToLibraryMethods`, to avoid an `equal_keys_in_map`
warning.
Change-Id: I65beef01f8a810af96be5e458eeecef7a7acff01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321820
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
I decided to unify the indented code block and markdown code block
classes, as there will be no functional difference between the two.
Work towards https://github.com/dart-lang/sdk/issues/52705
Change-Id: I6cd60f7a58a83e6a67ad187b5ff25868b6f84651
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321785
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Regenerate API and type tables.
Change-Id: I3fe630764edf774059c24cff645041452768a5db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321745
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
This should signal what is needed to add DDC canary mode
golem configs.
Change-Id: Id1fe8ed016641bda4bfa9e5fabacc78b26a35503
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315560
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Provides a signal for what needs to change in the golem configuration.
Change-Id: I1b77ec88ba3076cd4a0296a78950ed209e996661
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316843
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: William Hesse <whesse@google.com>
The flag was added recently marking casts that should not be performed
at runtime. DDC will skip these casts now.
Change-Id: Ied43653f43cebc91f093d7c6df10edabb2afc34b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321623
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Work towards https://github.com/dart-lang/sdk/issues/52705
In particular:
* A fenced code block starts with three backticks, but those must be
the first non-whitespace characters on their line.
* Same with the closing delimiter.
* A fenced code block can start with more than three backticks, and
must always be closed with a line of at least as many backticks.
Change-Id: I0060be7d6e67edb7fe3f93f426e46f23daed75db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321780
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
This is to allow `_HashFieldBase` to be used for immutable maps and
sets (which initialize their index lazily) without using an intrinsics
hack to allow a non-nullable field to be `null`.
This change is necessary for the upcoming optimization that will
use non-nullable Wasm types for non-nullable Dart fields.
Even though this code is shared with the VM, the change doesn't affect
VM performance in practice, since the VM compiler is able to infer
that the field is always non-null. Benchmark runs see no measurable
performance difference.
Change-Id: I3ba2f78044f965473a0ab10ddf864c78e7095634
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321400
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Jess Lally <jessicalally@google.com>
There is no code change in this CL, only code motion.
Change-Id: Icf48c806b810545721fcf6a33ec595e54b4f2759
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321420
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
The class `VariableModel` is renamed to `PromotionModel` to reflect
that it tracks promotion information for both local variables and
fields. Variables and fields that map from a promotion key to an
instance of `PromotionModel` are renamed from `variableInfo` to
`promotionInfo`.
Also a few comments are re-worded to make them clearer.
There is no functional change--this is a rename-only CL.
Change-Id: Ie0e7147d290171407f31fe65af85ce96dd51694a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321362
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Avoid trying to add a property to a non-object exception value to
cache the stack trace.
In "use strict" mode this is an error.
Otherwise the property is added to an ephemeral Object and then lost.
The observable behaviour is unchanged - returning a fresh
`_StackTrace` object each time.
Bug: #53105
Change-Id: I406ff14db4ed24b71e0cfe95cd87783621a5b809
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321622
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
Fix function signatures from one app leaking into another app when
communicating via JavaScript interop.
Change-Id: Iba881f78bbe5444e3888c55fd317b8eda8e19f18
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321520
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
In these two cases, a nullable value is passed where a runtime error
will occur if the value is null. Make runtime check explicit.
Cleanup for https://github.com/dart-lang/sdk/issues/53253
Change-Id: Ia14bd345cbe20c50c75bdd2069f44449157bcc36
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321423
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
This is the ID sometimes sent for internal VS Code users, and we want to capture these users as well for some internal IDE tracking.
Change-Id: Id3b5aa89eacefb873e88b59745014454a89e6a73
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321323
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Helin Shiah <helinx@google.com>
For-in statements are desugared on kernel AST, so handling of these
statements in the VM is a dead code and can be removed.
TEST=ci
Change-Id: Ic06080ee5d1b2ab74c55c400746f38a420668531
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321560
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
All constants including const local variables are evaluated
in the front-end.
TEST=ci
Change-Id: I0062f5ac021b335ceb60c93ef8c230b49ec11a07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321540
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Unresolved types would throw in `stringLength` and we don't handle them the same way we do with the other operators. Throwing EvaluationExceptions is the problem here, but that's for another CL.
In the meantime, this CL makes `stringLength` consistent to the other operators in the DartObjectComputer.
Fixes https://github.com/dart-lang/sdk/issues/53163
Bug: https://github.com/dart-lang/sdk/issues/53163
Change-Id: Ib99b61736d699056fa3c379e4d9c79756a4425f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319562
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Try/finally statements have an unusual property that needs to be
handled in a special way by flow analysis: within the `finally` block,
the `try` block might not have run to completion, but after the
try/finally statement, the `try` block is known to have run to
completion. Therefore, even though the code that follows the
try/finally statement is immediately preceded by the end of the
`finally` block, the flow states of those two control flow points
might not be the same.
Flow analysis accounts for this situation by analyzing the `finally`
block as though it started executing right after the beginning of the
`try` block, but with all variables that are written within the `try`
block demoted. Then, after it finishes analyzing the `finally` block,
it builds a fresh flow model by starting with the flow state after the
end of the `try` block, and then applying any promotions that were
performed within the `finally` block. This is accomplished by the
`FlowModel.attachFinally` method.
The following changes had to be made to make this work with field
promotion:
- If a given promotion key appears in the "after try" model but not
the "after finally" model, it might represent a field that was
promoted during the `try` block, so the promotion needs to be
preserved. Previously, this situation could only occur if the
promotion key represented a variable declared in the `try` block
(and therefore the variable would not be accessible after the
try/finally statement), so the promotion could be safely dropped.
- If a given promotion key appears in the "after try" model and the
"after finally" model, but not the "before finally" model, it might
represent a field that was promoted within both the `try` and
`finally` blocks, so the promotions need to be combined. Previously,
this situation could not occur, so the promotion could be safely
dropped.
- If a given promotion key is associated with the same SSA node in the
"before finally" and "after finally" models, but a different SSA
node in the "after try" model, that means that the corresponding
variable was assigned in the `try` block but not in the `finally`
block. If any properties of the variable were promoted within the
`finally` block, those promotions were applied to the SSA nodes used
by the `finally` block, and don't appear in the SSA nodes used in
the "after try" model. So those promotions need to be
transferred. This is accomplished by the new
`SsaNode._applyPropertyPromotions` method.
- If a given promotion key appears in the "after finally" model but
not the "after try" model, it might represent a field that was
promoted during the `finally` block, so the promotion needs to be
preserved. Previously, this situation could only occur if the
promotion key represented a variable declared in the `finally` block
(and therefore the variable would not be accessible after the
try/finally statement), so the promotion could be safely dropped.
Fixes https://github.com/dart-lang/sdk/issues/53225.
Bug: https://github.com/dart-lang/sdk/issues/53225
Change-Id: Ie4b635dbf838447d6964c326e1ecebfff99bed8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/320961
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>