Commit Graph

420 Commits

Author SHA1 Message Date
sgjesse@chromium.org
54e81c351f Add source position recording for variable loads
This provides more precise source to generated code mapping as variable loads can be handled using IC calls.

R=kmillikin@chromium.org

BUG=v8:1527
TEST=test/message/regress/regress-1527

Review URL: http://codereview.chromium.org//7327038

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8610 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-07-11 15:20:17 +00:00
vitalyr@chromium.org
fe7bdf1fe8 Remove unmarked entries from per context map caches.
Made "map_cache" a weak field of global context and added a pass over
all caches late in the marking phase.

R=vegorov@chromium.org
BUG=v8:1516
TEST=cctest/test-api/Regress1516

Review URL: http://codereview.chromium.org/7285031

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8515 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-07-01 12:47:18 +00:00
keuchel@chromium.org
628a2e2a1f Better codegen for '<expression> === void <literal>'.
Detect the pattern in both, the full compiler and crankshaft and generate direct pointer
comparisons. Along the way I cleaned up 'typeof <expression> == <string literal>' comparisons
as well by lifting platform independent code and checking the symmetric case.

BUG=v8:1440
TEST=cctest/test-api.cc

Review URL: http://codereview.chromium.org/7216008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8420 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-24 14:30:10 +00:00
lrn@chromium.org
1eb34e542c Make extensions in different tests have different names.
In the threaded test, they influenced each other.

Review URL: http://codereview.chromium.org/7244001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8389 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-23 08:28:23 +00:00
jkummerow@chromium.org
1e1387f12c Add possibility to configure 'prototype' property via FunctionTemplate
BUG=v8:1479
TEST=test-api/SetPrototypeProperties

Review URL: http://codereview.chromium.org/7229007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8366 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-22 12:39:45 +00:00
lrn@chromium.org
8c538d9012 Made parser not accept unicode escapes inside "native" when used as a keyword.
This is a regression relative to the original behavior, when "native" was a keyword,
since keywords cannot contain esacpes.

Added tests for escapes and for not allowing line-terminators betwen "native" and "function".

Review URL: http://codereview.chromium.org/7206022

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8327 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-20 11:52:24 +00:00
karlklose@chromium.org
f4e4bc43a8 Merge arguments branch to bleeding edge (second try).
Review URL: http://codereview.chromium.org/7187007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8315 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-16 14:12:58 +00:00
karlklose@chromium.org
cc19d1e278 Revert "Merge arguments branch to bleeding merge."
This reverts commit ceb31498b9d69edca3260820fb4047045891ce6d.

TBR=kmillikin@chromium.org

Review URL: http://codereview.chromium.org/7172030

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8308 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-16 06:37:49 +00:00
karlklose@chromium.org
6cfeb2d400 Merge arguments branch to bleeding merge.
Review URL: http://codereview.chromium.org/7167006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8300 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-15 15:09:28 +00:00
ricow@chromium.org
40fa4a761b Correctly set ReadOnly flag on indexed properties when using the API Set method (fixes issue 1470)
Review URL: http://codereview.chromium.org/7149015

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8286 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-15 06:44:57 +00:00
ricow@chromium.org
38a75cf731 Geve correct error message when Object.isExtensible is called on a non object (fixes issue 1452)
Review URL: http://codereview.chromium.org/7146010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8275 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-14 11:28:14 +00:00
ager@chromium.org
b7a93d417d Add GetOwnPropertyNames method for Object in the API
Patch by Peter Varga.

BUG=none
TEST=cctest/test-api/PropertyEnumeration

Review URL: http://codereview.chromium.org/7129058

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8264 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-10 12:33:55 +00:00
mikhail.naganov@gmail.com
508b22c436 "Deiceolate" Thread classes.
Thread class was receiving an isolate parameter by default.
This approact violates the assumption that only VM threads
can have an associated isolate, and can lead to troubles,
because accessing the same isolate from different threads
leads to race conditions.

