Commit Graph

56646 Commits

Author SHA1 Message Date
Jakob Gruber
d61a558a23 Reland "[regexp] Move AST-to-Node code to a dedicated file"
This is a reland of 811bfbbc56

Original change's description:
> [regexp] Move AST-to-Node code to a dedicated file
>
> Prior to this CL, jsregexp contains a bunch of things that are slightly
> related but would be cleaner in separate files, including: AST-to-Node
> transformations, the compiler implementation, and a debugging printer.
>
> This CL extracts AST-to-Node transformations.
>
> Bug: v8:9359
> Change-Id: I030cfca5c40cfd72e3a7abe2188e4654cfe2277c
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1655303
> Auto-Submit: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Commit-Queue: Jakob Gruber <jgruber@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#62148}

Tbr: yangguo@chromium.org
Bug: v8:9359
Change-Id: I68a16086dc56c9a059547033ca8bc1e9de1080db
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1658568
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62154}
2019-06-13 16:39:56 +00:00
Seth Brenith
a1462d9f07 [torque] Get rid of @noVerifier annotation on PromiseReactionJobTask
Include API-instantiated functions in the definition of Callable so
that PromiseReactionJobTask::handler can verify correctly. Also make
Callable verification stricter regarding JSProxy instances: they must
have the callable bit set.

Also update test-weak-references to use a different object type, since
FeedbackVector::optimized_code_weak_or_smi should never point to a
FixedArray.

Bug: v8:9311
Change-Id: I4242df993e381a75f5b53302fee8fd2b12e96d34
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1650563
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62153}
2019-06-13 16:24:10 +00:00
Mythri A
ccb7ff7524 [ic] Turn megamorphic when storing into an array with readonly length
The store element handlers don't check if the array length is writable
before updating the length. Since this is not expected to be a common
case no need of handling this in the element handlers. Just moving to
megamorphic would be sufficient.

Bug: chromium:967104
Change-Id: I7a7f9ea768266b9ffd6289328d61d2297d455619
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1658154
Commit-Queue: Mythri Alle <mythria@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62152}
2019-06-13 15:53:39 +00:00
Dan Elphick
b4be98d9db [codegen] Rename CallBuiltinPointer to CallBuiltinByIndex
Since TurboAssembler::CallBuiltinPointer actually takes the
builtin_index as input, rename the function to CallBuiltinByIndex.

Bug: v8:9183
Change-Id: I4958d96f18a48a2ec91525d80d597a35e45d5989
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1657915
Auto-Submit: Dan Elphick <delphick@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62151}
2019-06-13 15:49:49 +00:00
Darius Mercadier
f4ebc67405 Add FLAG_trace_gc_freelists and _verbose version
With this flag enabled, some statistics about the oldspace's freelists
(and free/used spaced in general) are printed before and after each
major garbage collection.

It is useful to get some intuition about fragmentation and debug
freelists. (This flag helped me track down the issues fixed by CLs
1647162 and 1648476)

Additionally, the verbose version (FLAG_trace_gc_freelists_verbose)
prints the freelists of each page of old_space.

Bug: v8:9329
Change-Id: Ifa80426bf9d97ac9950459154507a585b039326d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1655302
Commit-Queue: Darius Mercadier <dmercadier@google.com>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62150}
2019-06-13 15:06:04 +00:00
Leszek Swirski
ee279dc223 Revert "[regexp] Move AST-to-Node code to a dedicated file"
This reverts commit 811bfbbc56.

