Commit Graph

1670 Commits

Author SHA1 Message Date
mstarzinger
92b370ee64 Introduce {ConstantElementsPair} struct for type safety.
This introduces an explicit struct for the communication channel between
the {ArrayLiteral} AST node and the corresponding runtime methods. Those
methods take a pair of {ElementsKind} as well as an array (can either be
a FixedArray or a FixedDoubleArray) of constant values.

For bonus points it also reduces the size of the involved heap object by
one word (i.e. length field of FixedArray not needed anymore).

R=mvstanton@chromium.org

Review-Url: https://codereview.chromium.org/2581683003
Cr-Commit-Position: refs/heads/master@{#41752}
2016-12-16 10:57:06 +00:00
machenbach
6932ea5904 Revert of Disallow passing a SharedArrayBuffer in the transfer list. (patchset #4 id:60001 of https://codereview.chromium.org/2570433005/ )
Reason for revert:
Breaks layout tests:
https://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Linux%2064/builds/12098

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

Original issue's description:
> Disallow passing a SharedArrayBuffer in the transfer list.
>
> This behavior changed recently. SharedArrayBuffers should not be put in the
> transfer list, because they are not detached, and that is the meaning of being
> in the transfer list.
>
> This is the V8 side of the change, the Blink side will come next.
>
> Review-Url: https://codereview.chromium.org/2570433005
> Cr-Commit-Position: refs/heads/master@{#41740}
> Committed: 1c5e1504e0

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

Review-Url: https://codereview.chromium.org/2579963002
Cr-Commit-Position: refs/heads/master@{#41744}
2016-12-16 07:34:40 +00:00
binji
1c5e1504e0 Disallow passing a SharedArrayBuffer in the transfer list.
This behavior changed recently. SharedArrayBuffers should not be put in the
transfer list, because they are not detached, and that is the meaning of being
in the transfer list.

This is the V8 side of the change, the Blink side will come next.

Review-Url: https://codereview.chromium.org/2570433005
Cr-Commit-Position: refs/heads/master@{#41740}
2016-12-15 23:55:03 +00:00
yangguo
449829b85c [serializer] API to re-use global proxy in v8::Context::FromSnapshot.
R=jochen@chromium.org, peria@chromium.org
BUG=chromium:617892

Review-Url: https://codereview.chromium.org/2571743002
Cr-Commit-Position: refs/heads/master@{#41668}
2016-12-13 11:24:58 +00:00
bradnelson
aabbbec67c [wasm] [asmjs] Route asm.js warnings to the dev console.
Generalize Messages to include an error level.
Add a parameter to AddMessageHandler to select which error levels to receive, using a mask (default being just errors, i.e. the current behavior).

BUG=v8:4203
R=dgozman@chromium.org,machenbach@chromium.org,danno@chromium.org,bmeurer@chromium.org,jochen@chromium.org

Review-Url: https://codereview.chromium.org/2526703002
Cr-Commit-Position: refs/heads/master@{#41648}
2016-12-12 14:48:50 +00:00
clemensh
222541dff5 [wasm] Generate correct locations for error messages
The current logic in Isolate::GetLocationFromStackTrace just ignores
wasm frames, making the computed location point to the first javascript
frame, like this:

test.js:17: RuntimeError: divide by zero
module.exports.main();
               ^
RuntimeError: divide by zero
    at main (<WASM>[1]+5)
    at test.js:17:16

This CL not only fixes the location to point to the top-most wasm
frame, but also exposes to the embedder that the script of that location
is a wasm script, allowing for custom printing of wasm locations.
The Shell::ReportException method now checks for this flag, and prints
wasm locations like this:

<WASM>[0]+5: RuntimeError: divide by zero
RuntimeError: divide by zero
    at main (<WASM>[0]+5)
    at test/message/wasm-trap.js:15:16

R=titzer@chromium.org, yangguo@chromium.org
BUG=chromium:613110

Review-Url: https://codereview.chromium.org/2563673002
Cr-Commit-Position: refs/heads/master@{#41640}
2016-12-12 12:46:02 +00:00
yangguo
98b563ebf3 [serializer] include global proxy in additional context snapshots.
Aside from the default snapshot, there is no need for additional context
snapshots to have the ability to replace the global proxy and global object
after deserialization. Changes include:
 - Changes to the API to better distinguish default context snapshot from
   additional context snapshots.
 - Disallow global handles when creating snapshots.
 - Allow extensions when creating snapshots.

This solves the issue of not being able to having accessors and interceptors on
the global object of contexts to be serialized.

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

Review-Url: https://codereview.chromium.org/2557743003
Cr-Commit-Position: refs/heads/master@{#41588}
2016-12-08 12:45:05 +00:00
ishell
39e6f2ca4a [ic] Use validity cells to protect keyed element stores against object's prototype chain modifications.
... instead of clearing of all the KeyedStoreICs which didn't always work.

BUG=chromium:662907, chromium:669411, v8:5561
TBR=verwaest@chromium.org, bmeurer@chromium.org

Committed: https://crrev.com/a39522f44f7e0be4686831688917e9675255dcaf
Review-Url: https://codereview.chromium.org/2534613002
Cr-Original-Commit-Position: refs/heads/master@{#41332}
Cr-Commit-Position: refs/heads/master@{#41449}
2016-12-02 10:03:33 +00:00
jgruber
1a6dae8070 [debug] Partial reland of debug API deprecation
This relands API deprecation (without removing the implementation),
removal of NewFunction and BeforeCompile events, and removal of
DebugCommandProcessor tests.

The remaining portion of the original CLs can be relanded after the 4.7
branch point.

Original CLs:

https://codereview.chromium.org/2524323002
https://codereview.chromium.org/2531543002

BUG=v8:5510

Review-Url: https://codereview.chromium.org/2546473008
Cr-Commit-Position: refs/heads/master@{#41446}
2016-12-02 09:02:01 +00:00
jgruber
4292f32ed3 [debug] Revert debug API removal
Debugging API is still in use by Node.

Revert "[debug] remove deprecated debug command message queue."
This reverts commit abdbfc953d.

Revert "[debug] mark more unused debug API as deprecated."
This reverts commit d5ada19ce7.

BUG=v8:5530

Review-Url: https://codereview.chromium.org/2537313005
Cr-Commit-Position: refs/heads/master@{#41427}
2016-12-01 13:34:45 +00:00
kozyatinskiy
d385ed069b [inspector] removed old v8_inspector::Channel API
BUG=chromium:350797
R=dgozman@chromium.org
TBR=yangguo@chromium.org

Review-Url: https://codereview.chromium.org/2527473004
Cr-Commit-Position: refs/heads/master@{#41371}
2016-11-29 19:31:23 +00:00
cbruni
85321456cd [api] Support sharing prototypes between FunctionTemplates
FunctionTemplateInfo::SetPrototypeProviderTemplate adds support for sharing
prototypes between several function templates. This is used to properly set up
Image.prototype and HTMLImageElement.protoype which should be equal according
to the spec.

BUG=chromium:2969

Review-Url: https://codereview.chromium.org/2531653002
Cr-Commit-Position: refs/heads/master@{#41343}
2016-11-29 10:14:18 +00:00
machenbach
9c0e2a6723 Revert of [ic] Use validity cells to protect keyed element stores against object's prototype chain modificati… (patchset #2 id:40001 of https://codereview.chromium.org/2534613002/ )
Reason for revert:
Layout test crashes:
https://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Linux%2064/builds/11691

Original issue's description:
> [ic] Use validity cells to protect keyed element stores against object's prototype chain modifications.
>
> ... instead of clearing of all the KeyedStoreICs which didn't always work.
>
> BUG=chromium:662907, v8:5561
> TBR=verwaest@chromium.org, bmeurer@chromium.org
>
> Committed: https://crrev.com/a39522f44f7e0be4686831688917e9675255dcaf
> Cr-Commit-Position: refs/heads/master@{#41332}

TBR=jkummerow@chromium.org,ishell@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:662907, v8:5561

Review-Url: https://codereview.chromium.org/2538693002
Cr-Commit-Position: refs/heads/master@{#41337}
2016-11-29 08:49:48 +00:00
ishell
a39522f44f [ic] Use validity cells to protect keyed element stores against object's prototype chain modifications.
... instead of clearing of all the KeyedStoreICs which didn't always work.

BUG=chromium:662907, v8:5561
TBR=verwaest@chromium.org, bmeurer@chromium.org

Review-Url: https://codereview.chromium.org/2534613002
Cr-Commit-Position: refs/heads/master@{#41332}
2016-11-28 22:56:52 +00:00
adamk
4c9f56d90a [api] Remove "experimental" comments from ES6 features in v8.h
R=jochen@chromium.org

Review-Url: https://codereview.chromium.org/2473153004
Cr-Commit-Position: refs/heads/master@{#41329}
2016-11-28 21:44:04 +00:00
yangguo
d5ada19ce7 [debug] mark more unused debug API as deprecated.
R=jgruber@chromium.org
BUG=v8:5510

Review-Url: https://codereview.chromium.org/2531543002
Cr-Commit-Position: refs/heads/master@{#41283}
2016-11-25 09:11:04 +00:00
yangguo
abdbfc953d [debug] remove deprecated debug command message queue.
R=jgruber@chromium.org
BUG=v8:5510

Review-Url: https://codereview.chromium.org/2524323002
Cr-Commit-Position: refs/heads/master@{#41259}
2016-11-24 12:56:21 +00:00
yangguo
81a64aa548 [debug] remove JSON debug protocol related tests.
In most cases we can use the debug event listener as alternative.
Multithreaded tests are obsolete.

R=jgruber@chromium.org
BUG=v8:5510

Review-Url: https://codereview.chromium.org/2529883002
Cr-Commit-Position: refs/heads/master@{#41256}
2016-11-24 10:43:22 +00:00
kozyatinskiy
eb3551d0a3 Roll third_party/inspector_protocol to 4ad35c45aca9834b67ec2cb152c816ea1b7ceb48
This roll includes:
  - [inspector_protocol] Introduce protocol::Serializable [1]

[1] https://codereview.chromium.org/2526603002

BUG=chromium:350797
R=dgozman@chromium.org

Review-Url: https://codereview.chromium.org/2523583005
Cr-Commit-Position: refs/heads/master@{#41197}
2016-11-23 00:45:54 +00:00
kozyatinskiy
21091c327b [inspector] removed deprecated ScriptOrigin cstor with is_embedder_debug_script
BUG=none
R=yangguo@chromium.org

Review-Url: https://codereview.chromium.org/2505823002
Cr-Commit-Position: refs/heads/master@{#41162}
2016-11-22 03:46:05 +00:00
kozyatinskiy
afd49054ac [inspector] removed embbeder debugger script flag
After moving inspector from blink to V8, inspector can use DebugInterface to compile and mark internal scripts.

BUG=v8:5530
R=yangguo@chromium.org

Review-Url: https://codereview.chromium.org/2502173002
Cr-Commit-Position: refs/heads/master@{#41087}
2016-11-17 16:51:23 +00:00
vogelheim
541c36c00e Updated version to 5.7
BUG=
TBR=machenbach@chromium.org
NOTRY=true

Review-Url: https://codereview.chromium.org/2515443002
Cr-Commit-Position: refs/heads/master@{#41080}
2016-11-17 15:15:22 +00:00
yangguo
0d258b35c8 [api] deprecate v8::Function::IsBuiltin.
R=jochen@chromium.org, kozyatinskiy@chromium.org

Review-Url: https://codereview.chromium.org/2510633002
Cr-Commit-Position: refs/heads/master@{#41060}
2016-11-17 06:42:23 +00:00
yangguo
c759a3d847 [serializer] small fixes for blink snapshot.
Changes include:
 - Adding V8_EXPORT macro for SnapshotCreator
 - Removing outdated DCHECKs.
 - Allow nullptr as external reference. This required a...
 - Refactoring of hashmaps used by the serializer.
 - Remove external references for counters. These are not used
   anywhere for isolates that are being serialized.
 - Put template infos into the partial snapshot cache.
 - Remove unnecessary presubmit check for external references.
   mksnapshot crashes if external references are missing.

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

Review-Url: https://codereview.chromium.org/2490783004
Cr-Commit-Position: refs/heads/master@{#40949}
2016-11-14 07:17:59 +00:00
jbroman
5d3ce7ea4f Remove the deprecated ValueSerializer::ReadHeader overload with no context parameter.
Several weeks have now passed since it was deprecated; Chromium does not
call it.

BUG=chromium:148757

Review-Url: https://codereview.chromium.org/2478863002
Cr-Commit-Position: refs/heads/master@{#40945}
2016-11-13 03:10:24 +00:00
jbroman
94142ed8c9 ValueSerializer: Replace use of std::vector with a delegate-allocated buffer.
BUG=chromium:148757

Review-Url: https://codereview.chromium.org/2492943002
Cr-Commit-Position: refs/heads/master@{#40943}
2016-11-12 21:50:26 +00:00
mlippautz
58a753053c [api] Remove marking persistents as partially dependent
Also remove the flag scavenge_reclaim_unmodified_objects which has been
defaulted to true for quite some time now.

BUG=chromium:651354

Review-Url: https://codereview.chromium.org/2486173002
Cr-Commit-Position: refs/heads/master@{#40878}
2016-11-10 09:29:48 +00:00
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
lpy
2525b0573b [Tracing] Make TracingCategoryObserver v8 internal.
This patch removes TracingCategoryObserver API and moves the creation of
observer inside platform initialization, by assuming that either
Platform::AddTraceStateObserver is implemented correctly to add observer to
tracing controller that implemented by embedders, or default tracing controller
has already been set up and attached to platform before
v8::V8::InitializePlatform is called.

BUG=v8:5590

Review-Url: https://codereview.chromium.org/2471583004
Cr-Commit-Position: refs/heads/master@{#40739}
2016-11-03 18:03:56 +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
lpy
9c78194343 [Tracing] Remove unused excluded categories list.
We only need included categories list, excluded categories list will only work
if we use regular expression in categories list, which is not supported in V8.

TBR=jochen@chromium.org

Review-Url: https://codereview.chromium.org/2462143002
Cr-Commit-Position: refs/heads/master@{#40681}
2016-10-31 19:45:20 +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
lpy
6df8096a00 [Tracing] Implement TracingCategoryObserver.
This patch implements TracingCategoryObserver to set global flag when a V8
specific category is enabled. Previously, we set a global flag each time when we
encounter a top level trace event, and use it as a global check. With this
patch, we can set a group of flags when tracing is enabled; besides, we make
V8 tracing feature use V8 flags instead of defining its own flag in a messy way.

With this patch, whatever V8 flag we want to imply in tracing, we define another
integer flag, and the original V8 flag will set it to 0x01 when passing by
commandline, tracing will set it to 0x10 when we start tracing and reset the bit
when we stop tracing.

Review-Url: https://codereview.chromium.org/2436273002
Cr-Commit-Position: refs/heads/master@{#40659}
2016-10-28 20:44:04 +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
fmeawad
610fe2892b [Tracing] Remove State Sampling Profiling
The state sampling was implemented in chrome, we had an interface for it
V8 but it was not implemented yet.
The chrome version version has been removed in
https://codereview.chromium.org/2406703002/
Therefore following up with its removal in V8 as well.

This CL can land independent of the Chromium related CL.

R=primiano@chromium.org,alph@chromium.org

Review-Url: https://codereview.chromium.org/2410523002
Cr-Commit-Position: refs/heads/master@{#40232}
2016-10-12 15:34:51 +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
jochen
c59cf8cd21 Turn libplatform into a component
BUG=v8:5412
R=jgruber@chromium.org,machenbach@chromium.org
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_chromium_compile_dbg_ng;master.tryserver.chromium.android:android_clang_dbg_recipe

Review-Url: https://codereview.chromium.org/2372983003
Cr-Commit-Position: refs/heads/master@{#40111}
2016-10-10 08:52:06 +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
alph
4b575dfcef [profiler] Tracing-based CPU profiler.
A new V8 API object v8::TracingCpuProfiler is introduced.
Client can create it on an isolate to enable JS CPU profiles collected
during tracing session.

Once the v8.cpu_profile2 tracing category is enabled the profiler emits
CpuProfile and CpuProfileChunk events with the profile data.

BUG=chromium:406277

Review-Url: https://codereview.chromium.org/2396733002
Cr-Commit-Position: refs/heads/master@{#40054}
2016-10-06 18:14:24 +00:00
hablich
eeaa239889 Update version to 5.6
TBR=machenbach@chromium.org
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/2397153002
Cr-Commit-Position: refs/heads/master@{#40037}
2016-10-06 13:22:54 +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
alph
e4e3650e8b [profiler] Introduce Tracing CPU profiler V8 API.
Tracing CPU profiler allows V8 to automatically collect CPU profile when tracing
is started with category v8.cpu_profile2 enabled.

BUG=chromium:406277

Review-Url: https://codereview.chromium.org/2378143003
Cr-Commit-Position: refs/heads/master@{#39855}
2016-09-29 09:25:21 +00:00
franzih
c5e735deac [tracing] Simplify include statement.
Change include statement, otherwise embedders have problems compiling.

BUG=

Review-Url: https://codereview.chromium.org/2378773004
Cr-Commit-Position: refs/heads/master@{#39850}
2016-09-29 07:02:30 +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
alph
fcf1bac99a [tracing] Implement Add/RemoveTraceStateObserver for default platform.
BUG=chromium:406277

Review-Url: https://codereview.chromium.org/2369073003
Cr-Commit-Position: refs/heads/master@{#39794}
2016-09-27 20:12:55 +00:00
alph
4810f41a52 [tracing] Support ConvertableToTraceFormat argument type.
Drive-by: Use perfect forwarding for AddTraceEvent arguments.

BUG=406277

Committed: https://crrev.com/dcac49af485fe5d4c0027f153901435dbb29c232
Review-Url: https://codereview.chromium.org/2367603002
Cr-Original-Commit-Position: refs/heads/master@{#39742}
Cr-Commit-Position: refs/heads/master@{#39789}
2016-09-27 18:08:53 +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
machenbach
2c9661a62a Revert of [tracing] Support ConvertableToTraceFormat argument type. (patchset #5 id:80001 of https://codereview.chromium.org/2367603002/ )
Reason for revert:
Breaks layout tests:
https://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Linux%2064/builds/10100

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

Original issue's description:
> [tracing] Support ConvertableToTraceFormat argument type.
>
> Drive-by: Use perfect forwarding for AddTraceEvent arguments.
>
> BUG=406277
>
> Committed: https://crrev.com/dcac49af485fe5d4c0027f153901435dbb29c232
> Cr-Commit-Position: refs/heads/master@{#39742}

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

Review-Url: https://codereview.chromium.org/2371103002
Cr-Commit-Position: refs/heads/master@{#39750}
2016-09-27 07:02:02 +00:00
alph
dcac49af48 [tracing] Support ConvertableToTraceFormat argument type.
Drive-by: Use perfect forwarding for AddTraceEvent arguments.

BUG=406277

Review-Url: https://codereview.chromium.org/2367603002
Cr-Commit-Position: refs/heads/master@{#39742}
2016-09-26 21:54:56 +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
kozyatinskiy
e882623820 [inspector] fixed all shorten-64-to-32 warnings
BUG=chromium:635948
R=dgozman@chromium.org,alph@chromium.org

Committed: https://crrev.com/3d10918d2e1c57d72531c55a956262f5a72fceaa
Review-Url: https://codereview.chromium.org/2332163002
Cr-Original-Commit-Position: refs/heads/master@{#39426}
Cr-Commit-Position: refs/heads/master@{#39610}
2016-09-22 01:48:10 +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
alph
ce03778926 [tracing] Introduce TraceStateObserver interface to the platform.
Introduce TraceStateObserver interface along with add/remove
methods to the platform.

BUG=chromium:406277

Review-Url: https://codereview.chromium.org/2344893005
Cr-Commit-Position: refs/heads/master@{#39513}
2016-09-19 21:01:32 +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
hablich
4b8f6543f4 Revert of [inspector] fixed all shorten-64-to-32 warnings (patchset #4 id:80001 of https://codereview.chromium.org/2332163002/ )
Reason for revert:
Blocking V8 roll: https://codereview.chromium.org/2347463002/

See https://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/293368 for compile error.

Original issue's description:
> [inspector] fixed all shorten-64-to-32 warnings
>
> BUG=chromium:635948
> R=dgozman@chromium.org,alph@chromium.org
>
> Committed: https://crrev.com/3d10918d2e1c57d72531c55a956262f5a72fceaa
> Cr-Commit-Position: refs/heads/master@{#39426}

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

Review-Url: https://codereview.chromium.org/2339173004
Cr-Commit-Position: refs/heads/master@{#39432}
2016-09-15 00:42:06 +00:00
kozyatinskiy
3d10918d2e [inspector] fixed all shorten-64-to-32 warnings
BUG=chromium:635948
R=dgozman@chromium.org,alph@chromium.org

Review-Url: https://codereview.chromium.org/2332163002
Cr-Commit-Position: refs/heads/master@{#39426}
2016-09-14 18:25:00 +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
alph
5465c25cea Add two CpuProfileNode API functions to allow thread safe access to the node.
GetFunctionNameStr and GetScriptResourceNameStr can be called from a thread
other than isolate VM thread unlike their conterparts GetFunctionName
and GetScriptResourceName.

BUG=406277

Review-Url: https://codereview.chromium.org/2328673003
Cr-Commit-Position: refs/heads/master@{#39313}
2016-09-09 15:51:02 +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
dgozman
81b7e77ff0 [inspector] Build inspector under v8_enable_inspector build flag.
- inspector becomes a dependency of v8_base;
- generated public protocol files are placed to gen/v8/include/inspector/<Domain.h>;
- added v8_enable_inspector_override to be used in embedders (gn only);
- combined public headers into v8-inspector.h and v8-inspector-protocol.h.

BUG=chromium:635948

Review-Url: https://codereview.chromium.org/2292053003
Cr-Commit-Position: refs/heads/master@{#39226}
2016-09-06 23:26:35 +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
hablich
32422eff6c Update version to 5.5
TBR=jochen@chromium.org
NOTRY=true

Review-Url: https://codereview.chromium.org/2282453002
Cr-Commit-Position: refs/heads/master@{#38908}
2016-08-25 13:52:16 +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
peterssen
f4e92fe13e Add ToSmi and Goto operations to FastAccessorAssembler.
BUG=chromium:508898

Review-Url: https://codereview.chromium.org/2237443002
Cr-Commit-Position: refs/heads/master@{#38745}
2016-08-19 09:35:17 +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
lpy
c72f637c73 Move SimulatorHelper into V8 out of profiler clients.
This patch is based on alph's CL https://codereview.chromium.org/2128613004/.

This patch makes GetStackSample propogate the register state when using
simulator helper, and adds argument to avoid using register state from simulator
when pass the native register state.

BUG=v8:4789
LOG=N

Review-Url: https://codereview.chromium.org/2189513002
Cr-Commit-Position: refs/heads/master@{#38554}
2016-08-10 17:12:27 +00:00
lpy
0359e1f63e [Tracing] Create TraceConfig JSON string parser in D8.
BUG=v8:4561
LOG=N

Review-Url: https://codereview.chromium.org/2208873002
Cr-Commit-Position: refs/heads/master@{#38553}
2016-08-10 17:11:08 +00:00
peterssen
d073777bbf Add faster, but unsafe version of LoadInternalField.
LoadInternalField performs some redundant checks in the context of
fast accessors.
This improves the speedup from 20% to 60% for next/previousSibling in
the Dromaeo DOM traversal benchmarks.

BUG=chromium:508898

Review-Url: https://codereview.chromium.org/2186593002
Cr-Commit-Position: refs/heads/master@{#38535}
2016-08-10 11:54:11 +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
rskang
9a6a56d21f Add args and copy support to V8 tracing controller.
BUG=v8:4561

Review-Url: https://codereview.chromium.org/2190973003
Cr-Commit-Position: refs/heads/master@{#38255}
2016-08-02 17:13:13 +00:00
alph
d25e45df73 Deprecate CpuProfileNode::GetCallUid
The client can use scriptId + lineNumber + columnNumber
to uniquelly identify the call site.

Review-Url: https://codereview.chromium.org/2199003003
Cr-Commit-Position: refs/heads/master@{#38236}
2016-08-02 09:45:00 +00:00
mattloring
292cebc58b Add libplatform deps file
Add deps file allowing libplatform.h to include v8-tracing.h.

Additionally removes redundant include/ that was causing build errors
for node-lkgr.

BUG=

Review-Url: https://codereview.chromium.org/2195403002
Cr-Commit-Position: refs/heads/master@{#38217}
2016-08-01 16:20:54 +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
fmeawad
821c3e563c Reland [Tracing] V8 Tracing Controller
V8 has had a trace event macro interface for while, but without a tracing
controller a standalone V8 would be unable to collect traces.

This CL introduces a complete Tracing Controller system for V8.
It is fully function except that it does not yet store trace event args.

This CL has a few components,
The tracing controller itself, contributed by the author of this CL
The Trace config (including the parser), contributed by lpy@
The Trace Object, Trace Writer, and Trace Buffer are all contributed by rksang@

BUG=v8:4561
LOG=N

The original CL was failing the V8 Arm Builder:
https://build.chromium.org/p/client.v8.ports/builders/V8%20Arm%20-%20builder/builds/2456
and the V8 Mips Builder:
https://build.chromium.org/p/client.v8.ports/builders/V8%20Mips%20-%20builder/builds/2506

The failure is due to undefined behavior of CHECK_EQ of 2 const char*

Fix in patch #1

Committed: https://crrev.com/3d598452679ce208ad9b2f48e0fb3fae352ce375
Cr-Commit-Position: refs/heads/master@{#38073}

patch from issue 2137013006 at patchset 200001 (http://crrev.com/2137013006#ps200001)

Review-Url: https://codereview.chromium.org/2183923004
Cr-Commit-Position: refs/heads/master@{#38104}
2016-07-27 16:21:54 +00:00
yangguo
43ab247f56 Remove NaCl support.
Review-Url: https://codereview.chromium.org/2175193003
Cr-Commit-Position: refs/heads/master@{#38081}
2016-07-27 07:50:31 +00:00
lpy
13c3d06a31 Revert of [Tracing] V8 Tracing Controller (patchset #11 id:200001 of https://codereview.chromium.org/2137013006/ )
Reason for revert:
Revert this CL due to V8 Arm Builder failure and V8 Mips Builder failure.

https://build.chromium.org/p/client.v8.ports/builders/V8%20Arm%20-%20builder/builds/2456

https://build.chromium.org/p/client.v8.ports/builders/V8%20Mips%20-%20builder/builds/2506

Original issue's description:
> [Tracing] V8 Tracing Controller
>
> V8 has had a trace event macro interface for while, but without a tracing
> controller a standalone V8 would be unable to collect traces.
>
> This CL introduces a complete Tracing Controller system for V8.
> It is fully function except that it does not yet store trace event args.
>
> This CL has a few components,
> The tracing controller itself, contributed by the author of this CL
> The Trace config (including the parser), contributed by lpy@
> The Trace Object, Trace Writer, and Trace Buffer are all contributed by rksang@
>
> BUG=v8:4561
> LOG=N
>
> Committed: https://crrev.com/3d598452679ce208ad9b2f48e0fb3fae352ce375
> Cr-Commit-Position: refs/heads/master@{#38073}

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

Review-Url: https://codereview.chromium.org/2183943002
Cr-Commit-Position: refs/heads/master@{#38074}
2016-07-26 22:45:25 +00:00
fmeawad
3d59845267 [Tracing] V8 Tracing Controller
V8 has had a trace event macro interface for while, but without a tracing
controller a standalone V8 would be unable to collect traces.

This CL introduces a complete Tracing Controller system for V8.
It is fully function except that it does not yet store trace event args.

This CL has a few components,
The tracing controller itself, contributed by the author of this CL
The Trace config (including the parser), contributed by lpy@
The Trace Object, Trace Writer, and Trace Buffer are all contributed by rksang@

BUG=v8:4561
LOG=N

Review-Url: https://codereview.chromium.org/2137013006
Cr-Commit-Position: refs/heads/master@{#38073}
2016-07-26 22:15:39 +00:00
yangguo
ff542972f6 [debugger] remove deprecated api functions.
Review-Url: https://codereview.chromium.org/2162503002
Cr-Commit-Position: refs/heads/master@{#37892}
2016-07-20 08:52:18 +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