Commit Graph

332 Commits

Author SHA1 Message Date
mikhail.naganov@gmail.com
ec58c05f4e Add support for startup data (snapshot) compression.
This is for mobile platforms where application footprint size is
important. To avoid including compression libraries into V8, we assume
that the host machine have them (true for Linux), and rely on embedder
to provide decompressed data.

Currently, only snapshot data can be comressed. It is also possible to
compress libraries sources, but it is more involved and will be
addressed in another CL.

BUG=none
TEST=none

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7724 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-29 12:08:33 +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
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
karlklose@chromium.org
f7840f65f0 Isolates: Cleanup usage of FACTORY in code stubs and bootstrapper.
Review URL: http://codereview.chromium.org/6720014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7611 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-14 08:01:19 +00:00
vitalyr@chromium.org
d932b5f768 Do not rely on uniqueness of pthread_t
Patch by Dmitry Lomov.

pthreads implementations are free to reuse pthread_t (thread id) after
the thread has died. This change gets rid of ThreadHandle class and
replaces it with v8-managed thread identifiers.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7575 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-11 23:46:22 +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
vitalyr@chromium.org
302037d44e Make object groups and implicit references a bit more lightweight.
We can only call malloc/free once per group and we can avoid scanning
through a list of NULLs if we keep unprocessed groups in the beginning.

I also changed the internal representation of implicit references to
hold a handle to the parent (instead of a direct pointer). The
prologue callback must not trigger a GC, but it's better to be safe.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7521 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-06 19:17:54 +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
vegorov@chromium.org
0d7b70ee22 Remove unused variable to please GCC 4.6.
Review URL: http://codereview.chromium.org/6777024

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7451 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-30 20:14:55 +00:00
whesse@chromium.org
28323284c0 Add thread-safety to creation of MemCopy and modulo functions.
BUG=
TEST=release test-api MultipleIsolatesOnIndividualThreads on Windows X64 build.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7437 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-30 14:04:26 +00:00
vegorov@chromium.org
d919609b6a Fix a number of GC-unsafe evaluation order dependent places.
Also change places which are triggering false positive alert in our static analysis tool.
 
Review URL: http://codereview.chromium.org/6731054

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7432 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-30 10:46:55 +00:00
mikhail.naganov@gmail.com
2d95ed4b25 Remove snapshots-related code that is implemented in DevTools heap profiler.
Diffs and retaining paths are implemented on JS side. There is no need
to maintain native implementation.

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

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7412 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-29 12:52:07 +00:00
ager@chromium.org
ccce64c19c Rename local variable in api.cc to avoid using C++0x keyword thread_local.
Also, the name thread_local did not make much sense.

R=karlklose@chromium.org
BUG=1280

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7402 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-29 08:04:26 +00:00
vitalyr@chromium.org
1cefce33a2 Cleanup of HEAP and LOGGER macros usage in api.cc.
Patch by Peter Varga.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7382 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-28 09:11:14 +00:00
vitalyr@chromium.org
1ae2ea08b9 Remove more TLS hurting Dromaeo DOM.
Patch by Dmitry Lomov.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7380 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-28 08:44:30 +00:00
vitalyr@chromium.org
b675cfecc8 Remove unneeded TLS reads from v8::Null() and friends.
Patch by Dmitry Lomov.

Code review: http://codereview.chromium.org/6737003/

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7374 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-25 14:09:14 +00:00
vitalyr@chromium.org
62c512e436 Remove TLS read from ON_BAILOUT.
Patch by Dmitry Lomov.

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

TBR=ager@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7370 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-25 13:32:06 +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
vitalyr@chromium.org
aa0dfc8aeb Get rid of more TLS fetches in API implementation.
Patch by Dmitry Lomov.

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

TBR=dimich

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7352 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-24 18:49:45 +00:00
ager@chromium.org
7f7a91b1d3 Cleanup of Isolate::Current() usage in api.cc.
BUG=
TEST=

Review URL: http://codereview.chromium.org/6705024
Patch from Peter Varga <pvarga@inf.u-szeged.hu>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7329 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-23 14:07:52 +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
ager@chromium.org
d5359e338a Cleanup of FACTORY macro usage in api.cc.
BUG=
TEST=

Review URL: http://codereview.chromium.org/6725014
Patch from Peter Varga <pvarga@inf.u-szeged.hu>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7314 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-23 09:02:15 +00:00
podivilov@chromium.org
41f30cac90 Fix crash in Debug::SendCommand.
R=vitalyr@chromium.org
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7310 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-22 18:02:23 +00:00
mikhail.naganov@gmail.com
b2b5d2777e Add support for CPU and heap profiles deletion.
R=vitalyr@chromium.org
BUG=none
TEST=none

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7308 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-22 16:10:01 +00:00
vitalyr@chromium.org
5051d2c636 Remove TLS fetches in v8::String API implementation.
Patch by Dmitry Lomov.

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

TBR=ager

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7307 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-22 15:16:29 +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
sgjesse@chromium.org
bc9ddf20bb ARM: Port r7089 to ARM
Ensure that there is always enough bytes between consequtive calls in optimized code to write a call instruction at the return points without overlapping.

Add a call to deoptimize all functions after running tests with --stress-opt. This will catch some issues with functions which cannot be forcefully deoptimized. Some of the tests failed on ARM with that change without the rest of the changes in this change.
Review URL: http://codereview.chromium.org/6661022

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7132 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-10 13:58:20 +00:00
mikhail.naganov@gmail.com
dee9c00267 Add an interface for an embedder to provide information about native
objects retained by object groups and global handles.

This information is then used during heap snapshot generation
to provide a more complete memory picture.

This patch will be needed to fix https://bugs.webkit.org/show_bug.cgi?id=53659.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7125 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-10 12:05:31 +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
2a25c444d5 Fix various places which do not check if SetProperty threw an exception.
Review URL: http://codereview.chromium.org/6480003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6729 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-10 14:41:16 +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
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
antonm@chromium.org
e300c3cccc We cannot assert that v8 is running in fatal error callback.
BUG=v8:1111

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6688 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-08 19:19:42 +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
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
antonm@chromium.org
8805509f28 Wrap external pointers more carefully.
On 32-bit platforms any pointer with 0 as LSB can be wrapped into Smi.  However, on 64-bit
platforms it's currently not the case as x64 Smis must have 0s in lower 32 bit word.
Even worse, macroassembler Move instruction will try to fetch integer value from Smi
and will shift by 32 bits to the right rendering stored pointer incorrect.

BUG=v8:1037

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6301 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-13 15:56:33 +00:00
mikhail.naganov@gmail.com
6f72caf92d Add reporting of JS heap size limit to GetHeapStatistics.
I found it useful to know inside the heap profiler to avoid
crashes due to heap overflow.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6266 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-11 12:36:09 +00:00