Commit Graph

2017 Commits

Author SHA1 Message Date
Dan Elphick
c8376b0069 [cleanup] Reland: Remove deprecated functions
This is reland of https://chromium-review.googlesource.com/c/v8/v8/+/1154915
with no changes since the break in chromium for ChromeOS is now fixed.

Removes all V8_DEPRECATED functions that weren't recently marked as well
any V8_DEPRECATE_SOON function that relied on using using the address of
an object to get hold of the Isolate.

Bug: v8:7786
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng;luci.chromium.try:linux-chromeos-dbg;luci.chromium.try:linux-chromeos-rel
Change-Id: Ib62d38b9201fd0dab719948cb5ae5a0a164f7013
Reviewed-on: https://chromium-review.googlesource.com/1172350
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55119}
2018-08-14 11:23:03 +00:00
Alexey Kozyatinskiy
dbfcc4878a [inspector] added V8InspectorClient::resourceNameToUrl
Some clients (see Node.js) use platform path as ScriptOrigin.
Reporting platform path in protocol makes using protocol much harder.
This CL introduced V8InspectorClient::resourceNameToUrl method that
is called for any reported using protocol url.
V8Inspector uses url internally as well so protocol client may generate
pattern for blackboxing with file urls only and does not need to build
complicated regexp that covers files urls and platform paths on
different platforms.

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

Bug: none
Cq-Include-Trybots: luci.chromium.try:linux_chromium_headless_rel;luci.chromium.try:linux_chromium_rel_ng;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Iff302e7441df922fa5d689fe510f5a9bfd470b9b
Reviewed-on: https://chromium-review.googlesource.com/1164624
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Alexei Filippov <alph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55029}
2018-08-09 21:36:24 +00:00
Andreas Haas
5012e883dd [api] Add API callback setter for the wasm thread origin trial
With the callback we can check if the origin trial is turned on for a
given context.

I will not land the other CL which added a flag to the isolate. The
information if the origin trial is on is context-specific and not
isolate-specific, and it's hard on the embedder side to track all
creations of a context.

With the API proposed in this CL we will ask the embedder every time we
start compilation whether the origin trial is on or off.

R=yangguo@chromium.org

Bug:868844

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I8822f40ab12582a5b0bd6640790a269107fc085a
Reviewed-on: https://chromium-review.googlesource.com/1163621
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55011}
2018-08-09 10:05:19 +00:00
Dan Elphick
a2679e527f Revert "[api] Remove deprecated functions"
This reverts commit 5414884aec.

Reason for revert: breaks the roll due to not testing CrOs

Original change's description:
> [api] Remove deprecated functions
> 
> Removes all V8_DEPRECATED functions that weren't recently marked as well
> any V8_DEPRECATE_SOON function that relied on using the address of
> an object to get hold of the Isolate.
> 
> Normally we would have advanced the V8_DEPRECATE_SOON methods to
> V8_DEPRECATE in this release and removed them in the follow release, but
> their continuing presence blocks the work on creating a shared
> Read-Only space where some objects would not belong to any single
> Isolate. In preparation chromium and node.js (via the v8/node github)
> have been modified in advance.
> 
> Bug: v8:7786
> Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
> Change-Id: I8b4b06189896d94aff908ebcd121b3b38f9b482a
> Reviewed-on: https://chromium-review.googlesource.com/1154915
> Commit-Queue: Dan Elphick <delphick@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#54915}

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

Change-Id: Iaf23e04d55a95b01b0423effa6cde3c0be5e2ba8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7786
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/1164902
Reviewed-by: Dan Elphick <delphick@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54937}
2018-08-07 08:09:31 +00:00
Rodrigo Bruno
9f3170dad5 [heap] Add external memory counter to HeapStatistics.
Node.js is using AdjustAmountOfExternalAllocatedMemory to get
external memory from V8 [1]. In addition, they have a unittest
that verifies that AdjustAmountOfExternalAllocatedMemory returns
the correct value [2]. This CL proposes a new way to report
external memory through HeapStatistics.