This was found by investigating mysterious failures of the
CPU profiler layout test on Linux Chromium. As almost all
threads were associated with some isolate, the sampler was
trying to sample them.

As a side effect, we have also fixed the DebuggerAgent test.

Thanks to Vitaly for help in fixing isolates handling!

R=vitalyr@chromium.org
BUG=none
TEST=none

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8259 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-10 09:54:04 +00:00
mikhail.naganov@gmail.com
47248cc5fe Revert accidental r8254..r8256
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8257 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-10 09:42:08 +00:00
mikhail.naganov@gmail.com
6891dd204c tests compile but crash
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8255 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-10 09:36:18 +00:00
mikhail.naganov@gmail.com
3b2470d296 Fix presubmit errors catched by a more recent version of cpplint.py.
Mainly, there were errors concerning blank lines before and after class access
control sections [whitespace/blank_line].

BEFORE an access control section (e.g. public:, private:) there should be a
blank line (except for the section right after the class declaration).

AFTER an access control section there should be no blank line.

TBR=ager@chromium.org

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8193 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-07 07:17:46 +00:00
fschneider@chromium.org
7c9cf0b3a1 Re-land r8140: Deoptimize on never-executed code-paths.
Original cl: http://codereview.chromium.org/7105015

I'm removing the test GlobalLoadICGC test that was introduced for testing
inlined global cell loads (in the classic backend) and has an invalid assumption
about the number of global objects referenced from a v8 context. We don't have
this feature with Crankshaft anymore.
Review URL: http://codereview.chromium.org/7112032

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8185 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-06 14:57:25 +00:00
ager@chromium.org
017935408d Reapply change to Pass undefined to JS builtins when called with
implicit receiver.

A couple of corner cases have to be treated specially to not break
everything: eval and getter/setter definitions.

R=fschneider@chromium.org
BUG=v8:1365
TEST=mjsunit/regress/regress-1365.js

Review URL: http://codereview.chromium.org/7085034

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8110 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-30 13:49:22 +00:00
ager@chromium.org
c832c467a4 Revert "Pass undefined to JS builtins when called with implicit receiver."
Presubmit and failing test.

TBR=lrn@chromium.org
BUG=
TEST=

Review URL: http://codereview.chromium.org/7071009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8075 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-26 11:22:29 +00:00
ager@chromium.org
19b718fe73 Pass undefined to JS builtins when called with implicit receiver.
A couple of corner cases have to be treated specially to not break
everything: eval and getter/setter definitions.

R=lrn@chromium.org
BUG=v8:1365
TEST=mjsunit/regress/regress-1365.js

Review URL: http://codereview.chromium.org/7068009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8073 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-26 11:07:48 +00:00
ager@chromium.org
98778dc802 Remove execScript from V8. No longer present i neither Firefox nor Safari.
R=ricow@chromium.org
BUG=
TEST=

Review URL: http://codereview.chromium.org/7046002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7948 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-19 08:10:27 +00:00
vegorov@chromium.org
925107046e Extend Handle API with MarkIndependent.
Garbage collector is free to ignore object groups for independent handles and can collect then in minor collections.

Review URL: http://codereview.chromium.org/7031005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7915 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-17 12:18:19 +00:00
ricow@chromium.org
964dbff40d Only send null or undefined as receiver for es5 natives, not generally
for builtin functions.
Review URL: http://codereview.chromium.org/7012012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7879 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-13 07:26:44 +00:00
vitalyr@chromium.org
4cc800b3cf Support %_IsUndetectableObject in crankshaft.
Review URL: http://codereview.chromium.org/6995046

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7856 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-11 11:53:43 +00:00
jkummerow@chromium.org
944a388412 Avoid using a register for constant external array indices.
This CL is based on and obsoletes CL 6879037.

TEST=mjsunit/external-array.js

