Commit Graph

1954 Commits

Author SHA1 Message Date
Gabriel Charette
4b13a22ff4 [V8 Platform] Introduce CallDelayedOnWorkerThread()
GetWorkerThreadsTaskRunner() was about to be phased out [1] but v8
r52818 landed ahead  of it.

Add CallDelayedOnWorkerThread() to the new worker thread API to support
this use case before phasing out GetWorkerThreadsTaskRunner()

[1] https://chromium-review.googlesource.com/c/v8/v8/+/978443

Implemented it in d8+cctest+default-platform right away to avoid
requiring a non-null Isolate* (and yet another transitional API).

R=ahaas@chromium.org, kozyatinskiy@chromium.org

Bug: chromium:817421
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I2bee08fee08cf15a664d31cc6817e21cebe1d140
Reviewed-on: https://chromium-review.googlesource.com/1033584
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52892}
2018-04-30 18:39:51 +00:00
Yang Guo
afd73a4856 [api] deprecate old code caching APIs that require source string.
R=jgruber@chromium.org

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I62955f95812a2c6ac04599c437971863a73af66d
Reviewed-on: https://chromium-review.googlesource.com/1014103
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52817}
2018-04-26 14:53:22 +00:00
Alexey Kozyatinskiy
e81b0db787 [runtime] added v8::Isolate::SafeForTerminationScope and isolate flag
When only_terminate_in_safe_scope flag is passed as CreateParams for
v8::Isolate, V8 does not trigger intrruption for termination if there
is no explicit SafeForTerminationeScope.
Scope enables termination only in direct v8 calls, any recursive calls
require explicit SafeForTerminationScope.

R=yangguo@chromium.org

Bug: chromium:820640
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Iac17e30a4b47aa84e70e9218ca0adca9d07f726e
Reviewed-on: https://chromium-review.googlesource.com/1025390
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52793}
2018-04-25 18:11:58 +00:00
Predrag Rudic
2393710a27 [bigint] Add big endian support for BigInts serialization
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I3fc1b53c43e53e12e041178912f372f33068d67c
Reviewed-on: https://chromium-review.googlesource.com/1023418
Commit-Queue: Ivica Bogosavljevic <ivica.bogosavljevic@mips.com>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52775}
2018-04-25 08:29:20 +00:00
Erik Luo
9b3dafb99a [debug] expose SideEffectType when setting template accessors
This expands the SideEffectType flag to cover whitelisting embedder
callbacks that are setup with Template accessors.

- v8::ObjectTemplate::SetNativeDataProperty
- v8::ObjectTemplate::SetLazyDataProperty
- v8::ObjectTemplate::SetAccessor

Bug: v8:7515
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Ieda6c793141ab249c4f41d00e6572fe2a29ac629
Reviewed-on: https://chromium-review.googlesource.com/1015896
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52770}
2018-04-24 22:52:48 +00:00
Andreas Haas
5c9b30ae38 [api] Split isolate allocation and initialization
At the moment, the isolate is allocated and initialized in a single
step. This has the downside that the platform cannot register the
isolate before the isolate gets initialized, and therefore the platform
is not available for the isolate during initialization. With this CL we
register the uninitialized isolate on the platform and initialize the
isolate after that.

This change is needed to allow the creation of task runners already
during the initialization of the isolate.

The related chromium CL: https://crrev.com/c/1015020

R=yangguo@chromium.org

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I52e89388a757f2693d1a800e7aa7701aa0080795
Reviewed-on: https://chromium-review.googlesource.com/1014044
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52731}
2018-04-23 14:48:46 +00:00
jgruber
b3738e6583 [api] Deprecate {Create,WarmUp}SnapshotDataBlob
These functions are now unused within V8, as we need tighter control in
mksnapshot for creating embedded.cc.

Embedders should switch to using SnapshotCreator directly.

