Commit Graph

77249 Commits

Author SHA1 Message Date
Frank Tang
88a8b5358b [Temporal] Sync PR 2344 change BalanceDurationRelative by using newRelativeTo to store info
Spec Change PR:
https://github.com/tc39/proposal-temporal/pull/2344

Relative tests in test262 are
built-ins/Temporal/Duration/prototype/round/february-leap-year.js

Bug: v8:11544
Change-Id: Id31648436f629a8adf395e3b4c835adf46a2c455
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3855701
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82757}
2022-08-27 01:23:09 +00:00
Shu-yu Guo
31e17fe62d [shared-struct, api] Support shared isolates in API
Currently the ability to create shared isolates is partially exposed to
API. Instead of fully exposing it, this CL makes shared isolate and
shared heap handling transparent to the embedder.

If a flag that requires the shared heap is true (currently
--shared-string-table and --harmony-struct), the first isolate created
in the process will create and attach to a process-wide shared isolate.
Subsequent isolates will attach to that shared isolate. When that first isolate is deleted, the shared isolate is also deleted.

Bug: v8:12547
Change-Id: Idaf2947bc354066c44f2d10243e10162b1b7e4d6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3848825
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Owners-Override: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82756}
2022-08-26 23:41:57 +00:00
Frank Tang
8ff03afee0 Revert "[Temporal] Use double/int32_t instead of int64_t for duration parsing"
This reverts commit a165e82ea7.

Reason for revert: SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../../src/objects/js-temporal-objects.cc:3837:22  

Original change's description:
> [Temporal] Use double/int32_t instead of int64_t for duration parsing
>
> Use double instead of int64_t and int32_t in duration parsing result
> so we can parse very large duration fields as infinity and throw RangeError in later stages. The three fractional parts can hold up value from 0 to 999,999,999 so we use int32_t to hold it. Other part could be infinity so we use double to hold it. Also rearrange the order of the three int32_t in the struct ParsedISO8601Duration after all the double
>
> Bug: v8:11544
> Change-Id: I7e5b02f7c7bbb60997f1419f016aed61dd3e0d6c
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3840761
> Reviewed-by: Shu-yu Guo <syg@chromium.org>
> Commit-Queue: Frank Tang <ftang@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#82754}

Bug: v8:11544
Change-Id: Ia9d0a014463b00640d43b051753a554f42171c2b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3858575
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82755}
2022-08-26 22:44:17 +00:00
Frank Tang
a165e82ea7 [Temporal] Use double/int32_t instead of int64_t for duration parsing
Use double instead of int64_t and int32_t in duration parsing result
so we can parse very large duration fields as infinity and throw RangeError in later stages. The three fractional parts can hold up value from 0 to 999,999,999 so we use int32_t to hold it. Other part could be infinity so we use double to hold it. Also rearrange the order of the three int32_t in the struct ParsedISO8601Duration after all the double

Bug: v8:11544
Change-Id: I7e5b02f7c7bbb60997f1419f016aed61dd3e0d6c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3840761
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82754}
2022-08-26 21:28:29 +00:00
Matthias Liedtke
ee9b0f9f02 [wasm-gc] Debugger: Provide type info for structs and arrays in tables
This change also modifies the way references are typed: Instead of
using the static type (which may be a generic type like anyref) the
actual type based on the referenced object is used.
While this is very useful for arrays and structs (and somewhat nice for
i31 not just being a number but also having some type information), it
means for non-null values that the reference type is "not nullable",
so it will show e.g. "ref $type0" although the static type  might be
"ref null $type0".

Bug: v8:7748
Change-Id: I00c3258b0da6f89ec5efffd2a963889b1f341c3a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3852485
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Matthias Liedtke <mliedtke@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82753}
2022-08-26 14:51:20 +00:00
Matthias Liedtke
b592c968e0 [wasm-gc] Internalize JS init value in Table::grow(number, init_value)
This change follows up on 3cc931543f on which Table::grow() was missed.