Review URL: http://codereview.chromium.org/6902112

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7844 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-10 15:25:17 +00:00
ager@chromium.org
8033be880e Add IsCallable method for Object in the API
Patch by Peter Varga.

BUG=none
TEST=cctest/test-api/CallableObject

Review URL: http://codereview.chromium.org/6964005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7828 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-09 15:24:48 +00:00
ager@chromium.org
0961b1a936 Check that receiver is JSObject on API calls.
R=sgjesse@chromium.org
BUG=v8:1369
TEST=mjsunit/regress/regress-1369.js

Review URL: http://codereview.chromium.org/6931056

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7808 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-06 14:14:16 +00:00
ager@chromium.org
cf19179266 Implement CallAsConstructor method for Object in the API
Patch by Peter Varga.

BUG=v8:1348
TEST=cctest/test-api/ConstructorForObject

Review URL: http://codereview.chromium.org/6902108

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7803 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-06 11:07:52 +00:00
ricow@chromium.org
1d9133bbac Split threaded cctests into four parts (instead of 2)
The number of cctests are now so large that this is causing timeouts
when only splitting these into two parts.
Review URL: http://codereview.chromium.org/6929063

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7801 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-06 09:22:54 +00:00
dslomov@chromium.org
2500f14868 This implements per-isolate locking and unlocking, including tests
BUG=
TEST=

Committed: http://code.google.com/p/v8/source/detail?r=7734

Committed: http://code.google.com/p/v8/source/detail?r=7784

Review URL: http://codereview.chromium.org/6788023

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7797 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-05 18:55:31 +00:00
dslomov@chromium.org
6e4629a81c Revert "This implements per-isolate locking and unlocking, including tests"
This reverts commit 1aa40d0c278e195e9e69dcf8b29a212aa1817c0b.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7785 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-04 22:35:42 +00:00
dslomov@chromium.org
d54fe47fad This implements per-isolate locking and unlocking, including tests
BUG=
TEST=

Committed: http://code.google.com/p/v8/source/detail?r=7734

Review URL: http://codereview.chromium.org/6788023

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7784 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-04 21:04:32 +00:00
ager@chromium.org
82a04c7fdc Add CallAsFunction method to the Object class in the API
Patch by Peter Varga.

BUG=v8:1336
TEST=cctest/test-api/CallAsFunction

Review URL: http://codereview.chromium.org/6883045

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7781 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-04 13:03:08 +00:00
ager@chromium.org
24f19608d4 Actually revert "Add Call method to the Object class in the API"
Tests are failing in debug mode.

This also reapplies the change "Make Date and RegExp inherit from
Object in the API" that I accidentally reverted.

R=sgjesse@chromium.org
BUG=
TEST=

Review URL: http://codereview.chromium.org/6927009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7775 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-04 11:07:09 +00:00
ager@chromium.org
26c775da94 Revert "Make Date and RegExp inherit from Object in the API."
Tests are failing in debug mode.

R=sgjesse@chromium.org
BUG=
TEST=

Review URL: http://codereview.chromium.org/6930004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7774 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-04 10:51:07 +00:00
ager@chromium.org
b8cdecb517 Add Call method to the Object class in the API
Patch by Peter Varga.

BUG=v8:1336
TEST=cctest/test-api/CallAsFunction

Review URL: http://codereview.chromium.org/6883045

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7773 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-04 10:03:49 +00:00
ager@chromium.org
87f225936f Make Date and RegExp inherit from Object in the API.
They are objects and the API inheritance hierarchy should reflect that.

R=sgjesse@chromium.org
BUG=
TEST=

Review URL: http://codereview.chromium.org/6929008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7772 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-04 07:28:27 +00:00
ager@chromium.org
8aeaa5e90a Implement API to disallow code generation from strings for a context.
R=sgjesse@chromium.org
BUG=v8:1258
TEST=test-api/AllowCodeGenFromStrings