Bug: v8:6666
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Id231b3d1fdf50e06c9278f13d095186364264b86
Reviewed-on: https://chromium-review.googlesource.com/1019442
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52692}
2018-04-19 14:58:30 +00:00
Dan Elphick
7d291c7286 [heap] Add a read-only permission
Add a new permission kRead to PageAllocator::Permission and
OS::MemoryPermission and implement it in platform-*.

Not used yet, because it needs corresponding changes in chromium.

Bug: v8:7464
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I9f84251eff593536cbcc1cde04641d696c79d65c
Reviewed-on: https://chromium-review.googlesource.com/1006756
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52636}
2018-04-17 08:26:43 +00:00
Jakob Kummerow
55110038a1 [bigint] API: Implement missing Big{Int,Uint}64Array::Cast
This doesn't change the API, it just makes it functional: the
functions were declared already, but they lacked an implementation
so far. Trying to use them in Blink detects that issue.

Bug: v8:6791
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I48902a5bba4a42f2922eafd22858d584731fc777
Reviewed-on: https://chromium-review.googlesource.com/1014668
Reviewed-by: Daniel Clifford <danno@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52632}
2018-04-17 03:19:02 +00:00
Jakob Kummerow
f7d6b19f6c [ubsan] Fix many static_cast<int32_t> with undefined behavior
Casting from a floating-point type to an integer type is undefined behavior
if the integral part of the float cannot be represented in the range of the
int.

Bug: v8:3770, chromium:831145
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng;luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: I2e85ea8b0f09bbeeb3e0dcc1135fc747fa312f6d
Reviewed-on: https://chromium-review.googlesource.com/1011651
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52631}
2018-04-17 02:02:18 +00:00
Yang Guo
a440efb27f [api] do not require source string for producing code cache.
The embedder should not need to keep track of the source string.

R=jgruber@chromium.org

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Ie27df755a22fbcae7b6e87a435419d2d8f545558
Reviewed-on: https://chromium-review.googlesource.com/1013482
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52614}
2018-04-16 09:10:44 +00:00
Gus Caplan
39d546a240 [api] introduce v8::Value::IsModuleNamespaceObject
This allows an embedder to check if a Value is a module namespace object.

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Idffceff451dd5f5c6a53d4cb3ce02c1c2c5b653c
Reviewed-on: https://chromium-review.googlesource.com/1011762
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52597}
2018-04-13 18:26:36 +00:00
Michael Hablich
c6e3e1c0a8 Update version to 6.8
TBR=machenbach@chromium.org
NOTRY=true

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Ifd0eee86da0bf8b8e234b6f55ddce77239d0a3a5
Reviewed-on: https://chromium-review.googlesource.com/1009905
Commit-Queue: Michael Hablich <hablich@chromium.org>
Reviewed-by: Michael Hablich <hablich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52570}
2018-04-12 10:58:04 +00:00
Alexei Filippov
1def6cd4a3 [cpu-profiler] Automatically create TracingCpuProfiler
Previously embedder had to create an instance of TracingCpuProfiler explicitly.
The patch makes the profiler created automatically for every isolate.
The profiler has no overhead unless tracing with v8.cpu_profiler category is enabled.

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I9369c2c56bcddc72093eda33dc2bc185c9253b4a
Reviewed-on: https://chromium-review.googlesource.com/1006049
Commit-Queue: Alexei Filippov <alph@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52552}
2018-04-11 21:31:07 +00:00
Clemens Hammacher
609c8059b2 Remove redundant WARN_UNUSED_RESULT macro
Replace all uses with V8_WARN_UNUSED_RESULT.
WARN_UNUSED_RESULT was defined in src/base/compiler-specific.h, which
includes include/v8config.h, which already defined
V8_WARN_UNUSED_RESULT.

R=mstarzinger@chromium.org

Bug: v8:7570
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I662072294605036ca5aa0c8fdaa0218ac5d95f23
Reviewed-on: https://chromium-review.googlesource.com/998893
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52457}
2018-04-06 16:06:15 +00:00
Erik Luo
6da12d420a [debug] expose SideEffectType for whitelisting embedder callbacks
This exposes new flags to allow embedders to whitelist callbacks as
side-effect-free during evaluation with throwOnSideEffect.