Bug: v8:7748
Change-Id: I83dc4e4894354ad8c97e577da03d67a36f6d9443
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3858227
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Auto-Submit: Matthias Liedtke <mliedtke@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82752}
2022-08-26 14:46:37 +00:00
Milad Fa
fb6d80facd PPC [liftoff]: Implement a number of Simd ops
- LoadCallerFrameSlot
- StoreCallerFrameSlot
- LoadReturnStackSlot
- MoveStackValue
- Spill
- Fill

Change-Id: I5fee06a60b36ec145b4d35d59ede35bb849e57b8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3851544
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#82751}
2022-08-26 14:28:21 +00:00
Jakob Kummerow
c75d6b7a57 Revert "[turbofan][x64] When spilling 32bit values, reload only 32 bits"
This reverts commit adb5e163ac.

Reason for revert: ClusterFuzz ain't happy. (crbug.com/1356461 and others)

Original change's description:
> [turbofan][x64] When spilling 32bit values, reload only 32 bits
>
> When we spill a register that we know contains only 32 interesting bits
> and then reload it from the spill slot, it's enough to reload its lower
> half. This may save a few bytes, and guards against accidental changes
> to the upper half (e.g. via pointer decompression).
>
> Bug: v8:13216
> Change-Id: I1d950d6e33d8ae94cf385af4f3e1db028bf333c5
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3854506
> Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
> Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#82704}

Bug: v8:13216
Change-Id: I8923cbe00c73191f2fdd51f361d7cd073f338a00
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3859323
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#82750}
2022-08-26 14:13:28 +00:00
Jakob Kummerow
9c445c7c51 [wasm-gc] Fix TF scheduling of inlined call_ref sequence
For the branching control flow structure we set up for feedback-directed
inlining-capable `call_ref` sequences, we have to manually take care of
the "instance cache nodes" in the SSA environment.

Drive-by: improve Runtime_WasmTierUpFunction to process type feedback,
making it usable for the included regression test.

Fixed: v8:13230
Change-Id: I06a449ad73af90b96d0cc15c3cb9a0e4bed87be6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3859326
Reviewed-by: Matthias Liedtke <mliedtke@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82749}
2022-08-26 13:56:36 +00:00
Leszek Swirski
453abb7c9b [maglev] Re-enable maglev code on the FBV
Change the has-optimized FeedbackVector bit to two bits, one for Maglev
and one for Turbofan. Ignition and Sparkplug can check both bits, while
Maglev will only check the Turbofan one.

Bug: v8:7700
Change-Id: I95f6e4326180cac02f127a97438f960950f09d82
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3856569
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82748}
2022-08-26 13:53:57 +00:00
Leszek Swirski
45019f34f3 [maglev] Include compile time in --trace-opt
Bug: v8:7700
Change-Id: I2860bea3008ea1d357cf7e89fb0453221f065786
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3859344
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82747}
2022-08-26 13:27:26 +00:00
Matthias Liedtke
8600d58092 [wasm-gc] Rename array.new_fixed_static -> array.new_fixed
This is a left-over of the removal of the dynamic (rtt-based)
variants.

Bug: v8:7748
Change-Id: I93bb74a72543a5697f1102d283c7d65c6be99466
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3856577
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Auto-Submit: Matthias Liedtke <mliedtke@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82746}
2022-08-26 13:11:38 +00:00
Victor Gomes
bcda1e7647 [cpp20] Fixes undefined behaviour on mid tier regalloc
Fixes undefined behavior, which manifests as a compiler error in C++20 in Google3.

This was caused by using members of vector<T> before T has been defined.
This change just massages the code a bit to get everything in the proper order.

See cl/468678068 on Google3.

Bug: chromium:1284275
Change-Id: I0b65e7f850e8dd1ed482be1b5cc0b8d9d77776eb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3859343
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82745}
2022-08-26 13:09:06 +00:00
Samuel Groß
32b7b8e903 [sandbox] Avoid double-initialization of external pointer fields
This is a reland of commit a31e8f242f

Remove the checking logic, which will be addressed in a separate CL.