Review URL: http://codereview.chromium.org/6905167

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7753 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-03 05:40:47 +00:00
dslomov@chromium.org
7088aea3eb Revert "This implements per-isolate locking and unlocking, including tests"
This reverts commit 76c78febb70e75b18214f5fe45de95c7fb515386.

This change has broken test-thread-termination/TerminateMultipleV8Threads

TBR=vitalyr

Review URL: http://codereview.chromium.org/6903154

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7735 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-29 22:16:45 +00:00
dslomov@chromium.org
f4c120d615 This implements per-isolate locking and unlocking, including tests
BUG=
TEST=

Review URL: http://codereview.chromium.org/6788023

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7734 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-29 21:26:03 +00:00
karlklose@chromium.org
32732fbc86 Expose hasOwnProperty() through API.
BUG=http://code.google.com/p/v8/issues/detail?id=1342
TEST=test-api/HasOwnProperty

Review URL: http://codereview.chromium.org/6903059

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7699 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-28 09:27:40 +00:00
whesse@chromium.org
e39f0535be Disable logging for the Threading test in cctest/test-api by default.
BUG=
TEST=test-api/Threading

Review URL: http://codereview.chromium.org/6893050

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7684 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-27 07:56:41 +00:00
jkummerow@chromium.org
bc8f6943bb Support Float64Arrays
BUG=None
TEST=mjsunit/external-arrays.js; updated cctest; existing unit tests

Review URL: http://codereview.chromium.org/6879009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7675 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-21 07:15:43 +00:00
antonm@chromium.org
dc99761f31 Minor cosmetic changes.
Review URL: http://codereview.chromium.org/6875003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7646 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-18 13:28:00 +00:00
antonm@chromium.org
0b30898379 Allow recursive messages reporting as it is already used.
Instead discard unhandled exceptions thown while running
message listeners.

Review URL: http://codereview.chromium.org/6820003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7574 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-11 16:16:52 +00:00
sgjesse@chromium.org
75759805a9 ARM: Remove support for ABI prior to EABI
The support for the old ABI is known to be broken and has been deprecated for some time now. Removed the instructions for loading and storing co-processor registers as they where only used to support the old ABI.

R=karlklose@chromium.org

BUG=v8:1316
TEST=

Review URL: http://codereview.chromium.org//6822025

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7565 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-11 09:04:30 +00:00
yurys@chromium.org
9e181c5b4f Report stack overflow exceptions to V8 message listeners
Stack overflow exceptions like other JavaScript exceptions should be reported to listeners added via V8::AddMessageListener
Review URL: http://codereview.chromium.org/6816021

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7553 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-08 09:39:45 +00:00
antonm@chromium.org
8122f974d8 Make exception thrown via v8 public API propagate to v8::TryCatch as JS thrown exceptions do.
Correctly process failures which can be returned by Object::GetProperty
when performing GetRealNamedProperty* queries.

Callback properties can produce exceptions so we need to wrap access to them
into exception checks.  However, despite of many other methods with exception
checks, property access doesn't mandatroy go via JavaScript and hence we
need to inject code to propagate exception to public API TryCatch handlers.

Review URL: http://codereview.chromium.org/6685087

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7548 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-07 19:52:24 +00:00
danno@chromium.org
fa69fd0817 Fix opmitized external array access for compound assignments and count operations, also implement missing ARM typed array Hydrogen loads and stores.
BUG=none
TEST=none

Review URL: http://codereview.chromium.org/6805005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7536 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-07 09:51:25 +00:00
antonm@chromium.org
56b53dd5dc Introduce v8::Object::CreationContext method.
That allows to find out a global context in which the object
was created.