[1]07cb69720b/src/node_process.cc (L187)
[2]https://github.com/nodejs/node/blob/master/test/parallel/test-memory-usage.js

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Ia58ed0bab1c1d4ee23672e1347b9a00b6705a43c
Reviewed-on: https://chromium-review.googlesource.com/1162156
Commit-Queue: Rodrigo Bruno <rfbpb@google.com>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54919}
2018-08-06 12:11:15 +00:00
Dan Elphick
5414884aec [api] Remove deprecated functions
Removes all V8_DEPRECATED functions that weren't recently marked as well
any V8_DEPRECATE_SOON function that relied on using the address of
an object to get hold of the Isolate.

Normally we would have advanced the V8_DEPRECATE_SOON methods to
V8_DEPRECATE in this release and removed them in the follow release, but
their continuing presence blocks the work on creating a shared
Read-Only space where some objects would not belong to any single
Isolate. In preparation chromium and node.js (via the v8/node github)
have been modified in advance.

Bug: v8:7786
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I8b4b06189896d94aff908ebcd121b3b38f9b482a
Reviewed-on: https://chromium-review.googlesource.com/1154915
Commit-Queue: Dan Elphick <delphick@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54915}
2018-08-06 09:49:56 +00:00
Anna Henningsen
497f5a710f [heap-profiler] Mark SetBuildEmbedderGraphCallback with V8_DEPRECATED
This is not used in Chrome or Node anymore.
(This could also potentially be just removed at this point.)

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I59ecc216faeb3d56d3a52c548a863544570b6173
Reviewed-on: https://chromium-review.googlesource.com/1161936
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54913}
2018-08-06 08:46:10 +00:00
Peter Marshall
842569eb4b [arrays] Increase max size of FixedDoubleArray by 2x on 64 bit
FixedArray max size is currently 1024 MB on 64 bit and 512 MB on 32 bit.
Update the max size of FixedDoubleArray to match. This doubles the max
size for arrays of doubles.

Bug: chromium:814599
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I3ac1b4caaf5b6428fe8a8c848fffdf84af8a9ae9
Reviewed-on: https://chromium-review.googlesource.com/1160235
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54892}
2018-08-03 10:35:25 +00:00
Michael Lippautz
5d411aef29 [api] Make dtor of v8::EmbedderHeapTracer public
This enables direct uses in e.g.
  unique_ptr<v8::EmbedderHeapTracer>

Bug: chromium:843903
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I11f86c916dca5c31413866d9972178fccda7df9c
Reviewed-on: https://chromium-review.googlesource.com/1160538
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54883}
2018-08-03 07:56:40 +00:00
Dan Elphick
85cef38d2a Add v8::String::StringEquals to API
This new method only compares Strings and so doesn't need a Context. It
also can't throw so it returns bool. Can be used in place of the
deprecated Equals method and many Equals call currently taking a
Context.

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I4cfe7747aa140e5a55d9513681ee4704414e1545
Reviewed-on: https://chromium-review.googlesource.com/1151321
Commit-Queue: Dan Elphick <delphick@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54812}
2018-07-31 11:22:57 +00:00
Michael Starzinger
30ce1ba660 [wasm] Avoid serializing {TransferrableModule} if possible.
This avoids serializing and deserializing the sharable part of a module
when it is transferred via {TransferrableModule}, which is possible when
all Isolates run off the same engine via the --wasm-shared-engine flag.

This adds a new --wasm-shared-code flag to enable this feature.

R=ahaas@chromium.org
BUG=v8:7424

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I099d581d7ccc4d058a4646f545a011745fd84eb4
Reviewed-on: https://chromium-review.googlesource.com/1142144
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54806}
2018-07-31 09:17:39 +00:00
Clemens Hammacher
0fc61ecae5 [api] Deprecate some wasm methods
They were marked V8_DEPRECATE_SOON for the 6.9 branch, so we deprecate
them for the 7.0 branch.

R=yangguo@chromium.org