Original change's description:
> [sandbox] Forbid double-initialization of ExternalPointerSlots
>
> Double initialization may cause the ExternalPointerTable compaction
> algorithm to behave non-optimally: Consider the case of an Entry E1 that
> is owned by a HeapObject O and is marked for evacuation during GC
> marking. In that case, a new entry E2 is allocated for it, and during
> sweeping, E1 will be evacuated into E2 and the Handle in O updated to
> point to E2. However, if a new entry E3 for O is allocated before
> sweeping, then during sweeping E3 (instead of E1) will be moved into E2.
> This may then violate the invariant that the compaction algorithms
> always evacuates an entry out of the evacuation area.
>
> This CL therefore forbids double initializaiton of external pointer
> slots and adds DCHECKs to attempt to catch these in debug builds.
>
> Bug: v8:10391
> Change-Id: I128dc930e8b3f863dab18ba648f34d68d8cb276b
> Cq-Include-Trybots: luci.v8.try:v8_linux64_heap_sandbox_dbg_ng,v8_linux_arm64_sim_heap_sandbox_dbg_ng
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3856563
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Commit-Queue: Samuel Groß <saelo@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#82729}

Bug: v8:10391
Change-Id: I6cef79f4adc340fdcdc291ad0f0c2210f5bf48cd
Cq-Include-Trybots: luci.v8.try:v8_linux64_heap_sandbox_dbg_ng,v8_linux_arm64_sim_heap_sandbox_dbg_ng
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3857423
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Samuel Groß <saelo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82744}
2022-08-26 13:05:37 +00:00
Feng Yu
1bd68aa9e1 [test] Migrate cctest/compiler/test-run-jsops to unittests/
Bug: v8:12781
Change-Id: I0c1234c5a649f3533eebbab89f7fe16140327d59
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3858927
Commit-Queue: Feng Yu <f3n67u@gmail.com>
Reviewed-by: Nikolaos Papaspyrou <nikolaos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82743}
2022-08-26 11:07:32 +00:00
Victor Gomes
b3051413d7 [maglev] Fixes LookupExceptionHandlerInTable
Maglev uses a different safepoint table. This CL introduces the
functions FindReturnPCForTrampoline for MaglevFrame and TurboFanFrame.

Bug: v8:7700, chromium:1356902
Change-Id: I90784ddfdc96604c5ada8047e6f7447c17e6c3aa
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3859342
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82742}
2022-08-26 10:38:56 +00:00
Qifan Pan
6fb86b9788 [turbofan] Support BigIntDivide
Bug: v8:9407
Change-Id: I29f8f5ec68f09e8631b59d3a6a2926bab3b3bcd3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3845638
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Qifan Pan <panq@google.com>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82741}
2022-08-26 08:51:36 +00:00
Liu Yu
9e1ecccfd3 [loong64][mips64][builtins] Streamline API calls
Port commit 1e5c03c78e

