Commit Graph

11 Commits

Author SHA1 Message Date
Jochen Eisinger
f8deca1c86 Never freeze/seal/preventExtensions objects with interceptors
BUG=v8:6163
R=verwaest@chromium.org

Change-Id: Ieaec78c806cc3d459488a8491e77b7b5a8047079
Reviewed-on: https://chromium-review.googlesource.com/461903
Commit-Queue: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#44228}
2017-03-29 13:04:58 +00:00
Jochen Eisinger
9d0f248201 Store the FunctionTemplateInfo used to create remote objects in the map
That way, we don't need to create a context-less constructor function.
Instead, we use the constructor_or_backpointer (or null) field, and
rename it to constructor_or_fti_or_backpointer so nobody is confused.

Note that technically, we still have JSFunctions without contexts, as
they're temporarily created in the deoptimizer.

BUG=v8:6084
R=dcheng@chromium.org,bmeurer@chromium.org,verwaest@chromium.org

Change-Id: I084f052533c317f2cbfb9c35e1acf40263c6257b
Reviewed-on: https://chromium-review.googlesource.com/454636
Commit-Queue: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43834}
2017-03-15 15:57:38 +00:00
dcheng
e5f89fa5ae Don't mark remote contexts as callable or constructible.
Marking it as callable makes typeof return 'function' instead of
'object' when invoked on a remote context or object.

BUG=chromium:527190

Review-Url: https://codereview.chromium.org/2715593002
Cr-Commit-Position: refs/heads/master@{#43416}
2017-02-24 16:08:11 +00:00
dcheng
96eda1f7d1 Fix receiver checks for v8::Function on a remote context receiver.
v8 allows the embedder to specify a global template to use when
creating a new context. However, v8 does not use the supplied
template directly when creating the global proxy: it creates a
unique template for each global proxy. However, this is problematic
for remote contexts: functions cannot use strict receiver checks
with the remote context, as the global template will never match
the global proxy.

To fix this, remote contexts now also include a remote global
object in the prototype chain that is instantiated with the global
template. This mirrors the way the global proxy is configured for a
full v8 context, and allows strict receiver checks to work.

BUG=527190

Review-Url: https://codereview.chromium.org/2677653002
Cr-Commit-Position: refs/heads/master@{#43361}
2017-02-22 10:13:24 +00:00
dcheng
db624fc4d7 Always early return from HandleApiCallHelper on access check failure.
BUG=693695

Review-Url: https://codereview.chromium.org/2702123002
Cr-Commit-Position: refs/heads/master@{#43309}
2017-02-20 10:07:05 +00:00
dcheng
40b74d04da Make CreationContext() not crash when there is no creation context.
Remote objects don't have a creation context.

BUG=527190

Review-Url: https://codereview.chromium.org/2693203003
Cr-Commit-Position: refs/heads/master@{#43306}
2017-02-20 09:47:14 +00:00
dcheng
c5ccae970d Remove a few unnecssary scopers from unit tests.
TestWithIsolate and TestWithContext already instantiate the scopers.

BUG=none

Review-Url: https://codereview.chromium.org/2690303009
Cr-Commit-Position: refs/heads/master@{#43268}
2017-02-17 09:51:07 +00:00
dcheng
692cccce26 Make instance checks understand remote contexts.
https://crrev.com/2500363002 updated FunctionTemplate::HasInstance to
follow the hidden prototype chain of a global proxy to the global
object. However, remote contexts don't have a global object to check;
instead, teach the instance check knows about the conventions of
global proxy setup and have it also check the constructor's prototype.

Similarly, also teach Object::FindInstanceInPrototypeChain about the
unusual conventions for remote contexts.

BUG=527190

Review-Url: https://codereview.chromium.org/2698683003
Cr-Commit-Position: refs/heads/master@{#43263}
2017-02-16 21:46:15 +00:00
yukishiino
d014b47fe5 Fixes Object::SetAccessor to return false if the prop is unconfigurable.
http://www.ecma-international.org/ecma-262/7.0/#sec-validateandapplypropertydescriptor
says that [[DefineProperty]] should return false if the property is
already defined and it's unconfigurable (exactly speaking, the condition
in the spec is more complicated, but roughly speaking, it's when the
property is unconfigurable).

BUG=chromium:670651

Review-Url: https://codereview.chromium.org/2680353004
Cr-Commit-Position: refs/heads/master@{#43080}
2017-02-10 05:56:00 +00:00
jbroman
c8910f3539 Clear pending message during Isolate::CancelScheduledExceptionFromTryCatch.
Without doing this, a JSMessageObject can be kept alive by the isolate, which
in turn keeps the context alive, until the message is cleared.

BUG=v8:5941

Review-Url: https://codereview.chromium.org/2675203005
Cr-Commit-Position: refs/heads/master@{#43043}
2017-02-08 16:12:59 +00:00
jochen
72bad21c8b React immediately to memory pressure on foreground threads
R=marja@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2682033002
Cr-Commit-Position: refs/heads/master@{#43027}
2017-02-08 09:38:50 +00:00