Accessors and Functions/FunctionTemplates can take a new param on:
- v8::Object::SetNativeDataProperty
- v8::Object::SetLazyDataProperty
- v8::Object::SetAccessor
- v8::FunctionTemplate::New
- v8::FunctionTemplate::NewWithCache
- v8::Function::New

While Interceptors can be created with an additional flag:
PropertyHandlerFlag::kHasNoSideEffect

Bug: v8:7515
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I14823316bdd6de6d362a1104b65f13504d0db056
Reviewed-on: https://chromium-review.googlesource.com/994550
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52367}
2018-04-04 20:08:00 +00:00
Yang Guo
34cf25855c Add Ulan to API owners and make it noparent.
This ensures that we have gatekeepers for API changes.

R=adamk@chromium.org

Change-Id: I7a78f9590dfc444a20044fe323b9470f4f9004a3
Reviewed-on: https://chromium-review.googlesource.com/986267
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52318}
2018-04-03 09:41:11 +00:00
Yang Guo
e71055211c [snapshot] extend code caching support to CompileFunctionInContext.
R=leszeks@chromium.org, mythria@chromium.org

Bug: v8:7554
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I3eb29d67dfa64887fb52ac706d069e15dd2d0e85
Reviewed-on: https://chromium-review.googlesource.com/980944
Reviewed-by: Mythri Alle <mythria@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52299}
2018-03-29 12:53:41 +00:00
Ulan Degenbaev
84a80e103b [heap,api] Introduce near-heap-limit callbacks.
The embedder can get notification when V8 heap size approaches the heap limit
and can extend the heap limit if needed using
- v8::Isolate::AddNearHeapLimitCallback
- v8::Isolate::RemoveNearHeapLimitCallback

This generalizes the exiting v8::debug::SetOutOfMemoryCallback API.

Bug: chromium:824214

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ia444cb7efb6fe85c57fa3785e8fd1d8b654a5224
Reviewed-on: https://chromium-review.googlesource.com/979447
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52238}
2018-03-27 08:29:56 +00:00
Franziska Hinkelmann
64dbd26e1c [api] Deprecate SetNamedPropertyHandler
I replaced usages in Chromium and other embedders. I think we can safely
deprecate and soon remove.

Drive-by fix: Fixed some typos.

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Ia8e35adb2abebed3966403af61eda1ede319e5c3
Reviewed-on: https://chromium-review.googlesource.com/980452
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Franziska Hinkelmann <franzih@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52236}
2018-03-27 04:15:04 +00:00
Gabriel Charette
1983f3055d [V8 Platform] Make CallOnWorkerThread use std::unique_ptr
This is done now while embedders have yet to adapt to the new API before
it becomes hard to migrate.

Also renamed variable/methods to use "worker threads" rather than
"background" nomenclature.

Extracted from https://chromium-review.googlesource.com/c/v8/v8/+/978443/7
while resolving the more contentious bits around using task runners.

TBR=rmcilroy@chromium.org

Bug: chromium:817421
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Ie3ddf15a708e829c0f718d89bebf3e96d1990c16
Reviewed-on: https://chromium-review.googlesource.com/980953
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52231}
2018-03-26 17:43:22 +00:00
Daniel Clifford
c69b03baec Fix support for Builtin names for --gdbjit-full
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Ib76185e7b6bc893460b97b43cc385412485da20c
Reviewed-on: https://chromium-review.googlesource.com/956464
Commit-Queue: Daniel Clifford <danno@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52188}
2018-03-23 16:26:01 +00:00
Ulan Degenbaev
69040ced45 [api] Disable in_process_stack_dumping in DefaultPlatform by default.
This flips the default value of in_process_stack_dumping from enabled
to disabled. For many embedders the V8 signal handler produces worse
stack trace than the defaul signal handler.

