This adds a constructor function to be used as the base class for all
exported functions. With type reflection enabled exported functions are
instances of this new constructor. Using the constructor directly as
well as the 'type' property is still missing.
R=jkummerow@chromium.org
TEST=mjsunit/wasm/type-reflection
BUG=v8:7742
Change-Id: Id58359cf7866d24be0745abf36a839d3d86e5922
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1617253
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61614}
We currently have the problem that we trigger too many code GCs since
{new_potentially_dead_code_size_} is never reset to zero.
This CL adds a counter which tells us how many GCs we ran per native
module. This counter is sampled on each code GC. It will give us a
good understanding of the amount of GC work we are executing in the
wild. The number should stay in the single-digits generally.
R=mstarzinger@chromium.org, mpearson@chromium.org
Bug: v8:8217
Change-Id: I978a98dff76e0f466ff51e067626886b58d52ded
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1615246
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61611}
The script does not have the shebang and apparently running it without 'python'
on the command line produces some strange errors such as script trying to parse
itself as a suite config. Making it non-executable will make it clear that users
should prefix it with 'python' or 'vpython'.
R=machenbach@chromium.org
No-Try: true
No-Tree-Checks: true
Change-Id: I1d4373b8846034cf28b5fd02e60e9ed682330706
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1605942
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Sergiy Belozorov <sergiyb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61607}
Port 8e7945a691
Original Commit Message:
Port 381a7f9e76
Original Commit Message:
On Arm/64 the last return address is stored in a link register instead of
being pushed to the top-of-stack like on x64/ia32. Extend the support in the
tick sampler to check for samples in a frameless bytecode handler with support
for checking the link register if it exists instead of top-of-stack. In addition,
make the x64/ia32 check more robust by ensuring we only apply the change if the
pc is a bytecode handler and the top frame isn't a bytecode handler (stub) frame.
R=miladfar@ca.ibm.com, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=v8:9162
LOG=N
Change-Id: I52c40f8d4ba1bb10049410417d1e60f95315489d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1614791
Reviewed-by: Junliang Yan <jyan@ca.ibm.com>
Reviewed-by: Joran Siu <joransiu@ca.ibm.com>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#61605}
When TurboFan doesn't know anything about the receiver, it will
generally insert a call via CallFunctionTemplate builtin, which
does all the necessary checks. For this we don't need to be able
to deoptimize, so there's no need to have the speculation bit
available.
This restores the performance in the case of calling API methods
and accessors via `Function#call()`, i.e. like in this example:
```js
const hasAttribute = Element.prototype.hasAttribute;
// ...
hasAttribute.call(element, "bar");
```
Bug: v8:8820
Change-Id: Ic30719d7db75141023efc11d76180b001f871d28
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1615248
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61604}
Skipping rather than reverting the CL that introduced the slowness, due to
the fact that said CL is a Stable blocker fix.
Cq-Include-Trybots: luci.v8.try:v8_linux64_arm64_pointer_compression_rel_ng
Bug: v8:9256
Change-Id: I8f8b57c415d2b54fe57c43a87e42990909295c57
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1615260
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61603}
This CL extends Error.stack to include frames of functions declared
with the C++ FunctionTemplate API. For example, "print" in d8.
Two changes are necessary:
- HandleApiCall and friends need to go through an BUILTIN_EXIT frame
instead of an EXIT frame. The existing stack-trace machinery will
then pick up FunctionTemplate frames without additional changes.
- Turbofan doesn't go through HandleApiCall, but instead uses an
ASM builtin to enter FunctionTemplate functions. A "marker"
frame state is needed to include these frames in the stack trace.
Note: This CL only includes these frames in Error.stack,
but not (yet) in the stack-trace API (v8.h).
Bug: v8:8742,v8:6802
Change-Id: Ic0631af883cf56e0d0122a2e0c54e36fed324d91
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1609835
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61602}
This reverts commit 5f28539599.
Reason for revert: presubmit failure
Original change's description:
> Move logging and diagnostics related source files
>
> This also introduces a COMMON_OWNERS file, which is derived from the
> current top-level OWNERS file. It is to be used for parts of the
> codebase that is not sensitive to domain-specific expertise.
>
> NOPRESUBMIT=true
> TBR=verwaest@chromium.org
>
> Bug: v8:9247
> Change-Id: I34a5eaa7cb1509a80d15094a2aceedd62665b17c
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1613987
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Commit-Queue: Yang Guo <yangguo@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#61600}
TBR=rmcilroy@chromium.org,yangguo@chromium.org,mstarzinger@chromium.org,verwaest@chromium.org
Change-Id: I3827c3af4fd63b18aa48c49617f318a01746e813
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:9247
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1617247
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61601}
This also introduces a COMMON_OWNERS file, which is derived from the
current top-level OWNERS file. It is to be used for parts of the
codebase that is not sensitive to domain-specific expertise.
NOPRESUBMIT=true
TBR=verwaest@chromium.org
Bug: v8:9247
Change-Id: I34a5eaa7cb1509a80d15094a2aceedd62665b17c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1613987
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61600}
The language server and unit tests pass in an empty output directory
to signal that no C++ files should be generated. As these
generation steps include some validations, they should also be
included in language server and unit test compilation runs.
This CL introduces a "dry run" flag on the ImplementationVisitor.
Additionaly, the implementation visitor wraps the file writing
functionality. In case of a dry-run, file writing becomes a no-op.
R=sigurds@chromium.org
Bug: v8:7793
Change-Id: Id699fdf0b35311ddd3c1f5419baa0237b40ddce4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1617244
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61599}
Building Chromium Win64 ThinLTO is faulting, with a link error on a missing
symbol. The fix is to add a __declspec(dllexport) to function
CrashForExceptionInNonABICompliantCodeRange defined in
src/unwinding-info-win64.cc.
Note that using V8_EXPORT_PRIVATE instead does not work because
'BUILDING_V8_SHARED' is not defined.
Bug: v8:9224, v8:9251
Change-Id: Ic0265c22c1d6a4e4955f093bf8de0b5575bf6bde
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1601423
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61598}
This reverts commit 748de1e56a.
Reason for revert: Fails compilation (unused variable): https://ci.chromium.org/p/v8/builders/ci/V8%20Fuchsia/10879
Original change's description:
> [fuchsia] Replace zx_clock_get() with zx_clock_get_new().
>
> zx_clock_get() signature is being replaced to report errors.
> As part of a soft transition, zx_clock_get_new() is introduced with
> the final function signature.
>
> Bug: chromium:963956
> Change-Id: Ia6d0f4fc560bd9149683011099b064540b54edd6
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1616545
> Commit-Queue: Fabrice de Gans-Riberi <fdegans@chromium.org>
> Reviewed-by: Wez <wez@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#61591}
TBR=wez@chromium.org,fdegans@chromium.org
Change-Id: I14a97f6510f6fbd6b3698a3549def8feb128f0ff
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:963956
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1617241
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61593}
zx_clock_get() signature is being replaced to report errors.
As part of a soft transition, zx_clock_get_new() is introduced with
the final function signature.
Bug: chromium:963956
Change-Id: Ia6d0f4fc560bd9149683011099b064540b54edd6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1616545
Commit-Queue: Fabrice de Gans-Riberi <fdegans@chromium.org>
Reviewed-by: Wez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61591}
This commit attempts to change as little behavior as possible, but it
does require reordering the fields within Map to abide by Torque rules
specifying that strong and weak fields must be in separate sections.
Also includes some Torque compiler updates:
- Allow enums (types extending from integral types) as class fields
- Rename @ifdef to @if and add @ifnot for inverse checks
- Allow void fields in class declarations, which take up no space and
emit no accessors
Bug: v8:8952
Change-Id: I1de6f34c1b15ed87d718666a05176980a218e97c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1480919
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61588}
Also cleanup variable class size calculation for 'new'
statements as well as spread-based indexed field
initialization in Torque rather than in hand-written
ImplementationVisitor code. This is done with new
%-intrinsics. With this change, %-intrinsics can also
have bodies, in which case they are treated as macros.
Bug: v8:7793
Change-Id: I012d57166761688747eb683cb618263e8d0953db
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1554695
Commit-Queue: Daniel Clifford <danno@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61585}
Roll perfetto to get the fix for a TSAN race.
We need to override a new method on the producer, ClearIncrementalState.
It is only called if the producer opts into it, which we do not so we
add UNREACHABLE() in the implementation.
Cq-Include-Trybots: luci.v8.try:v8_linux64_perfetto_dbg_ng
Bug: v8:8339
Change-Id: I782989f32b511e98479f6637148e3bdd78a6578a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1615461
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61584}
Now that function counts are based on dedicated call counters instead
of FeedbackVector::invocation_count, we can enable optimizations for
block coverage modes.
This significantly speeds up V8 with enabled coverage:
Before this CL, the web-tooling-benchmark regressed by 70% (block
count coverage vs. no coverage). With this CL, the regression is
reduced to 40%.
Bug: v8:6000,v8:9148
Change-Id: I6bb538bd66f32f016c66c1d1996bce3b25958232
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1615241
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61582}
Instead of allocating a fixed array in which we write individually allocate
mutable heap numbers, we can allocate a byte array large enough to cover all
heap numbers. That avoids expensive allocation calls, write barriers, and
temporary memory O(number of heap numbers) (we'll just have 1 byte empty byte
array as overhead).
Change-Id: I4ffe16dd91e97a2e8cd8e36ff5af37375599276b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1613993
Auto-Submit: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61581}
We already use {base::AddressRegion} in some places, while other places
still receive {Address} and {size_t}. Those are often created from an
existing {base::AddressRegion}, hence pass that on explicitly.
Drive-by: Rename {AssignRanges} to {AssignRange}.
Drive-by^2: Return {base::AddressRegion} by value (it is trivially
copyable and small).
R=mstarzinger@chromium.org
Bug: v8:9183
Change-Id: Ia9f26cc96e084922f5e27d879209ee4c79c63fee
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1613242
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61578}
Helper functions to create and warm-up the snapshot blob were
duplicated in various spots (mksnapshot, inspector tests, serializer
cctests). This merges all of these into a single helper function
family declared in snapshot.h.
Bug: v8:9189, chromium:957029
Change-Id: I2d8d6fd8e955ffffd7d805c199d4a858500af588
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1598695
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61576}
Perfetto has a mechanism for getting trace data from buffers held alive
by TraceWriters. We enable this with the SetSMBScrapingEnabled() call.
This means we don't need to delete TraceWriter objects and can just leak
them for now, and eventually use thread-local destructors to ensure they
are eventually deleted on thread exit.
Cq-Include-Trybots: luci.v8.try:v8_linux64_perfetto_dbg_ng
Bug: v8:8339
Change-Id: I690bc435c48db6d91eab2fbc7a49ec9feae3b45a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1607653
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61575}
Prior to this CL, call counts at function scope were taken from the
FeedbackVector::invocation_count field. This had two major drawbacks:
1. for generator functions, these count the number of resumptions
instead of the number of calls; and 2. the invocation count is not
maintained in optimized code.
The solution implemented here is to add a dedicated call counter at
function scope which is incremented exactly once each time the
function is called.
A minor complication is that our coverage output format expects
function-scope counts in the dedicated CoverageFunction object, and
not as a CoverageBlock. Thus function-scope block counts are initially
marked with magic positions, and later recognized and rewritten during
processing.
This CL thus fixes reported generator function call counts and enables
optimizations in block coverage modes (more to come in a follow-up).
Drive-by: Don't report functions with empty source ranges.
Bug: v8:6000,v8:9148,v8:9212
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng
Change-Id: Idbe5edb35a595cf12b6649314738ac00efd173b8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1613996
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61574}
When decommitting memory, update the committed code space counters both
for the native module as well as engine-wide (via {WasmCodeManager}).
R=mstarzinger@chromium.org
Bug: v8:8217
Change-Id: I9679b27f2465de2cbc797529d83f90cdac903d01
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1613239
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61569}
With lazy feedback allocaiton functions may not have feedback vectors.
This causes crashes with clusterfuzz when it uses OptimizeOSR without
ensuring feedback vector. This cl ensures we have a feedback vector
before OSRing.
Bug: v8:8394
Change-Id: I5470c45cec2f6916d142f3bb4a385737083de25c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1611809
Auto-Submit: Mythri Alle <mythria@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61568}