Bug: v8:11880
Change-Id: I706056509c2d23e6d57203aba7adcbcbe22607cf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3859164
Reviewed-by: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Auto-Submit: Liu Yu <liuyu@loongson.cn>
Cr-Commit-Position: refs/heads/main@{#82740}
2022-08-26 08:11:56 +00:00
Hao Xu
2298b35f7c [x64][codegen] Reduce kX64Shr to kX64Shr32
This allows x64 to select shrl instead of shrq instruction for the
below pattern:

  2: ChangeUint32ToUint64(1)
  3: Int64Constant[2]
  4: Word64Shr(2, 3)

Change-Id: I3278b9ab52dd7212d1a616291d114a6bff0d13d8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3857740
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Hao A Xu <hao.a.xu@intel.com>
Cr-Commit-Position: refs/heads/main@{#82739}
2022-08-26 08:05:06 +00:00
Leon Bettscheider
ae44450b49 [heap] Fix data race in YoungGenerationMarkingVisitorBase
This CL fixes a data race that was found using TSAN.

Bug: v8:13012
Change-Id: Ic29620edce116effea097a9f1d58532ba93b2224
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3857424
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Leon Bettscheider <bettscheider@google.com>
Cr-Commit-Position: refs/heads/main@{#82738}
2022-08-26 07:45:16 +00:00
Lu Yahan
f8aebf8002 Reland "[riscv] Port [heap] Add shared barrier to RecordWrite builtin"
This is a reland of commit 59d7cf5259

Original change's description:
> [riscv] Port [heap] Add shared barrier to RecordWrite builtin
>
> Bug: v8:11708
>
> Change-Id: I803b5499f1bbc3f7b4e626628a73f98239df8454
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3854435
> Auto-Submit: Yahan Lu <yahan@iscas.ac.cn>
> Commit-Queue: ji qiu <qiuji@iscas.ac.cn>
> Reviewed-by: ji qiu <qiuji@iscas.ac.cn>
> Cr-Commit-Position: refs/heads/main@{#82710}

Bug: v8:11708
Change-Id: I56fcfc8a92c71463bce22a8090e161173cc2c64c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3857980
Commit-Queue: ji qiu <qiuji@iscas.ac.cn>
Auto-Submit: Yahan Lu <yahan@iscas.ac.cn>
Reviewed-by: ji qiu <qiuji@iscas.ac.cn>
Cr-Commit-Position: refs/heads/main@{#82737}
2022-08-26 07:02:47 +00:00
v8-ci-autoroll-builder
72a108434d Update ICU (trusted)
Rolling v8/third_party/icu: 31c77cb..bbdc7d8

Add microsecond and nanosecond unit (Frank Tang)
https://chromium.googlesource.com/chromium/deps/icu/+/bbdc7d8

R=v8-waterfall-sheriff@grotations.appspotmail.com,mtv-sf-v8-sheriff@grotations.appspotmail.com,ftang@chromium.org

Change-Id: I2d996e16a0e3e52c1de237eb13ca656829ff3d0c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3857874
Commit-Queue: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Bot-Commit: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#82736}
2022-08-26 04:20:36 +00:00
Yahan Lu
8b6e23ccd7 Revert "[riscv] Port [heap] Add shared barrier to RecordWrite builtin"
This reverts commit 59d7cf5259.

Reason for revert: wrong port

Original change's description:
> [riscv] Port [heap] Add shared barrier to RecordWrite builtin
>
> Bug: v8:11708
>
> Change-Id: I803b5499f1bbc3f7b4e626628a73f98239df8454
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3854435
> Auto-Submit: Yahan Lu <yahan@iscas.ac.cn>
> Commit-Queue: ji qiu <qiuji@iscas.ac.cn>
> Reviewed-by: ji qiu <qiuji@iscas.ac.cn>
> Cr-Commit-Position: refs/heads/main@{#82710}

Bug: v8:11708
Change-Id: I0e091b2eb086c87e7c60b9840d19b7c383124e42
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3857979
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Yahan Lu <yahan@iscas.ac.cn>
Auto-Submit: Yahan Lu <yahan@iscas.ac.cn>
Cr-Commit-Position: refs/heads/main@{#82735}
2022-08-26 03:37:38 +00:00
Milad Fa
84e9de321b PPC/s390: [builtins] Streamline API calls
Port 1e5c03c78e

Original Commit Message:

    This CL simplifies the API calls by removing some instructions from
    the most common path.

R=ishell@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
BUG=
LOG=N

Change-Id: I989c7da21347dc8a081b55ecea6374d3415d4aa3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3857444
Reviewed-by: Joran Siu <joransiu@ca.ibm.com>
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82734}
2022-08-26 02:42:13 +00:00
Frank Tang
4b14efad61 [Temporal] Add Calendar.prototype.weekOfYear
Also add AO: ToISOWeekOfYear

Spec Text:
https://tc39.es/proposal-temporal/#sec-temporal.calendar.prototype.weekofyear
https://tc39.es/proposal-temporal/#sec-temporal-toisoweekofyear

Note- this is only the non-intl version. intl version in
https://tc39.es/proposal-temporal/#sup-temporal.calendar.prototype.weekofyear
will be implemented in later cl.

PR https://github.com/tc39/proposal-temporal/pull/2378

Sync spec text for ToISODayOfYear and ToISODayOfWeek
in the comment and add DCHECK for assertion.


Bug: v8:11544
Change-Id: If07ff76551707d17d125e41bc624c12da6efa45a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3531567
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82733}
2022-08-26 02:18:06 +00:00
Samuel Groß
f7eda75efd Revert "[sandbox] Forbid double-initialization of ExternalPointerSlots"
This reverts commit a31e8f242f.

Reason for revert: Causes DCHECK failures with --stress-snapshot

Original change's description:
> [sandbox] Forbid double-initialization of ExternalPointerSlots
>
> Double initialization may cause the ExternalPointerTable compaction
> algorithm to behave non-optimally: Consider the case of an Entry E1 that
> is owned by a HeapObject O and is marked for evacuation during GC
> marking. In that case, a new entry E2 is allocated for it, and during
> sweeping, E1 will be evacuated into E2 and the Handle in O updated to
> point to E2. However, if a new entry E3 for O is allocated before
> sweeping, then during sweeping E3 (instead of E1) will be moved into E2.
> This may then violate the invariant that the compaction algorithms
> always evacuates an entry out of the evacuation area.
>
> This CL therefore forbids double initializaiton of external pointer
> slots and adds DCHECKs to attempt to catch these in debug builds.
>
> Bug: v8:10391
> Change-Id: I128dc930e8b3f863dab18ba648f34d68d8cb276b
> Cq-Include-Trybots: luci.v8.try:v8_linux64_heap_sandbox_dbg_ng,v8_linux_arm64_sim_heap_sandbox_dbg_ng
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3856563
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Commit-Queue: Samuel Groß <saelo@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#82729}

Bug: v8:10391
Change-Id: I37e6728cc16fe79fa7d743417dc9938d58fb0474
Cq-Include-Trybots: luci.v8.try:v8_linux64_heap_sandbox_dbg_ng,v8_linux_arm64_sim_heap_sandbox_dbg_ng
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3857422
Commit-Queue: Samuel Groß <saelo@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#82732}
2022-08-25 16:23:05 +00:00
Danylo Boiko
45cce9714b [turbolizer] Turboshaft nodes history fix
Bug: v8:7327
Change-Id: Ie10dd2b7fde80f100589b388644143e626b7e610
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3856570
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Danylo Boiko <danielboyko02@gmail.com>
Cr-Commit-Position: refs/heads/main@{#82731}
2022-08-25 15:45:50 +00:00
Patrick Thier
348adb07ca Prepare StringForwardingTable for external strings
- Move StringForwardingTable implementation to own compilation unit.
- Refactoring preparing for layout change (Introduce explicit record
  class to make transition from contiguous Tagged_t fields to a
  heterogeneous record layout easier).
- Replace RootVisitor pattern for transitioning/cleanup during GC with
  callback.
- Minor cleanups.

Bug: v8:12957
Change-Id: Iae343393f470130eac0c54148a1303b67fb95aa4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3845635
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Patrick Thier <pthier@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82730}
2022-08-25 15:17:49 +00:00
Samuel Groß
a31e8f242f [sandbox] Forbid double-initialization of ExternalPointerSlots
Double initialization may cause the ExternalPointerTable compaction
algorithm to behave non-optimally: Consider the case of an Entry E1 that
is owned by a HeapObject O and is marked for evacuation during GC
marking. In that case, a new entry E2 is allocated for it, and during
sweeping, E1 will be evacuated into E2 and the Handle in O updated to
point to E2. However, if a new entry E3 for O is allocated before
sweeping, then during sweeping E3 (instead of E1) will be moved into E2.
This may then violate the invariant that the compaction algorithms
always evacuates an entry out of the evacuation area.

This CL therefore forbids double initializaiton of external pointer
slots and adds DCHECKs to attempt to catch these in debug builds.

Bug: v8:10391
Change-Id: I128dc930e8b3f863dab18ba648f34d68d8cb276b
Cq-Include-Trybots: luci.v8.try:v8_linux64_heap_sandbox_dbg_ng,v8_linux_arm64_sim_heap_sandbox_dbg_ng
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3856563
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Samuel Groß <saelo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82729}
2022-08-25 15:05:31 +00:00
Michael Achenbach
047f91b898 [foozzie] Augment launcher script to bisect to bugs before Python3 switch
Bugs that are older than the switch of v8_foozzie.py to Python3
bisect to the switch commit unfortunately. This change attempts to
let bisect run longer if a python2 executable still exists.

No-Try: true
Bug: chromium:1355824
Change-Id: I457a50af21704ddd2985793861eee8be5601a673
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3856574
Reviewed-by: Liviu Rau <liviurau@google.com>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82728}
2022-08-25 14:28:39 +00:00
Dominik Inführ
4d66d9a526 [heap] No need for snapshotting protocol on ThinStrings
ThinStrings are not transitioned to other string representations, so we
shouldn't need the snapshotting protocol for them.

Change-Id: I17cee1a4171b10c441a005ac29bd232a0a065207
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3852489
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82727}
2022-08-25 13:49:51 +00:00
Victor Gomes
f6b4e6ceff [maglev] Preparation to support exception handlers
This does not enable exception handlers yet, we still bail out in
MaglevCompiler::Compile if we have an exception handler table in
the bytecode array.

This CL:
- Generates code for exception handler blocks (which previously were
set as dead code)
- Creates a machinery for nodes to set the property CanThrow
- Reads the exception handler table from the bytecode array and
identifies if we're emitting nodes inside a try-block and for which
handler we should jump in case of an exception
- Generates an exception handler table for Maglev code


Change-Id: Ifc9d4cb7440d3222f4fda48a86e4e482340b3b15
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3854061
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82726}
2022-08-25 13:44:05 +00:00
Feng Yu
64ca6cc4f0 [test] Migrate cctest/test-temporal-parser to unittests/
Bug: v8:12781
Change-Id: I281047a0606b8f709a930998ef7e7a53f780f59d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3840146
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Feng Yu <f3n67u@gmail.com>
Cr-Commit-Position: refs/heads/main@{#82725}
2022-08-25 13:01:48 +00:00
Feng Yu
c6a94381a9 Reland "[test] Migrate cctest/test-inspector to unittests/"
This is a reland of commit 437b311a18

Original change's description:
> [test] Migrate cctest/test-inspector to unittests/
>
> test-inspector.cc -> inspector-unittest.cc
>
> Bug: v8:12781
> Change-Id: I37d2bc2d023ffd91b94d5a09cdbfe4a6e22fecf1
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3813062
> Reviewed-by: Jakob Linke <jgruber@chromium.org>
> Commit-Queue: Jakob Linke <jgruber@chromium.org>
> Reviewed-by: Hannes Payer <hpayer@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#82512}

Bug: v8:12781
Change-Id: Iece26e724f21d459dd1e96423d3aa72f15c5424e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3837705
Commit-Queue: Feng Yu <f3n67u@gmail.com>
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82724}
2022-08-25 12:49:54 +00:00
Victor Gomes
c0c00ca9d5 [maglev] Use phi unicode symbol in maglev printer
Bug: v8:7700
Change-Id: I1cc74a53cde8594b3f0b116c7876e0d70139084c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3856583
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82723}
2022-08-25 12:41:20 +00:00
Leszek Swirski
a25aa43e84 [cleanup] Remove --stress-opt
--stress-opt never did what we wanted it to; it ran its runs in
different contexts (therefore not able to share feedback across runs),
and even if it didn't, each run would create new closures for any
defined closures, so we'd still more than likely end up poly- or
mega-morphic.