Bug: v8:7868
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Idc42affd4d1b103e9946e3b77a93720694eb2dfd
Reviewed-on: https://chromium-review.googlesource.com/1150024
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54803}
2018-07-31 08:55:27 +00:00
Rodrigo Bruno
da9386ae2d Reland^2 "Avoiding re-externalization of strings"
Previously landed as 2c4c2ad694 / #54599 and
f34158c9d2 / #54637

Previously reviewed at https://chromium-review.googlesource.com/1139056 and
https://chromium-review.googlesource.com/1146583

Bug: chromium:845409, chromium:866208
Change-Id: Idb1b6d1b29499f66bf8cd704977c40b027f99dbd
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/1148281
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Dan Elphick <delphick@chromium.org>
Commit-Queue: Rodrigo Bruno <rfbpb@google.com>
Cr-Commit-Position: refs/heads/master@{#54703}
2018-07-25 18:54:28 +00:00
Ross Mcilroy
727d82e923 [cleanup] Remove calls to deprecated GetFrame.
Use the isolate version instead.

BUG=v8:7754

Cq-Include-Trybots: luci.chromium.try:linux_chromium_headless_rel;luci.chromium.try:linux_chromium_rel_ng;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I5239192fe6d31e84028806127d21ac54ee0a8ef6
Reviewed-on: https://chromium-review.googlesource.com/1146181
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54702}
2018-07-25 18:02:32 +00:00
Sigurd Schneider
765c1eac1f Speculatively Revert "Reland "Avoiding re-externalization of strings.""
This reverts commit f34158c9d2.

Reason for revert: Seems to trigger DCHECKS. Two CLs in range; this one seemed more likely.
https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8-Blink%20Linux%2064%20(dbg)/12787
https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8-Blink%20Linux%2064%20(dbg)/12788


Original change's description:
> Reland "Avoiding re-externalization of strings."
> 
> This is a reland of 2c4c2ad694
> 
> Original change's description:
> > Avoiding re-externalization of strings.
> >
> > Bug: chromium:845409
> > Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
> > Change-Id: I75bddcf0e8879d2161486f24d1cd4e46d8fe008d
> > Reviewed-on: https://chromium-review.googlesource.com/1139056
> > Commit-Queue: Rodrigo Bruno <rfbpb@google.com>
> > Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> > Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#54599}
> 
> Bug: chromium:866208
> Change-Id: I7714bfc695ebeaf55b9ccbbc6b11368416ce7fec
> Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
> Reviewed-on: https://chromium-review.googlesource.com/1146583
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Commit-Queue: Rodrigo Bruno <rfbpb@google.com>
> Cr-Commit-Position: refs/heads/master@{#54637}

TBR=ulan@chromium.org,jkummerow@chromium.org,hpayer@chromium.org,mlippautz@chromium.org,rfbpb@google.com

Change-Id: Id12382d66bc5c9b5c76d73b06a6b421dd4d7be66
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:866208
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/1148400
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54645}
2018-07-24 13:37:04 +00:00
Rodrigo Bruno
f34158c9d2 Reland "Avoiding re-externalization of strings."
This is a reland of 2c4c2ad694

Original change's description:
> Avoiding re-externalization of strings.
>
> Bug: chromium:845409
> Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
> Change-Id: I75bddcf0e8879d2161486f24d1cd4e46d8fe008d
> Reviewed-on: https://chromium-review.googlesource.com/1139056
> Commit-Queue: Rodrigo Bruno <rfbpb@google.com>
> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#54599}

