Commit Graph

1956 Commits

Author SHA1 Message Date
Jeremy Roman
018e370041 [api] Correct comment on deprecated v8::String::IsExternal.
Bug: v8:10641
Change-Id: I9248c6877ead34e622b94cd32959b6570f824e15
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2390442
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Auto-Submit: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69678}
2020-09-02 15:18:48 +00:00
Camillo Bruni
9d413c635d [api] Deprecate misleading v8::String::IsExernal method
v8::String::IsExternal is confusing since it only checks for external
two byte strings. The goal is to reintroduce String::IsExternal which
checks for one and two byte external strings after removing the old,
misleading api method.

- Add String::IsExternalTwoByte
- Deprecate String::IsExternal for now since it is misleading


Bug: v8:10641
Change-Id: I8989de7576c823846e0536fc1898e769b6d68c87
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2284495
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69674}
2020-09-02 13:35:20 +00:00
Gus Caplan
d4d0cf3262 [api] add reflection apis for v8::Data
Allows reflection of v8::Data types, such as being able to check if a
value is a v8::Module. This is useful for libraries which wrap the V8
API, such as rusty_v8.

Change-Id: I4841c5f7f60885b20e1504c8562e278844ff7ec3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2382719
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Gus Caplan <snek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69649}
2020-09-01 16:31:59 +00:00
Clemens Backes
0ab923b8c0 [API] Add missing include for <atomic>
{std::atomic} is being used in the header without including the <atomic>
header. It was reported on the v8-users list that this causes compile
errors on Windows.

R=ulan@chromium.org

Change-Id: I1de19c301ce47787628416bf0e744d0dd7507fa3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2387562
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69633}
2020-09-01 07:46:09 +00:00
Santiago Aboy Solanes
9c5eed71c7 [unwinder] Delete the old unwinder API
The new one was created in
https://chromium-review.googlesource.com/c/v8/v8/+/1969900, and the old
API was deprecated in
https://chromium-review.googlesource.com/c/v8/v8/+/2110015, so now we
can remove it.

Bug: v8:8116
Change-Id: Ia839279609b412c36f1f17368acef23fe07e7c61
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2369174
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69536}
2020-08-24 10:36:59 +00:00
Yuki Shiino
5488d2dbd8 minor tidy up of v8/include/v8.h
Moves a forward declaration of v8::CFunction to the appropriate
position.

Change-Id: I9ea8c7697a0abd39a0c8fdc536aae0417e04cafe
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2359091
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Yuki Shiino <yukishiino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69424}
2020-08-17 12:25:13 +00:00
Dominik Inführ
2e37bfc5b9 [heap] Move external memory counters back into Heap
Move external memory counters out of IsolateData back into Heap.
The class ExternalMemoryAccounting now stores all counters and is
responsible for updates. This change will allow turning counters into
atomic variables.

Bug: v8:10315
Change-Id: I2abeda298d3cfcc630fd04ca78a3d6d703e3b419
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2346647
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69356}
2020-08-12 12:27:17 +00:00
Shu-yu Guo
a36f40cb3f [atomics] Remove the deprecated Atomics.wake
The Intent to Deprecate and Remove was sent in March 2019:
https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/_zPuM7ETNSE

Current use of Atomics.wake is at <0.0002% of page loads:
https://chromestatus.com/metrics/feature/timeline/popularity/2556

Bug: v8:7883
Change-Id: I4534df6cb88e0afbeae655254d6ce48ad7b462e7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2333349
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Ben Smith <binji@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69317}
2020-08-10 23:02:17 +00:00
Andreas Haas
c392760843 [api] Add API function Isolate::HasPendingBackgroundTasks
This CL adds an API function that tells the embedder if there is ongoing
background work that will eventually post foreground tasks.

Design doc: https://docs.google.com/document/d/18vaABH1mR35PQr8XPHZySuQYgSjJbWFyAW63LW2m8-w

R=adamk@chromium.org

Bug: v8:10787
Change-Id: I9060c5cdc9dbafeb7ea7c5c26d09c2dc744800bd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2342847
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69312}
2020-08-10 17:10:36 +00:00
Santiago Aboy Solanes
d855a6aa03 [heap] Remove DeferredHandles instrumentation
Now that we are using PersistentHandles, we don't need it anymore.