Reason for revert: Breaks noi18n build (https://ci.chromium.org/p/v8/builders/ci/V8%20Linux%20-%20noi18n%20-%20debug/27201)

Original change's description:
> [regexp] Move AST-to-Node code to a dedicated file
> 
> Prior to this CL, jsregexp contains a bunch of things that are slightly
> related but would be cleaner in separate files, including: AST-to-Node
> transformations, the compiler implementation, and a debugging printer.
> 
> This CL extracts AST-to-Node transformations.
> 
> Bug: v8:9359
> Change-Id: I030cfca5c40cfd72e3a7abe2188e4654cfe2277c
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1655303
> Auto-Submit: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Commit-Queue: Jakob Gruber <jgruber@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#62148}

TBR=yangguo@chromium.org,jgruber@chromium.org,petermarshall@chromium.org

Change-Id: I079e15b02d73d81aef806992f324f08d7008e367
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:9359
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1658160
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62149}
2019-06-13 15:05:01 +00:00
Jakob Gruber
811bfbbc56 [regexp] Move AST-to-Node code to a dedicated file
Prior to this CL, jsregexp contains a bunch of things that are slightly
related but would be cleaner in separate files, including: AST-to-Node
transformations, the compiler implementation, and a debugging printer.

This CL extracts AST-to-Node transformations.

Bug: v8:9359
Change-Id: I030cfca5c40cfd72e3a7abe2188e4654cfe2277c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1655303
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62148}
2019-06-13 14:40:08 +00:00
Sigurd Schneider
df13503dd3 [mjsunit] Disable newly introduced flaking test
Bug: v8:9360
Notry: true
Change-Id: Ic598601d18149bcde5660ae268e81936a3954f3c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1658151
Auto-Submit: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62147}
2019-06-13 14:10:52 +00:00
Mike Stanton
6345a24072 [Turbofan] Brokerize scope info access in promise call reductions
This is a first step in eliminating heap access from a bevy of promise
reductions in js-call-reducer.cc. We begin by recognizing calls to
the affected builtins at serialization time, then serializing what
data is necessary.

Bug: v8:7790
Change-Id: Iaa1581eee730e8d3610a97c71eed635f77029455
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1657921
Commit-Queue: Michael Stanton <mvstanton@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62146}
2019-06-13 13:36:02 +00:00
Mike Stanton
759bd180e1 [Turbofan] Brokerize the map inference class
There was a remaining TODO...

Bug: v8:7790
Change-Id: I82c65d4c1b636dbfe6f29ce35c195f4bb5ea1c08
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1657927
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Michael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62145}
2019-06-13 12:55:22 +00:00
Sigurd Schneider
66412e0f55 [arm64] Fix handling of handles in assembler
Previously, the handle's location was used as a proxy for the heap
object, i.e, we put the handle into the constant pool, to avoid the
need for GC visiting the constant pool entries during code generation.
The handle locations are replaced by the corresponding heap object
when the code is copied to the heap.

This CL changes the handling in the assembler: Instead of putting
in the handle location (which is a machine word) we put in a small
index number into a table. This will be useful for putting 32bit
constants into the constant pool.

This new approach also has the advantage that ordering the
constant pool entries by value produces a deterministic order
after this change.

Change-Id: Id47d56d487a0b64d1d1504a47937c8779ee02b13
Bug: v8:7703
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1648094
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62144}
2019-06-13 12:38:12 +00:00
Toon Verwaest
e79e81cdf5 [runtime] Throw RangeError if we try to get too many values or entries
Bug: chromium:973363
Change-Id: Id2e46702f73e901df5f26b764d98fb3d4f681a98
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1657914
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Auto-Submit: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62143}
2019-06-13 12:28:02 +00:00
Milad Farazmand
2bdbc1d33f ppc64, aix: Pass CallFrequency object by const reference to avoid value copy error.
Bug: v8:8193
GCC bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61976

Change-Id: Ia5ecf96ad409705e3d54fc77b081fc4907d0aa1e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1649711
Reviewed-by: Junliang Yan <jyan@ca.ibm.com>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#62142}
2019-06-13 12:20:53 +00:00
Jakob Gruber
6d990aee80 [execution] Extract interrupt scopes and stack guard
Refactor-only, this moves interrupt scopes and stack guard code into
their own dedicated files.

