Commit Graph

1495 Commits

Author SHA1 Message Date
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