Fuzzers cover this use case better than --stress-opt ever did, so now
it's just using precious bot time. We can get rid of it.

Bug: v8:10386
Change-Id: Ibbb9207d887b4b1dc4ec9093858d477c0f95eb37
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3803228
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82722}
2022-08-25 12:26:24 +00:00
Igor Sheludko
8809950ef3 Revert "Reland "[ext-code-space] Enable Code-less embedded builtins""
This reverts commit c89998d9ad.

Reason for revert: a lot of unexpected memory regressions that
require investigation.

Original change's description:
> Reland "[ext-code-space] Enable Code-less embedded builtins"
>
> This is a reland of commit 40901824d7
> The Ubsan issue is fixed here: https://chromium-review.googlesource.com/c/v8/v8/+/3849038.
>
> Original change's description:
> > [ext-code-space] Enable Code-less embedded builtins
> >
> > Bug: v8:11880, v8:12592
> > Change-Id: I8d3d6ad0a4c26eb1fea2a998ffeddd1d96afa690
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3784593
> > Commit-Queue: Igor Sheludko <ishell@chromium.org>
> > Reviewed-by: Jakob Linke <jgruber@chromium.org>
> > Cr-Commit-Position: refs/heads/main@{#82642}
>
> Bug: v8:11880, v8:12592
> Change-Id: I66373d6af30b060d1204b952d733e260228548df
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3846493
> Commit-Queue: Igor Sheludko <ishell@chromium.org>
> Reviewed-by: Jakob Linke <jgruber@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#82683}

Bug: v8:11880, v8:12592, chromium:1356329
Change-Id: I07aaf714da8d7afc66cf4116f189dd5dde5b8818
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3856357
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#82721}
2022-08-25 11:52:37 +00:00
Al Muthanna Athamina
ee58c57b9c Skip unpredictable tests on predictable builders
Bug: v8:13234
No-Try: true
Change-Id: I63a5402ce5e4419972e0d6728c7615a341398648
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3855450
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Auto-Submit: Almothana Athamneh <almuthanna@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82720}
2022-08-25 11:29:55 +00:00
Feng Yu
c48e39153a Reland "[test] Migrate cctest/test-global-handles to unittests/"
This is a reland of commit 3615ae691d.