Change-Id: I5723a04786a04bba31a0da54622f3cd0b926ef07
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1655288
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62141}
2019-06-13 12:03:52 +00:00
Tamer Tas
b9a128f751 [infra] create a builder for pointer compression without dchecks
{V8 Linux 64 - pointer compression} builder uploads dchecks enabled builds.

This CL creates a new builder that compiles V8 without dchecks enabled.

This CL uses the inverted naming predicate {without dchecks} to avoid renaming
the existing builder to {with dchecks} to avoid doing renames over multiple
repositories for a temporary builder that we'll remove after the ptr compression
merge to master.

R=sergiyb@chromium.org
CC=machenbach@chromium.org

Bug: v8:9345
Change-Id: I9e8cc1a9eb59325fd8eecc8fdcd2778b4da005c0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1657922
Commit-Queue: Tamer Tas <tmrts@chromium.org>
Commit-Queue: Sergiy Belozorov <sergiyb@chromium.org>
Auto-Submit: Tamer Tas <tmrts@chromium.org>
Reviewed-by: Sergiy Belozorov <sergiyb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62140}
2019-06-13 11:59:12 +00:00
Pierre Langlois
b87f29e80c [tracing] Fix JSON format to mention "spaces" instead of "pages".
As shown in the commit description of https://crrev.com/c/1619763, the JSON
format was supposed to refer to a list of "spaces" and not "pages", this was a
typo.

Bug: v8:9186
Change-Id: I1a674dac8af4b27b7ee46041e8c7a533bad8e68b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1657917
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Pierre Langlois <pierre.langlois@arm.com>
Cr-Commit-Position: refs/heads/master@{#62139}
2019-06-13 11:17:27 +00:00
Mythri A
98696649d3 [ic] Remove a check on FLAG_lazy_feedback_allocation when updating caches
This check shouldn't have been there. Even with lazy feedback allocation
we still transition to pre-monomorphic from uninitialized. We could
remove pre-monomorphic states with lazy-feedback allocation but that
requires changes at several other places.

Change-Id: I8f878a83f0fe3200eb530a34a74811639dcdc153
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1634920
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62138}
2019-06-13 09:57:27 +00:00
Maya Lekova
77fa93ded9 Reland "[turbofan] Brokerize reduction of API calls"
This is a reland of ca10d2babe

Original change's description:
> [turbofan] Brokerize reduction of API calls
> 
> JSCallReducer::ReduceCallApiFunction is now heap access free.
> 
> Bug: v8:7790
> Change-Id: I5718d73589d0bed14149ef0bc084b8a6ab1b9b5b
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1624792
> Commit-Queue: Maya Lekova <mslekova@chromium.org>
> Reviewed-by: Georg Neis <neis@chromium.org>
> Reviewed-by: Michael Stanton <mvstanton@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#62014}

Bug: v8:7790
Change-Id: Idc6acd18f0bf703ed072353c17471b4067ff1e61
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1648236
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62137}
2019-06-13 09:09:09 +00:00
Sathya Gunasekaran
94498b45f0 [WeakRefs] Rename to KeepDuringJob, ClearKeptObjects
Align with the spec defined names.

Bug: v8:8179
Change-Id: I892a2627c7712112b47a87e7a658dc4066540482
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1655654
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62136}
2019-06-13 08:57:39 +00:00
Sathya Gunasekaran
8665a710ca [WeakRefs] Make unregister spec compliant
- Return true or false, not undefined
- Check that unregister token is an object

Bug: v8:8179
Change-Id: I1a4ff7730158dba16efb552fb2f4892c8d31412c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1653120
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62135}
2019-06-13 08:48:16 +00:00
Toon Verwaest
1ff4a0c426 [runtime] Make bitfield2 immutable across named property transitions
Swap bits between bitfield2 and bitfield3 so that bitfield2 doesn't change
across named property transitions. This will allow us to share bf1/bf2 through
the descriptor array.

