Commit Graph

75 Commits

Author SHA1 Message Date
Erik Luo
6da12d420a [debug] expose SideEffectType for whitelisting embedder callbacks
This exposes new flags to allow embedders to whitelist callbacks as
side-effect-free during evaluation with throwOnSideEffect.

Accessors and Functions/FunctionTemplates can take a new param on:
- v8::Object::SetNativeDataProperty
- v8::Object::SetLazyDataProperty
- v8::Object::SetAccessor
- v8::FunctionTemplate::New
- v8::FunctionTemplate::NewWithCache
- v8::Function::New

While Interceptors can be created with an additional flag:
PropertyHandlerFlag::kHasNoSideEffect

Bug: v8:7515
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I14823316bdd6de6d362a1104b65f13504d0db056
Reviewed-on: https://chromium-review.googlesource.com/994550
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52367}
2018-04-04 20:08:00 +00:00
Erik Luo
3813cbf210 [debug] use flag to decide whether interceptor has side effect
Adds a flag onto InterceptorInfo to mark an interceptor's getter,
query, and enumerator callbacks as side-effect-free.

Bug: v8:7515
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Iafc5d2fa554d6d9a38604e179ea5b884c3b77af0
Reviewed-on: https://chromium-review.googlesource.com/957870
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51969}
2018-03-15 17:40:12 +00:00
Franziska Hinkelmann
971875ca4d Revert "[api] Prefer Descriptor interceptor over Getter in GetPropertyAttributes"
This reverts commit d5fbf7c5c3.

Reason for revert: Performance regression, see https://bugs.chromium.org/p/chromium/issues/detail?id=798279

Original change's description:
> [api] Prefer Descriptor interceptor over Getter in GetPropertyAttributes
> 
> Also fix GetPropertyDescriptorWithInterceptor so that it only calls the
> interceptor once.
> 
> R=​ahaas@chromium.org, franzih@chromium.org
> 
> Bug: node:17480, node:17481
> Change-Id: I2c3813f80df2962ec909bae7267884ce0b8ccbef
> Reviewed-on: https://chromium-review.googlesource.com/816515
> Commit-Queue: Franziska Hinkelmann <franzih@chromium.org>
> Reviewed-by: Franziska Hinkelmann <franzih@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#50260}

TBR=timothygu99@gmail.com,ahaas@chromium.org,franzih@chromium.org,sergiyb@chromium.org

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

Bug: node:17480, node:17481
Change-Id: I4997e0f3a330d719026e56dd83c1bb999b986bcf
Reviewed-on: https://chromium-review.googlesource.com/850355
Reviewed-by: Franziska Hinkelmann <franzih@chromium.org>
Commit-Queue: Franziska Hinkelmann <franzih@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50362}
2018-01-04 15:12:20 +00:00
Timothy Gu
d5fbf7c5c3 [api] Prefer Descriptor interceptor over Getter in GetPropertyAttributes
Also fix GetPropertyDescriptorWithInterceptor so that it only calls the
interceptor once.

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

Bug: node:17480, node:17481
Change-Id: I2c3813f80df2962ec909bae7267884ce0b8ccbef
Reviewed-on: https://chromium-review.googlesource.com/816515
Commit-Queue: Franziska Hinkelmann <franzih@chromium.org>
Reviewed-by: Franziska Hinkelmann <franzih@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50260}
2017-12-21 11:57:18 +00:00
Camillo Bruni
5275c3c41c [api] Mark SetNamedPropertyHandler as soon to be deprecated
Eventually we should migrate to new new-style callbacks which take Names
instead of Strings as first arguments everywhere. Internally we don't really
handler NamedPropertyCallbackXX differently from the newer
GenericNamedPropertyCallbackXX.

Bug: v8:7109
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I827182f447427c222d5144f1a3e27bf543226e51
Reviewed-on: https://chromium-review.googlesource.com/803340
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49824}
2017-12-04 11:06:50 +00:00
Mathias Bynens
822be9b238 Normalize casing of hexadecimal digits
This patch normalizes the casing of hexadecimal digits in escape
sequences of the form `\xNN` and integer literals of the form
`0xNNNN`.

Previously, the V8 code base used an inconsistent mixture of uppercase
and lowercase.

Google’s C++ style guide uses uppercase in its examples:
https://google.github.io/styleguide/cppguide.html#Non-ASCII_Characters

Moreover, uppercase letters more clearly stand out from the lowercase
`x` (or `u`) characters at the start, as well as lowercase letters
elsewhere in strings.