Review URL: http://codereview.chromium.org/6759054

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7476 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-01 12:17:20 +00:00
ricow@chromium.org
fb6d7e17df Follow jsc on not throwing when trying to add a property to a non-extensible object.
This change makes us compatible with Safari on not throwing when trying to add a property to a non-extensible object. 
Review URL: http://codereview.chromium.org/6712059

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7379 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-28 06:11:08 +00:00
ager@chromium.org
1a9e8d12b9 Correct order of arguments to CHECK_EQ in an API test.
R=karlklose@chromium.org
BUG=1275
TEST=

Review URL: http://codereview.chromium.org/6713125

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7361 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-25 10:34:39 +00:00
danno@chromium.org
fbbace7fbe Fix build
BUG=none
TEST=none
TBR=ager@chromium.org

Review URL: http://codereview.chromium.org/6732038

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7355 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-24 22:30:53 +00:00
danno@chromium.org
ea45f6719e Support external arrays in Crankshaft
Add specialized hydrogen and lithium instructions to support loading and storing to external arrays.

Review URL: http://codereview.chromium.org/6656001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7354 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-24 22:14:15 +00:00
vitalyr@chromium.org
401b308778 Allow calling stats API functions before we have an isolate.
Review URL: http://codereview.chromium.org/6733030

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7353 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-24 19:05:49 +00:00
danno@chromium.org
88854cd712 Remember and reuse derived map for external arrays
Ensure that all objects that had the same map before attaching an external array have the same map once the external array is attached.

BUG=75639
TEST=fast/canvas/webgl/uninitialized-test.html

Review URL: http://codereview.chromium.org/6685073

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7318 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-23 09:57:12 +00:00
vitalyr@chromium.org
04537cb227 Use v8::internal threading support in samples/shell.cc.
We need this for isolates testing. To make it work I had to extend the
internal Thread constructor with an option to set the stack size (see
the comment in shell.cc).

BUG=1264

Review URL: http://codereview.chromium.org/6711068

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7289 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-21 15:04:17 +00:00
vitalyr@chromium.org
7976ca2cbc Merge isolates to bleeding_edge.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7271 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-18 20:35:07 +00:00
vitalyr@chromium.org
76e226f832 Revert r7268: it borked the history.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7269 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-18 19:41:05 +00:00
vitalyr@chromium.org
6ff7fdebd3 Merge isolates to bleeding_edge.
Review URL: http://codereview.chromium.org/6685088

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7268 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-18 18:49:56 +00:00
antonm@chromium.org
6f45ce4529 Revert r7258 and r7260.
They apparently break Threading tests on at least Mac and Win64.

TBR=vitalyr@chromium.org

Review URL: http://codereview.chromium.org/6709028

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7262 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-18 13:24:38 +00:00
antonm@chromium.org
4722f692e4 Make exception thrown via v8 public API propagate to v8::TryCatch as JS thrown exceptions do.
Correctly process failures which can be returned by Object::GetProperty
when performing GetRealNamedProperty* queries.

Callback properties can produce exceptions so we need to wrap access to them
into exception checks.  However, despite of many other methods with exception
checks, property access doesn't mandatroy go via JavaScript and hence we
need to inject code to propagate exception to public API TryCatch handlers.

Review URL: http://codereview.chromium.org/6397011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7258 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-18 12:33:19 +00:00
ager@chromium.org
4f7fe371b2 Fix Array::New(length) in the API to return an array with the provided length.
The internal factory method initializes the elements but does not set
the length property of the array.

Add array api test case for length.

R=antonm@chromium.org
BUG=v8:1256
TEST=cctest/test-api/Array

Review URL: http://codereview.chromium.org/6674034

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7210 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-16 19:55:31 +00:00
antonm@chromium.org
a7bb1d5278 Introduce one way dependencies into object grouping.
Those are necessary to properly manage relationship between objects in cases
when they don't form proper tree structure.

Review URL: http://codereview.chromium.org/6686053

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7202 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-16 12:02:28 +00:00
ricow@chromium.org
fc38a2e509 Do not set value on host objects in Object.defineProperty (fixes issue 1250).
To be compatible with safari we should not change the value on API
objects in Object.defineProperty (e.g., the window.location object).