Change-Id: I3579ae89189ae0729cd492db1afb29cf90981f6a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1657908
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62134}
2019-06-13 08:39:36 +00:00
Benedikt Meurer
44b5a52496 Reland "[ic] Fix typo in Runtime_CloneObjectIC_Miss."
This is a reland of 823795fc2b, the reason
for the revert was flushing out a bug that was now fixed independently in
https://chromium-review.googlesource.com/c/v8/v8/+/1655307

Drive-by-fix: Correct wrong offset in CloneObjectIC fast-path.

Original change's description:
> [ic] Fix typo in Runtime_CloneObjectIC_Miss.
>
> https://chromium-review.googlesource.com/1649554 introduced a typo into
> Runtime_CloneObjectIC_Miss, where it wouldn't update the IC state UNLESS
> the source map is deprecated, which is the wrong way around of course.
>
> Bug: chromium:973045, v8:7611, v8:9114, v8:9183, v8:9343
> Change-Id: I7d6e0709e66ce4aaaf4a628d64ab801b84c8993c
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1655291
> Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
> Commit-Queue: Toon Verwaest <verwaest@chromium.org>
> Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#62106}

Bug: chromium:973045, v8:7611, v8:9114, v8:9183, v8:9343
Change-Id: I763d9eeab95043bed3bc4849fc3ddcda7787169a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1655651
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62133}
2019-06-13 05:49:51 +00:00
Jakob Gruber
4e3b1874dd [execution] Only take a single lock while handling interrupts
StackGuard::HandleInterrupts used to take a lock for testing and
clearing each individual interrupt bit. This CL changes that to a
single read up front.

Slight behavioral changes:

1. A TERMINATE_EXECUTION interrupt is now handled first; we
immediately exit and preserve all other interrupts (in case V8 is
later resumed).
2. Since interrupts are read once, it is no longer possible to request
an interrupt *within* HandleInterrupts that will later be processed
within the same HandleInterrupts call.
3. Stack limits are reset immediately after reading the interrupt
bits, and prior to actually processing the interrupts.

Bug: v8:9328
Change-Id: I3048bb413213d11307df49e0014b64a2b43444e0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1653115
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62132}
2019-06-13 05:41:59 +00:00
v8-ci-autoroll-builder
449de1d9f1 Update V8 DEPS.
Rolling v8/build: 4b9a126..afe9cbd

Rolling v8/buildtools: 2e18a95..5b97b40

Rolling v8/buildtools/third_party/libc++/trunk: 5938e05..78822a6

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/4d6b614..727d7ca

TBR=machenbach@chromium.org,sergiyb@chromium.org,tmrts@chromium.org

Change-Id: I3e4002f3059491dabcdc10bb2caffacfd35bcc75
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1657450
Reviewed-by: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#62131}
2019-06-13 03:41:59 +00:00
Z Nguyen-Huu
8e0ef9b9a0 Add fast path for proxy with preventExtensions trap
ObjectPreventExtensions and ReflectPreventExtensions are now Torque builtins (previously CPP) and the Proxy path is implemented completely in Torque while everything else calls into runtime (and is thus a bit slower than previously).

Perf improvement in micro-benchmark JSTests/Proxies
Before:
PreventExtensionsWithoutTrap-Proxies(Score): 1978
PreventExtensionsWithTrap-Proxies(Score): 739

After:
PreventExtensionsWithoutTrap-Proxies(Score): 3017
PreventExtensionsWithTrap-Proxies(Score): 2044

Bug: v8:6664
Change-Id: I6505d730cea6b0d197f6f5d0540b39056c8b763d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1652688
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62130}
2019-06-12 20:57:31 +00:00
Andrey Lushnikov
7b1f0c4f6c [heapprofiler] QueryObjects: do not return objects retained by feedback information
This was originally reported at https://github.com/GoogleChrome/puppeteer/issues/4545

R=ulan, alph

