Commit Graph

927 Commits

Author SHA1 Message Date
yangguo
57ee3c0f6e Revert of Implement SharedArrayBuffer (patchset #7 id:120001 of https://codereview.chromium.org/1136553006/)
Reason for revert:
breaks build

Original issue's description:
> Implement SharedArrayBuffer.
>
> This adds a new external type (v8::SharedArrayBuffer) that uses a JSArrayBuffer under the hood. It can be distinguished from an ArrayBuffer by the newly-added is_shared() bit.
>
> Currently there is no difference in functionality between a SharedArrayBuffer and an ArrayBuffer. However, a future CL will add the Atomics API, which is only available on an SharedArrayBuffer. All non-atomic accesses are identical to ArrayBuffer accesses.
>
> BUG=
>
> Committed: https://crrev.com/57170bff7baf341c666252a7f6a49e9c08d51263
> Cr-Commit-Position: refs/heads/master@{#28588}

TBR=jarin@chromium.org,jochen@chromium.org,binji@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

Review URL: https://codereview.chromium.org/1149203003

Cr-Commit-Position: refs/heads/master@{#28589}
2015-05-22 12:17:49 +00:00
binji
57170bff7b Implement SharedArrayBuffer.
This adds a new external type (v8::SharedArrayBuffer) that uses a JSArrayBuffer under the hood. It can be distinguished from an ArrayBuffer by the newly-added is_shared() bit.

Currently there is no difference in functionality between a SharedArrayBuffer and an ArrayBuffer. However, a future CL will add the Atomics API, which is only available on an SharedArrayBuffer. All non-atomic accesses are identical to ArrayBuffer accesses.

BUG=

Review URL: https://codereview.chromium.org/1136553006

Cr-Commit-Position: refs/heads/master@{#28588}
2015-05-22 12:06:44 +00:00
rossberg
65bea197ee [strong] cache strong object literal maps
Also, add more literal tests.

R=dslomov@chromium.org
BUG=v8:3956
LOG=N

Review URL: https://codereview.chromium.org/1145213005

Cr-Commit-Position: refs/heads/master@{#28579}
2015-05-22 10:51:29 +00:00
jochen
29deaef505 Introduce a new gyp flag to warn about to be deprecated APIs
This should help to keep syntax errors from creeping into v8.h

Also, I'll remove usages of to-be-deprecated APIs and turn this flag on
for standalone builds

BUG=4134
R=vogelheim@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/1149633003

Cr-Commit-Position: refs/heads/master@{#28538}
2015-05-21 10:34:22 +00:00
jochen
bf032c2ec8 Update ReturnValue to take non-deprecated versions of handles
R=vogelheim@chromium.org
BUG=none
LOG=n

Review URL: https://codereview.chromium.org/1145063002

Cr-Commit-Position: refs/heads/master@{#28501}
2015-05-20 08:59:34 +00:00
yangguo
9a1490ad6f Introduce extras export object.
BUG=

Review URL: https://codereview.chromium.org/1140333003

Cr-Commit-Position: refs/heads/master@{#28499}
2015-05-20 07:38:04 +00:00
rossberg
2fa664fbe2 Reland "[strong] Object literals create strong objects"
(patchset #4 id:60001 of https://codereview.chromium.org/1134333005/)"

This reverts commit 81c080ef8e.
Patchset #1 is the original CL.
Patchset #2 fixes a handlification bug that caused the crash.

R=dslomov@chromium.org
BUG=v8:3956
LOG=N

Review URL: https://codereview.chromium.org/1143813002

Cr-Commit-Position: refs/heads/master@{#28497}
2015-05-20 07:07:42 +00:00
ssid
66083dd05f Adding api to get last gc object statistics for chrome://tracing.
For dumping the number of objects and size of objects alive after the
last gc into chrome://tracing memory dumps, this CL adds new api to
get these number for each isolate.

Note: Chrome should be run with --js-flags='--track_gc_object_stats
--noincremental-marking' for object tracking.

BUG=476013
LOG=Y

Review URL: https://codereview.chromium.org/1113233002

Cr-Commit-Position: refs/heads/master@{#28474}
2015-05-19 11:01:24 +00:00
machenbach
81c080ef8e Revert of [strong] Object literals create strong objects (patchset #4 id:60001 of https://codereview.chromium.org/1134333005/)
Reason for revert:
[Sheriff] Segmentation fault on arm64 with nosnap:
http://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20arm64%20-%20sim%20-%20nosnap%20-%20debug%20-%201/builds/1990

Original issue's description:
> [strong] Object literals create strong objects
>
> R=dslomov@chromium.org
> BUG=v8:3956
> LOG=N
>
> Committed: https://crrev.com/fe6598cffb82ec4180dcc2e2310e77d07a803f96
> Cr-Commit-Position: refs/heads/master@{#28444}

TBR=dslomov@chromium.org,arv@chromium.org,rossberg@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:3956

Review URL: https://codereview.chromium.org/1135493006

Cr-Commit-Position: refs/heads/master@{#28464}
2015-05-19 07:35:54 +00:00
horo
c5eb9573e7 [V8] Added Script::is_opaque flag for embedders
When the page is controlled by a ServiceWorker, the ServiceWorker can return an opaque (non-CORS cross origin) resource response.
We need to treat the messages from such script resource as opaque.

Committed: https://crrev.com/7a599c5e1242d3c5ab7515ee149623da90ae69ec
Cr-Commit-Position: refs/heads/master@{#28445}

Review URL: https://codereview.chromium.org/1140673002

Cr-Commit-Position: refs/heads/master@{#28459}
2015-05-19 03:11:23 +00:00
machenbach
91f38435ea Revert of [V8] Added Script::is_opaque flag for embedders (patchset #5 id:80001 of https://codereview.chromium.org/1140673002/)
Reason for revert:
[Sheriff] Breaks chromium win compilation:
http://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Win/builds/96

Original issue's description:
> [V8] Added Script::is_opaque flag for embedders
>
> When the page is controlled by a ServiceWorker, the ServiceWorker can return an opaque (non-CORS cross origin) resource response.
> We need to treat the messages from such script resource as opaque.
>
> Committed: https://crrev.com/7a599c5e1242d3c5ab7515ee149623da90ae69ec
> Cr-Commit-Position: refs/heads/master@{#28445}

TBR=mkwst@chromium.org,jochen@chromium.org,yangguo@chromium.org,horo@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1135343005

Cr-Commit-Position: refs/heads/master@{#28449}
2015-05-18 14:54:42 +00:00
horo
7a599c5e12 [V8] Added Script::is_opaque flag for embedders
When the page is controlled by a ServiceWorker, the ServiceWorker can return an opaque (non-CORS cross origin) resource response.
We need to treat the messages from such script resource as opaque.

Review URL: https://codereview.chromium.org/1140673002

Cr-Commit-Position: refs/heads/master@{#28445}
2015-05-18 13:54:24 +00:00
rossberg
fe6598cffb [strong] Object literals create strong objects
R=dslomov@chromium.org
BUG=v8:3956
LOG=N

Review URL: https://codereview.chromium.org/1134333005

Cr-Commit-Position: refs/heads/master@{#28444}
2015-05-18 13:23:17 +00:00
jochen
7590d302e3 Fix deprecation declarations in headers
BUG=none
R=ulan@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/1127963005

Cr-Commit-Position: refs/heads/master@{#28407}
2015-05-15 01:48:20 +00:00
jochen
ae87d088bc Deprecate Isolate::New
Embedders need to always pass CreateParams now

BUG=none
LOG=y
R=vogelheim@chromium.org

Review URL: https://codereview.chromium.org/1133723004

Cr-Commit-Position: refs/heads/master@{#28353}
2015-05-12 04:59:40 +00:00
erikcorry
5bc51bb454 Postpone counters triggered during GC, and use a HandleScope when calling back.
R=jkummerow@chromium.org,hpayer@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1125383007

Cr-Commit-Position: refs/heads/master@{#28335}
2015-05-11 10:57:53 +00:00
machenbach
19a28dcefd Revert of Add the concept of a V8 extras exports object (patchset #5 id:80001 of https://codereview.chromium.org/1128113006/)
Reason for revert:
[Sheriff] Causes gc stress failures:
http://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20arm64%20-%20sim%20-%20gc%20stress/builds/2167

Original issue's description:
> Add the concept of a V8 extras exports object
>
> Exposed to the extras as extrasExports (on the builtins object), on
> which they can put things that should be accessible from C++. Exposed
> to C++ through the V8 API as v8::Context::GetExtrasExportsObject().
>
> Adding a test (in test-api.cc) required adding a simple extra,
> test-extra.js, which we build into the standalone builds.
>
> R=yangguo@chromium.org, jochen@chromium.org
> BUG=
>
> Committed: https://crrev.com/ad547cea05f3e02c67243b682e933fc53ac763d9
> Cr-Commit-Position: refs/heads/master@{#28317}

TBR=jochen@chromium.org,yangguo@chromium.org,domenic@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

Review URL: https://codereview.chromium.org/1127313005

Cr-Commit-Position: refs/heads/master@{#28332}
2015-05-11 08:19:58 +00:00
domenic
ad547cea05 Add the concept of a V8 extras exports object
Exposed to the extras as extrasExports (on the builtins object), on
which they can put things that should be accessible from C++. Exposed
to C++ through the V8 API as v8::Context::GetExtrasExportsObject().

Adding a test (in test-api.cc) required adding a simple extra,
test-extra.js, which we build into the standalone builds.

R=yangguo@chromium.org, jochen@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1128113006

Cr-Commit-Position: refs/heads/master@{#28317}
2015-05-08 12:06:35 +00:00
ben
6618793e87 Add ObjectTemplate::New() taking FunctionTemplate.
I know the bug has been closed but this seems like a simple addition that may
be useful in other ways as well.

BUG=v8:2180
LOG=N

Review URL: https://codereview.chromium.org/1128553002

Cr-Commit-Position: refs/heads/master@{#28261}
2015-05-06 14:10:44 +00:00
jochen
98140318fa Unify internal and external typed arrays a bit
Just give internal ones an ArrayBuffer with a NULL backing store. This
simplifies the access checks a lot.

BUG=v8:3996
R=hpayer@chromium.org,verwaest@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/1109353003

Cr-Commit-Position: refs/heads/master@{#28168}
2015-04-30 13:46:34 +00:00
Jochen Eisinger
66f428dd37 Bump Isolate::New back to deprecate soon
R=machenbach@chromium.org
TBR=machenbach@chromium.org

Review URL: https://codereview.chromium.org/1115133002

Cr-Commit-Position: refs/heads/master@{#28152}
2015-04-30 09:44:55 +00:00
jochen
9ba5fe028f Pass ArrayBuffer::Allocator via Isolate::CreateParams
We shouldn't have shared state between isolates by default. The embedder
is free to pass the same allocator to all isolates it creates.

BUG=none
R=dcarney@chromium.org
LOG=y

Review URL: https://codereview.chromium.org/1116633002

Cr-Commit-Position: refs/heads/master@{#28127}
2015-04-29 09:54:43 +00:00
machenbach
4c1f9d53cf Revert of deprecate non-phantom weak callbacks (patchset #1 id:1 of https://codereview.chromium.org/1103173002/)
Reason for revert:
[Sheriff] This is still used and now blocks the roll here:
http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_compile_dbg_ng/builds/47889

Original issue's description:
> Reland: deprecate non-phantom weak callbacks
>
> BUG=
>
> Committed: https://crrev.com/3be656fb55ad49834ec8ec0a57ba858bb1b21f37
> Cr-Commit-Position: refs/heads/master@{#28094}

TBR=jochen@chromium.org,dcarney@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

Review URL: https://codereview.chromium.org/1117623002

Cr-Commit-Position: refs/heads/master@{#28121}
2015-04-29 05:57:15 +00:00
ssid
0a1352a716 Extending v8::GetHeapStatistics to return total available size.
For dumping memory statistics about v8 heap, we need the total
available size of the heap. This CL adds extra field in HeapStatistics
to return the available size.

BUG=476013
LOG=Y

Review URL: https://codereview.chromium.org/1104123002

Cr-Commit-Position: refs/heads/master@{#28100}
2015-04-28 10:57:15 +00:00
dcarney
3be656fb55 Reland: deprecate non-phantom weak callbacks
BUG=

Review URL: https://codereview.chromium.org/1103173002

Cr-Commit-Position: refs/heads/master@{#28094}
2015-04-28 08:31:24 +00:00
machenbach
c5797f859a Revert of deprecate non-phantom weak callbacks (patchset #1 id:1 of https://codereview.chromium.org/1103173002/)
Reason for revert:
[Sheriff] Fails compilation on chromium android:
http://build.chromium.org/p/client.v8/builders/Android%20Builder/builds/4131

Is the chromium version our builder used maybe too old (it uses lkcr)? In that case please reland as soon as it's up-to-date.

Original issue's description:
> deprecate non-phantom weak callbacks
>
> BUG=
>
> Committed: https://crrev.com/39c31da2142ab0fca9dae279b9e59cd4951a1982
> Cr-Commit-Position: refs/heads/master@{#28077}

TBR=jochen@chromium.org,dcarney@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

Review URL: https://codereview.chromium.org/1104163002

Cr-Commit-Position: refs/heads/master@{#28079}
2015-04-27 13:30:19 +00:00
dcarney
39c31da214 deprecate non-phantom weak callbacks
BUG=

Review URL: https://codereview.chromium.org/1103173002

Cr-Commit-Position: refs/heads/master@{#28077}
2015-04-27 13:06:18 +00:00
dcarney
202a97c88e make Handle a synonym of Local
R=svenpanne@chromium.org

BUG=

Review URL: https://codereview.chromium.org/679143002

Cr-Commit-Position: refs/heads/master@{#27951}
2015-04-21 08:15:57 +00:00
jochen
ad854ea11e Allow for accessing an ArrayBuffer contents without externalizing it
The embedder has to take appropriate steps to ensure that the
ArrayBuffer doesn't die while it's accessing the pointer, e.g. keep a
Local handle to it around

BUG=none
R=dslomov@chromium.org
LOG=y

Review URL: https://codereview.chromium.org/1095083002

Cr-Commit-Position: refs/heads/master@{#27942}
2015-04-20 15:01:43 +00:00
jochen
53cc6486df Remove support for externally backed elements from the API
Embedders should use ArrayBuffers instead

BUG=v8:3996
LOG=y
R=verwaest@chromium.org,dslomov@chromium.org,kbr@chromium.org

Review URL: https://codereview.chromium.org/1092923002

Cr-Commit-Position: refs/heads/master@{#27939}
2015-04-20 13:31:27 +00:00
jochen
36f17ed030 Deprecate 3-args ResourceConstraints::ConfigureDefaults
Embedders should use the 2-args version. Number of cores is just
ignored.

BUG=none
R=dcarney@chromium.org
LOG=y

Review URL: https://codereview.chromium.org/1080633006

Cr-Commit-Position: refs/heads/master@{#27938}
2015-04-20 13:26:21 +00:00
ssid
4a597f527a Adding missing V8_EXPORT flag in SpaceStatistics class in v8.h
This class was added in crrev.com/1058253003 and missed V8_EXPORT in
definition.

BUG=466141, 476013
LOG=Y

Review URL: https://codereview.chromium.org/1090333002

Cr-Commit-Position: refs/heads/master@{#27926}
2015-04-17 19:33:13 +00:00
ssid
281d30d758 Adding V8 api to get memory statistics of spaces in V8::Heap.
This is first step towards adding V8 heap statistics to the memory
tracing infrastructure. For being able to get useful memory number into
the memory dump, v8 needs to provide an external api needs to obtain
more information about the heap. So, this Cl extends the api to give
information about the memory allocated and used in the spaces.

BUG=466141, 476013
LOG=Y

Review URL: https://codereview.chromium.org/1058253003

Cr-Commit-Position: refs/heads/master@{#27919}
2015-04-17 14:04:24 +00:00
jochen
47cca4684e Remove support for specifying the number of available threads
The embedder can control how many threads it wants to use via the
v8::Platform implementation. V8 internally doesn't spin up threads
anymore. If the embedder doesn't want to use any threads at all, it's
v8::Platform implementation must either run the background jobs on
the foreground thread, or the embedder should specify --predictable

BUG=none
R=yangguo@chromium.org
LOG=y

Review URL: https://codereview.chromium.org/1064723005

Cr-Commit-Position: refs/heads/master@{#27833}
2015-04-15 07:15:43 +00:00
jochen
ac23150fd2 When converting Maybe and MaybeLocal values with a check, always check
An embedder that wants to avoid the check should use MaybeLocal::ToLocal.

BUG=none
R=dcarney@chromium.org
LOG=y

Review URL: https://codereview.chromium.org/1083943002

Cr-Commit-Position: refs/heads/master@{#27832}
2015-04-15 07:11:50 +00:00
jochen
ada32ae636 Expose ArrayBufferView::HasBuffer
This allows the embedder to decide whether it's worthwhile to copy the
contents to avoid materializing a buffer.

BUG=v8:3996
R=dslomov@chromium.org,kbr@chromium.org
LOG=y

Review URL: https://codereview.chromium.org/1084513002

Cr-Commit-Position: refs/heads/master@{#27782}
2015-04-13 11:27:58 +00:00
fedor
1f85559a69 api: introduce SealHandleScope
When debugging Handle leaks in io.js we found it very convenient to be
able to Seal some specific (root in our case) scope to prevent Handle
allocations in it, and easily find leakage.

R=yangguo
BUG=

Review URL: https://codereview.chromium.org/1079713002

Cr-Commit-Position: refs/heads/master@{#27766}
2015-04-10 23:17:09 +00:00
verwaest
4bd9bdbb28 Reland "Merge cellspace into old pointer space"
This fixes the arm(64) and mips(64) write barriers

BUG=

Review URL: https://codereview.chromium.org/1073133002

Cr-Commit-Position: refs/heads/master@{#27751}
2015-04-10 13:54:10 +00:00
jochen
f56fb72f98 Special case the "empty string" root so it doesn't constantly jump around
BUG=none
R=hpayer@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/1075133002

Cr-Commit-Position: refs/heads/master@{#27736}
2015-04-10 09:23:44 +00:00
adamk
9e3e0aaa88 Revert of Merge cellspace into old pointer space (patchset #8 id:180001 of https://codereview.chromium.org/1010803012/)
Reason for revert:
Causes test failures on ARM bots related to cells and write barriers.

Original issue's description:
> Merge cellspace into old pointer space
>
> BUG=
>
> Committed: https://crrev.com/4e7163ce05f135918205c7855ae60a48e5d46cc5
> Cr-Commit-Position: refs/heads/master@{#27707}

TBR=hpayer@chromium.org,balazs.kilvady@imgtec.com,yangguo@chromium.org,verwaest@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

Review URL: https://codereview.chromium.org/1053243003

Cr-Commit-Position: refs/heads/master@{#27711}
2015-04-09 18:16:40 +00:00
verwaest
4e7163ce05 Merge cellspace into old pointer space
BUG=

Review URL: https://codereview.chromium.org/1010803012

Cr-Commit-Position: refs/heads/master@{#27707}
2015-04-09 13:34:21 +00:00
hpayer
59be4ba7f4 Reland "Merge old data and pointer space."
This reverts commit cbfcee5575.

BUG=

Review URL: https://codereview.chromium.org/1051233002

Cr-Commit-Position: refs/heads/master@{#27623}
2015-04-07 11:32:10 +00:00
jkummerow
90cbede588 Move prototype metadata from internal properties to prototype maps
The motivation is that we prefer to avoid creating internal properties, and we have a usable field on maps ("transitions", which is not used for prototype maps).
This CL also ensures the invariant that prototype maps are never shared, even if they are in dictionary mode.

Review URL: https://codereview.chromium.org/1033653002

Cr-Commit-Position: refs/heads/master@{#27617}
2015-04-07 10:42:57 +00:00
dcarney
9038004932 Revert of make ToLocalCheck crash in release mode (patchset #1 id:1 of https://codereview.chromium.org/1043363005/)
Reason for revert:
breaks some devtools things

Original issue's description:
> make ToLocalCheck crash in release mode
>
> R=svenpanne@chromium.org
> BUG=
>
> Committed: https://crrev.com/ce7cc5119c1e031bf1eb8476fbf5e55bef738f94
> Cr-Commit-Position: refs/heads/master@{#27585}

TBR=svenpanne@chromium.org,machenbach@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

Review URL: https://codereview.chromium.org/1057873003

Cr-Commit-Position: refs/heads/master@{#27589}
2015-04-02 13:09:28 +00:00
dcarney
ce7cc5119c make ToLocalCheck crash in release mode
R=svenpanne@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1043363005

Cr-Commit-Position: refs/heads/master@{#27585}
2015-04-02 10:59:51 +00:00
jochen
2a5eb8299b Expose an API on ArrayBufferView to copy out content w/o changing the buffer
BUG=v8:3996
LOG=y
R=dslomov@chromium.org,kbr@chromium.org,hpayer@chromium.org

Review URL: https://codereview.chromium.org/1041403003

Cr-Commit-Position: refs/heads/master@{#27580}
2015-04-02 09:36:39 +00:00
adamk
729b85ae86 Add a UseCounter for Object.observe
It triggers once per context that calls observe (or attempts to access
any observation metadata, e.g. through Object.getNotifier).

Review URL: https://codereview.chromium.org/1048213002

Cr-Commit-Position: refs/heads/master@{#27557}
2015-03-31 23:03:19 +00:00
jochen
3fbc0cb79a Deprecate IdleNotification()
Embedders should use IdleNotificationDeadline()

BUG=none
R=hpayer@chromium.org
LOG=y

Review URL: https://codereview.chromium.org/1019793008

Cr-Commit-Position: refs/heads/master@{#27550}
2015-03-31 17:11:21 +00:00
erikcorry
de9c3e59f0 Record various overflow events on the heap - reland of 1029323003
R=hpayer@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1040763002

Cr-Commit-Position: refs/heads/master@{#27520}
2015-03-30 11:56:36 +00:00
dcarney
f303b81bde ensure maybe results are checked in v8.h
also some drive-by handlescope fixes in api.cc

R=svenpanne@chromium.org

BUG=

Review URL: https://codereview.chromium.org/1040043002

Cr-Commit-Position: refs/heads/master@{#27510}
2015-03-30 09:16:07 +00:00