Commit Graph

1352 Commits

Author SHA1 Message Date
mlippautz
5b1de36d93 [api] Remove EmbedderReachableReferenceReporter
API was highly experimental. Embedders should use V8::RegisterExternalReference instead.

BUG=chromium:468240
R=jochen@chromium.org

Review-Url: https://codereview.chromium.org/2474163002
Cr-Commit-Position: refs/heads/master@{#40769}
2016-11-04 14:28:56 +00:00
vogelheim
cadcd787cf V8 support for cached accessors.
Some accessors requires little to no computation at all, its result can be
cached in a private property, avoiding the call overhead.
Calls to the getter are translated into a cheap property load.

Follow-on to crrev.com/2347523003, from peterssen@google.com

BUG=chromium:634276, v8:5548

Review-Url: https://codereview.chromium.org/2405213002
Cr-Commit-Position: refs/heads/master@{#40765}
2016-11-04 13:03:18 +00:00
dcheng
7fede7bb98 Set global proxy internal field count based on the global object template.
BUG=v8:5588
R=jochen@chromium.org

Review-Url: https://codereview.chromium.org/2475433008
Cr-Commit-Position: refs/heads/master@{#40755}
2016-11-04 10:02:36 +00:00
neis
43995e2fa8 [modules] Make ModuleInfoEntry a Struct rather than FixedArray.
It always has the same number of slots.

R=adamk@chromium.org
TBR=bmeurer@chromium.org
BUG=v8:1569

Review-Url: https://codereview.chromium.org/2460353002
Cr-Commit-Position: refs/heads/master@{#40754}
2016-11-04 09:37:43 +00:00
jochen
bf77741d43 Reland "Create internal fields on global proxy objects"
Original CL description:
> Create internal fields on global proxy objects
>
> BUG=v8:5588
> R=verwaest@chromium.org

BUG=v8:5588
TBR=verwaest@chromium.org

Review-Url: https://codereview.chromium.org/2472573004
Cr-Commit-Position: refs/heads/master@{#40705}
2016-11-02 14:40:31 +00:00
machenbach
b19abf5371 Revert "Create internal fields on global proxy objects"
This reverts commit 26547761ef.

Breaks layout tests:
https://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Linux%2064/bui...

See also:
https://github.com/v8/v8/wiki/Blink-layout-tests

BUG=v8:5588
TBR=jochen@chromium.org, verwaest@chromium.org, hablich@chromium.org

Review-Url: https://codereview.chromium.org/2467073002
Cr-Commit-Position: refs/heads/master@{#40686}
2016-11-01 20:40:09 +00:00
jochen
26547761ef Create internal fields on global proxy objects
BUG=v8:5588
R=verwaest@chromium.org

Review-Url: https://codereview.chromium.org/2467463002
Cr-Commit-Position: refs/heads/master@{#40670}
2016-10-31 14:16:24 +00:00
jochen
f074215082 Add a native data property that replaces itself with a real data property
This is useful for things that don't ever change, but we don't want to
eagerly compute the result.

Doing this from the embedder is difficult, using DefineOwnProperty would
read the property to get the property descriptor, creating an endless
recursion.

R=verwaest@chromium.org,haraken@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2449783006
Cr-Commit-Position: refs/heads/master@{#40648}
2016-10-28 14:40:11 +00:00
yangguo
39ed137bce [serializer] introduce API to serialize internal fields
See https://goo.gl/C9U1dL

BUG=chromium:617892

Review-Url: https://codereview.chromium.org/2452333002
Cr-Commit-Position: refs/heads/master@{#40623}
2016-10-27 13:35:36 +00:00
mtrofin
91a5a219d4 [wasm] Avoid double-serializing the wire bytes
Since the public API for deserialization is now just DeserializeOrCompile,
we can trickle down the wire bytes to the deserialization logic, and
avoid the need for duplicating the wire bytes when serializing.

BUG=chromium:657316

Review-Url: https://chromiumcodereview.appspot.com/2433273002
Cr-Commit-Position: refs/heads/master@{#40516}
2016-10-22 15:15:04 +00:00
heimbuef
ef690ca387 Constrain the zone segment pool size
Added a size constraint to the configuration to limit the segment pool.
This will likely fix the memory alerts from small android devices.

BUG=chromium:655129

Review-Url: https://chromiumcodereview.appspot.com/2424393002
Cr-Commit-Position: refs/heads/master@{#40476}
2016-10-20 14:48:55 +00:00
mtrofin
2282dd0941 [wasm] remove deprecated deserialization API
We don't need the Deserialize API taking in a SerializedData anymore.

BUG=

Review-Url: https://chromiumcodereview.appspot.com/2436543004
Cr-Commit-Position: refs/heads/master@{#40473}
2016-10-20 14:19:30 +00:00
ishell
73460009a6 [ic] Support data handlers that represent loads from prototypes.
This CL also adds separate runtime call stats buckets for data handlers.

BUG=

Review-Url: https://codereview.chromium.org/2419513002
Cr-Commit-Position: refs/heads/master@{#40281}
2016-10-13 16:19:24 +00:00
jochen
29ddd7ff82 Fix import/export annotations for v8 targets that are always static
Instead of suppressing the linker warnings and disallowing incremental
linking, just fix the annotations..

R=machenbach@chromium.org,jgruber@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2420603002
Cr-Commit-Position: refs/heads/master@{#40260}
2016-10-13 12:44:36 +00:00
gsathya
6f94a8f1c7 [promises] Move PromiseReactionJob to c++
This patch results in a 11% improvement over 5 runs in the
bluebird benchmark.

BUG=v8:5343,v8:5046
TBR=bmeurer@chromium.org

Review-Url: https://codereview.chromium.org/2406343002
Cr-Commit-Position: refs/heads/master@{#40239}
2016-10-12 20:45:57 +00:00
mtrofin
38ac7fe658 [wasm] API renames for wasm serialization/deserialization
This incorporates recent feedback:
- simpler deserialization API by dropping the std::unique_ptr.
The only purpose there was communicating to the caller that they
own the buffer, and that the deserializer won't delete it. The new
design communicates that through a naming choice.
- renamed *UncompiledBytes to *WasmWireBytes

BUG=

Review-Url: https://codereview.chromium.org/2411263004
Cr-Commit-Position: refs/heads/master@{#40238}
2016-10-12 20:11:29 +00:00
adamk
9d2051fc28 [modules] Store Module metadata in per-Context EmbedderData
This is a re-land of https://codereview.chromium.org/2393303002/ with
an additional call to DisposeModuleEmbedderData() added to fix lsan failures.

Unifies the approaches used for storing the specifier -> module mapping
and the module -> directory mapping, using std::unordered_maps for both
and storing them per-Context.

This requires adding a method to the v8::Module API to get a hash code
for a Module, but allows slimming down the API in return: gone are
SetEmbedderData/GetEmbedderData, along with the fourth argument
to ResolveModuleCallback.

Besides a simpler API, this allows d8 to get closer to the HTML loader,
which requires each Realm to have a persistent module map (though this
capability is not yet exercised by any tests).

BUG=v8:1569
TBR=neis@chromium.org,jochen@chromium.org

Review-Url: https://codereview.chromium.org/2405313002
Cr-Commit-Position: refs/heads/master@{#40186}
2016-10-11 19:22:25 +00:00
adamk
127798897f Revert of [modules] Store Module metadata in per-Context EmbedderData (patchset #7 id:120001 of https://codereview.chromium.org/2393303002/ )
Reason for revert:
Fails under LeakSanitizer on auto-roll fyi bot:

https://build.chromium.org/p/client.v8.fyi/builders/Auto-roll%20-%20release%20process/builds/49447

Original issue's description:
> [modules] Store Module metadata in per-Context EmbedderData
>
> Unifies the approaches used for storing the specifier -> module mapping
> and the module -> directory mapping, using std::unordered_maps for both
> and storing them per-Context.
>
> This requires adding a method to the v8::Module API to get a hash code
> for a Module, but allows slimming down the API in return: gone are
> SetEmbedderData/GetEmbedderData, along with the fourth argument
> to ResolveModuleCallback.
>
> Besides a simpler API, this allows d8 to get closer to the HTML loader,
> which requires each Realm to have a persistent module map (though this
> capability is not yet exercised by any tests).
>
> BUG=v8:1569
>
> Committed: https://crrev.com/9cf8fce74cf6e7afd6aea3f3545f6bb61572f277
> Cr-Commit-Position: refs/heads/master@{#40133}

TBR=jochen@chromium.org,neis@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:1569

Review-Url: https://codereview.chromium.org/2406973003
Cr-Commit-Position: refs/heads/master@{#40145}
2016-10-11 00:25:12 +00:00
adamk
9cf8fce74c [modules] Store Module metadata in per-Context EmbedderData
Unifies the approaches used for storing the specifier -> module mapping
and the module -> directory mapping, using std::unordered_maps for both
and storing them per-Context.

This requires adding a method to the v8::Module API to get a hash code
for a Module, but allows slimming down the API in return: gone are
SetEmbedderData/GetEmbedderData, along with the fourth argument
to ResolveModuleCallback.

Besides a simpler API, this allows d8 to get closer to the HTML loader,
which requires each Realm to have a persistent module map (though this
capability is not yet exercised by any tests).

BUG=v8:1569

Review-Url: https://codereview.chromium.org/2393303002
Cr-Commit-Position: refs/heads/master@{#40133}
2016-10-10 17:37:51 +00:00
mtrofin
cc02e74320 [wasm] Avoid copying when deserializing wasm
Updated the deserialization API to avoid copying uncompiled
bytes.

BUG=

Review-Url: https://codereview.chromium.org/2404673002
Cr-Commit-Position: refs/heads/master@{#40108}
2016-10-10 04:12:45 +00:00
neis
0d2830a265 Minor comment fixes.
R=adamk@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2394173002
Cr-Commit-Position: refs/heads/master@{#40069}
2016-10-07 08:23:48 +00:00
mtrofin
917ef616cc [wasm] Support recompilation if deserialization fails.
One step closer to the informally-agreed upon specification
that structured cloning will always succeed, meaning, if
we fail to deserialize (e.g. because version mismatch in
serialized format and v8 version), we recompile.

As part of this work, the deserializer will need to become
more resilient to invalid input data, and fail graciously
rather than CHECK-ing. This CL addresses some of that,
sufficient to unblock the current serialization tests.
Subsequent CLs will add more testing and the appropriate
fixes.

BUG=639090

Review-Url: https://codereview.chromium.org/2395793003
Cr-Commit-Position: refs/heads/master@{#40058}
2016-10-06 19:33:57 +00:00
jbroman
5fa2734d39 ValueSerializer: Expose reading/writing doubles to embedder.
BUG=chromium:148757

Review-Url: https://codereview.chromium.org/2386233002
Cr-Commit-Position: refs/heads/master@{#39955}
2016-10-04 13:44:41 +00:00
hlopko
0698f10661 Introduce EmbedderReachableReferenceReporter
This cl introduces reporter to the embedder heap tracer. Heap tracer uses
reporter to report reachable objects from embedder heap. This refactoring is a
step towards being able to take heap snapshots with wrapper tracing.

LOG=no
BUG=468240

Review-Url: https://codereview.chromium.org/2371733002
Cr-Commit-Position: refs/heads/master@{#39824}
2016-09-28 12:55:12 +00:00
franzih
ab486146d4 [api] Add documentation for various HasProperty functions.
Add documentation for Has(), HasOwnProperty(), and HasRealNamedProperty()
that points out their differences and links to the other functions.

BUG=v8:5433

Review-Url: https://codereview.chromium.org/2365403003
Cr-Commit-Position: refs/heads/master@{#39818}
2016-09-28 09:57:46 +00:00
haraken
9285e66630 Add v8::Object::CreationContext that works for a persistent handle
I need this API for https://codereview.chromium.org/1609343002/.

BUG=483722

Review-Url: https://codereview.chromium.org/1627233002
Cr-Commit-Position: refs/heads/master@{#39775}
2016-09-27 14:19:46 +00:00
littledan
713e247e7d Add method on Value::IsAsyncFunction to detect async functions
DevTools wants to be able to detect async functions in order to print
their synopsis better in stack traces and tooltips. This patch provides a
simple method to do the check.

BUG=v8:4483

Review-Url: https://codereview.chromium.org/2365833002
Cr-Commit-Position: refs/heads/master@{#39687}
2016-09-23 18:31:33 +00:00
adamk
3bbd11c233 [modules] Do path resolution relative to each module file in d8
BUG=v8:1569

Review-Url: https://codereview.chromium.org/2361593002
Cr-Commit-Position: refs/heads/master@{#39646}
2016-09-22 21:03:42 +00:00
gsathya
8c87ae9b88 [promises] Move PromiseResolveThenableJob to c++
- Add a new container object to store the data required for
PromiseResolveThenableJob.

- Create a new runtime function to enqueue the microtask event with
the required data.

This patches causes a 4% regression in the bluebird benchmark.

BUG=v8:5343

Review-Url: https://codereview.chromium.org/2314903004
Cr-Commit-Position: refs/heads/master@{#39571}
2016-09-21 03:49:50 +00:00
adamk
cf127e8144 [modules] Expand API to allow linking and use it in d8
This patch gives the ability for the embedder to ask for the
module requests of a module, and to pass a ResolveCallback
into Module::Instantiate().

In d8, I've implemented a simple module_map that's used
along with this API to allow loading, compiling, instantiating,
and evaluating a whole tree of modules.

No path resolution is yet implemented, meaning that all
import paths are relative to whatever directory d8 runs
in. And no imports are linked to the exports of the
requested module.

BUG=v8:1569

Review-Url: https://codereview.chromium.org/2351113004
Cr-Commit-Position: refs/heads/master@{#39569}
2016-09-20 23:39:41 +00:00
jgruber
4f5695229e [d8] Fix the shared-library build
This commit ensures that the d8 shared library build uses the same logic as
the standard static build by exporting relevant functions and classes.

BUG=chromium:646337

Committed: https://crrev.com/2c10ca8086a4d595ecf9aa843d2031b068470d65
Review-Url: https://codereview.chromium.org/2342563002
Cr-Original-Commit-Position: refs/heads/master@{#39503}
Cr-Commit-Position: refs/heads/master@{#39547}
2016-09-20 12:06:54 +00:00
machenbach
298ee9cde1 Revert of [d8] Fix the shared-library build (patchset #12 id:20002 of https://codereview.chromium.org/2342563002/ )
Reason for revert:
Unblocking roll

Original issue's description:
> [d8] Fix the shared-library build
>
> This commit ensures that the d8 shared library build uses the same logic as
> the standard static build by exporting relevant functions and classes.
>
> BUG=chromium:646337
>
> Committed: https://crrev.com/2c10ca8086a4d595ecf9aa843d2031b068470d65
> Cr-Commit-Position: refs/heads/master@{#39503}

TBR=jochen@chromium.org,vogelheim@chromium.org,bmeurer@chromium.org,titzer@chromium.org,jgruber@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:646337

Review-Url: https://codereview.chromium.org/2356703003
Cr-Commit-Position: refs/heads/master@{#39526}
2016-09-20 07:13:27 +00:00
jgruber
2c10ca8086 [d8] Fix the shared-library build
This commit ensures that the d8 shared library build uses the same logic as
the standard static build by exporting relevant functions and classes.

BUG=chromium:646337

Review-Url: https://codereview.chromium.org/2342563002
Cr-Commit-Position: refs/heads/master@{#39503}
2016-09-19 12:47:22 +00:00
adamk
aa6db9d990 [modules] Introduce v8::Module to the API and return it from CompileModule
R=neis@chromium.org
BUG=v8:1569

Review-Url: https://codereview.chromium.org/2347933002
Cr-Commit-Position: refs/heads/master@{#39481}
2016-09-16 21:47:54 +00:00
neis
7c05d8a4a6 [modules] Turn JSModule into Module.
Rename JSModule to Module and make it a Struct rather than a JSObject.  We will
later add a separate JSModuleNamespace object to implement the 'import * as foo'
syntax.

BUG=v8:1569

Review-Url: https://codereview.chromium.org/2345823002
Cr-Commit-Position: refs/heads/master@{#39477}
2016-09-16 16:47:56 +00:00
jbroman
d825492bb6 Support delegating serialization of host objects.
This exposes an interface for the embedder to provide a delegate which can
serialize or deserialize embedder-specific objects, like Blink's DOM wrappers.

BUG=chromium:148757

Review-Url: https://codereview.chromium.org/2327653002
Cr-Commit-Position: refs/heads/master@{#39422}
2016-09-14 16:42:07 +00:00
franzih
16f34a416e [api] Add documentation for IndexedPropertyCallbacks.
BUG=v8:5260

Review-Url: https://codereview.chromium.org/2322673004
Cr-Commit-Position: refs/heads/master@{#39310}
2016-09-09 14:11:34 +00:00
franzih
b0a7738a5f [api] Add interceptor for getOwnPropertyDescriptor().
The existing PropertyQueryCallback intercepts getOwnPropertyDescriptor, but
it returns only value and attributes, not the accessors. This
PropertyDescriptorCallback returns a descriptor similar to Ecma-262 6.2.4.

You can either set a PropertyQueryCallback or a PropertyDescriptorCallback,
but not both. When you set a callback for DefineProperty(), you can set a
PropertyDescriptorCallback but not a PropertyQueryCallback.

BUG=v8:5359

Review-Url: https://codereview.chromium.org/2311873002
Cr-Commit-Position: refs/heads/master@{#39279}
2016-09-08 12:51:49 +00:00
franzih
9048298d4c [api] Fix typo.
BUG=

Review-Url: https://codereview.chromium.org/2315413002
Cr-Commit-Position: refs/heads/master@{#39259}
2016-09-07 18:55:40 +00:00
franzih
2b13976820 [api] Rename parameter for consistency.
BUG=

Review-Url: https://codereview.chromium.org/2311913002
Cr-Commit-Position: refs/heads/master@{#39218}
2016-09-06 16:35:53 +00:00
franzih
ca6c87341f [api] Improve documentation for PropertyDeleterCallback.
BUG=v8:5260

Review-Url: https://codereview.chromium.org/2312863003
Cr-Commit-Position: refs/heads/master@{#39215}
2016-09-06 15:54:00 +00:00
jbroman
5a97e95520 Handle errors in v8::ValueDeserializer by throwing exceptions.
This restores the contract that all API methods that return Maybe<T> or
MaybeLocal<T> always throw an exception when they return nothing.

Since v8::ValueDeserializer::ReadHeader can now throw exceptions, it
needs a Local<Context> parameter so that it can set up execution state
(entering the context, etc.). The old method has been marked for
deprecation, but since this API is experimental I intend to remove it
as soon as I've removed the use from Blink.

value-serializer-unittest has been updated to expect an exception in
all decode failure cases.

BUG=chromium:148757,chromium:641964

Review-Url: https://codereview.chromium.org/2308053002
Cr-Commit-Position: refs/heads/master@{#39188}
2016-09-06 03:24:53 +00:00
jbroman
f72351f540 Throw exceptions for errors in v8::ValueSerializer.
BUG=chromium:148757,chromium:641964

Review-Url: https://codereview.chromium.org/2307603002
Cr-Commit-Position: refs/heads/master@{#39140}
2016-09-02 15:17:07 +00:00
franzih
d9a026e628 [api] Minor improvement to documentation for kNonMasking.
BUG=

Review-Url: https://codereview.chromium.org/2302133003
Cr-Commit-Position: refs/heads/master@{#39137}
2016-09-02 13:16:10 +00:00
franzih
7c401bd84c [api] Add interceptor for defineProperty().
With the Indexed/GenericNamedPropertyDefinerCallback it is possible to intercept Object.defineProperty() calls.

Requests that call JSReceiver::OrdinaryDefineOwnProperty() internally, also trigger the interceptor. This includes Object.freeze(), Object.preventExtensions(), and Object.seal().

As without this patch, the query interceptor triggers on
defineProperty, unless the definer callback
intercepts the request.

As without this patch, the query interceptor triggers on defineProperty, unless the definer callback intercepts the request.

BUG=

Committed: https://crrev.com/b9d985975cf3bab0ded0cec9fafd3799f9bde29a
Review-Url: https://codereview.chromium.org/2272383002
Cr-Original-Commit-Position: refs/heads/master@{#39094}
Cr-Commit-Position: refs/heads/master@{#39122}
2016-09-02 09:09:08 +00:00
jkummerow
9fe4efe5b8 Revert of [api] Add interceptor for defineProperty(). (patchset #9 id:160001 of https://codereview.chromium.org/2272383002/ )
Reason for revert:
Breaks cctest/test-api-interceptors/QueryInterceptor on the waterfall

Original issue's description:
> [api] Add interceptor for defineProperty().
>
> With the Indexed/GenericNamedPropertyDefinerCallback it is possible to intercept Object.defineProperty() calls.
>
> Requests that call JSReceiver::OrdinaryDefineOwnProperty() internally, also trigger the interceptor. This includes Object.freeze(), Object.preventExtensions(), and Object.seal().
>
> BUG=
>
> Committed: https://crrev.com/b9d985975cf3bab0ded0cec9fafd3799f9bde29a
> Cr-Commit-Position: refs/heads/master@{#39094}

TBR=jochen@chromium.org,franzih@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

Review-Url: https://codereview.chromium.org/2303533004
Cr-Commit-Position: refs/heads/master@{#39095}
2016-09-01 16:04:00 +00:00
franzih
b9d985975c [api] Add interceptor for defineProperty().
With the Indexed/GenericNamedPropertyDefinerCallback it is possible to intercept Object.defineProperty() calls.

Requests that call JSReceiver::OrdinaryDefineOwnProperty() internally, also trigger the interceptor. This includes Object.freeze(), Object.preventExtensions(), and Object.seal().

BUG=

Review-Url: https://codereview.chromium.org/2272383002
Cr-Commit-Position: refs/heads/master@{#39094}
2016-09-01 15:18:30 +00:00
franzih
8acb7ab9f1 [api] Add PropertyDescriptor and DefineProperty().
BUG=

Review-Url: https://codereview.chromium.org/2244123005
Cr-Commit-Position: refs/heads/master@{#39093}
2016-09-01 15:09:59 +00:00
franzih
8225465b09 [api] Add documentation for PropertyQueryCallback.
Also add tests that document the behavior of the PropertyQueryCallback.

BUG=v8:5260

Review-Url: https://codereview.chromium.org/2286323002
Cr-Commit-Position: refs/heads/master@{#39090}
2016-09-01 14:41:56 +00:00
jbroman
e2361954e5 Blink-compatible serialization of SharedArrayBuffer.
BUG=chromium:148757

Review-Url: https://codereview.chromium.org/2290753002
Cr-Commit-Position: refs/heads/master@{#39017}
2016-08-30 14:05:49 +00:00
daniel.bevenius
47bcea99fb Updating comment for Proxy::New function
The comment for the Proxy::New functions seems inaccurate and is
currently identical to Map::New:

3090   /**
3091    * Creates a new empty Map.
3092    */
3093   static Local<Map> New(Isolate* isolate);

This commit updates the comment to describe that it creates a Proxy and
not a Map.

BUG=

Review-Url: https://codereview.chromium.org/2176063002
Cr-Commit-Position: refs/heads/master@{#39002}
2016-08-30 09:43:53 +00:00
mlippautz
0f01a5881f [api] Add NumberOfWrappersToTrace to EmbedderHeapTracer.
V8 can use this metter to better estimate the amount of work that is still to be
done by the embedder. Supposed to be used to decide whether incremental marking
should be finalized or not.

BUG=chromium:468240
R=ulan@chromium.org

Review-Url: https://codereview.chromium.org/2291613002
Cr-Commit-Position: refs/heads/master@{#38985}
2016-08-29 15:38:51 +00:00
franzih
25e2d1588e [api] Add documentation for the PropertyAttribute enum.
Add comments to make it easier to browse the HTML documentation generated with Doxygen.

BUG=v8:5260

Review-Url: https://codereview.chromium.org/2290553003
Cr-Commit-Position: refs/heads/master@{#38982}
2016-08-29 13:22:37 +00:00
franzih
97118fb504 [api] Improve documentation for NamedPropertyGetterCallback.
BUG=v8:5260

Review-Url: https://codereview.chromium.org/2277513003
Cr-Commit-Position: refs/heads/master@{#38951}
2016-08-26 17:14:15 +00:00
franzih
260d0f1c19 [api] Improve documentation for NamedPropertySetterCallback.
BUG=v8:5260

Review-Url: https://codereview.chromium.org/2269053002
Cr-Commit-Position: refs/heads/master@{#38950}
2016-08-26 16:48:58 +00:00
franzih
5aa7230516 [api] Add documentation for PropertyCallbackInfo.This().
BUG=v8:5260

Review-Url: https://codereview.chromium.org/2278523002
Cr-Commit-Position: refs/heads/master@{#38949}
2016-08-26 16:15:55 +00:00
jbroman
864728085d Blink-compatible serialization of ArrayBuffer transfer.
The embedder is expected to arrange for the array buffer contents to be
transferred into a v8::ArrayBuffer in the receiving context (generally by
assuming ownership of the externalized backing store).

BUG=chromium:148757

Review-Url: https://codereview.chromium.org/2275033003
Cr-Commit-Position: refs/heads/master@{#38948}
2016-08-26 15:47:41 +00:00
franzih
7a57dd1540 [api] Add documentation for PropertyCallbackInfo.
BUG=v8:5260

Review-Url: https://codereview.chromium.org/2263303003
Cr-Commit-Position: refs/heads/master@{#38947}
2016-08-26 15:29:21 +00:00
jbroman
58cac6501f Add an experimental public API for value serialization.
Suitably scary warnings attached, as this will yet evolve (notably to handle
host objects, which are not currently handled).

Unit tests adjusted to use the public version of ValueSerializer, eliminating
any need they have to access v8::internal.

With this, Blink can begin using this code experimentally behind a flag as it
develops.

BUG=chromium:148757

Review-Url: https://codereview.chromium.org/2274693002
Cr-Commit-Position: refs/heads/master@{#38915}
2016-08-25 16:00:25 +00:00
franzih
8ce60a195c [api] Disable new and delete using = delete.
According to our style guide on Copyable and Movable Types,
copy/move operators should be disabled using = delete in the public: section.
Use consistent style for disabling new and delete.

BUG=

Review-Url: https://codereview.chromium.org/2276063002
Cr-Commit-Position: refs/heads/master@{#38880}
2016-08-25 04:27:43 +00:00
franzih
6effe72f46 [api] Disable copy constructors using = delete.
According to our style guide on Copyable and Movable Types,
copy/move operators should be disabled using = delete in the public: section,
not in the private: section.

BUG=

Review-Url: https://codereview.chromium.org/2272063002
Cr-Commit-Position: refs/heads/master@{#38879}
2016-08-25 04:24:08 +00:00
franzih
ceadddd15d [api] Disable copy constructors in the public section.
According to our style guide on Copyable and Movable Types,
copy/move operators should be disabled in the public: section, not
in the private: section.

BUG=

Review-Url: https://codereview.chromium.org/2278573002
Cr-Commit-Position: refs/heads/master@{#38872}
2016-08-24 16:28:11 +00:00
franzih
6cfa92fb45 [api] Add documentation for SetHandler().
BUG=v8:5260

Review-Url: https://codereview.chromium.org/2263363002
Cr-Commit-Position: refs/heads/master@{#38831}
2016-08-23 14:41:44 +00:00
franzih
d003bd9b84 [api] Move documentation to the function it describes.
BUG=v8:5260

Review-Url: https://codereview.chromium.org/2262313002
Cr-Commit-Position: refs/heads/master@{#38826}
2016-08-23 14:07:01 +00:00
franzih
3a0a24dcf3 [api] Improve documentation for SetNamedPropertyHandler().
BUG=v8:5260

Review-Url: https://codereview.chromium.org/2268673002
Cr-Commit-Position: refs/heads/master@{#38823}
2016-08-23 13:28:49 +00:00
franzih
30da343d11 [api] Minor fix in documentation.
BUG=

Review-Url: https://codereview.chromium.org/2269033002
Cr-Commit-Position: refs/heads/master@{#38821}
2016-08-23 13:15:06 +00:00
keishi
00c49a3e85 Add kGCCallbackFlagCollectAllExternalMemory for external memory limit triggered gc
BUG=chromium:570268,chromium:621829

Review-Url: https://codereview.chromium.org/2233683002
Cr-Commit-Position: refs/heads/master@{#38808}
2016-08-23 06:23:21 +00:00
littledan
b2a257f9ff Remove --promise-extra flag
This flag was shipped on in 52, so it's due for removal. The patch includes
removing the deprecated and unused-in-Blink API Promise::Chain, and many
test updates.

R=adamk@chromium.org
BUG=v8:4633

Review-Url: https://codereview.chromium.org/2267033002
Cr-Commit-Position: refs/heads/master@{#38804}
2016-08-22 21:35:06 +00:00
mlippautz
fbf1bc66c4 Revert of [heap] Improve size profiling for ArrayBuffer tracking (patchset #6 id:140001 of https://codereview.chromium.org/2210263002/ )
Reason for revert:
Tanks octane

Original issue's description:
> [heap] Improve size profiling for ArrayBuffer tracking
>
> Eagerly account for retained sizes during ArrayBuffer tracking. Following up on this,
> we can now do Scavenges if the amount of memory retained from new space is too large.
>
> BUG=chromium:621829
> R=jochen@chromium.org,hpayer@chromium.org
>
> Committed: https://crrev.com/28e13bd6a75c9467dae43043e7b741a1387d5252
> Cr-Commit-Position: refs/heads/master@{#38731}

TBR=jochen@chromium.org,hpayer@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:621829

Review-Url: https://codereview.chromium.org/2261513003
Cr-Commit-Position: refs/heads/master@{#38739}
2016-08-19 08:17:25 +00:00
mlippautz
28e13bd6a7 [heap] Improve size profiling for ArrayBuffer tracking
Eagerly account for retained sizes during ArrayBuffer tracking. Following up on this,
we can now do Scavenges if the amount of memory retained from new space is too large.

BUG=chromium:621829
R=jochen@chromium.org,hpayer@chromium.org

Review-Url: https://codereview.chromium.org/2210263002
Cr-Commit-Position: refs/heads/master@{#38731}
2016-08-18 20:45:43 +00:00
jgruber
6b7493a4d8 Revert of Use a custom Struct for stack trace storage (patchset #4 id:60001 of https://codereview.chromium.org/2230953002/ )
Reason for revert:
Performance regressions in Gameboy, Life, CodeLoad and others. See crbug.com/638210.

Original issue's description:
> Refactor data structures for simple stack traces
>
> Simple stack traces are captured through Isolate::CaptureSimpleStackTrace.
> Captured frames are stored in a FixedArray, which in turn is stored as a
> property (using a private symbol) on the error object itself. Actual formatting
> of the textual stack trace is done lazily when the user reads the stack
> property of the error object.
>
> This would involve many conversions back and forth between index-encoded raw
> data (receiver, function, offset and code), JS CallSite objects, and C++
> CallSite objects.
>
> This commit refactors the C++ CallSite class into a Struct class called
> StackTraceFrame, which is the new single point of truth frame information.
> Isolate::CaptureSimpleStackTrace stores an array of StackTraceFrames, and JS
> CallSite objects (now created only when the user specifies custom stack trace
> formatting through Error.prepareStackTrace) internally only store a reference
> to a StackTraceFrame.
>
> BUG=
>
> Committed: https://crrev.com/b4c1aefb9c369f1a33a6ca94a5de9b06ea4bf5c4
> Cr-Commit-Position: refs/heads/master@{#38645}

TBR=yangguo@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=

Review-Url: https://codereview.chromium.org/2252783007
Cr-Commit-Position: refs/heads/master@{#38700}
2016-08-18 08:31:26 +00:00
jgruber
b4c1aefb9c Refactor data structures for simple stack traces
Simple stack traces are captured through Isolate::CaptureSimpleStackTrace.
Captured frames are stored in a FixedArray, which in turn is stored as a
property (using a private symbol) on the error object itself. Actual formatting
of the textual stack trace is done lazily when the user reads the stack
property of the error object.

This would involve many conversions back and forth between index-encoded raw
data (receiver, function, offset and code), JS CallSite objects, and C++
CallSite objects.

This commit refactors the C++ CallSite class into a Struct class called
StackTraceFrame, which is the new single point of truth frame information.
Isolate::CaptureSimpleStackTrace stores an array of StackTraceFrames, and JS
CallSite objects (now created only when the user specifies custom stack trace
formatting through Error.prepareStackTrace) internally only store a reference
to a StackTraceFrame.

BUG=

Review-Url: https://codereview.chromium.org/2230953002
Cr-Commit-Position: refs/heads/master@{#38645}
2016-08-16 08:37:07 +00:00
mtrofin
0686c414a6 [wasm] Serialization test using external APIs and contexts
A test exercising the public APIs for wasm serialization and
simulates the serialization scenario - serialize in one isolate, deserialize
in another.

BUG=v8:5072

Review-Url: https://codereview.chromium.org/2249973002
Cr-Commit-Position: refs/heads/master@{#38644}
2016-08-16 08:07:19 +00:00
mtrofin
d29bb4bfab [wasm] serialization: updated external APIs.
We only need these external v8 APIs to expose serialization externally,
so bypassed having an internal layer for now.

BUG=v8:5072

Review-Url: https://codereview.chromium.org/2228073002
Cr-Commit-Position: refs/heads/master@{#38516}
2016-08-10 06:35:42 +00:00
cbruni
0cabbd3d60 [api] Templatize do_callback parameter in CallDepthScope
Drive-by-fix: mark isolates as const in stack-allocated scopes

BUG=chromium:630217

Review-Url: https://codereview.chromium.org/2220993003
Cr-Commit-Position: refs/heads/master@{#38496}
2016-08-09 13:57:49 +00:00
mtrofin
5de4722278 [wasm] external serialization APIs
V8 APIs for wasm serialization/deserialization.

BUG=v8:5072

Review-Url: https://codereview.chromium.org/2226753002
Cr-Commit-Position: refs/heads/master@{#38455}
2016-08-08 18:19:55 +00:00
jochen
682a8f71d8 Mark Local::As and Persistent::As as const
Since they are.

R=verwaest@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2216123003
Cr-Commit-Position: refs/heads/master@{#38386}
2016-08-05 13:00:24 +00:00
haraken
c8241635f1 Change an output parameter of Maybe<T>::To() from a reference to a pointer
This is a follow-up fix for https://codereview.chromium.org/2194793003/

BUG=

Review-Url: https://codereview.chromium.org/2205203002
Cr-Commit-Position: refs/heads/master@{#38305}
2016-08-03 15:10:23 +00:00
cbruni
ce49c32973 [api] Add v8::Object::SetAlignedPointerInInternalFields
This new API function allows for setting several internal fields at once.
By avoiding crossing the API each time for setting an internal property we
can speed up the wrapper creation which has to set two fields for every new
object.

BUG=chromium:630217

Review-Url: https://codereview.chromium.org/2185963002
Cr-Commit-Position: refs/heads/master@{#38299}
2016-08-03 14:39:34 +00:00
haraken
cf1779495d Introduce Maybe::To/ToChecked
Per discussion in https://groups.google.com/a/chromium.org/d/topic/platform-architecture-dev/vGLGCaMqhCU/discussion

BUG=

Review-Url: https://codereview.chromium.org/2194793003
Cr-Commit-Position: refs/heads/master@{#38173}
2016-07-29 10:56:57 +00:00
jochen
562bb5823c Add API to create a "remote" instance of a given FunctionTemplate
BUG=chromium:618305
R=verwaest@chromium.org
CC=dcheng@chromium.org,haraken@chromium.org

Review-Url: https://codereview.chromium.org/2162443002
Cr-Commit-Position: refs/heads/master@{#37867}
2016-07-19 12:22:37 +00:00
bmeurer
0abba43524 [stubs] Improve code generation for ToBoolean.
Introduce a proper CodeStubAssembler::BranchIfToBooleanIsTrue helper
method, that branches to if_true/if_false labels depending on whether
the value that is passed would yield true or false when fed to
ToBoolean. Use this helper to implement the bytecode handlers w/o having
to materialize the temporary booleans and essentially branching twice.
The CodeStubAssembler::BranchIfToBooleanIsTrue helper favors the most
likely case of a Boolean constant now.

Also migrate the ToBooleanStub to a ToBoolean TurboFan builtin, that
also uses the helper method under the hood.

Remove the now obsolete Oddball::to_boolean field.

R=hpayer@chromium.org, rmcilroy@chromium.org, yangguo@chromium.org

Review-Url: https://codereview.chromium.org/2151163002
Cr-Commit-Position: refs/heads/master@{#37849}
2016-07-19 06:16:14 +00:00
jochen
02ba244125 Reland^2 "Don't compile functions in a context the caller doesn't have access to"
Original issue's description:
> Don't compile functions in a context the caller doesn't have access to
>
> Instead just return undefined
>
> A side effect of this is that it's no longer possible to compile
> functions in a detached context.
>
> BUG=chromium:541703
> R=verwaest@chromium.org,bmeurer@chromium.org

BUG=chromium:541703
R=verwaest@chromium.org
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_chromium_rel_ng

Review-Url: https://codereview.chromium.org/2155503004
Cr-Commit-Position: refs/heads/master@{#37842}
2016-07-18 15:35:45 +00:00
daniel.bevenius
d52b403f51 Minor typos in v8.h code documentation.
When reading through the source code (v8.h) I found some minor typos
which I wanted to report.

BUG=

Review-Url: https://codereview.chromium.org/2130513002
Cr-Commit-Position: refs/heads/master@{#37835}
2016-07-18 12:39:49 +00:00
jochen
ad93c01aa5 Track peak Zone memory usage and report it via HeapStatistics
BUG=
R=ulan@chromium.org,verwaest@chromium.org

Review-Url: https://codereview.chromium.org/2153423002
Cr-Commit-Position: refs/heads/master@{#37824}
2016-07-18 09:32:01 +00:00
wfh
bc44b1c627 V8: Add API to report OOM to embedder.
This is a dependent CL for the blink/chromium side change in https://codereview.chromium.org/2130293003/

BUG=614440

Review-Url: https://codereview.chromium.org/2139873002
Cr-Commit-Position: refs/heads/master@{#37781}
2016-07-14 19:42:39 +00:00
jochen
63449d21d3 Revert of Reland "Don't compile functions in a context the caller doesn't have access to" (patchset #4 id:60001 of https://codereview.chromium.org/2143893005/ )
Reason for revert:
blink is unhappy about the microtask change

Original issue's description:
> Reland "Don't compile functions in a context the caller doesn't have access to"
>
> Original issue's description:
> > Don't compile functions in a context the caller doesn't have access to
> >
> > Instead just return undefined
> >
> > A side effect of this is that it's no longer possible to compile
> > functions in a detached context.
> >
> > BUG=chromium:541703
> > R=verwaest@chromium.org,bmeurer@chromium.org
>
> BUG=chromium:541703
> R=verwaest@chromium.org
>
> Committed: https://crrev.com/6bceabac5b705b2ce1f52d34650cea1ae3b8c617
> Cr-Commit-Position: refs/heads/master@{#37756}

TBR=verwaest@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:541703

Review-Url: https://codereview.chromium.org/2151843002
Cr-Commit-Position: refs/heads/master@{#37760}
2016-07-14 12:39:13 +00:00
jochen
6bceabac5b Reland "Don't compile functions in a context the caller doesn't have access to"
Original issue's description:
> Don't compile functions in a context the caller doesn't have access to
>
> Instead just return undefined
>
> A side effect of this is that it's no longer possible to compile
> functions in a detached context.
>
> BUG=chromium:541703
> R=verwaest@chromium.org,bmeurer@chromium.org

BUG=chromium:541703
R=verwaest@chromium.org

Review-Url: https://codereview.chromium.org/2143893005
Cr-Commit-Position: refs/heads/master@{#37756}
2016-07-14 11:08:52 +00:00
daniel.bevenius
f810ccc867 Updating the code example in FunctionTemplate class documentation
Currently the code example in the FunctionTemplate class documentation
is out of date. This commit updates the examples so they compile and run
without error.

BUG=

Review-Url: https://codereview.chromium.org/2127523003
Cr-Commit-Position: refs/heads/master@{#37741}
2016-07-14 06:34:26 +00:00
adamk
68f205b2a7 Revert of Don't compile functions in a context the caller doesn't have access to (patchset #9 id:160001 of https://codereview.chromium.org/2034083002/ )
Reason for revert:
Causes crashes on Canary

Original issue's description:
> Don't compile functions in a context the caller doesn't have access to
>
> Instead just return undefined
>
> A side effect of this is that it's no longer possible to compile
> functions in a detached context.
>
> BUG=chromium:541703
> R=verwaest@chromium.org,bmeurer@chromium.org
> CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_chromium_rel_ng
>
> Committed: https://crrev.com/992e34c21635b179a993b82ac1d81753e7a6a57a
> Cr-Commit-Position: refs/heads/master@{#37657}

TBR=bmeurer@chromium.org,verwaest@chromium.org,jochen@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=chromium:541703, chromium:628053

Review-Url: https://codereview.chromium.org/2148163002
Cr-Commit-Position: refs/heads/master@{#37736}
2016-07-14 02:02:20 +00:00
jochen
992e34c216 Don't compile functions in a context the caller doesn't have access to
Instead just return undefined

A side effect of this is that it's no longer possible to compile
functions in a detached context.

BUG=chromium:541703
R=verwaest@chromium.org,bmeurer@chromium.org
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_chromium_rel_ng

Review-Url: https://codereview.chromium.org/2034083002
Cr-Commit-Position: refs/heads/master@{#37657}
2016-07-11 20:11:51 +00:00
jochen
f592f2e516 Fix small typo in NewRemoteContext comment
R=verwaest@chromium.org,dcheng@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2137943003
Cr-Commit-Position: refs/heads/master@{#37647}
2016-07-11 14:32:48 +00:00
alph
120b753f71 Introduce v8::CpuProfiler::New and v8::CpuProfiler::Dispose API.
Isolate is not going to retain a CPU profiler.
The client will be creating an instance of profiler when needed.

Deprectate v8::Isolate::GetCpuProfiler()

BUG=v8:4789

Review-Url: https://codereview.chromium.org/2117343006
Cr-Commit-Position: refs/heads/master@{#37613}
2016-07-08 15:01:10 +00:00
jochen
0058f82e2c Add an API to create a detached global object
Such an object can be used to later create a context from it. It has to
have access checks with handlers enabled, as it cannot be accessed
otherwise.

BUG=chromium:618305
R=verwaest@chromium.org

Review-Url: https://codereview.chromium.org/2107673003
Cr-Commit-Position: refs/heads/master@{#37594}
2016-07-07 19:38:08 +00:00
jochen
46428e45e9 Make it possible to create a v8::Function directly w/o a prototype
BUG=chromium:625823
R=verwaest@chromium.org

Review-Url: https://codereview.chromium.org/2123143002
Cr-Commit-Position: refs/heads/master@{#37549}
2016-07-06 11:42:04 +00:00
littledan
0ff7b4830c Implement immutable prototype chains
This patch implements "immutable prototype exotic objects" from the ECMAScript
spec, which are objects whose __proto__ cannot be changed, but are not otherwise
frozen. They are introduced in order to prevent a Proxy from being introduced
to the prototype chain of the global object.

The API is extended by a SetImmutablePrototype() call in ObjectTemplate, which
can be used to vend new immutable prototype objects. Additionally, Object.prototype
is an immutable prototype object.

In the implementation, a new bit is added to Maps to say whether the prototype is
immutable, which is read by SetPrototype. Map transitions to the immutable prototype
state are not saved in the transition tree because the main use case is just for
the prototype chain of the global object, which there will be only one of per
Context, so no need to take up the extra word for a pointer in each full transition
tree.

BUG=v8:5149

Review-Url: https://codereview.chromium.org/2108203002
Cr-Commit-Position: refs/heads/master@{#37482}
2016-07-01 19:20:11 +00:00
jochen
356a85be5d Provide a convenience array buffer allocator
BUG=none
R=ulan@chromium.org

Review-Url: https://codereview.chromium.org/2101413002
Cr-Commit-Position: refs/heads/master@{#37365}
2016-06-29 07:42:40 +00:00
ulan
c4f4d6352f Make v8::Isolate::SetRAILMode thread safe and remove the
PERFORMANCE_DEFAULT mode.

BUG=

Review-Url: https://codereview.chromium.org/2108503003
Cr-Commit-Position: refs/heads/master@{#37340}
2016-06-28 17:32:32 +00:00
yangguo
872c461b00 [snapshot] revisit snapshot API.
This part of the snapshot API should not be in use yet, so we can still
change this. The motivation for this change is:
- Use MaybeHandle where reasonable.
- Remove ambiguity: when we use index to create context from snapshot,
  we should not have a silent fallback if snapshot is not available.
- Symmetry: rename to Context::FromSnapshot to mirror templates.

R=jochen@chromium.org
BUG=chromium:617892

Review-Url: https://codereview.chromium.org/2100073002
Cr-Commit-Position: refs/heads/master@{#37334}
2016-06-28 13:48:05 +00:00
jochen
c34cc7a6ff Optionally invoke an interceptor on failed access checks
This superseeds all-can-read/all-can-write properties

BUG=chromium:618305
R=verwaest@chromium.org

Review-Url: https://codereview.chromium.org/2087823002
Cr-Commit-Position: refs/heads/master@{#37286}
2016-06-27 11:49:09 +00:00
bakkot
b2ce1fa20c add use counters for __defineGetter__ failing
We deviate from spec in that, in our implementation, __defineGetter__ on non-
configurable properties returns false instead of throwing a TypeError. This commit
adds a use counter to track how often we would be throwing an error we currently
avoid, to determine if we can change to align with spec or if the spec is not
implementable.

BUG=v8:5070

Review-Url: https://codereview.chromium.org/2089533002
Cr-Commit-Position: refs/heads/master@{#37259}
2016-06-24 22:05:03 +00:00
jochen
c7715c2fbe Add HasOwnProperty with array indexes
This way embedders don't have to manually convert them to strings

BUG=chromium:619166
R=verwaest@chromium.org

Review-Url: https://codereview.chromium.org/2085223002
Cr-Commit-Position: refs/heads/master@{#37179}
2016-06-22 10:20:45 +00:00
mlippautz
706b3f2730 [heap] Internalize kExternalAllocationLimit
Base the fast-path in AdjustAmountOfExternalMemory on a value + limit. To
preserve the behavior the limit is just set using kExternalAllocationLimit.

Redo naming of related members.

R=jochen@chromium.org
BUG=chromium:621829
LOG=N

Review-Url: https://codereview.chromium.org/2085893002
Cr-Commit-Position: refs/heads/master@{#37131}
2016-06-21 09:26:53 +00:00
yangguo
c5ae5bb16b [snapshot] support including templates in the snapshot.
R=jochen@chromium.org, verwaest@chromium.org
BUG=chromium:617892

Review-Url: https://codereview.chromium.org/2076083002
Cr-Commit-Position: refs/heads/master@{#37122}
2016-06-21 05:10:50 +00:00
yangguo
0b177bc06c [snapshot] serialize embedder-provided external references.
R=jochen@chromium.org, vogelheim@chromium.org
BUG=chromium:617892

Review-Url: https://codereview.chromium.org/2066993004
Cr-Commit-Position: refs/heads/master@{#37109}
2016-06-20 15:28:26 +00:00
hlopko
eaafd900e9 Introduce EmbedderHeapTracer::EnterFinalPause()
I need this method because of ActiveScriptWrappables, which have to be processed
at the atomic pause even for incremental solution, as there is no other way of
detecting when an object starts or stops being active than querying it.

LOG=no
BUG=468240

Review-Url: https://codereview.chromium.org/2065833003
Cr-Commit-Position: refs/heads/master@{#37062}
2016-06-17 10:25:47 +00:00
yangguo
533453f929 [snapshot] support multiple contexts in the same snapshot.
R=jochen@chromium.org, vogelheim@chromium.org
BUG=chromium:617892

Review-Url: https://codereview.chromium.org/2055203002
Cr-Commit-Position: refs/heads/master@{#37008}
2016-06-15 15:39:06 +00:00
hlopko
ac1587bb86 Move EmbedderHeapTracer::TracePrologue call to the beginning of full gc
With cl https://codereview.chromium.org/2043033002 blink will add new wrappers
to its marking deque (and maintain this deque) so black allocated wrappers are
not a problem anymore. To limit the scope of when blink has to detect wrappers,
we need to tell blink when we start and when we end full gcs. For that we can
nicely use TracePrologue and TraceEpilogue.

LOG=no
BUG=468240

Review-Url: https://codereview.chromium.org/2051103002
Cr-Commit-Position: refs/heads/master@{#36937}
2016-06-13 17:15:30 +00:00
hlopko
d5f758eed6 Cleanup after EmbedderHeapTracer api updates
In order to update v8 api and still be able to build chromium, we had to keep
code in suboptimal state. Now when chromium caught up, we can perform cleanup :)

LOG=no
BUG=468240

Review-Url: https://codereview.chromium.org/2057613002
Cr-Commit-Position: refs/heads/master@{#36933}
2016-06-13 14:27:06 +00:00
yangguo
e5760c0808 [snapshot] introduce SnapshotCreator API.
And use it to implement existing the existing snapshot API.

R=jochen@chromium.org, vogelheim@chromium.org
BUG=chromium:617892

Review-Url: https://codereview.chromium.org/2046423002
Cr-Commit-Position: refs/heads/master@{#36879}
2016-06-10 05:47:47 +00:00
yangguo
d77963feea Add UseCounter for Date.parse's legacy parse heuristics.
R=adamk@chromium.org, jochen@chromium.org
BUG=chromium:618595

Review-Url: https://codereview.chromium.org/2050733004
Cr-Commit-Position: refs/heads/master@{#36846}
2016-06-09 09:09:59 +00:00
alph
2f863593d1 Move stack trace extraction code out of TickSample::Init
Make it a part of V8 API GetStackSample function.
Also expose external_callback_entry in SampleInfo to break dependency
of clients on internal V8 structures.

BUG=v8:4789

Committed: https://crrev.com/70acfe39c07322144f5fe9b40bb584a8b1099ffd
Review-Url: https://codereview.chromium.org/2007343003
Cr-Original-Commit-Position: refs/heads/master@{#36831}
Cr-Commit-Position: refs/heads/master@{#36836}
2016-06-08 21:36:57 +00:00
alph
9ac4a6efa9 Revert of Move stack trace extraction code out of TickSample::Init (patchset #1 id:1 of https://codereview.chromium.org/2007343003/ )
Reason for revert:
Make MSAN arm bot flaky

Original issue's description:
> Move stack trace extraction code out of TickSample::Init
>
> Make it a part of V8 API GetStackSample function.
> Also expose external_callback_entry in SampleInfo to break dependency
> of clients on internal V8 structures.
>
> BUG=v8:4789
>
> Committed: https://crrev.com/70acfe39c07322144f5fe9b40bb584a8b1099ffd
> Cr-Commit-Position: refs/heads/master@{#36831}

TBR=yangguo@chromium.org,lpy@chromium.org,jochen@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:4789

Review-Url: https://codereview.chromium.org/2049903002
Cr-Commit-Position: refs/heads/master@{#36835}
2016-06-08 19:48:31 +00:00
alph
70acfe39c0 Move stack trace extraction code out of TickSample::Init
Make it a part of V8 API GetStackSample function.
Also expose external_callback_entry in SampleInfo to break dependency
of clients on internal V8 structures.

BUG=v8:4789

Review-Url: https://codereview.chromium.org/2007343003
Cr-Commit-Position: refs/heads/master@{#36831}
2016-06-08 15:36:18 +00:00
jochen
490131987e Remove deprecated access check callbacks
BUG=chromium:618305
R=verwaest@chromium.org

Review-Url: https://codereview.chromium.org/2045273002
Cr-Commit-Position: refs/heads/master@{#36827}
2016-06-08 14:43:46 +00:00
machenbach
cec0ed0f77 [icu] Support loading data file from default location
This allows using icu data, bundled in the icudtl.dat file,
to be loaded automatically from a default location
side-by-side with the executable.

The v8 stand-alone default is still to use statically
linked ICU data, but this will be switched in a separate
follow-up CL.

BUG=chromium:616033
LOG=y

Review-Url: https://codereview.chromium.org/2042253002
Cr-Commit-Position: refs/heads/master@{#36823}
2016-06-08 12:11:34 +00:00
yangguo
31c0c024bb [snapshot] remove metadata field.
The upcoming snapshot creator API will have no way to distinguish default
from custom snapshots.

R=vogelheim@chromium.org
BUG=chromium:617892

Review-Url: https://codereview.chromium.org/2040813005
Cr-Commit-Position: refs/heads/master@{#36812}
2016-06-08 07:51:28 +00:00
mlippautz
839f3fd406 Track based on JSArrayBuffer addresses on pages instead of the attached
backing store.

Details of tracking:
- Scavenge: New space pages are processes in bulk on the main thread
- MC: Unswept pages are processed in bulk in parallel. All other pages
  are processed by the sweeper concurrently.

BUG=chromium:611688
LOG=N
TEST=cctest/test-array-buffer-tracker/*
CQ_EXTRA_TRYBOTS=tryserver.v8:v8_linux_arm64_gc_stress_dbg,v8_linux_gc_stress_dbg,v8_mac_gc_stress_dbg,v8_linux64_tsan_rel,v8_mac64_asan_rel

Review-Url: https://codereview.chromium.org/2036643002
Cr-Commit-Position: refs/heads/master@{#36798}
2016-06-07 17:29:35 +00:00
hlopko
0f93486699 Introduce api for incremental wrapper tracing
This cl sketches an api for incremental wrapper tracing, but still uses the api
in the stop-the-world fashion. Responsibility to maintain a marking deque is
transfered to the embedder. V8 will still collect wrapper internal fields, but
will send them to the embedder after each incremental gc task. Wrappers must be
sent at latest by the time next oilpan gc runs - so blink can keep all
discovered wrappables alive.

The old api will be cleared after this cl and corresponding blink cl land.

Comments are very welcomed :)

LOG=no
BUG=468240

Review-Url: https://codereview.chromium.org/2032213003
Cr-Commit-Position: refs/heads/master@{#36761}
2016-06-06 16:33:59 +00:00
mlippautz
5979bf5654 Revert of Reland "[heap] Fine-grained JSArrayBuffer tracking" (patchset #7 id:180001 of https://codereview.chromium.org/2026633003/ )
Reason for revert:
Also failing with the new implementation:
  https://build.chromium.org/p/chromium.gpu/builders/Linux%20Debug%20%28NVIDIA%29/builds/62646

Will do a local repro now.

Original issue's description:
> Track based on JSArrayBuffer addresses on pages instead of the attached
> backing store.
>
> Details of tracking:
> - Scavenge: New space pages are processes in bulk on the main thread
> - MC: Unswept pages are processed in bulk in parallel. All other pages
>   are processed by the sweeper concurrently.
>
> BUG=chromium:611688
> LOG=N
> TEST=cctest/test-array-buffer-tracker/*
> CQ_EXTRA_TRYBOTS=tryserver.v8:v8_linux_arm64_gc_stress_dbg,v8_linux_gc_stress_dbg,v8_mac_gc_stress_dbg,v8_linux64_tsan_rel,v8_mac64_asan_rel
>
> Committed: https://crrev.com/279e274eccf95fbb4bd41d908b9153acf6ec118a
> Cr-Commit-Position: refs/heads/master@{#36653}

TBR=hpayer@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:611688

Review-Url: https://codereview.chromium.org/2032973002
Cr-Commit-Position: refs/heads/master@{#36663}
2016-06-02 06:47:34 +00:00
mlippautz
279e274ecc Track based on JSArrayBuffer addresses on pages instead of the attached
backing store.

Details of tracking:
- Scavenge: New space pages are processes in bulk on the main thread
- MC: Unswept pages are processed in bulk in parallel. All other pages
  are processed by the sweeper concurrently.

BUG=chromium:611688
LOG=N
TEST=cctest/test-array-buffer-tracker/*
CQ_EXTRA_TRYBOTS=tryserver.v8:v8_linux_arm64_gc_stress_dbg,v8_linux_gc_stress_dbg,v8_mac_gc_stress_dbg,v8_linux64_tsan_rel,v8_mac64_asan_rel

Review-Url: https://codereview.chromium.org/2026633003
Cr-Commit-Position: refs/heads/master@{#36653}
2016-06-01 16:30:32 +00:00
mlippautz
a43b732e0e Revert of Reland "[heap] Fine-grained JSArrayBuffer tracking" (patchset #2 id:20001 of https://codereview.chromium.org/2024063002/ )
Reason for revert:
Breaking
  http://build.chromium.org/p/client.v8/builders/V8%20Linux64%20-%20avx2/builds/7972

Original issue's description:
> Track based on JSArrayBuffer addresses on pages instead of the attached
> backing store.
>
> Details of tracking:
> - Scavenge: New space pages are processes in bulk on the main thread
> - MC: Unswept pages are processed in bulk in parallel. All other pages
>   are processed by the sweeper concurrently.
>
> BUG=chromium:611688
> LOG=N
> TEST=cctest/test-array-buffer-tracker/*
> CQ_EXTRA_TRYBOTS=tryserver.v8:v8_linux_arm64_gc_stress_dbg,v8_linux_gc_stress_dbg,v8_mac_gc_stress_dbg,v8_linux64_tsan_rel,v8_mac64_asan_rel
>
> Committed: https://crrev.com/089da007bb990b5b29aab257aa836fdd3f3b8ce0
> Cr-Commit-Position: refs/heads/master@{#36608}

TBR=hpayer@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:611688

Review-Url: https://codereview.chromium.org/2028503003
Cr-Commit-Position: refs/heads/master@{#36609}
2016-05-31 09:32:17 +00:00
mlippautz
089da007bb Track based on JSArrayBuffer addresses on pages instead of the attached
backing store.

Details of tracking:
- Scavenge: New space pages are processes in bulk on the main thread
- MC: Unswept pages are processed in bulk in parallel. All other pages
  are processed by the sweeper concurrently.

BUG=chromium:611688
LOG=N
TEST=cctest/test-array-buffer-tracker/*
CQ_EXTRA_TRYBOTS=tryserver.v8:v8_linux_arm64_gc_stress_dbg,v8_linux_gc_stress_dbg,v8_mac_gc_stress_dbg,v8_linux64_tsan_rel,v8_mac64_asan_rel

Review-Url: https://codereview.chromium.org/2024063002
Cr-Commit-Position: refs/heads/master@{#36608}
2016-05-31 09:16:55 +00:00
cbruni
63efe9e416 [api] Add more parameters to Object::GetPropertyNames
Expose more or less the full functionality of the KeyAccumulator in the API:
- use the PropertyFilter introduced for GetOwnPropertyNames
- use KeyCollectionLimit for OWN_ONLY or INLCUDE_PROTOS
- use IndexFilter to eithe SKIP_INDICES or INCLUDE_INDICES

Rewire Object::GetOwnPropertyNames to use GetPropertyNames.

BUG=chromium:148757

Review-Url: https://codereview.chromium.org/2002203002
Cr-Commit-Position: refs/heads/master@{#36595}
2016-05-30 15:54:12 +00:00
mlippautz
07fadde87c [api] Remove deprectated memory allocation callback API
Users of this api should use a combination of |RequestInterrupt| and
|GCCallback| (see |AddGCPrologueCallback| and friends) to keep track allocated
memory.

BUG=v8:4813
LOG=Y
R=jochen@chromium.org

Review-Url: https://codereview.chromium.org/1991293002
Cr-Commit-Position: refs/heads/master@{#36594}
2016-05-30 15:54:11 +00:00
mlippautz
ecb2ec8ff3 Revert of Reland "[heap] Fine-grained JSArrayBuffer tracking" (patchset #3 id:60001 of https://codereview.chromium.org/2026463002/ )
Reason for revert:
Investigating new arm simulator failure:
  https://build.chromium.org/p/client.v8.ports/builders/V8%20Linux%20-%20arm%20-%20sim/builds/851/steps/Check%20-%20novfp3/logs/box2d

Original issue's description:
> Reland "[heap] Fine-grained JSArrayBuffer tracking"
>
> Track based on JSArrayBuffer addresses on pages instead of the attached
> backing store.
>
> Details of tracking:
> - Scavenge: New space pages are processes in bulk on the main thread
> - MC: Unswept pages are processed in bulk in parallel. All other pages
>   are processed by the sweeper concurrently.
>
> BUG=chromium:614730, chromium:611688
> LOG=N
> CQ_EXTRA_TRYBOTS=tryserver.v8:v8_linux_arm64_gc_stress_dbg,v8_linux_gc_stress_dbg,v8_mac_gc_stress_dbg,v8_linux64_tsan_rel,v8_mac64_asan_rel
>
> Committed: https://crrev.com/bc0fb6e83eb7351f52bfd6f780bb6c12bd87c58c
> Cr-Commit-Position: refs/heads/master@{#36592}

TBR=hpayer@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:614730, chromium:611688

Review-Url: https://codereview.chromium.org/2021893002
Cr-Commit-Position: refs/heads/master@{#36593}
2016-05-30 15:50:40 +00:00
mlippautz
bc0fb6e83e Reland "[heap] Fine-grained JSArrayBuffer tracking"
Track based on JSArrayBuffer addresses on pages instead of the attached
backing store.

Details of tracking:
- Scavenge: New space pages are processes in bulk on the main thread
- MC: Unswept pages are processed in bulk in parallel. All other pages
  are processed by the sweeper concurrently.

BUG=chromium:614730, chromium:611688
LOG=N
CQ_EXTRA_TRYBOTS=tryserver.v8:v8_linux_arm64_gc_stress_dbg,v8_linux_gc_stress_dbg,v8_mac_gc_stress_dbg,v8_linux64_tsan_rel,v8_mac64_asan_rel

Review-Url: https://codereview.chromium.org/2026463002
Cr-Commit-Position: refs/heads/master@{#36592}
2016-05-30 14:53:29 +00:00
mythria
c1af2821ea Adds support for collecting statistics about code and its metadata.
Adds an API to request the total size of code/bytecode and their associated
metadata in the heap. When requested, the code_space, old_space and
large_object_space  is scanned to find any code/bytecode array objects.
This could be slow and hence it should be used with caution.

BUG=v8:5019
LOG=N

Review-Url: https://codereview.chromium.org/1997363002
Cr-Commit-Position: refs/heads/master@{#36534}
2016-05-26 09:47:27 +00:00
lpy
a0198c0f62 Reland: Create libsampler as V8 sampler library.
This patch does five things:

1. Extracts sampler as libsampler to provide sampling functionality support.
2. Makes SampleStack virtual so embedders can override the behaviour of sample collecting.
3. Removes sampler.[h|cc].
4. Moves sampling thread into log.cc as workaround to keep the --prof functionality.
5. Creates SamplerManager to manage the relationship between samplers and threads.

The reason we port hashmap.h is that in debug mode, STL containers are using
mutexes from a mutex pool, which may lead to deadlock when using asynchronously
signal handler.

Currently libsampler is used in V8 temporarily.

BUG=v8:4789
LOG=n

Committed: https://crrev.com/06cc9b7c176a6223971deaa9fbcafe1a05058c7b
Cr-Commit-Position: refs/heads/master@{#36527}

Review-Url: https://codereview.chromium.org/1922303002
Cr-Commit-Position: refs/heads/master@{#36532}
2016-05-26 02:14:50 +00:00
mlippautz
6a92d74875 Revert of "[heap] Fine-grained JSArrayBuffer tracking" (patchset #1 id:1 of https://codereview.chromium.org/2009383002/ )
Reason for revert:
https://build.chromium.org/p/chromium.gpu.fyi/builders/Linux%20Debug%20%28NVIDIA%29/builds/29860/steps/maps_pixel_test%20on%20NVIDIA%20GPU%20on%20Linux%20on%20Linux/logs/stdio

Original issue's description:
> Reland of "[heap] Fine-grained JSArrayBuffer tracking" (patchset #1 id:1 of https://codereview.chromium.org/2011563003/ )
>
> Reason for revert:
> Premature revert. Chromium roll included an earlier version.
>
> Original issue's description:
> > Revert of "[heap] Fine-grained JSArrayBuffer tracking" (patchset #3 id:80001 of https://codereview.chromium.org/2007253002/ )
> >
> > Reason for revert:
> > Breaks webgl2 conformance tests
> >   https://bugs.chromium.org/p/chromium/issues/detail?id=614730
> >
> > Original issue's description:
> > > Reland of "[heap] Fine-grained JSArrayBuffer tracking"
> > >
> > > Track based on JSArrayBuffer addresses on pages instead of the attached
> > > backing store.
> > >
> > > Details of tracking:
> > > - Scavenge: New space pages are processes in bulk on the main thread
> > > - MC: Unswept pages are processed in bulk in parallel. All other pages
> > >   are processed by the sweeper concurrently.
> > >
> > > This reverts commit 93fe04afa9.
> > >
> > > R=hpayer@chromium.org
> > > BUG=chromium:611688
> > > LOG=N
> > > CQ_EXTRA_TRYBOTS=tryserver.v8:v8_linux_arm64_gc_stress_dbg,v8_linux_gc_stress_dbg,v8_mac_gc_stress_dbg,v8_linux64_tsan_rel,v8_mac64_asan_rel
> > >
> > > Committed: https://crrev.com/863d015e573798e263b35b31d2ab979739706533
> > > Cr-Commit-Position: refs/heads/master@{#36513}
> >
> > TBR=hpayer@chromium.org
> > # Skipping CQ checks because original CL landed less than 1 days ago.
> > NOPRESUBMIT=true
> > NOTREECHECKS=true
> > NOTRY=true
> > BUG=chromium:611688
> >
> > Committed: https://crrev.com/b9b0868ec49a52c9a80c9beea862a61707b292e5
> > Cr-Commit-Position: refs/heads/master@{#36524}
>
> TBR=hpayer@chromium.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=chromium:611688
>
> Committed: https://crrev.com/b23e008885c4c452ae2b329c9dad167a76e4d7be
> Cr-Commit-Position: refs/heads/master@{#36530}

TBR=hpayer@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:611688

Review-Url: https://codereview.chromium.org/2009893003
Cr-Commit-Position: refs/heads/master@{#36531}
2016-05-25 21:21:15 +00:00
mlippautz
b23e008885 Reland of "[heap] Fine-grained JSArrayBuffer tracking" (patchset #1 id:1 of https://codereview.chromium.org/2011563003/ )
Reason for revert:
Premature revert. Chromium roll included an earlier version.

Original issue's description:
> Revert of "[heap] Fine-grained JSArrayBuffer tracking" (patchset #3 id:80001 of https://codereview.chromium.org/2007253002/ )
>
> Reason for revert:
> Breaks webgl2 conformance tests
>   https://bugs.chromium.org/p/chromium/issues/detail?id=614730
>
> Original issue's description:
> > Reland of "[heap] Fine-grained JSArrayBuffer tracking"
> >
> > Track based on JSArrayBuffer addresses on pages instead of the attached
> > backing store.
> >
> > Details of tracking:
> > - Scavenge: New space pages are processes in bulk on the main thread
> > - MC: Unswept pages are processed in bulk in parallel. All other pages
> >   are processed by the sweeper concurrently.
> >
> > This reverts commit 93fe04afa9.
> >
> > R=hpayer@chromium.org
> > BUG=chromium:611688
> > LOG=N
> > CQ_EXTRA_TRYBOTS=tryserver.v8:v8_linux_arm64_gc_stress_dbg,v8_linux_gc_stress_dbg,v8_mac_gc_stress_dbg,v8_linux64_tsan_rel,v8_mac64_asan_rel
> >
> > Committed: https://crrev.com/863d015e573798e263b35b31d2ab979739706533
> > Cr-Commit-Position: refs/heads/master@{#36513}
>
> TBR=hpayer@chromium.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=chromium:611688
>
> Committed: https://crrev.com/b9b0868ec49a52c9a80c9beea862a61707b292e5
> Cr-Commit-Position: refs/heads/master@{#36524}

TBR=hpayer@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:611688

Review-Url: https://codereview.chromium.org/2009383002
Cr-Commit-Position: refs/heads/master@{#36530}
2016-05-25 21:09:24 +00:00
lpy
636f1e8e59 Revert of Create libsampler as V8 sampler library. (patchset #24 id:460001 of https://codereview.chromium.org/1922303002/ )
Reason for revert:
V8 Linux64 TSAN failure because ThreadSanitizer indicated data race.

Original issue's description:
> Create libsampler as V8 sampler library.
>
> This patch does five things:
>
> 1. Extracts sampler as libsampler to provide sampling functionality support.
> 2. Makes SampleStack virtual so embedders can override the behaviour of sample collecting.
> 3. Removes sampler.[h|cc].
> 4. Moves sampling thread into log.cc as workaround to keep the --prof functionality.
> 5. Creates SamplerManager to manage the relationship between samplers and threads.
>
> The reason we port hashmap.h is that in debug mode, STL containers are using
> mutexes from a mutex pool, which may lead to deadlock when using asynchronously
> signal handler.
>
> Currently libsampler is used in V8 temporarily.
>
> BUG=v8:4789
> LOG=n
>
> Committed: https://crrev.com/06cc9b7c176a6223971deaa9fbcafe1a05058c7b
> Cr-Commit-Position: refs/heads/master@{#36527}

TBR=jochen@chromium.org,alph@chromium.org,fmeawad@chromium.org,yangguo@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:4789

Review-Url: https://codereview.chromium.org/2000323007
Cr-Commit-Position: refs/heads/master@{#36529}
2016-05-25 20:23:33 +00:00
lpy
06cc9b7c17 Create libsampler as V8 sampler library.
This patch does five things:

1. Extracts sampler as libsampler to provide sampling functionality support.
2. Makes SampleStack virtual so embedders can override the behaviour of sample collecting.
3. Removes sampler.[h|cc].
4. Moves sampling thread into log.cc as workaround to keep the --prof functionality.
5. Creates SamplerManager to manage the relationship between samplers and threads.

The reason we port hashmap.h is that in debug mode, STL containers are using
mutexes from a mutex pool, which may lead to deadlock when using asynchronously
signal handler.

Currently libsampler is used in V8 temporarily.

BUG=v8:4789
LOG=n

Review-Url: https://codereview.chromium.org/1922303002
Cr-Commit-Position: refs/heads/master@{#36527}
2016-05-25 19:06:45 +00:00
mlippautz
b9b0868ec4 Revert of "[heap] Fine-grained JSArrayBuffer tracking" (patchset #3 id:80001 of https://codereview.chromium.org/2007253002/ )
Reason for revert:
Breaks webgl2 conformance tests
  https://bugs.chromium.org/p/chromium/issues/detail?id=614730

Original issue's description:
> Reland of "[heap] Fine-grained JSArrayBuffer tracking"
>
> Track based on JSArrayBuffer addresses on pages instead of the attached
> backing store.
>
> Details of tracking:
> - Scavenge: New space pages are processes in bulk on the main thread
> - MC: Unswept pages are processed in bulk in parallel. All other pages
>   are processed by the sweeper concurrently.
>
> This reverts commit 93fe04afa9.
>
> R=hpayer@chromium.org
> BUG=chromium:611688
> LOG=N
> CQ_EXTRA_TRYBOTS=tryserver.v8:v8_linux_arm64_gc_stress_dbg,v8_linux_gc_stress_dbg,v8_mac_gc_stress_dbg,v8_linux64_tsan_rel,v8_mac64_asan_rel
>
> Committed: https://crrev.com/863d015e573798e263b35b31d2ab979739706533
> Cr-Commit-Position: refs/heads/master@{#36513}

TBR=hpayer@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:611688

Review-Url: https://codereview.chromium.org/2011563003
Cr-Commit-Position: refs/heads/master@{#36524}
2016-05-25 16:31:14 +00:00
mlippautz
863d015e57 Reland of "[heap] Fine-grained JSArrayBuffer tracking"
Track based on JSArrayBuffer addresses on pages instead of the attached
backing store.

Details of tracking:
- Scavenge: New space pages are processes in bulk on the main thread
- MC: Unswept pages are processed in bulk in parallel. All other pages
  are processed by the sweeper concurrently.

This reverts commit 93fe04afa9.

R=hpayer@chromium.org
BUG=chromium:611688
LOG=N
CQ_EXTRA_TRYBOTS=tryserver.v8:v8_linux_arm64_gc_stress_dbg,v8_linux_gc_stress_dbg,v8_mac_gc_stress_dbg,v8_linux64_tsan_rel,v8_mac64_asan_rel

Review-Url: https://codereview.chromium.org/2007253002
Cr-Commit-Position: refs/heads/master@{#36513}
2016-05-25 12:11:08 +00:00
mlippautz
93fe04afa9 Revert of "[heap] Fine-grained JSArrayBuffer tracking" (patchset #6 id:220001 of https://codereview.chromium.org/2005723005/ )
Reason for revert:
Breaking TSAN
  https://uberchromegw.corp.google.com/i/client.v8/builders/V8%20Linux64%20TSAN/builds/9741/steps/Ignition%20-%20turbofan%20%28flakes%29/logs/FixedUint32Array

Original issue's description:
> Reland of "[heap] Fine-grained JSArrayBuffer tracking"
>
> Track based on JSArrayBuffer addresses on pages instead of the attached
> backing store.
>
> Details of tracking:
> - Scavenge: New space pages are processes in bulk on the main thread
> - MC: Unswept pages are processed in bulk in parallel. All other pages
>   are processed by the sweeper concurrently.
>
> This reverts commit d2dff0320b.
>
> R=hpayer@chromium.org
> BUG=chromium:611688
> LOG=N
> CQ_EXTRA_TRYBOTS=tryserver.v8:v8_linux_arm64_gc_stress_dbg,v8_linux_gc_stress_dbg,v8_mac_gc_stress_dbg,v8_linux64_tsan_rel,v8_mac64_asan_rel
>
> Committed: https://crrev.com/b5704bc1e6ba74c9ca975f5d58f5b2dc60261457
> Cr-Commit-Position: refs/heads/master@{#36495}

TBR=hpayer@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:611688

Review-Url: https://codereview.chromium.org/2011863002
Cr-Commit-Position: refs/heads/master@{#36504}
2016-05-25 09:38:58 +00:00
mlippautz
b5704bc1e6 Reland of "[heap] Fine-grained JSArrayBuffer tracking"
Track based on JSArrayBuffer addresses on pages instead of the attached
backing store.

Details of tracking:
- Scavenge: New space pages are processes in bulk on the main thread
- MC: Unswept pages are processed in bulk in parallel. All other pages
  are processed by the sweeper concurrently.

This reverts commit d2dff0320b.

R=hpayer@chromium.org
BUG=chromium:611688
LOG=N
CQ_EXTRA_TRYBOTS=tryserver.v8:v8_linux_arm64_gc_stress_dbg,v8_linux_gc_stress_dbg,v8_mac_gc_stress_dbg,v8_linux64_tsan_rel,v8_mac64_asan_rel

Review-Url: https://codereview.chromium.org/2005723005
Cr-Commit-Position: refs/heads/master@{#36495}
2016-05-25 07:29:02 +00:00
mlippautz
d2dff0320b Revert of [heap] Fine-grained JSArrayBuffer tracking (patchset #19 id:770001 of https://codereview.chromium.org/1964023002/ )
Reason for revert:
Revert it.

Original issue's description:
> [heap] Fine-grained JSArrayBuffer tracking
>
> Track based on JSArrayBuffer addresses instead of the attached backing store.
> This way we can later on iterate buffers on a single page. The reland also
> switches to a page-based implementation where a page contains the set of its
> contained (live and dead) buffers.
>
> Details of tracking:
> - Scavenge: New space pages are processes in bulk on the main thread
> - MC: Unswept pages are processed in bulk in parallel. All other pages
>   are processed by the sweeper concurrently.
>
> BUG=chromium:611688
> LOG=N
> CQ_EXTRA_TRYBOTS=tryserver.v8:v8_linux_arm64_gc_stress_dbg,v8_linux_gc_stress_dbg,v8_mac_gc_stress_dbg,v8_linux64_tsan_rel,v8_mac64_asan_rel
>
> Committed: https://crrev.com/b2d8bfc7931eef49d527605ba485950dea41cde3
> Cr-Commit-Position: refs/heads/master@{#36437}

TBR=hpayer@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:611688

Review-Url: https://codereview.chromium.org/2006183003
Cr-Commit-Position: refs/heads/master@{#36461}
2016-05-24 07:22:02 +00:00
mlippautz
b2d8bfc793 [heap] Fine-grained JSArrayBuffer tracking
Track based on JSArrayBuffer addresses instead of the attached backing store.
This way we can later on iterate buffers on a single page. The reland also
switches to a page-based implementation where a page contains the set of its
contained (live and dead) buffers.

Details of tracking:
- Scavenge: New space pages are processes in bulk on the main thread
- MC: Unswept pages are processed in bulk in parallel. All other pages
  are processed by the sweeper concurrently.

BUG=chromium:611688
LOG=N
CQ_EXTRA_TRYBOTS=tryserver.v8:v8_linux_arm64_gc_stress_dbg,v8_linux_gc_stress_dbg,v8_mac_gc_stress_dbg,v8_linux64_tsan_rel,v8_mac64_asan_rel

Review-Url: https://codereview.chromium.org/1964023002
Cr-Commit-Position: refs/heads/master@{#36437}
2016-05-23 11:21:49 +00:00
hpayer
ba8ecfd58f Adding a SetRAILMode API.
BUG=chromium:613518
LOG=n

Review-Url: https://codereview.chromium.org/1999743002
Cr-Commit-Position: refs/heads/master@{#36411}
2016-05-20 13:37:49 +00:00
yangguo
e17c68c493 [JSON] implement indentation in the BasicJsonStringifier and expose via API.
R=jochen@chromium.org, verwaest@chromium.org

Review-Url: https://codereview.chromium.org/1922603006
Cr-Commit-Position: refs/heads/master@{#36392}
2016-05-20 07:58:02 +00:00
jwolfe
5582e158e5 Add UseCounter for decimal with leading zero.
Re-landing https://codereview.chromium.org/1948403002/

New changes:

move variable initialization to make compiler happy

BUG=v8:4973
LOG=y

Review-Url: https://codereview.chromium.org/1969203004
Cr-Commit-Position: refs/heads/master@{#36262}
2016-05-16 23:22:26 +00:00
mlippautz
b32f9599be [api] Clarify expectations of ArrayBuffer::Allocator in API
BUG=chromium:611688
LOG=Y
R=jochen@chromium.org

Review-Url: https://codereview.chromium.org/1978773002
Cr-Commit-Position: refs/heads/master@{#36231}
2016-05-13 10:13:38 +00:00
machenbach
a05ecb05b6 Revert of add UseCounters for NonOctalDecimalIntegerLiteral in strict mode (patchset #6 id:100001 of https://codereview.chromium.org/1948403002/ )
Reason for revert:
[Sheriff] Breaks
https://build.chromium.org/p/client.v8.ports/builders/V8%20Arm%20-%20debug%20builder/builds/602

Original issue's description:
> In parallel to the strict octal check that would reject `012` in strict mode, this patch collects UseCounters for `089` in strict mode. The spec says this should be an error, but this patch does not report it as such.
>
> BUG=v8:4973
> LOG=y
>
> Committed: https://crrev.com/d0b6686c14339bd5d0aeaf610705c7ed85393e1f
> Cr-Commit-Position: refs/heads/master@{#36221}

TBR=littledan@chromium.org,caitpotter88@gmail.com,jwolfe@igalia.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:4973

Review-Url: https://codereview.chromium.org/1970333004
Cr-Commit-Position: refs/heads/master@{#36224}
2016-05-13 06:53:52 +00:00
jwolfe
d0b6686c14 In parallel to the strict octal check that would reject 012 in strict mode, this patch collects UseCounters for 089 in strict mode. The spec says this should be an error, but this patch does not report it as such.
BUG=v8:4973
LOG=y

Review-Url: https://codereview.chromium.org/1948403002
Cr-Commit-Position: refs/heads/master@{#36221}
2016-05-12 20:54:14 +00:00
hlopko
c0b2cdf804 V8_EXPORT EmbedderHeapTracer
LOG=no
BUG=468240

Review-Url: https://codereview.chromium.org/1961083005
Cr-Commit-Position: refs/heads/master@{#36130}
2016-05-10 10:46:06 +00:00
kozyatinskiy
6f419dfe67 [V8] Add v8::Value::TypeOf to API
There is TypeOf static method on object inside V8. In this CL I've extracted it via API.

LOG=Y
R=yangguo@chromium.org
BUG=chromium:595206

Review-Url: https://codereview.chromium.org/1829833002
Cr-Commit-Position: refs/heads/master@{#36113}
2016-05-09 16:21:35 +00:00
jochen
acbbd59f29 Expose IsConstructor to the C++ API
BUG=v8:4993
R=verwaest@chromium.org
LOG=y

Review-Url: https://codereview.chromium.org/1964433002
Cr-Commit-Position: refs/heads/master@{#36107}
2016-05-09 13:24:21 +00:00
ulan
a6da98d86f Introduce a new phantom weakness type without finalization callback.
Handles of this type are automatically reset by the garbage collector
when their objects are not longer reachable.

The motivation is to reduce pause time of external.weak_global_handles
phase of the garbage collector by not maintaing the list of pending
callbacks and not calling the callbacks.

Local testing on discourse page of the v8.inifinite_scroll benchmark
shows 7x improvement for this GC phase.

Before:
external.weak_global_handles
 len: 21
 min: 0.0
 max: 4.5
 avg: 0.757142857143

After:
external.weak_global_handles
 len: 21
 min: 0.0
 max: 0.5
 avg: 0.109523809524

A follow-up patch will enable the new phantom handles in Chromium.

BUG=chromium:608333
LOG=NO

Review-Url: https://codereview.chromium.org/1950963002
Cr-Commit-Position: refs/heads/master@{#36095}
2016-05-09 07:18:00 +00:00
ulan
82dcb2beee [API] Remove deprecated WeakCallbackData and related functions.
This removes:
- PersistentBase::SetWeak that takes WeakCallbackData.
  The embedders should use the version that takes WeakCallbackInfo.
- PersistentBase::SetPhantom.
  The embedders should SetWeak that takes WeakCallbackInfo.

Functions in DefaultPersistentValueMapTraits are changed to accept
WeakCallbackInfo instead of WeakCallbackData.

BUG=chromium:609808
LOG=NO

Review-Url: https://codereview.chromium.org/1953263002
Cr-Commit-Position: refs/heads/master@{#36079}
2016-05-06 13:18:07 +00:00