Change-Id: I5134506e56cd40e49b358cd47590913b81013b6d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1649473
Commit-Queue: Andrey Lushnikov <lushnikov@chromium.org>
Reviewed-by: Alexei Filippov <alph@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62129}
2019-06-12 18:33:49 +00:00
Aleksei Koziatinskii
915aeab1b5 inspector: fix queryObjects when page contains JSModuleNamespace
JSModuleNamespace does not have well defined CreationContext: current
implementation of JSReceiver::GetCreationContext crashes on CHECK.

R=lushnikov@chromium.org,yangguo@chromium.org

Bug: none
Change-Id: Ie2c0bfa39117d42d81f9709c21376c177b18e5ba
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1652559
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62128}
2019-06-12 18:27:19 +00:00
Z Nguyen-Huu
a26adb2b41 Optimize array.map for sealed, frozen objects
Extend same approach for FastJSArray to FastJSArrayForRead in ArrayMap builtin

~6x perf improvement in micro-benchmark JSTests/ObjectFreeze
Before:
ArrayMap
ArrayMap-Numbers(Score): 0.0887

After:
ArrayMap
ArrayMap-Numbers(Score): 0.531

Bug: v8:6831
Change-Id: I06cba44ca4c9198977c6da522b782b61f9df04fa
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1653732
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62127}
2019-06-12 18:13:55 +00:00
Milad Farazmand
e18b2e11be PPC/s390: [counters] Introduce proper bottleneck for FunctionCallback.
Port ea4206556e

Original Commit Message:

    API calls made via the CallApiCallback builtin, which is used from the
    ICs and optimized code, are currently misattributed to the wrong counter
    InvokeFunctionCallback instead of FunctionCallback. In addition we don't
    use the C trampoline when only runtime call stats are enabled, but the
    Chrome DevTools profiler is not active, which means that these calls
    will not be attrituted properly at all, and that had to be worked around
    using all kinds of tricks (i.e. disabling fast-paths in ICs when RCS is
    active and not inlining calls/property accesses into optimized code
    depending on the state of RCS).

    All of this was really brittle and only due to the fact that the central
    builtin didn't properly check for RCS (in addition to checking for the
    CDT profiler). With this fix it's now handled in a central place and
    attributed to the correct category, so user code doesn't need to worry
    about RCS anymore and can just call straight into the fast-path.

    core hand-written native code with the API callback logic.

R=bmeurer@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=
LOG=N

Change-Id: I2d200be4544cf62393330bb2891b6ba6f088db68
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1655343
Reviewed-by: Junliang Yan <jyan@ca.ibm.com>
Reviewed-by: Joran Siu <joransiu@ca.ibm.com>
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#62126}
2019-06-12 16:59:25 +00:00
Milad Farazmand
04936d0959 PPC: Fixing the EmptyFreeListCategoriesRemoved test on pLinux and AIX
Original commit: 303ca9ac26

Change-Id: I276bc68253fe4cedecdd2a77db0e8dbbc998c1a5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1652504
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#62125}
2019-06-12 16:39:56 +00:00
Z Nguyen-Huu
aff557b61b add micro-benchmark of Array.map for frozen objects
Bug: v8:6831
Change-Id: I79cd1e25ddca17f0d5026bee737cd3fde0041e85
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1653733
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62124}
2019-06-12 16:37:07 +00:00
Seth Brenith
3834c6377c [torque] Stricter object field verification, part 1
This change adjusts object initialization order for a few classes so
that the GC can never see those objects in an invalid, partially-
initialized state.

AccessorInfo: Just zeros out a few fields upon construction. This is the
simplest case.

FunctionTemplateInfo: Slightly changes the order in which fields are
set, so that the Smi field is set ahead of the call to SetCallHandler,
which can GC. Also a pretty simple case.

JSListFormat, JSPluralRules, JSRelativeTimeFormat, JSSegmenter: The spec
requires that we start with OrdinaryCreateFromConstructor, which has
observable side effects (it fetches the prototype from the new.target).
So we split JSObject::New in half: the first half does all of the user-
visible things and returns a Map, which we can pass to the second half
when we're ready to actually allocate the object.