Bug: chromium:866208
Change-Id: I7714bfc695ebeaf55b9ccbbc6b11368416ce7fec
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/1146583
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Rodrigo Bruno <rfbpb@google.com>
Cr-Commit-Position: refs/heads/master@{#54637}
2018-07-24 11:02:59 +00:00
Sigurd Schneider
367815ea13 Revert "Avoiding re-externalization of strings."
This reverts commit 2c4c2ad694.

Reason for revert: Speculatively revert CL, as it seems to break blink debug bots:
https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8-Blink%20Linux%2064%20(dbg)/12756
https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8-Blink%20Linux%2064%20(dbg)/12764

# Fatal error in ../../v8/src/api.cc, line 5960
# Check failed: expected == value ((nil) vs. 0x176ae0f70a48).

Original change's description:
> Avoiding re-externalization of strings.
>
> Bug: chromium:845409
> Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
> Change-Id: I75bddcf0e8879d2161486f24d1cd4e46d8fe008d
> Reviewed-on: https://chromium-review.googlesource.com/1139056
> Commit-Queue: Rodrigo Bruno <rfbpb@google.com>
> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#54599}

TBR=ulan@chromium.org,jkummerow@chromium.org,hpayer@chromium.org,mlippautz@chromium.org,rfbpb@google.com

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

Bug: chromium:845409
Change-Id: Ie172148c0bdef71c0cf9819e63a66aec09d6888d
Reviewed-on: https://chromium-review.googlesource.com/1146582
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54611}
2018-07-23 14:25:09 +00:00
Rodrigo Bruno
2c4c2ad694 Avoiding re-externalization of strings.
Bug: chromium:845409
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I75bddcf0e8879d2161486f24d1cd4e46d8fe008d
Reviewed-on: https://chromium-review.googlesource.com/1139056
Commit-Queue: Rodrigo Bruno <rfbpb@google.com>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54599}
2018-07-20 18:02:59 +00:00
Andreas Haas
54723da771 [api] Remove the deprecated function EnsureEventLoopInitialized
This function has been deprecated for month by now.

R=ulan@chromium.org

Bug: v8:7754
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I19d1b41bad2849b7f3d4d6684dc6f0f80af081f0
Reviewed-on: https://chromium-review.googlesource.com/1144922
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54575}
2018-07-20 10:28:36 +00:00
Michael Hablich
efbb3d8d10 Update V8 version to 7.0
TBR=machenbach@chromium.org
NOTRY=true

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I13105e27794ebbfdfc57ca351959b92bfbbad7c7
Reviewed-on: https://chromium-review.googlesource.com/1143280
Commit-Queue: Michael Hablich <hablich@chromium.org>
Reviewed-by: Michael Hablich <hablich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54559}
2018-07-19 12:16:47 +00:00
Dan Elphick
ed9ea21661 Fix uses of V8_DEPRECATE_SOON in v8.h
Move brackets enclosing declarator in a couple of V8_DEPRECATE_SOON
cases so that the attribute is correctly placed.

I.e. should come after the class keyword and after a function signature
but before the body.

Also adds suppressions for a case where a replacement method calls
the deprecated method it replaces.

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I490ff07a13552cf335186d64ca061f21ac4e8afc
Reviewed-on: https://chromium-review.googlesource.com/1140593
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54527}
2018-07-18 18:32:09 +00:00
Dan Elphick
3dd5c6fe38 [string] deprecate String::Utf8Length
Deprecate String::Utf8Length in favor of a new, similar function that
takes the Isolate used for the String::Flatten call as an argument.

BUG: v8:7786

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Icaf04b272679fd853e9cdbe6c7088f63e9aacb95
Reviewed-on: https://chromium-review.googlesource.com/1124724
Commit-Queue: Dan Elphick <delphick@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54476}
2018-07-16 21:53:26 +00:00
Dan Elphick
8a011b57d8 [explicit isolates] Remove nearly all GetIsolates in api.cc
This marks the following methods as V8_DEPRECATE_SOON and adds new
versions that take Isolate* as their first parameter:
PrimitiveArray::Set
PrimitiveArray::Get
StackTrace::GetFrame
String::Write
String::WriteOneByte
String::WriteUtf8
String::Concat
StringObject::New

Additionally StackFrameInfo, Module and TemplateInfo are marked as
NeverReadOnlySpaceObject so their GetIsolates calls are safe.

In api.cc, ContextFromHeapObject is split into
ContextFromNeverReadOnlySpaceObject and UnsafeContextFromHeapObject,
where the latter uses the deprecated methods but is only called from
methods that were themselves already marked V8_DEPRECATE_SOON.