Change-Id: Idb5ec30dc4b3cefe243be7304d10a02f1dcda167
Reviewed-on: https://chromium-review.googlesource.com/977903
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52186}
2018-03-23 15:26:30 +00:00
Marja Hölttä
79e6f35e80 [in-place weak refs] Move weak object tag away from v8.h.
Exposing it inside Internals was a hack. The downside of this CL is that heap
object tagging is in two places now (v8.h and globals.h).

BUG=v8:7308

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Ic7115ab20d67109dd2b62c772d52eeb84fa7d9f7
Reviewed-on: https://chromium-review.googlesource.com/968423
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52093}
2018-03-21 08:57:17 +00:00
Eric Holk
7c61c3ce6e [wasm] Add new API for enabling trap handler
The new API supersedes the old `RegisterDefaultSignalHandler` and flag
combination. Now the embedder must explicitly call
`EnableWebAssemblyTrapHandler` to activate the trap handler and optionally
install the default signal handler. The old flag is now used only by D8 to
decide whether to call this function.

Bug: v8:5277

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I05fbb2138138bfc95b14361aabd712db84789b4a
Reviewed-on: https://chromium-review.googlesource.com/963179
Commit-Queue: Eric Holk <eholk@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52081}
2018-03-20 18:06:38 +00:00
Ulan Degenbaev
23a593b9d8 [api] Deprecate HeapProfiler::SetWrapperClassInfoProvider.
The embedders should use the EmbedderGraph API. The similar structure
can be created with the following steps:
1) Create a root node for each retainer info group.
2) Iterate all handles using Isolate::VisitHandlesWithClassIds.
3) Add an edge from the retainer info node to the v8 wrapper node.
4) Add an edge from the v8 wrapper node to the retainer info node.

See how HeapSnapshotRetainedObjectInfo is converted to the new API.

Bug: chromium:749490
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I124ae3853354863b4f888e6aa2ea13777dcaa37d
Reviewed-on: https://chromium-review.googlesource.com/948842
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52067}
2018-03-20 13:53:43 +00:00
Ulan Degenbaev
747d198cad [api] Deprecate HeapProfiler::SetGetRetainerInfosCallback.
The embedders should use the new EmbedderGraph API to provide retainer
info.

Bug: chromium:749490
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Iac8dc1e749ef14277b027f43e799357c5bd413ea
Reviewed-on: https://chromium-review.googlesource.com/948489
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52059}
2018-03-20 12:26:43 +00:00
Marja Hölttä
38525dd209 [reland] [in-place weak refs] Use WeakArray in Script::shared_function_infos.
For serializer changes, see goo.gl/Kh2eop

Previous version: https://chromium-review.googlesource.com/955593

BUG=v8:7308

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I14c92874d04545eb6d04590bedb21dc402326401
Reviewed-on: https://chromium-review.googlesource.com/968245
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52027}
2018-03-19 13:33:24 +00:00
Ulan Degenbaev
6ad63309ed [api] Restore v8::V8::InitializeICU API.
This function re-uses the implementation of InitializeICUDefaultLocation.

Removal of the API breaks embedders' code without providing any benefit.

Bug: v8:7561
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I006cd307887ac132f574af26ca9cd1d5e5317644
Reviewed-on: https://chromium-review.googlesource.com/963024
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51956}
2018-03-15 12:32:21 +00:00
Ulan Degenbaev
9fe417cb7f [api] Restore the simple version of Message::GetEndColumn API.
This also undeprecates Message::GetStartColumn API.

The simple versions are easier to use for the embedders and have the
same implementation as the complex versions.

Bug: v8:7560
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I656161b04c5d9de6d1de9435b7825009f96572a5
Reviewed-on: https://chromium-review.googlesource.com/963322
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51951}
2018-03-15 12:16:38 +00:00
Michael Achenbach
73f049e445 Revert "[in-place weak refs] Use WeakArray in Script::shared_function_infos."
This reverts commit bf9ab7294d.