JSTypedArray: Extends the pattern from JSListFormat into Torque code:
start with a Map and don't allocate the object until we're ready to set
all of its properties.

Bug: v8:9311
Change-Id: Id7703e8a0727ec756c774cfbb56af787658a111a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1646844
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62123}
2019-06-12 16:16:55 +00:00
Sathya Gunasekaran
2f2657a6af [WeakRefs] Update cleanupSome to be spec compliant
Make sure to use the callback passed to cleanupSome

Bug: v8:8179
Change-Id: Ia5d90b56edf80e05bdaf0dc520b555c29042b64c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1655306
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62122}
2019-06-12 16:10:35 +00:00
Georg Schmid
45bf9d8fa9 [torque] Add support for variable offset loads to CSA Load Elimination
R=jarin@chromium.org, tebbi@chromium.org

Change-Id: Iec887aec4ae0fc477176a7431a1bd0de0775c060
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1645325
Commit-Queue: Georg Schmid <gsps@google.com>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62121}
2019-06-12 15:04:51 +00:00
Seth Brenith
98ba192d12 Use Torque-generated verifier for AllocationMemento
I originally marked AllocationMemento::allocation_site as @noVerifier
out of an abundance of caution because AllocationMemento::IsValid checks
whether allocation_site is an AllocationSite. However, I can't find any
way for allocation_site to not be an AllocationSite.

Bug: v8:9311
Change-Id: I8b7ab51978c90d9baff42dace28d176a1cd2921a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1653520
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#62120}
2019-06-12 14:53:53 +00:00
Mathias Bynens
c6a16c10dd [test] Add %PrepareForOptimization to even more tests
With bytecode flushing and lazy feedback allocation, we need to call
%PrepareForOptimization before we call %OptimizeFunctionOnNextCall,
ideally after declaring the function.

Bug: v8:8801, v8:8394, v8:9183
Change-Id: I3fb257282a30f6526a376a3afdedb44786320d34
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1648255
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62119}
2019-06-12 14:40:14 +00:00
Jakob Gruber
b0899cf8ab [regexp] Add wrapper header for arch-specific files
This adds regexp-macro-assembler-arch.h which contains the arch-specific
include dispatch.

Change-Id: Ibc2be8059d54b57afeed9b7ce244229ce1bd79bc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1655296
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62118}
2019-06-12 14:17:13 +00:00
Benedikt Meurer
e6f991c850 [debugger] Properly remove promises from prediction stack upon await.
Make sure that we pop the async function promise from the catch
prediction stack when `await`ing inside an async function, and
push it back onto the stack when we're resuming execution. This
is to ensure that we don't leak memory when there are suspended
async functions while navigating away to a new page.

Bug: chromium:968603
Change-Id: I004715bc95d426958f1a89ce76c4856da1d4ceee
Cq-Include-Trybots: luci.chromium.try:linux-rel,win7-rel
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1655652
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62117}
2019-06-12 14:04:03 +00:00
Toon Verwaest
2dba18ed83 [intl] Cleanup ascii char predicates
Reuse helpers and move generic functions to char-predicates

Change-Id: I63bf704bdd8e8cd788e80ad2d42b689527865e00
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1653118
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62116}
2019-06-12 13:42:41 +00:00
Georg Schmid
e1f91dbaff [turbofan] Extend BitcastTaggedToWord(BitcastWordToTaggedSigned(...)) elimination to BitcastTaggedSignedToWord
R=tebbi@chromium.org

Bug: chromium:973047
Change-Id: I33de86258e04140c6da8099a0d9e4aee3f74abe9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1655298
Commit-Queue: Georg Schmid <gsps@google.com>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62115}
2019-06-12 12:36:52 +00:00
Benedikt Meurer
80f7c4a85a [es9] Fix object cloning wrt. MutableHeapNumbers.
Previously the object cloning fast-path had a single loop which would
initialize the object _and_ at the same time clone MutableHeapNumbers.
But since that can trigger GCs, the heap verifier was a bit sad to see
double fields holding undefined values. This was flushed out by the CL
https://chromium-review.googlesource.com/1655291, which changed the GC
timing slightly and thus made the test crash in the verifier.