Deprecation warnings for using HeapObject::GetHeap/GetIsolate are
suppressed for all the uses in V8_DEPRECATE_SOON methods so that stats
produced using tools/collect_deprecation_stats.sh don't show them.

Bug: v8:7786
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I48799b5599711661b14d0cd04f21a0a00322da4a
Reviewed-on: https://chromium-review.googlesource.com/1136641
Commit-Queue: Dan Elphick <delphick@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54469}
2018-07-16 14:33:24 +00:00
Joyee Cheung
6ee834532d [heap-profiler] Allow embedder to specify edge names
This patch adds a variant of EmbedderGraph::AddEdge() which
allows the embedder to specify the name of an edge. The edges
added without name are element edges with auto-incremented indexes
while the edges added with names will be internal edges with
the specified names for more meaningful output in the heap
snapshot.

Refs: https://github.com/nodejs/node/pull/21741
Bug: v8:7938
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I8feefa2cf6911743e24b3b2024e0e849b0c65cd3
Reviewed-on: https://chromium-review.googlesource.com/1133299
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54412}
2018-07-12 13:42:18 +00:00
Andreas Haas
7971f9d6f7 [wasm] Prepare API changes for WebAssembly.instantiateStreaming
This is the first CL to refactor WebAssembly.instantiateStreaming to
make it spec compliant again. The design doc where the whole change is
discussed is available in the tracking bug. The tracking bug also
references prototype implementations of the whole change, which includes
the changes in this CL.

Tests for the new API functions will be added with the second V8 CL
which adds the implementation of the API functions.

R=ulan@chromium.org

Bug: chromium:860637
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Ia1048b7ca0291c824ef4212ebde2c6054e102069
Reviewed-on: https://chromium-review.googlesource.com/1127667
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54393}
2018-07-12 09:06:28 +00:00
Michael Lippautz
8de19ddbcf [unified-heap] Add finalization trigger
Allows embedders using the EmbedderHeapTracer to synchronously finalize
an already running garbage collection

Bug: chromium:843903
Tbr: ulan@chromium.org
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Iea01451ea2c1204c34dc7904732abae6b63e1704
Reviewed-on: https://chromium-review.googlesource.com/1128971
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54378}
2018-07-11 12:25:40 +00:00
Michael Lippautz
848f989e3d [embedder-tracing] Deprecate NumberOfWrappersToTrace
Deprecates EmbedderHeapTracer::NumberOfWrappersToTrace and replaces it
with EmbedderHeapTracer::IsTracingDone.

V8 only really cares about the final state (emptiness) here and
embedders may choose implementations that have a hard time determinining
exact size for their work queues.

Bug: chromium:843903
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I1e141c47771ef08aab7dbe204e8175cfee99cf92
Reviewed-on: https://chromium-review.googlesource.com/1127599
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54311}
2018-07-09 08:06:49 +00:00
Benedikt Meurer
907d7bcd18 [promise] Implement Swallowed Rejection Hook.
This extends the current Promise Rejection Hook with two new events

  kPromiseRejectAfterResolved
  kPromiseResolveAfterResolved

which are used to detect (and signal) misuse of the Promise constructor.
Specifically the common bug like

  new Promise((res, rej) => {
    res(1);
    throw new Error("something")
  });

where the error is silently swallowed by the Promise constructor without
the user ever noticing can be caught via this hook.

Doc: https://goo.gl/2stLUY
Bug: v8:7919
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I890a7e766cdd1be88db94844fb744f72823dba33
Reviewed-on: https://chromium-review.googlesource.com/1126099
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54309}
2018-07-09 06:06:39 +00:00
Toon Verwaest
c7ad1ddd44 [scanner] Drop lonely byte support as it's unused by blink anyway.
The embedder should ultimately be responsible for handling this since they
anyway give us a copy of the data. They can easily make sure that the chunks we
get do not have lonely bytes.

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Ie862107bbbdd00c4d904fbb457a206c2fd52e5d0
Reviewed-on: https://chromium-review.googlesource.com/1127044
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54262}
2018-07-05 14:22:44 +00:00
Ross McIlroy
ce409375b3 [sfi] Reduce FunctionTokenPosition and ExpectedNofProperties to 16 bits.
Changes SharedFunctionInfo to store a function_token_offset, relative
to the start_position, instead of the full function_token_position.
This enables us to reduce both FunctionTokenPosition and
ExpectedNofProperties to 16 bits each, saving 32 bits per SFI.