BUG=v8:7109
TBR=marja@chromium.org,titzer@chromium.org,mtrofin@chromium.org,mstarzinger@chromium.org,rossberg@chromium.org,yangguo@chromium.org,mlippautz@chromium.org
NOPRESUBMIT=true

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I790e21c25d96ad5d95c8229724eb45d2aa9e22d6
Reviewed-on: https://chromium-review.googlesource.com/804294
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49810}
2017-12-02 01:24:40 +00:00
Franziska Hinkelmann
37a3a15c3e [api] Intercept DefineProperty after Descriptor query
Analog to other interceptors, intercept the DefineProperty
call only after obtaining the property descriptor.

This behavior allows us to mirror calls on a sandboxed object
as it is needed in Node. See for example
https://github.com/nodejs/node/pull/13265

Bug: 
Change-Id: I73b8f8908d13473939b37fb6727858d0bee6bda3
Reviewed-on: https://chromium-review.googlesource.com/725295
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Franziska Hinkelmann <franzih@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48683}
2017-10-18 12:26:59 +00:00
Mathias Bynens
62f929ff4c Use nullptr instead of NULL where possible
New code should use nullptr instead of NULL.

This patch updates existing use of NULL to nullptr where applicable,
making the code base more consistent.

BUG=v8:6928,v8:6921

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng;master.tryserver.v8:v8_linux_noi18n_rel_ng
Change-Id: I4687f5b96fcfd88b41fa970a2b937b4f6538777c
Reviewed-on: https://chromium-review.googlesource.com/718338
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48557}
2017-10-13 17:21:49 +00:00
Franziska Hinkelmann
9865b356bc [api] Do not re-use PropertyCallbackArguments
args.Call() sets a return value on args. Do not reuse the
same args object, otherwise the return value might be from the previous Call().

Bug: v8:6627
Change-Id: I05fb2d8036f94908a492d46cc5d746bc145e419e
Reviewed-on: https://chromium-review.googlesource.com/651407
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Franziska Hinkelmann <franzih@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47843}
2017-09-06 08:31:56 +00:00
Franziska Hinkelmann
b6bf9ad92d Reland "[api] Add test for EnumeratorCallback and for...in."
This is a reland of 56772de7f9
Original change's description:
> [api] Add test for EnumeratorCallback and for...in.
> 
> If a QueryCallback is present, it is used to
> filter the result from the EnumeratorCallback for
> enumerable properties. This tests assures that
> for...in loops work correctly with these interceptors.
> 
> Bug: v8:6627
> Change-Id: I1e568beac1e138a330034492b87bd49c22e0c804
> Reviewed-on: https://chromium-review.googlesource.com/609982
> Commit-Queue: Franziska Hinkelmann <franzih@chromium.org>
> Reviewed-by: Adam Klein <adamk@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#47445}

TBR=adamk@chromium.org

Bug: v8:6627
Change-Id: I509016a879d175b01f7cc7918758354fe0df8ebf
Reviewed-on: https://chromium-review.googlesource.com/650906
Reviewed-by: Franziska Hinkelmann <franzih@chromium.org>
Commit-Queue: Franziska Hinkelmann <franzih@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47838}
2017-09-05 18:46:30 +00:00
Franziska Hinkelmann
43bb277898 [api] Use query interceptor in Object.keys().
The V8 API provides interceptors. They are not part of the
EcmaScript specification. But their behavior should be consistent.
For example, when an EnumeratorInterceptor is defined, Object.keys(),
Object.entries(), and Object.values() should all have the
same number of entries.

This CL creates consistent behavior among these
functions. If a QueryCallback is present, it is used to
filter the result from the EnumeratorCallback for
enumerable properties.

