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>
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>
- 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>
This CL adds base classes for breakpoint events (which support a
`breakpoint` getter) and async suspension events (which support an
`atAsyncSuspension` getter). Previously these getters were accessed
through dynamic dispatch.
Change-Id: I9bc450a8988483cd0662b1dfe31b4adaf0936ff9
Reviewed-on: https://dart-review.googlesource.com/57380
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Relanding 4be50d6fa1 with fixes to DBC
and location summaries: AssertAssignable must save FPU registers.
For now we are limiting this to type checks against type parameter types.
In Dart 1 mode Dart2JS compiles itself in 28s when running from source
and in 23s when running from ideal app-jit snapshot (trained on the
same workload).
Before this change in Dart 2 mode numbers were 51s and 57s respectively.
After this change in Dart 2 mode numbers are 38s and 32s. Meaning
that regression is reduced by 50%.
Issue https://github.com/dart-lang/sdk/issues/31798
Issue https://github.com/dart-lang/sdk/issues/33257
Change-Id: Ifb55f86453bfdf36a2e03bcd7f3197cfde257103
Reviewed-on: https://dart-review.googlesource.com/57980
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
This is necessary because HtmlElement.children= requires its parameter
type to be a List<Element>, and text nodes are not elements.
Change-Id: I99c91fe060c16f02d737d904f6869b3dad19c196
Reviewed-on: https://dart-review.googlesource.com/57005
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This test was looking up "int", "List" ... in a generated test library
instead of the "dart:core" library.
It seems like the old lookup has succeded because the C++ parser adds all
imports to the library object and the lookup mechanism uses the library scope,
which most likely falls back to the import scope.
Issue https://github.com/dart-lang/sdk/issues/33042
Change-Id: I37ea756fe53fe5dcbd8efe24053591816d5fc4af
Reviewed-on: https://dart-review.googlesource.com/57821
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
This reverts commit 4be50d6fa1.
Reason for revert: Failures on SIMDBC64 and Analyzer bots.
Original change's description:
> [vm] Enable type stubs based type checks in JIT mode for some types.
>
> For now we are limiting this to type checks against type parameter types.
>
> # Performance improvements
>
> In Dart 1 mode Dart2JS compiles itself in 28s when running from source
> and in 23s when running from ideal app-jit snapshot (trained on the
> same workload).
>
> Before this change in Dart 2 mode numbers were 51s and 57s respectively.
>
> After this change in Dart 2 mode numbers are 38s and 32s. Meaning
> that regression is reduced by 50%.
>
> Issue https://github.com/dart-lang/sdk/issues/31798
> Issue https://github.com/dart-lang/sdk/issues/33257
>
> Change-Id: I34bf5385a5cc3c7702dc281c6dfa89da85d3dde1
> Reviewed-on: https://dart-review.googlesource.com/57601
> Reviewed-by: Régis Crelier <regis@google.com>
> Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
TBR=vegorov@google.com,kustermann@google.com,regis@google.com
Change-Id: I85a30c962b0cd556310e19193f5993ab76ecf2e7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/57840
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
For now we are limiting this to type checks against type parameter types.
# Performance improvements
In Dart 1 mode Dart2JS compiles itself in 28s when running from source
and in 23s when running from ideal app-jit snapshot (trained on the
same workload).
Before this change in Dart 2 mode numbers were 51s and 57s respectively.
After this change in Dart 2 mode numbers are 38s and 32s. Meaning
that regression is reduced by 50%.
Issue https://github.com/dart-lang/sdk/issues/31798
Issue https://github.com/dart-lang/sdk/issues/33257
Change-Id: I34bf5385a5cc3c7702dc281c6dfa89da85d3dde1
Reviewed-on: https://dart-review.googlesource.com/57601
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Rationale:
Some native typed setters/getters in the typed_data library
are only called from clients that perform explicit bounds checks
first. Under strongly typed Dart2, there is no need to repeat
these tests. Avoids overhead, and reduces the polymorphicness
of these calls (preparing more inlining later).
https://github.com/dart-lang/sdk/issues/33205
Tests:
./tools/test.py --mode release --arch x64 -r vm
tools/test.py -m release -r vm -c dartk --strong standalone_2/typed_data_test
Change-Id: I81771a4f4b41a21e344f2d50745bbc30480b2a6c
Reviewed-on: https://dart-review.googlesource.com/57460
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Fixes#33170: We had an assert that type variables are not bounded by "dynamic".
This assert was previously valid because the FE replaces "extends dynamic" with
"extends Object". However, it's not necessary in any way, and it's difficult to
access the Object type from outside the FE when synthesizing type parameters for
expression compilation.
Fixes#33171: The synthetic class generated during serialization to hold the
synthetic method may need to extend core library classes if the expression's
scope was within a core library class. In this case, the class finalizer needs
to avoid applying the restrictions on class extension to the synthetic class.
To facilitate this, we now use a single class name for all synthetic classes,
rather than copying the original class name. The name of the synthetic class has
no function at all, since the synthetic method is reparented to the original
class before execution.
Fixes#33239: The arguments descriptor passed to InvokeFunction for expression
functions which capture generic type parameters was using the wrong argument
count.
Fixes#33270: Use LookupClassAllowPrivate instead of LookupClass when resolving
the expression's scope in the VM.
Test Plan:
#33170: python tools/test.py -m debug -c dartk --strong service/evaluate_function_type_parameters_test
#33171: python tools/test.py -m debug -c dartk --strong service/eval_test
#33239: Updated "evaluate_function_type_parameters_test.dart".
#33270: Updated "eval_test.dart".
Change-Id: I376926bddd2224ec2322b43685d6c13831f1a8e7
Reviewed-on: https://dart-review.googlesource.com/56060
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
We recently removed two kind bits from `Function` to free up space for other
bits. This left two bits in `RawFunction::kind_tag_` unused and no longer
deterministically initialized. This caused `Function` objects saved in the
snapshot within the `.rodata` section of the `dart` binary to be serialized with
a non-deterministic kind tag. We now zero-initialize the kind tag.
# Test Plan
I built the `runtime` target (which includes `dart`) 10 times locally and
received the same SHA256 hash for `dart` each time.
Change-Id: Ib0de4b4b040e26a92a1ba3364460bcec0f665789
Reviewed-on: https://dart-review.googlesource.com/57624
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
The method ObservatoryApplication._switchVM calls newVM.onDisconnect
and requires the resulting future to be completed with a String. In
normal operation, this is satisfied and we just need to change a few
static types to enforce it. But when FakeVM was in use, the future
was completed with `this`. Since ObservatoryApplication._switchVM is
the only call site that cares what the future is completed with, it
makes sense to just change all the types to Future<String> and modify
FakeVM accordingly.
Change-Id: Id94d27ac6a42f31ab19ccc9ad8dd270ecf4042b4
Reviewed-on: https://dart-review.googlesource.com/57400
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
When the constant transformation is enabled on annotations, we need to fix handling
of @ExternalName annotations in the kernel_loader to ensure that we are setting
is_external = false on native methods.
The original revision is in patchset 1.
# Test Plan
The only regression was on benchmarks, Golem results are pending.
Change-Id: Ib80bb9f532299056e770a3b378cc5ad9ee451f57
Reviewed-on: https://dart-review.googlesource.com/56960
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
GrowableArrayMarker was a class that implemented int and was used to
enable implementation of default List factory constructor in pure Dart:
factory List([int length = GROWABLE_ARRAY_MARKER]) {
return identical(length, GROWABLE_ARRAY_MARKER) ? new _GrowableList<E>(0)
: new _List<E>(length);
}
Its existence complicated all kinds of things in the VM and it is finally
time to remove it.
Instead we build List factory body directly in IL.
This CL also provides inlining rule for `new List(n)` case.
Change-Id: I870751658a4ac17fce649c9ac70395ff88a5436c
Reviewed-on: https://dart-review.googlesource.com/57262
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
* Use 3-arg variant of open() to fix compilation on GCC and also to ensure
that created file is readable/writable by all users.
* Avoid changing protection on code pages emitted into VM isolate heap: this
allows to profile stubs.
Change-Id: I2b621596405ad78f54a63cfebde7a1af9fa15911
Reviewed-on: https://dart-review.googlesource.com/57263
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
- Forward only kImportTag requests to DFE. This restores the current handling of a kScriptTag request when loading the kernel isolate in the simulators.
- Mark dynamic_load_test as failing in the reload stress tests (reload fails to preserve library identity).
Change-Id: Ibe6f0a3505b99736a38d566abf3b2151505d7a7e
Reviewed-on: https://dart-review.googlesource.com/56706
Reviewed-by: Siva Annamalai <asiva@google.com>
Add a clause indicating that FunctionCallTreeNode (in
lib/src/sample_profile/sample_profile.dart) implements
M.FunctionCallTreeNode. This allows the two types for `root`
inherited by FunctionCallTree to be consistent with each other: the
type inherited from CallTree<FunctionCallTreeNode> is
FunctionCallTreeNode whereas the type inherited from
M.FunctionCallTree is M.FunctionCallTreeNode.
Change-Id: I0b48c57f84681a7d40afadfb59c72501cfe38577
Reviewed-on: https://dart-review.googlesource.com/57002
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>