Bug: v8:7790
Change-Id: Id0b9d555191c00fb08dc2bb9099746076c5ad1b7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2332161
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69278}
2020-08-06 15:57:48 +00:00
Omer Katz
75d4b18a77 heap: Fix TracedReference::IsEmptyThreadSafe again
reinterpret_cast to std::atomic was missing const.

Bug: chromium:1108537
Change-Id: Ib737418bddbef6774deafa9714b0efcf2e3fd07c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2332797
Auto-Submit: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69194}
2020-08-03 09:37:02 +00:00
Ulan Degenbaev
260ec99599 [ukm] Rename v8::Context::Token to v8::metrics::Recorder::ContextId
Chrome is currently adding a 128-bit V8ContextToken to keep track of
V8 contexts across multiple isolates and processes. Having per-isolate
token exposed by V8 leads to confusion of these two tokens.

This moves v8::Context::Token to v8::metrics::Recorder and changes
the corresponding functions:
- v8::Context::GetToken => v8::metrics::Recorder::GetContextId
- v8::Context::GetByToken => v8::metrics::Recorder::GetContext

This CL is purely mechanical and does not change the behaviour.

Bug: chromium:1101749
Tbr: clemensb@chromium.org
Change-Id: I31bbfa02ebab1c0d91b00f0d08c1b236392d14d2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2330023
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Emanuel Ziegler <ecmziegler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69188}
2020-08-01 14:16:11 +00:00
Omer Katz
84be14c245 heap: Fix TracedReference::IsEmptyThreadSafe
* GetThreadSlot was missing const (Blink CL failed to build).
* Aligning IsEmptyThreadSafe implementation with IsEmpty.

Bug: chromium:1108537
Change-Id: I9c07e9a0e7f029cf3d70b4d2507900b600d064cc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2330027
Auto-Submit: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69157}
2020-07-31 07:20:58 +00:00
Omer Katz
af92046ad3 heap: Use atomic writes in TracedReference.
Bug: chromium:1108537
Change-Id: I82a64d57432b7e0854a3787f309c85477d37f701
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2327910
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69142}
2020-07-30 12:12:16 +00:00
Bill Budge
80396fd3e5 Revert "[api] Add a SharedArrayBuffersEnabled callback."
This reverts commit 76b53b66b0.

Reason for revert: Can't be used easily in embedder (Chromium).

Original change's description:
> [api] Add a SharedArrayBuffersEnabled callback.
> 
> - Adds a SharedArrayBuffersEnabled callback and uses it to
>   enable/disable SABs per context. The feature flag is used
>   if no callback is registered.
> 
> Bug: chromium:923807
> Change-Id: I4d3472fcd79b158cb50dc98793aece6dbbb81d93
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2316901
> Reviewed-by: Adam Klein <adamk@chromium.org>
> Commit-Queue: Bill Budge <bbudge@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#69057}

TBR=bbudge@chromium.org,adamk@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: chromium:923807
Change-Id: I6e3ddfa9cd64ba3106b4a75ea7a5185f873facc9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2326952
Reviewed-by: Bill Budge <bbudge@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69134}
2020-07-29 18:47:17 +00:00
Emanuel Ziegler
367da30543 [ukm] Add framework for collecting event-based metrics
Add a framework for collecting event-based metrics like UKMs in V8
that is independent of the actual implementation.

Design doc: https://docs.google.com/document/d/1vCZQCh4B05isqwJOwTPv7WqcnVp4KJITMgsHSBg35ZI/

R=ulan@chromium.org

Bug: chromium:1101749
Change-Id: If3a5b954d1f0bcee4e06a03467b651feae378a5f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2288231
Commit-Queue: Emanuel Ziegler <ecmziegler@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69098}
2020-07-28 12:09:21 +00:00
Bill Budge
76b53b66b0 [api] Add a SharedArrayBuffersEnabled callback.
- Adds a SharedArrayBuffersEnabled callback and uses it to
  enable/disable SABs per context. The feature flag is used
  if no callback is registered.

Bug: chromium:923807
Change-Id: I4d3472fcd79b158cb50dc98793aece6dbbb81d93
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2316901
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69057}
2020-07-24 18:15:02 +00:00
Georg Neis
b8e51d9307 [modules] Allow import.meta callback to throw
It makes no sense to allow calling into V8 but at the same time insist
that there must be no exception, as potentially any such call can result
in a stack overflow.

This CL only removes a comment from v8.h, the code changes were part of
https://chromium-review.googlesource.com/c/v8/v8/+/2299375.