Bug: v8:6627
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I4f4271ddeb99a5e85918148c5033923c149b9468
Reviewed-on: https://chromium-review.googlesource.com/649786
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Franziska Hinkelmann <franzih@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47831}
2017-09-05 17:28:29 +00:00
Mateusz Czeladka
fe598532ec Pass Isolate pointer to String::Utf8Value/Value constructors
As part of J2V8 development (https://github.com/eclipsesource/J2V8),
we realized that we had a subtle bug in how Isolate scope was created
and it's lifetime managed, see:
https://github.com/eclipsesource/J2V8/issues/313.

Mentioned above bug was fixed, however, what we also noticed is that
V8 API has been constantly and slowly moving to such an API, in which
one has to pass Isolate explicitly to methods and/or constructors. We
found two more places that might have been overlooked. This contribution
adds passing of Isolate pointer explicitly to constructors of
String::Utf8Value and String::Value classes.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng;master.tryserver.v8:v8_linux_noi18n_rel_ng
Change-Id: I61984285f152aba5ca922100cf3df913a9cb2cea
Reviewed-on: https://chromium-review.googlesource.com/593309
Commit-Queue: Adam Klein <adamk@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47656}
2017-08-28 18:17:08 +00:00
Adam Klein
1385f95fed Revert "[api] Use query interceptor in Object.keys()."
It caused crashes in the extension process on Canary.

This reverts commit b6059a67ca.

Also revert followup test CL:

  "[api] Add test for EnumeratorCallback and for...in."

as it depends on the logic in the reverted change.

This reverts commit 56772de7f9.

Bug: chromium:757371, v8:6627
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: Id110128e6dc858a5a60ffc0175e8bb927b90bfc5
Reviewed-on: https://chromium-review.googlesource.com/626720
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47522}
2017-08-22 18:42:17 +00:00
Franziska Hinkelmann
56772de7f9 [api] Add test for EnumeratorCallback and for...in.
If a QueryCallback is present, it is used to
filter the result from the EnumeratorCallback for
enumerable properties. This tests assures that
for...in loops work correctly with these interceptors.

Bug: v8:6627
Change-Id: I1e568beac1e138a330034492b87bd49c22e0c804
Reviewed-on: https://chromium-review.googlesource.com/609982
Commit-Queue: Franziska Hinkelmann <franzih@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47445}
2017-08-18 19:07:57 +00:00
Franziska Hinkelmann
b6059a67ca [api] Use query interceptor in Object.keys().
The V8 API provides interceptors. They are not part of the
EcmaScript specification. But their behavior should be consistent.
For example, when an EnumeratorInterceptor is defined, Object.keys(),
Object.entries(), and Object.values() should all have the
same number of entries.

This CL creates consistent behavior among these
functions. If a QueryCallback is present, it is used to
filter the result from the EnumeratorCallback for
enumerable properties.

Bug: v8:6627
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: Ie51e69bb77099d9fafc4b1ea02671eced610edba
Reviewed-on: https://chromium-review.googlesource.com/609068
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Franziska Hinkelmann <franzih@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47442}
2017-08-18 17:56:44 +00:00
Igor Sheludko
6cb999b97b [ic] Properly handle loads from global interceptor via prototype chain.
... when receiver is in dictionary mode.

Bug: v8:6490
Change-Id: Ic5a8d214adcc4efd4cb163cbc6b351c4e6b596af
Reviewed-on: https://chromium-review.googlesource.com/559548
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46428}
2017-07-06 08:09:12 +00:00
Mythri
7371c34b6b Use --opt instead of --crankshaft in tests.
1. Replaces --crankshaft with --opt in tests.
2. Also fixes presubmit to check for --opt flag when
assertOptimized is used.
3. Updates testrunner/local/variants.py and 
v8_foozie.py to use --opt flag.
This would mean, nooptimize variant means there are
no optimizations. Not even with %OptimizeFunctionOnNextCall.

Bug:v8:6325

Change-Id: I638e743d0773a6729c6b9749e2ca1e2537f12ce6
Reviewed-on: https://chromium-review.googlesource.com/490206
Commit-Queue: Mythri Alle <mythria@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#44985}
2017-04-28 14:20:39 +00:00
Adam Klein
b3887f8a2c [cctest] Simplify the majority of callers of CcTest::CollectAllGarbage
Most callers passed kFinalizeIncrementalMarkingMask, so use that as
a default argument (not using default argument syntax to avoid including
heap.h in cctest.h).

Change-Id: I904f1eb3a0f5fdbe63eab16f6a6f01d04618645d
Reviewed-on: https://chromium-review.googlesource.com/488104
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#44950}
2017-04-27 17:20:54 +00:00
addaleax
de1461b7ef Drop UniqueId from include/v8.h
It's unused since March 2 2017 (https://chromium-review.googlesource.com/448539).
This removes it assuming that leaving it in the header was an oversight.

BUG=v8:5828