Original change's description:
> [test] Migrate cctest/test-global-handles to unittests/
>
> Bug: v8:12781
> Change-Id: If7681564f3e0c087e3347557a3f9169625b51607
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3817621
> Reviewed-by: Camillo Bruni <cbruni@chromium.org>
> Commit-Queue: Igor Sheludko <ishell@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#82633}

Bug: v8:12781
Change-Id: I776ab176733722fd8853deaabec93e0d44274d9c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3855979
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82719}
2022-08-25 10:22:02 +00:00
ishell@chromium.org
1e5c03c78e [builtins] Streamline API calls
This CL simplifies the API calls by removing some instructions from
the most common path.

Bug: v8:11880
Change-Id: Id8a62c35af51947ad2c152e093346d03c8e2f508
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3855039
Auto-Submit: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82718}
2022-08-25 10:01:40 +00:00
Feng Yu
ae9d62ea88 Reland "[test] Migrate cctest/test-weakmaps to unittests/"
This is a reland of commit d83346befb

Original change's description:
> [test] Migrate cctest/test-weakmaps to unittests/
>
> Bug: v8:12781
> Change-Id: Ief6bd7ee0ff2876e19970b2fb6af4f3208ec7f4e
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3815486
> Commit-Queue: Leszek Swirski <leszeks@chromium.org>
> Reviewed-by: Leszek Swirski <leszeks@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#82699}