Review URL: http://codereview.chromium.org/6673042

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7169 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-15 09:16:12 +00:00
danno@chromium.org
9cca7d2733 Combine typed and pixel arrays.
Worth mentioning:
- Specialized versions of pixel array and store/loads inside the generic stubs have been removed, since to have parity for all external arrays, 8 different versions would have to be inlined/checked.
- There's a new constant in v8.h for external arrays with pixel array elements.

Review URL: http://codereview.chromium.org/6546036

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7106 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-09 15:01:16 +00:00
mmaly@chromium.org
9dc156ac62 Passing strict mode throughout SetElement.
Throw if assigning to read only element.
Adding tests for element assignment in strict mode.

Fix tests for strict mode SetElement.

Review URL: http://codereview.chromium.org/6613005/

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7053 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-04 00:21:52 +00:00
mmaly@chromium.org
1d040083b0 Assignment to read only properties throws in strict mode.
Review URL: http://codereview.chromium.org/6594037/

Revert "Revert "Assignment to read only properties throws in strict mode.""

This reverts commit aefcd82e1d36d458dd071ebf4777340f08aa67b1.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7007 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-02 04:53:43 +00:00
mmaly@chromium.org
749b69853a Revert "Assignment to read only properties throws in strict mode."
This reverts commit 503f2a501e504f330821f247074e731aa649b1f0.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6977 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-01 06:10:41 +00:00
mmaly@chromium.org
98aea3c353 Assignment to read only properties throws in strict mode.
Review URL: http://codereview.chromium.org/6594037/

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6976 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-01 01:42:37 +00:00
antonm@chromium.org
4718466e48 Landing for Zaheer.
Direct call accessor getter callbacks (arm implementation).

Original review: http://codereview.chromium.org/6462029/

Review URL: http://codereview.chromium.org/6576035

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6938 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-24 15:39:09 +00:00
ager@chromium.org
c2969bfb1a Implement pixel array elements access in the presence of an
interceptor that does not handle the elements load.

Review URL: http://codereview.chromium.org/6551001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6869 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-21 15:59:23 +00:00
ricow@chromium.org
95892799e1 Add access checks to Object.preventExtensions + add regression test for 1027.
Object.preventExtensions can currently be used cross-domain. With this
change we follow firefox (IE9 has our current behaviour). In addition
this includes a regression test for 1027 and access tests for
Object.seal and Object.freeze.


Review URL: http://codereview.chromium.org/6534019

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6848 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-18 10:39:02 +00:00
danno@chromium.org
12b4e0efe7 Implement crankshaft support for pixel array stores.
Review URL: http://codereview.chromium.org/6528013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6817 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-16 13:31:12 +00:00
antonm@chromium.org
6b4ff18b5b Properly process try/finally blocks.
In some circumstances, try/finally block can actually catch the exception:

function f() {
  try {
    throw 42;
  } finally {
    return 0;
  }
}

Therefore when propagating exception to v8::TryCatch, we must be sure
there is no try/finally blocks as well.

When bulding the messages we should be more conservative and expect that
any v8::TryCatch with no JS try/catch in between can potentionally
be the right exception handler.

Plus various minor refactorings.

BUG=1147
TEST=cctest/test-api/TryCatchAndFinallyHidingException, cctest/test-api/TryCatchAndFinally

Review URL: http://codereview.chromium.org/6526016

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6809 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-16 11:40:48 +00:00
ricow@chromium.org
4d07390196 Add access check when Object.keys is called on the global js proxy (fixes issue 1154)
I will land access checks for a range of ES5 features in another patch (we added a bunch of cases like this in the past few weeks, i.e., cases where we simply use the global object instead of the js global proxy).


