There is no good reason to have the meat of most objects' initialization
logic in heap.cc, all wrapped by the CALL_HEAP_FUNCTION macro. Instead,
this CL changes the protocol between Heap and Factory to be AllocateRaw,
and all object initialization work after (possibly retried) successful
raw allocation happens in the Factory.
This saves about 20KB of binary size on x64.
Original review: https://chromium-review.googlesource.com/c/v8/v8/+/959533
Originally landed as r52416 / f9a2e24bbc
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: Id072cbe6b3ed30afd339c7e502844b99ca12a647
Reviewed-on: https://chromium-review.googlesource.com/1000540
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52492}
Port a6d974fe00
Original Commit Message:
This change makes lifetime management of WasmCode much simpler.
By using the WasmInstanceObject as the context for WASM code execution,
including the pointer to the memory base and indirect function tables,
this keeps the instance alive when WASM code is on the stack, since
the instance object is passed as a parameter and spilled onto the stack.
This is in preparation of sharing the code between instances and
isolates.
R=titzer@chromium.org, joransiu@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=
LOG=N
Change-Id: I03c3ecff296cca929c69489e769a5dab60b93830
Reviewed-on: https://chromium-review.googlesource.com/1003117
Reviewed-by: Joran Siu <joransiu@ca.ibm.com>
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#52491}
Loads/Stores are overflowed by huge offsets in 1 test case.
R=joransiu@ca.ibm.com
Change-Id: Ic9bc019e1f281b4ee0cdf1b88d29ea269197c95d
Reviewed-on: https://chromium-review.googlesource.com/1003173
Reviewed-by: Joran Siu <joransiu@ca.ibm.com>
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#52490}
The Win10 GCE images were recently updated from RS1/14393 to RS2/15063.
Allow tasks triggered via mb to find machines on which to run.
Change-Id: I5a61f7d38d80cb441fa32a4bc9c0c7e23fbba75e
Reviewed-on: https://chromium-review.googlesource.com/1000721
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52488}
MUST_USE_RESULT was deprecated for some time. This removes it and
replaces all uses by the equivalent V8_WARN_UNUSED_RESULT.
R=mstarzinger@chromium.org
Bug: v8:7570
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng;luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: I86883218638e64eeeb7a5891904319ed0844a004
Reviewed-on: https://chromium-review.googlesource.com/999533
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52486}
gn flag: v8_enable_minor_mc
The default is 'true' until infra is updated to be able to build and
test with it using this flag.
Bug: v8:7638
Change-Id: I7946eb9bf4087c528d1a844b156a726a1c0671bf
Reviewed-on: https://chromium-review.googlesource.com/1000777
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52485}
This fixes a deadlock related to throttling: It can happen that all
background tasks detect that they should not produce more work because
of throttling (!CanAcceptWork()). Reducing the number of running
background tasks is done in a later step (OnBackgroundTaskStopped).
If the finisher task finishes all outstanding units between these two
calls, it will not schedule another background compilation task, but
all background compilation tasks will quit, hence compilation will
never finish.
Fixing this should allow us to reenable the 'wasm-finish-compilation'
test: https://crrev.com/c/999632R=ahaas@chromium.org
Bug: chromium:824681
Change-Id: I967e4d6b2917d369dd49bb80ce4bef552d10b371
Reviewed-on: https://chromium-review.googlesource.com/1002174
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52483}
Throttling of background compilation tasks is enabled in all paths
anyway (async compilation, parallel compilation). Hence remove the bool
to control that.
R=ahaas@chromium.org
Change-Id: Id5d4de38d22e1eb63c8864f41c219f4dd28429e0
Reviewed-on: https://chromium-review.googlesource.com/1002814
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52482}
CompilationState had three different mutexes, plus two atomic fields.
Not holding the right mutexes at the right time has already led to
failures. Hence, only use a single mutex to protect all shared state of
the CompilationState.
R=ahaas@chromium.org
Bug: chromium:824681
Change-Id: I2c414f3ddb75e82944621590493fadcbbdfb781c
Reviewed-on: https://chromium-review.googlesource.com/1000783
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52481}
This CL ensures that the frame pointer register is set to the innermost
frame for builtin continuations. To make this work, this CL contains a
temporary fix for NotifyDeoptimized, which needs to skip these frames
in order to obtain a valid JavaScript context.
Bug: v8:7584, v8:7639
Change-Id: I8ea318e5441950fdf45d909e1f3ee649daf38dca
Reviewed-on: https://chromium-review.googlesource.com/1001899
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52479}
This CL adds a forced GC point in Deoptimizer::MaterializeHeapObjects,
which will catch problems with deoptimized frames early and improve
reproducibility.
Bug: v8:7584
Change-Id: Idfad584e821b777542cf8fce673a9080c64d5d7b
Reviewed-on: https://chromium-review.googlesource.com/1002655
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52478}
For BuiltinContinuationFrames we stored the frame-height as a plain
value, which did not cause problems because height (in bytes) always
looks like a Smi to the GC. This CL introduces proper Smi encoding.
Bug: v8:7584
Change-Id: I5e3c41c2e576926bbb2bad7dbe0f277cc017b495
Reviewed-on: https://chromium-review.googlesource.com/1000782
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52476}
std::unique_ptr should never be passed by rvalue reference. This is
also not allowed by our style guide. Instead, just pass it by value.
R=ahaas@chromium.org
Bug: v8:7570
Change-Id: I525d3b4fd88e6ea47b22a517714a713dbb711ef8
Reviewed-on: https://chromium-review.googlesource.com/999419
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52475}
Builtins::IsOffHeapSafe is unused now that embedded builtins are
shipped in the snapshot.
A longer explanation: there used to be a difference between
IsOffHeapSafe and IsIsolateIndependent back at an earlier stage when
we still copied off-heap-safe builtins off the heap on isolate startup.
At that point, off-heap builtins didn't need to be isolate-independent,
e.g. they could still contain embedded external references.
Now that embedded builtins are shipped in the snapshot, this
distinction is no longer needed.
Bug: v8:6666
Change-Id: I0be6120b94b01480262f472f0904ea9037941e2a
Reviewed-on: https://chromium-review.googlesource.com/1002652
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52473}
The prologue checks if optimized code exists, and if not, continues
execution of the current function. Otherwise, it jumps to the address
specified in the native module's code_table.
Also-by: clemensh@chromium.org
Change-Id: If3e76de02115f44ab7758590a949c3f0965a11ca
Reviewed-on: https://chromium-review.googlesource.com/985837
Commit-Queue: Kim-Anh Tran <kimanh@google.com>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52471}
We hardcoded this accidentally in the original CL for the turbofan case,
instead we need to call JSConstructStubGeneric() which will return the
correct construct stub based on the harmony_restrict_constructor_return
flag.
Bug: chromium:829899
Change-Id: I6776a5daebd57d8881d926ad68595141312a877d
Reviewed-on: https://chromium-review.googlesource.com/1001893
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52470}
Replace direct calls to generated code with calls using GeneratedCode to
match the rest of v8.
BUG=v8:7164
Change-Id: I5d90bcb6e90d99e105be18886d4844b83f611b95
Reviewed-on: https://chromium-review.googlesource.com/1000416
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52467}
Remaining tests also lead to OOM, skip all of them on tsan stress
modes.
Bug: v8:7626
Change-Id: Ie2c128b9a718c7c34c974e628ba60e5549ea04fc
Reviewed-on: https://chromium-review.googlesource.com/1002552
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52466}
Currently a WeakMap key edge shows up as '<id> / WeakMap'. This patch
changes it to '<id> / key <KeyName> in WeakMap'.
Bug: chromium:827713
Change-Id: I0306bacdc331ab69739be88cf29d16a21187625f
Reviewed-on: https://chromium-review.googlesource.com/992035
Reviewed-by: Alexei Filippov <alph@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52465}
Currently these new functions are unused and untested, but will be used once
Torque is checked in. They are split off into this separate CL to ease rollback
of Torque if required.
Change-Id: If2b96f342011592ae7cd88a4f6d9a4f2acc3643e
Reviewed-on: https://chromium-review.googlesource.com/998171
Commit-Queue: Daniel Clifford <danno@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52460}
A DCHECK in TimeTicks::HighResolutionNow was replaced with
a warning to stop systems from crashing. This warning broke
parts of the Node.js test-suite on certain systems.
The warning has been replaced with a comment documenting
this situation and a TODO to ensure we don't lose track
of this code path.
Bug: v8:7617
Bug: chromium:809016
Change-Id: I5e3af8c31817291d264af861514f34e3e1af9af2
Reviewed-on: https://chromium-review.googlesource.com/997153
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Commit-Queue: Myles Borins <mborins@google.com>
Cr-Commit-Position: refs/heads/master@{#52458}
Replace all uses with V8_WARN_UNUSED_RESULT.
WARN_UNUSED_RESULT was defined in src/base/compiler-specific.h, which
includes include/v8config.h, which already defined
V8_WARN_UNUSED_RESULT.
R=mstarzinger@chromium.org
Bug: v8:7570
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I662072294605036ca5aa0c8fdaa0218ac5d95f23
Reviewed-on: https://chromium-review.googlesource.com/998893
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52457}
Merge the outer_scope_info and feedback_metadata fields on
SharedFunctionInfo. outer_scope_info is only used during parsing,
and feedback_metadata is only available after compilation, so the
two never exist at the same time. Thus, they can share a field slot.
The exception is un-compiling and re-compiling a function, where we
need the outer_scope_info again. Fortunately, the outer_scope_info
can be re-calculated from the SFI's scope_info.
Bug: v8:7606
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I6b97fefe859e89df75ad870da4a0bfa4b869772a
Reviewed-on: https://chromium-review.googlesource.com/992432
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52454}
The maximum number of background tasks to spawn can be computed
right in the constructor of the CompilationState, and is constant
afterwards. Additionally, we ensure to never start more background
tasks than the number of available compilation units.
R=ahaas@chromium.org
Change-Id: I430e9a28a0bd15166ed05d120782f182d10c3e44
Reviewed-on: https://chromium-review.googlesource.com/997652
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52451}
Port b158bfdc2f
Original Commit Message:
This is a reland of 63ecddc814
Original change's description:
> [runtime] Remove the construct_stub field of the SFI
>
> Don't dispatch based on the construct_stub field anymore. Rather than
> read it out and jump to the construct stub, we can switch on the
> builtin_id.
>
> Builtins will always have builtin_id as a Smi, so this signals we need
> to jump to JSBuiltinsConstructStub. The only exception is for uncompiled
> functions, which will have kCompileLazy as the builtin_id, but need to
> jump to the generic stub instead.
>
> API function calls will have a FunctionTemplateInfo in the SFI
> function_data field, and need to go to the builtins stub as well.
>
> The final case is everything else, which should go to the generic stub.
>
> Bug: v8:7503
> Change-Id: I14790a5f9784dc0d940bf10a05f5310026e1d482
> Reviewed-on: https://chromium-review.googlesource.com/980941
> Reviewed-by: Leszek Swirski <leszeks@chromium.org>
> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
> Commit-Queue: Peter Marshall <petermarshall@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#52345}
R=petermarshall@chromium.org, joransiu@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=
LOG=N
Change-Id: I53d92ea7326c5a0ffec25eef0972cdeb659848b6
Reviewed-on: https://chromium-review.googlesource.com/998018
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@{#52449}
If --wasm-num-compilation-tasks is set to 0, we spawn all background
tasks as foreground tasks. Semantically, they are still treated like
background tasks, but they will execute interleaved with the foreground
tasks. This should not deadlong since all foreground tasks eventually
return to the event loop.
R=ahaas@chromium.org
Bug: chromium:829681
Change-Id: Id57cbb10157c085acd57a3d30a0a43c824a64591
Reviewed-on: https://chromium-review.googlesource.com/999594
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52445}