Reason for revert:
https://build.chromium.org/p/client.v8/builders/V8%20Win64%20-%20debug/builds/22169

Original change's description:
> [in-place weak refs] Use WeakArray in Script::shared_function_infos.
> 
> For serializer changes, see goo.gl/Kh2eop
> 
> BUG=v8:7308
> 
> Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
> Change-Id: I2b790413a4c0d8c8cc0c07ba7b901c965d64eb11
> Reviewed-on: https://chromium-review.googlesource.com/955593
> Commit-Queue: Marja Hölttä <marja@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Reviewed-by: Hannes Payer <hpayer@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#51895}

TBR=ulan@chromium.org,marja@chromium.org,yangguo@chromium.org,hpayer@chromium.org

Change-Id: Ib9552d5c2c284ff27463e61a054c60cc20f2f8cc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7308
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/960121
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51896}
2018-03-13 10:13:54 +00:00
Marja Hölttä
bf9ab7294d [in-place weak refs] Use WeakArray in Script::shared_function_infos.
For serializer changes, see goo.gl/Kh2eop

BUG=v8:7308

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I2b790413a4c0d8c8cc0c07ba7b901c965d64eb11
Reviewed-on: https://chromium-review.googlesource.com/955593
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51895}
2018-03-13 09:22:30 +00:00
Erik Luo
bf505e6065 [inspector] support BigInt in inspector
- Label as "bigint" in DevTools heap snapshot viewer
- Treat as new primitive in injected-script-source
- Show primitive value as property for BigIntObject
- Adds the "n" suffix onto description, both with/without inspector
  being present

Bug: v8:7486
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng;master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I47a02e32f9bdd9124a6c91056965574ecd443867
Reviewed-on: https://chromium-review.googlesource.com/940804
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Alexei Filippov <alph@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51855}
2018-03-09 21:28:00 +00:00
Yang Guo
1b9f518d21 [api] introduce v8::Context::GetNumberOfEmbedderDataFields.
The number of embedder fields grows dynamically, but reading these
fields do not perform bounds checks. The naming is taken from a similar
method on v8::Isolate.

Also changed the growing strategy for the backing store to not
over-allocate.

R=adamk@chromium.org, bmeurer@chromium.org

Bug: v8:7533
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I70beab124a32296c940ffabd897a7790bc8ff47a
Reviewed-on: https://chromium-review.googlesource.com/952923
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51822}
2018-03-08 18:18:35 +00:00
Yang Guo
e089566716 [api] unschedule deprecation for v8::Object::GetIsolate.
R=adamk@chromium.org

Bug: v8:7288
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: If8e2416a0e9b0915572c2ad37a45e3ea8ca3a75a
Reviewed-on: https://chromium-review.googlesource.com/952924
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51793}
2018-03-07 19:21:36 +00:00
Yang Guo
308d4e28f3 [cpu-profiler] Move SetIdle() to v8::Isolate
The VM state is a property of the isolate, not the CPU profiler.
Having to create a v8::CpuProfiler instance in order to change
the property is somewhat inefficient.

See https://github.com/nodejs/node/issues/18039 and
https://github.com/nodejs/node/pull/18534 for context.

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng;master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I70e31deca6529bccc05a0f4ed500ee268fb63cb8
Reviewed-on: https://chromium-review.googlesource.com/900622
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51779}
2018-03-07 06:16:08 +00:00
Dan Elphick
58e15ee246 Remove ObjectSpace and AllocationAction enums
ObjectSpace was only referred to in static_asserts and was otherwise
removed in http://codereview.chromium.org/7945009.

AllocationActions's last usage was removed in
https://codereview.chromium.org/1991293002.