Bug: v8:7044
Change-Id: I57769fa0f109219d07a7bdb979b46ca98cd0cec7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2306792
Auto-Submit: Georg Neis <neis@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68999}
2020-07-22 15:02:06 +00:00
Marijn Kruisselbrink
0c1a75ee23 Expose async iterator prototype.
Exposes initial_async_iterator_prototype the same way that
initial_iterator_prototype is exposed, to let blink implement
async iterables better.

Bug: chromium:1087157
Change-Id: I94f65eedb3aad0bf62cb4808935f320fe4bf4e9c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2300779
Commit-Queue: Marijn Kruisselbrink <mek@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68921}
2020-07-17 16:30:11 +00:00
Camillo Bruni
3353502322 [api] Fix TryCatch comment
TryCatch creates normal handles for Exception and Message objects.

Bug: v8:10537
Change-Id: I6ccd531242bfdc7a97ff5d8314d2f31086a28b07
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2284490
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68764}
2020-07-09 17:31:08 +00:00
Ulan Degenbaev
10fdca843d [heap, api] Add a memory measurement mode that doesn't force GC
By default the v8::MeasureMemory API forces GC after some timeout.
There are use cases that require low overhead measurements without
forcing GC at all.

Change-Id: I7d57c552d78d86800c4f37acb680c70c6422477f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2257856
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68718}
2020-07-07 15:14:31 +00:00
Kim-Anh Tran
b7bbe0af0f [v8] Change TypedArray max length definition for 32 bit builds
This makes the 4GB max length compilable for 32 bit MSVC.

Bug: chromium:1095721
Change-Id: I2be9f69668687f18beb86028debb3fd5ff350202
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2272558
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68637}
2020-07-01 15:32:11 +00:00
Alex Turner
de05e68e3e [api] Add a ScriptId getter for Module objects
There is currently no API call that allows access to the id of the
script underlying a Module. As this function can only be used for
SourceTextModules, we also add IsSourceTextModule() and
IsSyntheticModule() to allow callers to distinguish them.

Bug: v8:10616
Change-Id: Ia55ea8e6993922b695019852e38ca54ffce32cbf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2248199
Reviewed-by: Georg Neis <neis@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Alex Turner <alexmt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68487}
2020-06-23 16:23:15 +00:00
Dan Elphick
6574a7133d [Respect] Rename lists
This changes black/white list to block/allow list.

Bug: v8:10619
Change-Id: Id55d72f90891670ca57b62dfeb6b3251025927dc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2257228
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68464}
2020-06-22 15:15:31 +00:00
Kim-Anh Tran
94dd3e992e [v8] Allow for 4GB TypedArrays
Increase TypedArray.kMaxLength by 1.

Bug: chromium:1095721
Change-Id: Ic3668ff4e71cfd1289eda495333c4aae62c44795
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2249668
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68424}
2020-06-19 06:52:21 +00:00
Daniel Bevenius
f08cbfdc40 Suppress cast-function-type in PersistentBase::SetWeak
This issue was seen in Node.js when compiling with GCC. It can also
been see if building V8 using GCC and enabling -Wcast-function-type
in BUILD.gn:
  "-Wcast-function-type",

There are unit tests in V8 that produce this warning, for example
test/cctest/test-global-handles.cc (formatted to fit the commit
message width):
g++ -MMD -MF obj/test/cctest/cctest_sources/test-global-handles.o.d
...
In file included from ../../include/v8-inspector.h:14,
                 from ../../src/execution/isolate.h:15,
                 from ../../src/api/api.h:10,
                 from ../../src/api/api-inl.h:8,
                 from ../../test/cctest/test-global-handles.cc:28:
../../include/v8.h:
In instantiation of ‘void v8::PersistentBase<T>::SetWeak(
    P*,
    typename v8::WeakCallbackInfo<P>::Callback,
    v8::WeakCallbackType)
[with
  P = v8::Global<v8::Object>;
  T = v8::Object;
  typename v8::WeakCallbackInfo<P>::Callback =
  void (*)(const v8::WeakCallbackInfo<v8::Global<v8::Object> >&)
]’:
../../test/cctest/test-global-handles.cc:292:47: required from here
../../include/v8.h:10750:16: warning:
cast between incompatible function types from
‘v8::WeakCallbackInfo<v8::Global<v8::Object> >::Callback’ {aka
‘void (*)(const v8::WeakCallbackInfo<v8::Global<v8::Object> >&)’} to
‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’}
[-Wcast-function-type]
10750 |                reinterpret_cast<Callback>(callback), type);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This commit suggests adding a pragma specifically for GCC to suppress
this warning.