Review-Url: https://codereview.chromium.org/2732803002
Cr-Commit-Position: refs/heads/master@{#43605}
2017-03-06 10:58:01 +00:00
franzih
0ba513f056 [api] Fix DescriptorInterceptor with access check.
The DescriptorInterceptor should intercept all
Object.getOwnPropertyDescriptor calls. This CL fixes
the interceptor's behavior if the iterator state is
ACCESS_CHECK.

BUG=

Review-Url: https://codereview.chromium.org/2707263002
Cr-Commit-Position: refs/heads/master@{#43417}
2017-02-24 16:34:02 +00:00
Marja Hölttä
d1055c1fbd [iwyu] Remove unallowed include arguments.h -> objects-inl.h
After this, only 2 illegal includes to objects-inl.h remain (some wasm stuff).

R=​mstarzinger@chromium.org
BUG=v8:5294

Change-Id: I18682f42f0d2a7cc29a0a0be76f8e4eea26aafd9
Reviewed-on: https://chromium-review.googlesource.com/441744
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43147}
2017-02-13 10:06:48 +00:00
franzih
0c137304e6 [runtime] Skip vector config for interceptors.
Do not preinitialize the feedback vector slot if
the lookup iterator is an interceptor, because it is not
guaranteed that the iterator has a PropertyCell.

If the HandlerConfiguration has a non-masking
intercepting setter,
the iterator does not have a valid PropertyCell.

BUG=chromium:656648

Review-Url: https://codereview.chromium.org/2674103002
Cr-Commit-Position: refs/heads/master@{#43034}
2017-02-08 11:49:58 +00:00
franzih
a495fc92da [test] Cleanup CHECK_EQ order.
Keep the order in CHECK_EQ calls consistent as
(expected, actual).

Simplify CHECK_EQ(true, expected) to CHECK(expected) and
CHECK_EQ(false, expected) to CHECK(!expected).

BUG=

Review-Url: https://codereview.chromium.org/2677133002
Cr-Commit-Position: refs/heads/master@{#42964}
2017-02-06 12:51:53 +00:00
franzih
29e8d49f56 [runtime] Fix use of attributes if intercepted.
The property details of a LookupIterator are not accessible,
if the iterator state is interceptor. Instead, use the
property attributes.

Fixes a crash in Node.js tests in Debug mode, see
c2c6ae52ea

BUG=

Review-Url: https://codereview.chromium.org/2675993002
Cr-Commit-Position: refs/heads/master@{#42941}
2017-02-04 16:30:05 +00:00
ishell
4a5446fb2b [tests] Make assertOptimized()/assertUnoptimized() great again.
The mentioned asserts did not work properly with interpreted and turbofanned functions.

To fix this issue %GetOptimizationStatus() now returns a set of flags instead of a single value.

This CL also adds more helper functions to mjsunit, like isNeverOptimize(), isAlwaysOptimize(),
isOptimized(fun), etc.

BUG=v8:5890

Review-Url: https://codereview.chromium.org/2654733004
Cr-Original-Commit-Position: refs/heads/master@{#42703}
Committed: d1ddec7857
Review-Url: https://codereview.chromium.org/2654733004
Cr-Commit-Position: refs/heads/master@{#42731}
2017-01-27 10:13:53 +00:00
machenbach
d2d99e084a Revert of [tests] Make assertOptimized()/assertUnoptimized() great again. (patchset #6 id:130042 of https://codereview.chromium.org/2654733004/ )
Reason for revert:
Mac gc stress failures:
https://build.chromium.org/p/client.v8/builders/V8%20Mac%20GC%20Stress/builds/11195

There's also this flake, but maybe unrelated:
https://build.chromium.org/p/client.v8/builders/V8%20Win64/builds/15422

Original issue's description:
> [tests] Make assertOptimized()/assertUnoptimized() great again.
>
> The mentioned asserts did not work properly with interpreted and turbofanned functions.
>
> To fix this issue %GetOptimizationStatus() now returns a set of flags instead of a single value.
>
> This CL also adds more helper functions to mjsunit, like isNeverOptimize(), isAlwaysOptimize(),
> isOptimized(fun), etc.
>
> BUG=v8:5890
>
> Review-Url: https://codereview.chromium.org/2654733004
> Cr-Commit-Position: refs/heads/master@{#42703}
> Committed: d1ddec7857

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

Review-Url: https://codereview.chromium.org/2655223003
Cr-Commit-Position: refs/heads/master@{#42704}
2017-01-26 15:04:47 +00:00
ishell
d1ddec7857 [tests] Make assertOptimized()/assertUnoptimized() great again.
The mentioned asserts did not work properly with interpreted and turbofanned functions.

To fix this issue %GetOptimizationStatus() now returns a set of flags instead of a single value.

This CL also adds more helper functions to mjsunit, like isNeverOptimize(), isAlwaysOptimize(),
isOptimized(fun), etc.

BUG=v8:5890

Review-Url: https://codereview.chromium.org/2654733004
Cr-Commit-Position: refs/heads/master@{#42703}
2017-01-26 14:35:29 +00:00
franzih
c93bdaaff1 [test] Move stray variables into namespaces.
BUG=

Review-Url: https://codereview.chromium.org/2496133003
Cr-Commit-Position: refs/heads/master@{#41027}
2016-11-16 11:38:18 +00:00
franzih
0188c3fba3 [test] Add tests for definitions in object literal.
Properties can be defined inside the object literal (ES6) or after
object creation. The behavior differes if there are accessors, interceptors
or proxies in the Object prototype chain.

These test cases assure we preserve correct behavior as we
improve performance of definitions in literals.

BUG=v8:5624

Review-Url: https://codereview.chromium.org/2501553002
Cr-Commit-Position: refs/heads/master@{#41024}
2016-11-16 11:00:36 +00:00
franzih
8439401d2d [runtime] Intercept function declarations.
We used to intercept function definitions, but not declarations.
GenericNamedPropertySetterCallback now also intercepts function declarations.

For definitions, we call DeclareGlobal and then InitializeVarGlobal. For
declarations, we never call InitializeVarGlobal, thus we must check for
interceptors in DeclareGlobal.

If the semantics of a redeclaration are wrong, e.g., redeclaring a read-only
property, an exception is thrown independent of whether an interceptor is
installed. Usually, i.e., not during a declaration, we only throw if
the call is not successfully intercepted.

BUG=v8:5375

Review-Url: https://codereview.chromium.org/2334733002
Cr-Commit-Position: refs/heads/master@{#39450}
2016-09-15 15:48: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
ulan
1b26611ce9 [heap] Introduce enum of garbage collection reasons.
Now callers of Heap::CollectGarbage* functions need to
specify the reason as an enum value instead of a string.

Subsequent CL will add stats counter for GC reason.

BUG=

Review-Url: https://codereview.chromium.org/2310143002
Cr-Commit-Position: refs/heads/master@{#39239}
2016-09-07 10:03:08 +00:00
franzih
2672029333 [api] Add tests that document get callback behavior.
BUG=

Review-Url: https://codereview.chromium.org/2301393002
Cr-Commit-Position: refs/heads/master@{#39208}
2016-09-06 13:36:53 +00:00
adamk
6dd2bc20b4 Remove unnessary includes of parser.h
This makes for slightly faster rebuilds when touching parser-base.h
(which changes frequently!). Also takes care of an old TODO,
moving CompileTimeValue into its own file under ast/, where it
properly belongs.

BUG=v8:5294

Review-Url: https://codereview.chromium.org/2305883002
Cr-Commit-Position: refs/heads/master@{#39141}
2016-09-02 17:48:46 +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
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
franzih
986c23a5a5 [test] Remove unused dependency.
BUG=

Review-Url: https://codereview.chromium.org/2262153002
Cr-Commit-Position: refs/heads/master@{#38782}
2016-08-22 12:49:58 +00:00
ishell
d634e65fb0 [ic] Don't share LoadGlobalIC slots inside typeof and outside typeof.
Because in case of interceptors we will install a slow stub that suits only one case.

BUG=chromium:634467
TBR=verwaest@chromium.org

Review-Url: https://codereview.chromium.org/2219303002
Cr-Commit-Position: refs/heads/master@{#38503}
2016-08-09 16:30:44 +00:00
ishell
5c8cb1689a [ic] Don't call LookupIterator::GetStoreTarget() when receiver is not a JSReceiver.
BUG=chromium:619166,chromium:625155

Review-Url: https://codereview.chromium.org/2175273002
Cr-Commit-Position: refs/heads/master@{#38018}
2016-07-25 12:32:59 +00:00
ishell
4f674da2e9 [ic] Don't compile load interceptor handlers for LoadGlobalIC.
As a result LoadGlobalIC requires different slow stubs for each TypeofMode.

This CL is a prerequisite for not passing variable name to LoadGlobalIC:
the interceptor handler is the only kind of handler that requires a name
and therefore LoadGlobalIC dispatcher does not need a variable name as well.

BUG=chromium:576312

Review-Url: https://codereview.chromium.org/2081143002
Cr-Commit-Position: refs/heads/master@{#37222}
2016-06-23 16:51:14 +00:00
cbruni
667188b1a7 Reland of [keys] Simplify KeyAccumulator (patchset #1 id:1 of https://codereview.chromium.org/2010593002/ )
Reason for revert:
relanding, fixed handle dereferencing

Original issue's description:
> Revert of [keys] Simplify KeyAccumulator (patchset #15 id:280001 of https://codereview.chromium.org/1995263002/ )
>
> Reason for revert:
> https://build.chromium.org/p/client.v8/builders/V8%20Mac%20GC%20Stress/builds/6248
>
> Original issue's description:
> > [keys] Simplify KeyAccumulator
> >
> > - Use KeyAccumulator::GetKeys directly instead of JSReceiver::GetKeys
> > - Revert KeyAccumulator to single OrderedHashSet implementation.
> > - Convert the OrderedHashSet in-place to a FixedArray
> > - IndexedInterceptor indices are no longer combined and sorted with the object indices
> >
> > BUG=
> >
> > Committed: https://crrev.com/d3324df017046bcde247a5aef6d1b59bfae5908f
> > Cr-Commit-Position: refs/heads/master@{#36485}
>
> TBR=jkummerow@chromium.org,verwaest@chromium.org,cbruni@chromium.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=
>
> Committed: https://crrev.com/893524b53d43df63bca6cb9b7244d21771fadb0b
> Cr-Commit-Position: refs/heads/master@{#36486}

TBR=jkummerow@chromium.org,verwaest@chromium.org,machenbach@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/2014523002
Cr-Commit-Position: refs/heads/master@{#36502}
2016-05-25 09:13:54 +00:00
machenbach
893524b53d Revert of [keys] Simplify KeyAccumulator (patchset #15 id:280001 of https://codereview.chromium.org/1995263002/ )
Reason for revert:
https://build.chromium.org/p/client.v8/builders/V8%20Mac%20GC%20Stress/builds/6248

Original issue's description:
> [keys] Simplify KeyAccumulator
>
> - Use KeyAccumulator::GetKeys directly instead of JSReceiver::GetKeys
> - Revert KeyAccumulator to single OrderedHashSet implementation.
> - Convert the OrderedHashSet in-place to a FixedArray
> - IndexedInterceptor indices are no longer combined and sorted with the object indices
>
> BUG=
>
> Committed: https://crrev.com/d3324df017046bcde247a5aef6d1b59bfae5908f
> Cr-Commit-Position: refs/heads/master@{#36485}

TBR=jkummerow@chromium.org,verwaest@chromium.org,cbruni@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/2010593002
Cr-Commit-Position: refs/heads/master@{#36486}
2016-05-24 17:37:41 +00:00
cbruni
d3324df017 [keys] Simplify KeyAccumulator
- Use KeyAccumulator::GetKeys directly instead of JSReceiver::GetKeys
- Revert KeyAccumulator to single OrderedHashSet implementation.
- Convert the OrderedHashSet in-place to a FixedArray
- IndexedInterceptor indices are no longer combined and sorted with the object indices

BUG=

Review-Url: https://codereview.chromium.org/1995263002
Cr-Commit-Position: refs/heads/master@{#36485}
2016-05-24 16:41:19 +00:00
jochen
9c9708ac91 Interceptors expect the receiver to always be an JSReceiver.
BUG=chromium:609134
R=verwaest@chromium.org

Review-Url: https://codereview.chromium.org/1973513002
Cr-Commit-Position: refs/heads/master@{#36203}
2016-05-12 11:06:11 +00:00
jochen
a75b2c8f69 Add the data parameter back to the access check callback
BUG=none
R=verwaest@chromium.org
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#33699}
2016-02-03 10:02:35 +00:00
jochen
6f472db65a Disable soon to be deprecated APIs per default for v8
Embedders still can use those APIs by default

test-api.cc still has an exception to use the old APIs...

BUG=v8:4143
R=vogelheim@chromium.org
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#32701}
2015-12-09 10:35:04 +00:00
jochen
4b3239107a Remove usage of deprecated APIs from api interceptor tests
BUG=v8:4341
R=vogelheim@chromium.org
LOG=y
NOTRY=true
NOPRESUBMIT=true

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

Cr-Commit-Position: refs/heads/master@{#32676}
2015-12-08 18:39:24 +00:00