BUG=chromium:818642,chromium:783853
TBR=yangguo@chromium.org

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I45aefcec605c1da502053c23c73564ceaed6c9b5
Reviewed-on: https://chromium-review.googlesource.com/1122982
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54220}
2018-07-04 16:53:37 +00:00
Rodrigo Bruno
c5c4b588f1 [heap] Forcing external strings to be registered in the external string table.
Bug: chromium:845409
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I2ab1ca18a900828e4e116f1b087925319d41bf97
Reviewed-on: https://chromium-review.googlesource.com/1124845
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Rodrigo Bruno <rfbpb@google.com>
Cr-Commit-Position: refs/heads/master@{#54203}
2018-07-04 10:55:26 +00:00
Anna Henningsen
477df066db [API] Expand BigInt API
Provide a more complete BigInt API.

Bug: v8:7712
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Ic8562d616f3125deabdf8b52c7019b191bef0e07
Reviewed-on: https://chromium-review.googlesource.com/1101198
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54122}
2018-07-02 05:39:36 +00:00
Clemens Hammacher
9635e1a303 [wasm] Move wire bytes to the NativeModule
The wire bytes are currently stored as {SeqOneByteString} on the JS
heap. In order to make the {NativeModule} isolate independent, and to
ensure fast access to the wire bytes, they should move to the native
heap.

R=titzer@chromium.org

Bug: chromium:854794, v8:7868, v8:7424
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I36811ec87f780c5b1f6863cd6de89a165aa0b7d5
Reviewed-on: https://chromium-review.googlesource.com/1108208
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53977}
2018-06-22 15:45:59 +00:00
Clemens Hammacher
e90af2c702 [api] Properly define BufferReference instead of CallerOwnedBuffer
The name {CallerOwnedBuffer} does not make sense in all situations,
especially if such an object is returned instead of being passed as
argument.
I am working on moving the wasm wire bytes off the JS heap, and hence
will return unowned references via the API. To prepare this change, I
deprecate the existing {CallerOwnedBuffer} and introduce a new
{BufferReference} struct with proper field names.

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

Bug: v8:7868
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Ic8953951447038a831b15a336a52a199bfbeafd5
Reviewed-on: https://chromium-review.googlesource.com/1108207
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53929}
2018-06-21 13:17:18 +00:00
Anna Henningsen
4da05e97ad [SAB] Fix flake in Atomics.wait
As specified in https://tc39.github.io/ecma262/#sec-atomics-wait, the
critical section must occur before the load and comparison.

This slightly changes the `AtomicsWaitCallback` API, but in a
direction that arguably makes it more consistent.

As a drive-by fix, reset `node->waiting_` in case there
was an exception from the first callback.

Refs: https://chromium-review.googlesource.com/c/v8/v8/+/1095814
Bug: v8:7836
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I577cdf76cedfe39bc61f783203b543c7c68fc238
Reviewed-on: https://chromium-review.googlesource.com/1096236
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Ben Smith <binji@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53673}
2018-06-12 15:46:37 +00:00
Anna Henningsen
555c811c0d [api] Switch from SetBuildEmbedderGraphCallback to AddBuildEmbedderGraphCallback
`SetBuildEmbedderGraphCallback`, unlike `SetWrapperClassInfoProvider`,
assumes a monolithic embedder that can provide all necessary information.
That is not the case for e.g. Node.js, which can e.g. provide multiple Node.js
instances per V8 Isolate, as well as native addons that may allocate resources
on their own.

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Ib53dfde82416dd69934b08623e27d674a483ac2d
Reviewed-on: https://chromium-review.googlesource.com/1082441
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53545}
2018-06-06 09:46:57 +00:00
Igor Sheludko
d123f30b6d [ptr-compr] Support 31-bit Smis in lower half-word on 64-bit architectures.
This CL introduces a new gn argument: v8_enable_pointer_compression which is
false by default. All the changes done in this CL are made under this flag.