Bug: v8:8735
Change-Id: I5dd2dccf215a7fd2f6dd14993368cc5cbb6c71e5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2080361
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68320}
2020-06-12 13:01:10 +00:00
Thibaud Michaud
fe201c34db [wasm] Add use counters for anyref, bulk memory and multi value
R=clemensb@chromium.org

Bug: v8:10549
Change-Id: I516d35b0810ce147b568c1b8e32eb084753614e8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2235697
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68294}
2020-06-10 15:15:21 +00:00
Daniel Bevenius
04210bb8bf Fix two minor typos in v8.h
Change-Id: Iea3514074fb7c5669ec2b766f8234a6545164759
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2213423
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68050}
2020-05-28 16:46:56 +00:00
Junha Park
c3112fc2ff Added API to verify version match on snapshot blob
This patch added an IsValid method to StartupData which returns a
boolean upon verifying a given snapshot matches the v8 version.
Embedders can use this API now to check snapshots' versions.

This was originally done by Snapshot::CheckVersion, which now simply
runs Startup::IsValid.

Bug: v8:8104
Change-Id: If555bcc55de4a05adf61798cd58d9ea8c8a71302
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2178091
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Auto-Submit: Junha Park <jpark3@scu.edu>
Cr-Commit-Position: refs/heads/master@{#67951}
2020-05-25 08:52:48 +00:00
Igor Sheludko
f67131e500 [sandbox][api] Introduce Internals::GetIsolateForHeapSandbox()
... for the cases when the Isolate is necessary only for external
pointers decoding. This will avoid unnecessary calls to non-inlined
IsolateFromNeverReadOnlySpaceObject().

Bug: v8:10391
Change-Id: I0a299c8a44d5845f26cf704ce53555bf07c93f8d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2198978
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67771}
2020-05-13 09:42:00 +00:00
Omer Katz
fff219bff7 heap,cppgc: Update StackState enum values
This CL adds 2 new values to the EmbedderStackState enum with more
explicit names. The old values are updated as aliases to the new
values and marked as soon to be deprecated. This CL also moves the
enum to v8-platform.h so that it can be reused by cppgc.

Depracating individual values in an enum is supported by GCC only
since version 6. Thus new macros were needed for the deprecation
(which delegate to the existing macros when supported). GCC versions
older than 6 are still used by the CQ bots.

Bug: chromium:1056170
Change-Id: Id1ea73edfbbae282b0d8a3bb103dbbbf8ebd417e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2188971
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67744}
2020-05-12 12:07:27 +00:00
Shu-yu Guo
df8b8117a9 Add use counter for var redeclarations of catch bindings
Bug: v8:10516
Change-Id: I0a75b32ca4b90dc5a6c2f2f3ec66b183dc3ff99e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2191411
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67724}
2020-05-11 22:50:24 +00:00
Deepti Gandluri
9c546d8fe0 [wasm-simd] Add use counter for SIMD opcodes
This CL adds use counters, as well as the callbacks needed to
register usage during the SIMD origin trial.

Change-Id: I35b7f48277b519b72136f86cf03508adbaa069b8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2189334
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67690}
2020-05-08 19:14:00 +00:00
Georg Neis
5bf4772878 [modules] Disallow throwing in import.meta callback
... via a comment in the API and a CHECK in
Isolate::RunHostInitializeImportMetaObjectCallback.

Also restructure things a little bit such that
this function really just runs the callback and
doesn't deal with module internals. Memoization
now happens in the SourceTextModule class.

Bug: v8:7044
Change-Id: I5b850ae629c3638c4b30dfdeaa996642a33d14dc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2190413
Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Auto-Submit: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67682}
2020-05-08 14:18:40 +00:00
Nico Hartmann
c64b52a892 [sandbox] Wire ExternalString resource through bottleneck
Bug: v8:10391
Change-Id: Ic92cdaca38c2181427cc12ec5e572d5964afe704
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2152647
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67601}
2020-05-06 12:35:46 +00:00
Michael Lippautz
4570ce146c heap: Introduce EmbedderHeapTracer::kForced
The flag is used by V8 to propagate information on whether this GC was
somehow forced.

This allows the embedder using EmbedderHeapTracer to easily figure out
whether a GC was forced based on a local flag without depending on GC
prologue/epilogue callbacks.