So instead of the one loop, we now have a second loop that takes care
of cloning any MutableHeapNumbers. This has the advantage that the first
loop can always run without write barriers.

Bug: chromium:964748, chromium:973045, v8:7611, v8:9114, v8:9183, v8:9343
Change-Id: I724a1c1e534243ce9ecde95bf0c07ca26363b515
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1655307
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62114}
2019-06-12 12:35:48 +00:00
Jakob Gruber
89ad50be1f [regexp] Rename interpreter files
bytecodes-irregexp.h -> regexp-bytecodes.h
interpreter-irregexp.{cc,h} -> regexp-interpreter.{cc,h}

Change-Id: I98ca9d5c3264ad0adbd280b93082aa3e01b45b67
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1655294
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62113}
2019-06-12 11:57:58 +00:00
Sigurd Schneider
4c0bf17eb5 [arm64,test] Generate code object in assembler tests
This is pre-work for a refactoring that changes how heap objects
are handled in the assembler: Currently, we put the handle location in
the constant pool, and replace these with the actual heap object when
we copy the code from the assembler's buffer to the heap.

In the future, we will put a small index in the constant pool, which
will ultimately enable 32bit constant pool slots for compressed heap
objects. This small index will be fixed up when we copy the code to
the heap.

This CL makes the assembler tests copy the code to the heap, which
ensures that the fix-up phase is actually run.

Change-Id: I80cd69dc57414a3bd0a27f8d558616aadcae05a2
Bug: v8:7703
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1647166
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62112}
2019-06-12 11:44:28 +00:00
Mike Stanton
648ff5627e [turbofan] JSHeapBroker logging respects --trace-turbo-filter
As a component of the wider Turbofan logging scheme, it makes sense
for JSHeapBroker logging to come through flags specified in the
OptimizedCompilationInfo class, which uses --trace-turbo-filter
to control which functions are logged.

Bug: v8:7790
Change-Id: I3b068d8be78867ab0bd9607dda9eca4123b9d7b1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1655297
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Michael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62111}
2019-06-12 11:02:38 +00:00
Leszek Swirski
510f4f2c12 Revert "[ic] Fix typo in Runtime_CloneObjectIC_Miss."
This reverts commit 823795fc2b.

Reason for revert: Breaks mjsunit/es9/regress/regress-904167 on bots (https://ci.chromium.org/p/v8/builders/ci/V8%20Linux%20-%20debug/26342)

Original change's description:
> [ic] Fix typo in Runtime_CloneObjectIC_Miss.
> 
> https://chromium-review.googlesource.com/1649554 introduced a typo into
> Runtime_CloneObjectIC_Miss, where it wouldn't update the IC state UNLESS
> the source map is deprecated, which is the wrong way around of course.
> 
> Bug: chromium:973045, v8:7611, v8:9114, v8:9183, v8:9343
> Change-Id: I7d6e0709e66ce4aaaf4a628d64ab801b84c8993c
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1655291
> Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
> Commit-Queue: Toon Verwaest <verwaest@chromium.org>
> Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#62106}

TBR=bmeurer@chromium.org,verwaest@chromium.org

Change-Id: Ie651523c556b220e57ec5e11e37b0a67936bb291
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:973045, v8:7611, v8:9114, v8:9183, v8:9343
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1655299
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62110}
2019-06-12 09:15:43 +00:00
Benedikt Meurer
ea4206556e [counters] Introduce proper bottleneck for FunctionCallback.
API calls made via the CallApiCallback builtin, which is used from the
ICs and optimized code, are currently misattributed to the wrong counter
InvokeFunctionCallback instead of FunctionCallback. In addition we don't
use the C trampoline when only runtime call stats are enabled, but the
Chrome DevTools profiler is not active, which means that these calls
will not be attrituted properly at all, and that had to be worked around
using all kinds of tricks (i.e. disabling fast-paths in ICs when RCS is
active and not inlining calls/property accesses into optimized code
depending on the state of RCS).