Upper half-word of a Smi word must be properly sign-extended according to the
sign of the lower-half containing the actual Smi value.

Bug: v8:7703
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I2b52ab49cd18c7c613130705de445fef44c30ac5
Reviewed-on: https://chromium-review.googlesource.com/1061175
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53519}
2018-06-05 11:37:35 +00:00
Anna Henningsen
5eaa03b2d3 [api] Add AtomicsWaitCallback for diagnostics
Add an inspection callback for embedders that allows tracking
of `Atomics.wait()` calls in order to enable diagnostic tooling
around it, as well as providing a way to break out of an
`Atomics.wait()` call without having to fully terminate execution.

The motivation here is that this allows embedders to perform
somewhat customizable deadlock detection.

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Ib6346747aa3cbffb07cf6abd12645e2d98584f0f
Reviewed-on: https://chromium-review.googlesource.com/1080788
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Ben Smith <binji@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53517}
2018-06-05 10:11:13 +00:00
Ulan Degenbaev
0c5096130b Revert "Global handles: Remove independent handle infrastructure"
This reverts 0944553ee8.

This is a short-term fix for NodeJS regression caused by Scavenger
not collecting weak handles that are marked as independent.

Bug: chromium:847863, chromium:780749
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Ibd5224893c64baef1aaaecd18af94f29e2e74487
Reviewed-on: https://chromium-review.googlesource.com/1082439
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53498}
2018-06-04 18:33:33 +00:00
Alexei Filippov
60a858deb1 [cpu-profiler] Deprecate v8::TracingCpuProfiler
It is created automatically for each isolate.

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: If366becb2fe4c02b150cbbe9a2d425f4de63687b
Reviewed-on: https://chromium-review.googlesource.com/1079900
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Alexei Filippov <alph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53465}
2018-05-31 23:34:43 +00:00
Alexei Filippov
90569cb053 [cpu-profiler] Remove deprecated Isolate::GetCpuProfiler method.
Do not create a CPU profiler for each isolate implicitly.

BUG=v8:7070

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I6ddd93c58f56591477d8fe4249103a74b7698904
Reviewed-on: https://chromium-review.googlesource.com/1043449
Commit-Queue: Alexei Filippov <alph@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53449}
2018-05-30 22:16:28 +00:00
jgruber
70b5fd3b6e [api] Add option to consume code cache on module compilation
This extends the ScriptCompiler::CompileModule function with a
CompileOptions argument. Accepted values are kNoCompileOptions (in
which case, behavior remains unmodified) and kConsumeCodeCache. If the
latter is passed, we try to fetch the given module from the code
cache.

Since it is possible to compile the same source code as both a script
and a module (and different code is generated for the two cases), a
new is_module bit is added to the SerializedCodeData header to
disambiguate between the two cases.

Bug: v8:7685
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I34b3642505577ed9ed0caedbee5876308c5a53ea
Reviewed-on: https://chromium-review.googlesource.com/1073327
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53432}
2018-05-30 07:32:48 +00:00
Anna Henningsen
0fd549f885 [api] Allow escaping MaybeLocal handles on EscapableHandleScope
This adds a convenience overload for `EscapableHandleScope::Escape()`
which moves `MaybeLocal<T>`s into the outer scope, like a regular
`Local<T>`.

This basically moves the syntactic clutter of having to write
`maybe_local.FromMaybe(Local<Foo>())` instead of just `maybe_local`
to a central location.

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I1d87d75c6564b10e8ec34957bdd3eac46ffea917
Reviewed-on: https://chromium-review.googlesource.com/1056529
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53415}
2018-05-29 14:51:18 +00:00
Yang Guo
aa6ce3ee61 [log][api] introduce public CodeEventListener API
Introduce a new public API called CodeEventListener to allow embedders
to better support external profilers and other diagnostic tools without
relying on unsupported methods like --perf-basic-prof.

