* move names to Identifiers
* move resolution parts to front end strategy
* move codegen parts to backend strategy
* remove now unneeded methods from FrontendStrategy and BackendStrategy
Change-Id: I0675d56045dd212ad195177ecd23b27b0d849a80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105742
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
This reduce the memory footprint and cost of parsing these extensions. Another
advantage is a reduction on the size of the .map files. On a large customer
app, this was a 11% reduction, and the frames section was about 1Mb (excluding
the extra names and uris added on the existing tables).
The encoding works as follows:
- minified names are written as a list of names and indices, in pairs.
{'n1': 1, 'n2': 2} => 'n1,1,n2,2'
- frames are encoded using a sequence of values with markers for the different
kind of frames. Numbers are encoded using VLQ deltas. We use VLQ because it's
already available to any parser that deals with the mappings).
This change also uses the dart2js_tools parser implementation for all unit tests.
Change-Id: Iacc2833c6517eb473955cc618adec501c610870f
Reviewed-on: https://dart-review.googlesource.com/c/82780
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
- Move more that one assignment into var-list
- Move 'this' to a local variable
- Move repeated large 'fast' constants to local variable
Currently under flag --experiment-code-1
Change-Id: I091cab47f498b4ec3759b9ed358bcc0f2e73fdb1
Reviewed-on: https://dart-review.googlesource.com/c/77025
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
* The J model is in the /js_model/ folder and KernelToElementMapForBuilding is renamed
to JsToElementMap.
* The K model is in the /kernel/ folder and KernelToElementMapForImpact is renamed
to KernelToElementMap.
* Code shared between JsToElementMap and KernelToElementMap is in the /ir/ folder using
the interface IrToElementMap internally.
* KernelToElementMap and JsToElementMap do _not_ implement IrToElementMap so all code
that is not part of the implementation must explicitly use one or the other.
* Both KernelToElementMap and JsToElementMap extend KernelToElementMapBase
but this will be changed in a follow-up.
Change-Id: Id6b762984d25354477cb099dc2f8301b83a7ba07
Reviewed-on: https://dart-review.googlesource.com/73382
Reviewed-by: Stephen Adams <sra@google.com>
* All helpers in /helpers/
* Tests of user-facing behavior in /end_to_end/
* Tests of internal models and unittests of internal classes in /model/
Change-Id: Ic7a7e58aa01f92f8572514ae81230804f36af67e
Reviewed-on: https://dart-review.googlesource.com/72644
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
This starts tracking inlining data and records it as an extension
to source-map files so we are able to expand inlined calls when
deobfuscating production stack traces.
Change-Id: I46daf21c2f42305b2bd6ca17fbafb65226355096
Reviewed-on: https://dart-review.googlesource.com/67083
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
If a function expression is used in a context that expects a return type
other than dynamic/void/Null, issue a hint if that function has a block
body and is missing a `return` statement.
Change-Id: Ia55212abd84f5718343cf7401b87aba2891d6446
Reviewed-on: https://dart-review.googlesource.com/66340
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
This change:
* introduces a sourcemap extension to store minified names from the global and
instance namespaces.
* adds a test suite to test that this information is accurate
This is just an initial step: at this time names come from proposed names, which
include extra stuff we don't want. On a later CL I plan to change this to be
able to get the original name instead.
For example, I want to add a test for translating an instance method, right now
we would get "@method@0@" or "method$0" instead of "method".
Change-Id: I411c3bea96446e29e80581750250349799332b9a
Reviewed-on: https://dart-review.googlesource.com/65660
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
- into computeClosedWorld, performGlobalTypeInference and generateJavaScriptCode
+ pass closed world and inference results directly
+ this prepares for (de)serialization after global inference
Change-Id: I1180de35eea78a107c9e95fc6e904084b63ba0f2
Reviewed-on: https://dart-review.googlesource.com/63943
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Assign dynamic to dart:core in NamespaceBuilder & LibraryScope
This seems to be the best two places to hit up all cases. We need two to
handle the case of where code imports dart:core, vs code that is itself
the definition of dart:core.
Includes a member sort of compile_time_error_code_kernel_test, so that
pollutes the diff a bit, but not importantly so and its good to get that
sorted.
Bug: 32227
Change-Id: Ibe620f4b66a35d088355f36da042a5d82380772c
Reviewed-on: https://dart-review.googlesource.com/62730
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
sync*/async/async* generators have two parts: an entry, which does
checks and computes the element type of the result, and a body, which
is transformed after lowering to JavaScript.
The split ensures that the code for checks is done at function call
time, rather than e.g. in the moveNext method of a sync* iterator.
A following CL with optimize the split to generate one function when
there are no checks and the type argument is simple enough for textual
substitution.
Change-Id: I5414109ca851f9267871aa113a2e29b16236986d
Reviewed-on: https://dart-review.googlesource.com/54308
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>