Review URL: http://codereview.chromium.org/6499013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6786 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-15 10:39:22 +00:00
danno@chromium.org
36088cb64f Implement specialized IC code stubs for pixel array stores.
Review URL: http://codereview.chromium.org/6478027

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6781 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-14 21:21:33 +00:00
antonm@chromium.org
5d3430a509 Fix forging of object's identity hashes.
Do not do standard property lookup on hidden properties object as it might
reach Object.prototype which can be altered to forge identity hashes.
Instead do only local lookup.

Review URL: http://codereview.chromium.org/6472001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6728 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-10 14:09:52 +00:00
danno@chromium.org
1bd9f602be Implement crankshaft support for pixel array loads.
Review URL: http://codereview.chromium.org/6410112

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6725 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-10 12:02:36 +00:00
antonm@chromium.org
2f17f3e5d7 Do not invoke any setters when forming stack trace JS object.
Review URL: http://codereview.chromium.org/6463022

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6709 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-09 19:34:04 +00:00
antonm@chromium.org
47a22dcecd Reapply http://code.google.com/p/v8/source/detail?r=6555
Compare JSObjects by identity immediately.

When invoking EQUALS JS builtin, 1st argument is passed as a receiver and
if it's a global object, it gets overwritten with global proxy object and
thus one gets incorrect results.

BUG=v8:1082

TBR=ricow@chromium.org

Review URL: http://codereview.chromium.org/6461028

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6708 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-09 19:09:26 +00:00
ager@chromium.org
8c6c273236 Fix issues with using defineProperty on the global proxy object.
Review URL: http://codereview.chromium.org/6452004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6683 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-08 16:31:58 +00:00
antonm@chromium.org
aecb05354b Landing for Zaheer Ahmad.
Direct call api functions (arm implementation)

See: http://codereview.chromium.org/6170001/

Review URL: http://codereview.chromium.org/6286078

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6639 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-04 13:43:38 +00:00
antonm@chromium.org
710fbd2cfb Do proper security checks when accessing elements with getOwnPropertyDescriptor.
This extends logic applied to regular properties to elements.

Review URL: http://codereview.chromium.org/6246055

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6626 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-03 18:09:51 +00:00
antonm@chromium.org
73348e83ea Fix array boundary error.
It made value of allowed_access_type[v8::ACCESS_KEYS] be a wild value.  On most of
platforms it was 0 and tests passed.  But on ARM (and on ia32 if you alter test a bit)
it could become true and hence allow enumeration of properties.

Review URL: http://codereview.chromium.org/6334089

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6618 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-03 13:30:22 +00:00
danno@chromium.org
a2fb4a12bb Create specialized code stubs for PixelArray loads.
Review URL: http://codereview.chromium.org/6287030

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6614 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-03 12:50:50 +00:00
antonm@chromium.org
fed5622671 Better security checks when accessing named properties via Object.getOwnPropertyDescriptor.
Current approach returns undefined descriptor if caller is not granted v8::HAS_ACCESS.
If the caller has v8::HAS_ACCESS, for no JS accessors regular v8::GET_ACCESS check is
performed and value property of the descriptor is set to undefined if caller doesn't
have proper access.  For JS accessors both v8::GET_ACCESS and v8::SET_ACCESS are checked
and affect if getter and setter would be stored in the descriptor.

Review URL: http://codereview.chromium.org/6286020

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6592 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-02 17:44:29 +00:00
ager@chromium.org
73a4ecfae1 A MessageObject is a purely internal object to hold information about
an error message that needs to be generated and reported. This change
hides all of the error information from JavaScript code so user
callbacks cannot get hold of it.

Review URL: http://codereview.chromium.org/6368051

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6574 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-02 13:31:52 +00:00
ricow@chromium.org
0dd951ee84 Revert revision 6555 as it causes win32 debug to fail.
Review URL: http://codereview.chromium.org/6349044

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6564 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-02 08:14:06 +00:00
antonm@chromium.org
32a631d8bc Compare JSObjects by identity immediately.
When invoking EQUALS JS builtin, 1st argument is passed as a receiver and
if it's a global object, it gets overwritten with global proxy object and
thus one gets incorrect results.