Bug: v8:7310
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I2ccbf3b674517bc698b4c92754cd0b251229d342
Reviewed-on: https://chromium-review.googlesource.com/931887
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51763}
2018-03-06 12:07:45 +00:00
Adam Klein
21b984be72 [api] Add yangguo@ to include/OWNERS
Change-Id: I9854c151c9de636ba1d9ac3733c34485831e6cc4
Reviewed-on: https://chromium-review.googlesource.com/946858
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51752}
2018-03-06 07:37:11 +00:00
Marja Hölttä
88062a2cbc Reland [in-place weak refs] Add in-place weak references & migrate one WeakCell to it.
Implement in-place weak reference handling in GC.

Turn FeedbackVector::optimized_code_or_smi into an in-place weak reference (this
is the only in-place weak reference at this point).

(See bug for design doc.)

BUG=v8:7308
TBR=yangguo@chromium.org

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I16d65dc768f10ed431252e23a0df07bee9063534
Reviewed-on: https://chromium-review.googlesource.com/948493
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51731}
2018-03-05 14:24:21 +00:00
Sigurd Schneider
73d6037c20 Revert "[in-place weak refs] Add in-place weak references & migrate one WeakCell to it."
This reverts commit 07c1e641d9.

Reason for revert: Breaks TSAN build.

https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20TSAN/builds/19784

Original change's description:
> [in-place weak refs] Add in-place weak references & migrate one WeakCell to it.
> 
> Implement in-place weak reference handling in GC.
> 
> Turn FeedbackVector::optimized_code_or_smi into an in-place weak reference (this
> is the only in-place weak reference at this point).
> 
> (See bug for design doc.)
> 
> BUG=v8:7308
> 
> Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng;master.tryserver.chromium.linux:linux_chromium_rel_ng
> Change-Id: I0f9f992cb4ee0457c40b7c868317dfb607bfb906
> Reviewed-on: https://chromium-review.googlesource.com/873638
> Commit-Queue: Marja Hölttä <marja@chromium.org>
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Reviewed-by: Hannes Payer <hpayer@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#51722}

TBR=ulan@chromium.org,marja@chromium.org,yangguo@chromium.org,hpayer@chromium.org,mlippautz@chromium.org,ishell@chromium.org,bmeurer@chromium.org

Change-Id: I75a7dd99fbfd2f5922a6c4d2000bea2adfdeac11
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7308
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng;master.tryserver.chromium.linux:linux_chromium_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/948522
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51723}
2018-03-05 11:38:41 +00:00
Marja Hölttä
07c1e641d9 [in-place weak refs] Add in-place weak references & migrate one WeakCell to it.
Implement in-place weak reference handling in GC.

Turn FeedbackVector::optimized_code_or_smi into an in-place weak reference (this
is the only in-place weak reference at this point).

(See bug for design doc.)

BUG=v8:7308

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng;master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I0f9f992cb4ee0457c40b7c868317dfb607bfb906
Reviewed-on: https://chromium-review.googlesource.com/873638
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51722}
2018-03-05 11:11:48 +00:00
Bill Budge
9568cea8bf [API] Remove ArrayBuffer::Allocator virtual memory methods.
- Removes Reserve, Free (overload) and SetProtection methods.
- Updates comment on enum which we still need to distinguish
  between allocated and reserved ArrayBuffers.

Bug: chromium:799573
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I1b4e08f97c22ae6b6af847fbcdde047be62fecf8
Reviewed-on: https://chromium-review.googlesource.com/924603
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Eric Holk <eholk@chromium.org>
Commit-Queue: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51714}
2018-03-03 12:00:24 +00:00
Jakob Kummerow
ed2e7dc618 [bigint] Expose BigInt on the API
Bug: v8:6791, v8:7486
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I733d0fb886c42928816fe570712ed23f41c8e751
Reviewed-on: https://chromium-review.googlesource.com/938945
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51664}
2018-03-01 18:58:38 +00:00
Gabriel Charette
70222a9d03 [v8 platform] Rename BackgroundThread methods to WorkerThreads method.
Follow-up to https://chromium-review.googlesource.com/c/v8/v8/+/941442.