All of this was really brittle and only due to the fact that the central
builtin didn't properly check for RCS (in addition to checking for the
CDT profiler). With this fix it's now handled in a central place and
attributed to the correct category, so user code doesn't need to worry
about RCS anymore and can just call straight into the fast-path.

Drive-by-fix: Do the same for AccessorInfo getter calls, which share the
core hand-written native code with the API callback logic.

Bug: v8:9183
Change-Id: Id0cd99d3dd676635fe3272b67cd76a19a9a9cea4
Cq-Include-Trybots: luci.chromium.try:linux-rel,win7-rel
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1651470
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62109}
2019-06-12 09:04:38 +00:00
Nico Weber
c6e6c2c6c5 win: Make v8 build with /Zc:twoPhase, and improve a comment.
The C++ standard says that template functions should be parsed immediately,
and only type-dependent things should be deferred.

cl.exe (MSVC's compiler) instead deferred parsing of all template functions
until the end of the translation unit, and unreferenced template functions
are not parsed at all. clang-cl emulates cl.exe's behavior.

Recently, cl.exe (and clang-cl) grew a /Zc:twoPhase flag that opts in to the
standards-conforming behavior, and system headers are now clean enough
to build with this flag set.

This cleans up v8 to also build with this flag. There was just a single issue:
RecyclingZoneAllocator() is unused and contains invalid code: It calls
the superclass ctor using `ZoneAllocator(nullptr, nullptr)`, when it should
be doing `ZoneAllocator<T>(nullptr, nullptr)`. With /Zc:twoPhase, this is
now a parsing error. However, since the RecyclingZoneAllocator() default
constructor isn't used anywhere, just delete it.

Finally, improve the comment for ZoneAllocator's default constructor to
explain why it's needed on Windows.

Bug: chromium:969702
Change-Id: I7a516afde67fe090a512d7c7214a3c6932754aca
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1652503
Auto-Submit: Nico Weber <thakis@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62108}
2019-06-12 08:56:58 +00:00
Igor Sheludko
0ebc2b6d76 [ptr-compr][cleanup] Remove ROOT_PARAM, ROOT_VALUE and friends
... in favor of Isolate*. It seems that it's better to be uniform in
using Isolate* or isolate root value, so if we decide to pass isolate
root value instead of Isolate* it should better be done everywhere and
it will be a separate CL anyway.

Regarding the "optionality" of the isolate parameter - C++ compilers
are smart enough to optimize it away during inlining.

Bug: v8:9353
Change-Id: Idf86a792476f49393041ced1c54b8671f5b1794a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1653121
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62107}
2019-06-12 08:46:48 +00:00
Benedikt Meurer
823795fc2b [ic] Fix typo in Runtime_CloneObjectIC_Miss.
https://chromium-review.googlesource.com/1649554 introduced a typo into
Runtime_CloneObjectIC_Miss, where it wouldn't update the IC state UNLESS
the source map is deprecated, which is the wrong way around of course.

Bug: chromium:973045, v8:7611, v8:9114, v8:9183, v8:9343
Change-Id: I7d6e0709e66ce4aaaf4a628d64ab801b84c8993c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1655291
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62106}
2019-06-12 08:45:38 +00:00
Frank Tang
1945392a4e [Intl] Fix RegExp [\W] with i flag
Add special condiction in
ecma262 #sec-runtime-semantics-canonicalize-ch Step 3.g-h.

Bug: chromium:971636
Change-Id: Id533beb66749af6e38ee114cf79f995a1156df20
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1652795
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62105}
2019-06-12 06:18:08 +00:00