Bug: v8:7694
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I063cc965394d59401358757634c9ea84c11517e9
Co-authored-by: Daniel Beckert <daniel@sthima.com.br>
Reviewed-on: https://chromium-review.googlesource.com/1028770
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53382}
2018-05-28 09:27:24 +00:00
Hannes Payer
fb436a5e15 Adding an API to enable and disable the memory savings mode.
Bug: chromium:846360
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I5376d4f6f9c8df768d60c63e0a767bf41b51b8b3
Reviewed-on: https://chromium-review.googlesource.com/1071531
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Hannes Payer <hpayer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53345}
2018-05-24 18:25:32 +00:00
Michael Hablich
9a03c0f3fb Update V8 version to 6.9
TBR=machenbach@chromium.org
NOTRY=true

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I045123269afe02302d6b7823ba431fa735312000
Reviewed-on: https://chromium-review.googlesource.com/1070978
Commit-Queue: Michael Hablich <hablich@chromium.org>
Reviewed-by: Michael Hablich <hablich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53324}
2018-05-24 10:31:20 +00:00
Peter Marshall
ecae80cdb3 [cpu-profiler] Add a new profiling mode with a more detailed call tree.
The current profiling mode (called kLeafNodeLineNumbers in this CL)
produces a tree, with each node representing a stack frame that is seen
in one or more samples taken during profiling. These nodes refer to a
particular function in a stack trace, but not to a particular line or
callsite within that function.

This CL adds a new more (called kCallerLineNumbers) which produces a
different profile tree, where each stack trace seen during profiling,
including the line number, has a unique path in the tree.

The profile tree was previously keyed on CodeEntry*. Now it is keyed on
the pair of CodeEntry* and line_number, meaning it has distinct nodes
for those combinations which exist, and each distinct stack trace that
was sampled is represented in the tree.

For optimized code where we have inline frames, there are no line
numbers for the inline frames in the stack trace, causing duplicate
branches in the tree with kNoLineNumberInfo as the reported line number.
This will be addressed in follow-ups.

Bug: v8:7018
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I512e221508f5b50ec028306d212263b514a9fb24
Reviewed-on: https://chromium-review.googlesource.com/1013493
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53298}
2018-05-23 09:23:40 +00:00
Anna Henningsen
ff0a979333 [api] Expose PreviewEntries as public API
Turn `debug::EntriesPreview` into a public API.
This is a straightforward approach to addressing
https://github.com/nodejs/node/issues/20409
(not relying on functionality behind `--allow-natives-syntax`)
in Node.js.

Refs: https://github.com/nodejs/node/issues/20409
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I7021e5846012a55a82c488408ded6591f6b139e7
Reviewed-on: https://chromium-review.googlesource.com/1057467
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53226}
2018-05-17 08:04:33 +00:00
Anna Henningsen
1e8d963fb3 [api] Slightly improve ValueSerializer documentation
Without specifying what the default allocator does, using
the buffer returned from `Release()` means that one basically
had to make an educated guess on how to free it
(and that ownership actually was transferred to the caller).

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Ie2ac0c91d9bdafbe91f6bce9b2263e304b2336ea
Reviewed-on: https://chromium-review.googlesource.com/1056369
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53225}
2018-05-17 08:01:32 +00:00
Gabriel Charette
8f6ffbfca7 [V8Platform] Remove deprecated Background threads APIs and make new APIs pure virtual.
Also fixup some implementations that were lagging behind per the lack of
pure virtual not having enforced everything yet.

Also fixed recently introduced
PredictablePlatform::CallDelayedOnWorkerThread() to ignore delayed tasks
after realizing the intent is to intercept worker tasks instead of
sending them to |platform_|.

Node.js migrated off these APIs @
https://github.com/v8/node/pull/69

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

Bug: chromium:817421
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I92171f213b5fc64ab1f21e8eec72738f5ce228bd
Reviewed-on: https://chromium-review.googlesource.com/1045310
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53223}
2018-05-16 23:27:02 +00:00