"background" refers to a priority and is inappropriate to refer to
worker threads as many tasks posted to worker threads by v8 are in
fact high priority.

Also took advantage of this rename to make NumberOfWorkerThreads()
return an int instead of size_t. While it is never negative, int is
simpler and Google C++ style guide states to avoid unsigned integers in
such cases (ref. "On Unsigned Integers" @
https://google.github.io/styleguide/cppguide.html#Integer_Types).

The Chromium embedder for that call provided an int which was converted
to size_t for this override and most often casted back down to int on the
v8 side, adding churn, and readability overhead.

R=ahaas@chromium.org

Bug: v8:7310
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Ib5280df73d2846b111d985be65a10b049995ea6a
Reviewed-on: https://chromium-review.googlesource.com/941944
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51662}
2018-03-01 15:30:35 +00:00
Gabriel Charette
ce1cc81468 [v8 platform] Use V8_DEPRECATED macro for CallOnBackgroundThread().
Follow-up to https://chromium-review.googlesource.com/c/v8/v8/+/941442#message-bc46157bdd4667cb44c2533bfd3201b45c32fe75

TBR=rmcilroy@chromium.org

Bug: v8:7310
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: If3afbdca1393e7f3bb264abadd99f83f5a2b554a
Reviewed-on: https://chromium-review.googlesource.com/942823
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51656}
2018-03-01 14:32:04 +00:00
Michael Hablich
ac9b1ebe7c Update V8 version to 6.7
TBR=machenbach@chromium.org

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I4b5675a02364631f88f203b5c60edc14314a4617
Reviewed-on: https://chromium-review.googlesource.com/942904
Commit-Queue: Michael Hablich <hablich@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Michael Hablich <hablich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51653}
2018-03-01 13:51:39 +00:00
Gabriel Charette
2600038ddb [v8 platform] Introduce CallBlockingTaskFromBackgroundThread()
and use it for parallel GC as it blocks the main thread.

On Chromium this will result in a TaskPriority::USER_BLOCKING task,
allowing TaskScheduler to prioritize them above all other async work.

R=ahaas@chromium.org

Bug: chromium:817421
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I8c782eb045035ce2899214528deae5a45f0e6600
Reviewed-on: https://chromium-review.googlesource.com/941946
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51650}
2018-03-01 13:00:07 +00:00
Gabriel Charette
86b4b5345a [v8 platform] Get rid of unused ExpectedRuntime parameter.
With a temporary intermediate step to allow adapting embedders before
getting rid of the ExpectedRuntime method altogether.

The method is being renamed to CallOnWorkerThread() as an effort to
go away from "background" nomenclature for worker threads ("background"
usually refers to a priority but worker threads are commonly used for
high priority tasks in v8).
Other CLs will follow to rename other "background" APIs.

Bug: v8:7310
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng;master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I2fd4eac7458708d4eacb0f4871c982a567a3865e
Reviewed-on: https://chromium-review.googlesource.com/941442
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51645}
2018-03-01 10:35:42 +00:00
Andreas Haas
9bacf52359 [cleanup] Deprecate EnsureEventLoopInitialized
Due to a recent refactoring the function EnsureEventLoopInitialized on
the default platform became obsolete. It does not contain a single line
of code. With this CL we prepare the removal of this function from the
V8 platform API.

R=rmcilroy@chromium.org

Bug: v8:7310
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng;master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: If4d54cd989f8df2f40b322be3b67bb8a482398d0
Reviewed-on: https://chromium-review.googlesource.com/934221
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51635}
2018-02-28 15:32:28 +00:00
Michael Achenbach
4f6df6e346 [CQ] Let presubmit scripts point to correct LUCI bots
TBR=iannucci@chromium.org
NOTRY=true

Change-Id: I6bee8db469b43a01402798953a1bcdaf3dc06cf7
Reviewed-on: https://chromium-review.googlesource.com/940421
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51618}
2018-02-27 23:26:51 +00:00