Bug: v8:12781
Change-Id: I9f74c32b924433dea67f62e26a336ef7263282e7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3856096
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82717}
2022-08-25 09:36:11 +00:00
Tom Anderson
2dd434f4db Fix build with -Wextra-semi
Bug: chromium:1355871
Change-Id: I7c465e7ce326c62cbc8ad92e2547eea78d23fe0b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3852443
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Thomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82716}
2022-08-25 09:19:28 +00:00
Vasili Skurydzin
823f2a6e91 Aix: Avoid using Malloc::GetUsableSize
Change-Id: I99b4c5d9ea6183acf629f5f76ebb0f84c88e7b20
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3855198
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Milad Farazmand <mfarazma@redhat.com>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82715}
2022-08-25 08:12:39 +00:00
Clemens Backes
538f7bd720 [flags] Restrict the types we use for FlagValue
Add static asserts that we only use specific types for flag values.
Also, document that string values are not be frozen yet, and add TODOs
to fix that.

R=cbruni@chromium.org

Bug: v8:12887
Change-Id: I7367108810f0c6463509f744c5cefd9392c469fb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3852487
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82714}
2022-08-25 08:07:43 +00:00
Leszek Swirski
d9e0603c27 Revert "[test] Migrate cctest/test-weakmaps to unittests/"
This reverts commit d83346befb.