BUG=v8::1082

Review URL: http://codereview.chromium.org/6287018

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6555 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-01 13:29:37 +00:00
ager@chromium.org
471c0d2983 Avoid callbacks to user code during error formatting in a couple of
other situations.

Do not use overwritten Object.prototype.hasOwnProperty and
Array.prototype.pop. Do not use split and join in the error formatting
implementation. They are too big to control and their generality is
not needed.

Review URL: http://codereview.chromium.org/6287041

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6552 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-01 12:31:16 +00:00
antonm@chromium.org
1023f569b9 Perform security checks before fetching the value in Object.getOwnPropertyDescriptor.
Review URL: http://codereview.chromium.org/6386022

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6539 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-31 13:49:15 +00:00
kmillikin@chromium.org
78b9981b90 Revert "Add custom typed ICs for pixel array loads. "
This change caused failures in (out of bounds) keyed loads of strings.

TBR'd.

Review URL: http://codereview.chromium.org/6298019

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6528 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-28 15:07:04 +00:00
danno@chromium.org
afd0906204 Add custom typed ICs for pixel array loads.
Review URL: http://codereview.chromium.org/6323002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6526 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-28 14:06:20 +00:00
ager@chromium.org
f8b74a1541 Avoid using Function.prototype.call in a number of places in our
builtins files. We should always use %_CallFunction for a couple of
reasons: it cannot be overwritten and it does not wrap basic types in
wrapper objects.

Review URL: http://codereview.chromium.org/6349018

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6524 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-28 10:33:10 +00:00
ager@chromium.org
eb3970c822 Fix another message object leak.
Review URL: http://codereview.chromium.org/6269021

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6495 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-26 15:16:13 +00:00
ager@chromium.org
d69ef26f7d Another fix for leaking error objects. User code can overwrite
ReferenceError.prototype.__proto__ which will make "error instanceof
Error" fail. However, the ReferenceError.prototype object itself
cannot be modified. Therefore, the error checks must check for
concrete error instances instead of only checking for Error.

Review URL: http://codereview.chromium.org/6388003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6450 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-25 08:48:59 +00:00
ager@chromium.org
b5151d118d Avoid calling overwritten toString methods for internal error
formatting. I missed a couple of places. Extracting the error object
check to a separate function.

Review URL: http://codereview.chromium.org/6304015

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6435 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-24 07:59:40 +00:00
kbr@chromium.org
cbc1c0fca6 Truncate rather than round to nearest when performing float-to-integer
conversions for external array types, which implement the Typed Array
spec. (Revision of http://codereview.chromium.org/6315004 .)

Prefer SSE2 code path on x86 processors. Non-SSE2 processors now make
a slow runtime call for float-to-int conversions. Use SSE3 for 32-bit
signed and unsigned int array types where possible.

The movement of code from ic-arm.cc to stub-cache-arm.cc caused the
VFP3 code path to be tested for the first time. Fixed bugs in the
register usage and in the constant value stored into integer arrays
for NaN and +/-Infinity.

Added new truncation test to test-api.cc. Storage of NaN and +/-Inf
was already covered. Ran unit tests on x86, x64 and ARM simulator.
Tested ia32 and x64 code in Chromium on Mac and Linux respectively
with Typed Array unit tests and WebGL content.

BUG=http://code.google.com/p/chromium/issues/detail?id=50972
TEST=test-api/ExternalArrays

Review URL: http://codereview.chromium.org/6303012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6431 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-21 23:58:00 +00:00
antonm@chromium.org
b0abe13ed2 Using unsigned shifts and masks when dealing with 64-bit addresses.
BUG=v8:1037

Review URL: http://codereview.chromium.org/6242005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6388 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-19 11:16:23 +00:00