This improves the performance of ExtractFixedArray and
CloneFastJSArray for double arrays, which in turn improve the
performance of cloning double arrays with slice() or spreading.
This, however, does not improve performance of spreading holey
double arrays, because spreading needs extra work to convert
holes to undefined.
Bug: v8:7980
Change-Id: Ib8aed74abbb0b06982a3b754e134fa415cb7de2d
Reviewed-on: https://chromium-review.googlesource.com/c/1280308
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Hai Dang <dhai@google.com>
Cr-Commit-Position: refs/heads/master@{#56680}
The InstructionSelector on x64 was missing the ability to properly match
comparisons of memory operands with zero, i.e. it used to turn something
like
Word32Equal(Load[Uint8](o, i), Int32Constant(0))
into
movzbl reg, [o,i]
cmp 0, reg
even requiring a temporary register. Now with this change it generates
the proper
cmpb [o,i], 0
sequence.
R=sigurds@chromium.org
Bug: v8:8238
Change-Id: I52a71bbf95c85e11cb275f0f4a5726a6873cde95
Reviewed-on: https://chromium-review.googlesource.com/c/1281342
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56677}
This bug does not affect the Torque run on tip-of-tree, but surfaced
in https://crrev.com/c/1196693.
The logic in Stack::DeleteRange was completely wrong and does not work
if the number of moved elements is bigger than the number of deleted
elements.
Change-Id: I5433b3b06e2e54646104493e9bc5e77b9763a521
Reviewed-on: https://chromium-review.googlesource.com/c/1282103
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56676}
This adds root-relative access in a couple of spots (e.g.: LoadRoot,
CompareRoot, PushRoot, Push, Move, etc.). Some methods now dispatch
based on whether the given Immediate is an embedded object.
ShouldGenerateIsolateIndependentCode() was added as a porting crutch:
it forces isolate-independent code for builtins even though the
builtin is not in the Builtins::IsIsolateIndependent() whitelist. This
allows us to easily figure out which builtins can be white-listed with
--print-embedded-builtin-candidates.
Newly isolate-independent builtins are now whitelisted.
Drive-by: Remove dead CompareRoot and JumpIfRoot helpers.
Bug: v8:6666
Change-Id: I6b5f6f71b90ac22e7e15482af0617b0ca1c319da
Reviewed-on: https://chromium-review.googlesource.com/c/1280665
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56673}
Change Heap::IterateStrongRoots to never iterate the read-only roots. In
doing so remove VISIT_ALL_BUT_READ_ONLY and
VISIT_ONLY_STRONG_FOR_SERIALIZATION. All such uses should now use
VISIT_ALL and VISIT_ONLY_STRONG. Where ReadOnlyRoots iteration is
required, this adds ReadOnlyRoots(isolate)->Iterate() at the call site.
Add new begin, end, strong_mutable_roots_begin and
strong_mutable_roots_end methods to RootsTable and try and make the
existing uses a little more consistent.
Bug: v8:8191
Change-Id: Ie9d0f9e5186db418428e2fafd38432b0bd879daa
Reviewed-on: https://chromium-review.googlesource.com/c/1278500
Commit-Queue: Dan Elphick <delphick@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56672}
As well as a few other things in JSNativeContextSpecialization.
Bug: v8:7790
Change-Id: Ic13abec45797bb4c6cc66a140180122529c7288d
Reviewed-on: https://chromium-review.googlesource.com/c/1280327
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56670}
If `out` is empty accessing `out.back()` is invalid.
TBR=yangguo@chromium.org
Bug: chromium:894934
Change-Id: I7286c5b6a9857f1cdb2bcaf383094bee65bac393
Reviewed-on: https://chromium-review.googlesource.com/c/1282565
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56669}
The code for the initialization of the wrapper promise was using the
generic InitializeJSObjectFromMap() helper, which generates a loop to
initialization all fields of some generic object. In this particular
case we're constructing a JSPromise, so we only need to initialize the
elements and properties pointers, since all the other fields are taken
care of by the PromiseInit() call on the next line anyways.
Bug: v8:7253, v8:8238
Change-Id: If11963d1f94607ed9e48788f597c81c7344aafbe
Reviewed-on: https://chromium-review.googlesource.com/c/1281602
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56665}
There's a AsyncBuiltinsAssembler::InitializeNativeClosure() helper which
is used by the `await` builtins to initialize the native closures, which
are registered as fulfill/reject handlers. This helper initializes a
JSFunction based on the builtin SharedFunctionInfo. Since we are dealing
with builtins here, there's no point in using the fully generic helper
CodeStubAssembler::GetSharedFunctionInfoCode(), but we can immediately
assume that the SharedFunctionInfo::function_data() field contains a Smi
builtin index (guarded by TNode CASTs).
This almost cuts the generated code size for the `await` builtins in a
half, and might also yield some performance improvements due to reduced
register and instruction cache pressure.
Bug: v8:7253, v8:8238
Change-Id: I3415c2f9e0f04a7154c4bf4c3fe8156854dbfe13
Reviewed-on: https://chromium-review.googlesource.com/c/1281604
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56662}
- Add a new Intl::ResolveLocale method and uses it in all the intl objects.
- Fix CanonicalizeLocaleList to call out to HasProperty as per spec.
- Add calls to CanonicalizeLocaleList where it was previously missing.
- Change CanonicalizeLocaleListJS calls to CanonicalizeLocaleList now
that we have migrated ResolveLocale.
Bug: v8:5751
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: I4249d2045c1556f18d570b00f7c92cbc3fa52077
Reviewed-on: https://chromium-review.googlesource.com/c/1270255
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Frank Tang <ftang@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56660}
This patch adds support for "gm.py android_arm.release.check"
and similar invocations.
Change-Id: I6e2204cb00f574d759b9e142ecabd2582153f707
Reviewed-on: https://chromium-review.googlesource.com/c/1278629
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56659}
This is in preparation of referencing this type from the code
generated by third_party/inspector_protocol/code_generator.py.
v8 will not use protocol::Binary, that is, the .pdl file for
v8 won't have binary fields. Therefore, we need not provide
an implementation for this type.
My overall WIP change is in here, and happy to explain more:
https://chromium-review.googlesource.com/c/chromium/src/+/1244719
Bug: chromium:891377
Cq-Include-Trybots: luci.chromium.try:linux_chromium_headless_rel;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I7336be5f6a60e6ad143290eca09dea59ff4b56a8
Reviewed-on: https://chromium-review.googlesource.com/c/1277714
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Johannes Henkel <johannes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56658}
Array.prototype.map is currently not preserving PACKEDness. Use a
for-loop instead.
Bug: v8:7980
Change-Id: I08aff1cbcd84b9de260a5a1e2c68b9cfb5c3d888
Reviewed-on: https://chromium-review.googlesource.com/c/1280329
Commit-Queue: Hai Dang <dhai@google.com>
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56657}
This switches the encoding of the exceptions (in the exceptions as well
as the import section) to use a signature index instead of a flat type
vector encoding. Note that only signatures that have a void return type
can be used for declaring exceptions.
R=clemensh@chromium.org
BUG=v8:8153
Change-Id: I481ccbce9ddf29becdf4ed7ceffe80d6145446e1
Reviewed-on: https://chromium-review.googlesource.com/c/1280323
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56654}
Adds a build-time flag to control enabling of V8 Lite mode. Currently
this mode enables optimize-for-size and makes that flag read-only so that
it can't be changed at runtime.
This mode also replaces the --minimal flag which was previously used
to make porting easier.
BUG=v8:8293
Change-Id: I8360b4d55dd15a2a7c18429c94329dc5264dea86
Reviewed-on: https://chromium-review.googlesource.com/c/1276467
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56653}
The race happens when the sweeper is looking up the size of an object
that had its map replaced concurrently.
The fix is to load the object map using an acquire load so that the
sweeper observes the initializing stores of the new map.
Bug: v8:8303
Change-Id: Ifaaef06cb815be7d07b6a574085ee61a466bc1d6
Reviewed-on: https://chromium-review.googlesource.com/c/1280310
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56652}
While this is mostly a mechanical change to enable re-visiting macros for
inlining, it has a few user-facing effects:
- Labels and (variables, parameters, local constants) are handled separately,
so they do not shadow each other.
- A local variable or constant is not bound in its initializer.
This allows code like:
const x = 5;
{
const x = x + 1;
}
Bug: v8:7793
Change-Id: I968e1f93d92689737362c803342a797d312e95cd
Reviewed-on: https://chromium-review.googlesource.com/c/1276628
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Daniel Clifford <danno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56649}
This removes the check for holeyness when using CopyFixedArrayElements,
because the function does not use that information.
Change-Id: I6033495bf00947ded083ebc24695f6c8bf4569d0
Reviewed-on: https://chromium-review.googlesource.com/c/1280763
Commit-Queue: Hai Dang <dhai@google.com>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56646}
Change-Id: I982f3615136c7a4ba18e4a6d2cc06a3e24e22f54
Reviewed-on: https://chromium-review.googlesource.com/c/1277722
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56645}
For serialization we are using the code table to find the code of all
functions. We want to serialize compiled code though, not interpreter
entries (we currently fail a DCHECK there).
This CL changes the logic to not update the code table with interpreter
entries but instead keeps a separate bit set of interpreted functions.
R=mstarzinger@chromium.org
Bug: v8:8177, chromium:735509
Change-Id: I69c59f92712135ddef667b54114614fad94cc6fc
Reviewed-on: https://chromium-review.googlesource.com/c/1278794
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56644}
Split the runtime function for initializing a promise into AwaitPromisesInit
and AwaitPromisesInitOld, the former not firing the INIT hook and being used
by the AwaitOptimized builtin. In addition to this the AsyncHooks now caches
all the previously inited promises and checks that the init hook is not fired
twice for the same promise.
Modified test expectations for the new async ids in the async hooks tests.
Bug: v8:8300
Change-Id: If4a17e501b2a233578fa70b6442f219473f001d9
Reviewed-on: https://chromium-review.googlesource.com/c/1280442
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56642}
This reverts commit 6ec90ecee2.
Reason for revert: causes a lot of Canary crashes (chromium:895208).
GC relies on an the fact that the transition array stays alive while it's owner map
is alive (this is needed in order to properly transfer descriptor array ownership
to the parent map when the map owning a shared descriptor array dies). We need to
rethink a way of caching the migration target shortcut.
Original change's description:
> Reland "Create a fast path to get migration target when updating map"
>
> This is a reland of c285380ca8
>
> Original change's description:
> > Create a fast path to get migration target when updating map
> >
> > During map updating, store the pointer to new map in the
> > raw_transitions slot of the old map that is deprecated from map
> > transition tree. Thus, we can get the migration target directly
> > instead of TryReplayPropertyTransitions when updating map.
> >
> > This can improve Speedometer2.0 Elm-TodoMVC case by ~5% on ATOM
> > Chromebook and ~9% on big-core Ubuntu.
> >
> > Change-Id: I56f9ce5183bbdd567b964890f623ef0ceed9b7db
> > Reviewed-on: https://chromium-review.googlesource.com/1233433
> > Commit-Queue: Shiyu Zhang <shiyu.zhang@intel.com>
> > Reviewed-by: Igor Sheludko <ishell@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#56303}
>
> Change-Id: Idf0b7716b92a6a15bfe58721c2c34dbd02b31137
> Reviewed-on: https://chromium-review.googlesource.com/c/1270261
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Commit-Queue: Shiyu Zhang <shiyu.zhang@intel.com>
> Cr-Commit-Position: refs/heads/master@{#56588}
TBR=ishell@chromium.org,shiyu.zhang@intel.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: Ie7e9b98395b041a1095da549d1cd71d7180a4888
Bug: chromium:895208
Reviewed-on: https://chromium-review.googlesource.com/c/1280223
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56641}
Port commit 23dbb81d8f.
Original CL message:
>This CL uses pc-relative jumps and calls (B/BL) for calls from embedded
>builtins to embedded builtins. To make this work, the code range size is
>limited to 32MB on arm during mksnapshot, which ensures that all builtin
>to builtin offsets for jumps/calls fit into the B/BL immediate. At code
>generation time, we put a placeholder into the instruction offset which
>we resolve to the right code object when the code is copied to the heap.
>We use a new relocation mode RELATIVE_CODE_TARGET for these relative jumps.
>The relocation mode RELATIVE_CODE_TARGET should never appear after
>generating the snapshot.
>
>We modify the target_address/set_target_address methods of RelocInfo
>such that they return the absolute target addresses for pc-relative B/BL
>instructions. This ensures that the GC can treat RELATIVE_CODE_TARGET in
>the same way as code targets. This, however, only matters during
>snapshot creation time, and production code never contains
>RELATIVE_CODE_TARGET relocations.
>
>Bug: v8:6666
>Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
>Change-Id: If7eab83ad588859ca87c654a5ddc3e37caea884c
>Reviewed-on: https://chromium-review.googlesource.com/1117181
>Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
>Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
>Reviewed-by: Jakob Gruber <jgruber@chromium.org>
>Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
>Cr-Commit-Position: refs/heads/master@{#54320}
This CL is completed Miran's draft without MIPS64 port.
(https://chromium-review.googlesource.com/c/v8/v8/+/1136640/3).
Change-Id: I979378ac445548641755968d890f7f4a82dc7986
Reviewed-on: https://chromium-review.googlesource.com/c/1221313
Commit-Queue: Ivica Bogosavljevic <ibogosavljevic@wavecomp.com>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Ivica Bogosavljevic <ibogosavljevic@wavecomp.com>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56640}
Irregexp code spills and restores ebx at boundaries, and clobbers it
inbetween. Root-relative loads are disabled in this region.
Bug: v8:6666
Change-Id: I9c68bc8ef88d324da609996a8457ac9e30a9b6fc
Reviewed-on: https://chromium-review.googlesource.com/c/1280762
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56639}
Callers of the ConcurrentMarking API should check the flags, which they were
already mostly doing.
Change-Id: Ie273bb740fe6d2b36dfb924ce813670ebd47bf3f
Reviewed-on: https://chromium-review.googlesource.com/c/1280307
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56638}
Some jobs might need to be aborted, e.g., if a function is a default parameter in an
arrow function it will be re-scoped and won't have a SFI to register. Adds support to
abort jobs without having to block if the job is currently running on the background
thread.
BUG=v8:8041
Change-Id: I9149740401cbaaa31c21be9d79d4e3f5c450bfcf
Reviewed-on: https://chromium-review.googlesource.com/c/1278497
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56637}
This is the first CL in a series that removes the StaticVariable operand.
Change-Id: I2acdbf4a7481af43321b8af10dbe38f8f481bea8
Bug: v8:6666
Reviewed-on: https://chromium-review.googlesource.com/c/1276365
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56635}
{IsAligned} is defined twice with exactly the same signature and
implementation: once in base/macros.h, once in utils.h.
This CL removes the definition from utils.h.
Note that utils.h includes macros.h, so no further changes are needed.
R=mlippautz@chromium.org
Bug: v8:8238
Change-Id: I589b00c01619d054ff39c717f728a2351b6c32ea
Reviewed-on: https://chromium-review.googlesource.com/c/1280206
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56632}
Since {Address} is just {uintptr_t}, we can just use the standard
{IsAligned} function.
R=mlippautz@chromium.org
Bug: v8:8238
Change-Id: I260591e88b50855cf327096a07b2c18f0c1e4508
Reviewed-on: https://chromium-review.googlesource.com/c/1280204
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56631}