Bug: chromium:1074061
Change-Id: Ic04c93ae58da854e54c6da1ca4aac03b5ab49897
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2182473
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67567}
2020-05-05 15:38:09 +00:00
Samuel Groß
961c21b1ca [sandbox] Access external pointers in embedder slots via bottlenecks
Bug: v8:10391
Change-Id: I55d4d33820c83711d3ea3c6a2f3a20a36707fe36
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2151354
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67566}
2020-05-05 15:27:49 +00:00
Dan Elphick
4cab8099cd [ro-heap] Remove ReadOnlyHeap::Instance
This removes the static ReadOnlyHeap::Instance method replacing it with
PopulateReadOnlySpaceStatistics on the way to removing the global
ReadOnlyHeap object.

Bug: v8:10454
Change-Id: Ic78c898ff99c6a7dac023d2b5230fbbbf6f36f46
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2179805
Commit-Queue: Dan Elphick <delphick@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Auto-Submit: Dan Elphick <delphick@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67545}
2020-05-04 16:32:41 +00:00
Thibaud Michaud
7b582b615e [wasm] Store the source URL in CompiledWasmModule
This allows us to preserve the script URL when importing a module in a
worker.

R=ahaas@chromium.org,clemensb@chromium.org
CC=kimanh@chromium.org

Bug: chromium:1064548
Change-Id: Id5e48c840e2dba8eadb5c854fcb389787ce11215
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2167866
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67543}
2020-05-04 15:07:21 +00:00
Shu-yu Guo
de4c0042cb [weakrefs] Remove deprecated FinalizationGroup V8 API
Bug: v8:8179
Change-Id: I16170a197028beb35309b15613004b29a956896c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2171696
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Auto-Submit: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67492}
2020-04-30 10:18:05 +00:00
Ulan Degenbaev
92a44876bd Reland "[heap] Skip memory reducer on AdjustAmountOfExternalAllocateMemory"
This is a reland of 7ae30cb7b6

Original change's description:
> [heap] Skip memory reducer on AdjustAmountOfExternalAllocateMemory
>
> V8 performs GC based on external memory limit. Additionally triggering
> memory reducing GCs may be problematic for large heaps and increases
> the chances of multiple V8 isolates performing GCs after
> IsolateInBackgroundNotification.
>
> Bug: chromium:1072746
>
> Change-Id: I7649a176504803ba666e6367b008593bbcfe6312
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2159488
> Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Reviewed-by: Hannes Payer <hpayer@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#67398}

Bug: chromium:1072746
Tbr: mlippautz@chromium.org,hpayer@chromium.org
Change-Id: Ieccd77c868a8b5d5613e6c4b7e70fdb4bcff3044
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2165763
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67409}
2020-04-27 19:47:05 +00:00
Clemens Backes
920a53b6b6 Fix LINT exceptions across the code base
The category name changed in https://crrev.com/c/2159690 (in
depot_tools), hence presubmit tests start failing whenever someone
touches a file which still refers to the old category.

R=zhin@chromium.org
TBR=machenbach@chromium.org

No-Try: true
No-Tree-Checks: true
Change-Id: I62813a42d63e512d421c4fe94229d04a56056978
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2165760
Reviewed-by: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67403}
2020-04-27 16:37:04 +00:00
Zhi An Ng
cf74836599 Revert "[heap] Skip memory reducer on AdjustAmountOfExternalAllocateMemory"
This reverts commit 7ae30cb7b6.

Reason for revert: https://ci.chromium.org/p/v8/builders/ci/V8%20Presubmit/10185

Original change's description:
> [heap] Skip memory reducer on AdjustAmountOfExternalAllocateMemory
> 
> V8 performs GC based on external memory limit. Additionally triggering
> memory reducing GCs may be problematic for large heaps and increases
> the chances of multiple V8 isolates performing GCs after
> IsolateInBackgroundNotification.
> 
> Bug: chromium:1072746
> 
> Change-Id: I7649a176504803ba666e6367b008593bbcfe6312
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2159488
> Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Reviewed-by: Hannes Payer <hpayer@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#67398}

TBR=ulan@chromium.org,hpayer@chromium.org,mlippautz@chromium.org

Change-Id: I008b1a0db2b4902190a6fa7e0861b5366f25b7fd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1072746
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2168113
Reviewed-by: Zhi An Ng <zhin@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67400}
2020-04-27 16:22:36 +00:00
Jakob Gruber
054f5f69e5 Revert "Add counter to track Date::getTimezoneOffset()."
This reverts commit 14ebea15a4.