Reason for revert: Seems to be breaking TSAN bot (https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64%20TSAN%20-%20stress-incremental-marking/8867/overview)

Original change's description:
> [test] Migrate cctest/test-weakmaps to unittests/
>
> Bug: v8:12781
> Change-Id: Ief6bd7ee0ff2876e19970b2fb6af4f3208ec7f4e
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3815486
> Commit-Queue: Leszek Swirski <leszeks@chromium.org>
> Reviewed-by: Leszek Swirski <leszeks@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#82699}

Bug: v8:12781
Change-Id: Ia20078e9f40d0e2257cf0b953ddd2e72594c4085
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3855938
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#82713}
2022-08-25 07:03:08 +00:00
Liu Yu
776c95f3b7 [loong64][mips64][heap, baseline] Implement shared write barrier
Port commit 805df68f56

Bug: v8:11708
Change-Id: I1a6970d18f1991e4158edb41ec5b8e393fccba4c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3855696
Auto-Submit: Liu Yu <liuyu@loongson.cn>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Reviewed-by: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/main@{#82712}
2022-08-25 07:02:05 +00:00
Clemens Backes
3e9f46e8b4 Revert "[flags] Rename v8_flags to FLAGS"
This reverts commit d84b4664fa.

Reason for revert: Fails "Mutable Constants" check on android-binary-size: https://ci.chromium.org/ui/p/chromium/builders/try/android-binary-size/1211670/overview

For details about this check, see https://chromium.googlesource.com/chromium/src/+/main/docs/speed/binary_size/android_binary_size_trybot.md#Mutable-Constants

Original change's description:
> [flags] Rename v8_flags to FLAGS
>
> Team members expressed concerns that "v8_flags" is easier to miss in the
> code than the previous "FLAG_" syntax. After a poll and discussions we
> decided to rename the struct to "FLAGS", so the new syntax for
> addressing flag values is "FLAGS.foo" instead of the previous
> "FLAG_foo".
>
> R=​cbruni@chromium.org
> CC=​jkummerow@chromium.org
>
> Bug: v8:12887
> Change-Id: I51af4aa7fd5a3b3c29310c0cb4c4ff42086ff012
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3854508
> Commit-Queue: Clemens Backes <clemensb@chromium.org>
> Reviewed-by: Camillo Bruni <cbruni@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#82701}

Bug: v8:12887
Change-Id: I75516a0be9bc475afa2bbaa96a05e8a9b5be9be7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3855936
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82711}
2022-08-25 06:39:25 +00:00
Lu Yahan
59d7cf5259 [riscv] Port [heap] Add shared barrier to RecordWrite builtin
Bug: v8:11708

Change-Id: I803b5499f1bbc3f7b4e626628a73f98239df8454
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3854435
Auto-Submit: Yahan Lu <yahan@iscas.ac.cn>
Commit-Queue: ji qiu <qiuji@iscas.ac.cn>
Reviewed-by: ji qiu <qiuji@iscas.ac.cn>
Cr-Commit-Position: refs/heads/main@{#82710}
2022-08-25 06:05:03 +00:00
Michael Lippautz
6ee0e4c4fd cppgc: Fix DCHECK in statistics collection
Resident set size may be smaller than the recorded size in
StatsCollector due to discarded memory.

Change-Id: I7e052fc4412afc64dc1ed5be6ed7dc9271e6f9d2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3855204
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Anton Bikineev <bikineev@chromium.org>
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82709}
2022-08-25 06:04:00 +00:00
Tobias Tebbi
d75a0eed1c [base] allow inlining of hash_combine to improve performance
This improved Turboshaft value numbering performance
significantly in local testing.

Change-Id: I8b8c8e3a67da9b83b57efc34c08ca693e84d9076
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3852486
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Auto-Submit: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82708}
2022-08-24 18:58:27 +00:00