Reason for revert: CountUsage() can't be called without a C entry frame.

Note this counter was never hooked up in chromium. Besides removing the
problematic CountUsage() call, this CL also makes the call path more
robust against similar future issues by adding {gc,handle,js} disallow
scopes.

Original change's description:
> Add counter to track `Date::getTimezoneOffset()`.
>
> Bug: chromium:915620
> Change-Id: I75579080098632639b125b2252b3ab9615c7ea95
> Reviewed-on: https://chromium-review.googlesource.com/c/1379876
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Commit-Queue: Mike West <mkwst@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#58306}

TBR=yangguo@chromium.org,mkwst@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Tbr: ulan@chromium.org
Bug: chromium:915620,v8:10460
Change-Id: I2dd2e14947fe527de24ea644b4b33897f437a119
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2165790
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67399}
2020-04-27 15:49:18 +00:00
Ulan Degenbaev
7ae30cb7b6 [heap] Skip memory reducer on AdjustAmountOfExternalAllocateMemory
V8 performs GC based on external memory limit. Additionally triggering
memory reducing GCs may be problematic for large heaps and increases
the chances of multiple V8 isolates performing GCs after
IsolateInBackgroundNotification.

Bug: chromium:1072746

Change-Id: I7649a176504803ba666e6367b008593bbcfe6312
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2159488
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67398}
2020-04-27 15:48:13 +00:00
Jakob Gruber
6d392516d8 Reland "[protectors] Add use counters to track invalidations"
This is a reland of 5241205835

Original change's description:
> [protectors] Add use counters to track invalidations
> 
> ... to make real world protector invalidations measurable.
> 
> Chromium CL: https://crrev.com/c/2149324
> 
> Drive-by: Add missing newline in protector tracing.
> Drive-by: Consistent naming for the regexp species protector.
> 
> Bug: v8:9496
> Change-Id: I3c7238aa8024e03ea9e89daf83345b8ec4f0d768
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2149428
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Commit-Queue: Jakob Gruber <jgruber@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#67149}

Bug: v8:9496
Change-Id: I3c97bfa747e8429569eaa09ea909de73fc377efa
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2151363
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67261}
2020-04-21 05:55:50 +00:00
Jakob Gruber
daf59562c4 Revert "[protectors] Add use counters to track invalidations"
This reverts commit 5241205835.

Reason for revert: Use counters are not the right approach, we
need histograms instead.

Original change's description:
> [protectors] Add use counters to track invalidations
> 
> ... to make real world protector invalidations measurable.
> 
> Chromium CL: https://crrev.com/c/2149324
> 
> Drive-by: Add missing newline in protector tracing.
> Drive-by: Consistent naming for the regexp species protector.
> 
> Bug: v8:9496
> Change-Id: I3c7238aa8024e03ea9e89daf83345b8ec4f0d768
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2149428
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Commit-Queue: Jakob Gruber <jgruber@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#67149}

TBR=ulan@chromium.org,jgruber@chromium.org

Change-Id: Ia36b598844fbad2166772298c2e2ec8f6b4f92b1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:9496
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2151358
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67170}
2020-04-16 11:36:10 +00:00
Yang Guo
fa3e37e511 [api] remove deprecated snapshot APIs
R=verwaest@chromium.org

Fixed: v8:7463
Change-Id: I3d0127865ad0430d38124c3ad8ed3bc63ba4e6d3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2149421
Auto-Submit: Yang Guo <yangguo@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67169}
2020-04-16 11:23:30 +00:00
Jakob Gruber
5241205835 [protectors] Add use counters to track invalidations
... to make real world protector invalidations measurable.

Chromium CL: https://crrev.com/c/2149324

Drive-by: Add missing newline in protector tracing.
Drive-by: Consistent naming for the regexp species protector.

Bug: v8:9496
Change-Id: I3c7238aa8024e03ea9e89daf83345b8ec4f0d768
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2149428
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67149}
2020-04-15 12:47:29 +00:00
Igor Sheludko
2db93c0233 [api] Add embedder-vs-V8 build configuration compatibility check
v8::V8::Initialize() will fail with meaningful error upon build
configuration mismatch.

Bug: v8:10041
Change-Id: Ic69ba68ef1764b356beef0f204fe58b45bae3c49
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2144953
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67116}
2020-04-14 14:13:39 +00:00