Commit Graph

52 Commits

Author SHA1 Message Date
mvstanton@chromium.org
c4caf766bf Allocation Info Tracking, continued.
Addresses missing cases for array literals.
Adds support for "new Array()" call sites. This isn't complete yet, I have to run with --noinline_new.

BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13790 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-01 16:06:34 +00:00
svenpanne@chromium.org
fb6776e84a Made Isolate a mandatory parameter for everything Handle-related.
Unified parameter order of CreateHandle with the rest of v8 on the way. A few
Isolate::Current()s had to be introduced, which is not nice, and not every place
will win a beauty contest, but we can clean this up later easily in smaller steps.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13717 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-25 14:46:09 +00:00
svenpanne@chromium.org
71a26c928a Make the Isolate parameter mandatory for internal HandleScopes.
Improved Frames and their iterators on the way, too.

BUG=v8:2487

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13674 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-15 09:27:10 +00:00
danno@chromium.org
a77daae9f8 Add additional flags to control array abuse tracing
R=jkummerow@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13632 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-08 14:32:38 +00:00
danno@chromium.org
9cb3a2e97d Add --trace-array-abuse to help find OOB accesses.
R=ulan@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13613 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-07 07:56:11 +00:00
verwaest@chromium.org
537d1d89b0 Move CopyElements to the accessor of the target.
Review URL: https://chromiumcodereview.appspot.com/11416238

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13292 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-02 10:09:42 +00:00
verwaest@chromium.org
cfd4a240ef Pass FixedArrayBase in elements.cc.
This avoids casting problems in case of empty_fixed_array as
FixedDoubleArray with size 0. This avoids prematurely shortcutting in
case of 0 all over the place, which in turn leads to errors.

Review URL: https://chromiumcodereview.appspot.com/11299226

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13098 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-29 15:58:16 +00:00
verwaest@chromium.org
7553f0d68e CopyPackedSmiToDoubleElements should fill the FixedDoubleArray with holes
BUG=v8:2433

Review URL: https://chromiumcodereview.appspot.com/11280223
Patch from Adam Klein <adamk@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13082 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-29 08:34:19 +00:00
verwaest@chromium.org
09b1574baa Make ElementsAccessors more tolerant of varying backing store types
This avoids bogus calls to Fixed*Array::cast() when FastElements-backed objects are empty (and thus backed by empty_fixed_array).

Review URL: https://chromiumcodereview.appspot.com/11299190
Patch from Adam Klein <adamk@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13071 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-28 08:41:45 +00:00
verwaest@chromium.org
1b0e373f09 Avoid double initialization of arrays.
Review URL: https://chromiumcodereview.appspot.com/11413179

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13064 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-27 12:01:14 +00:00
verwaest@chromium.org
ebeaad6cb5 Ensure double arrays are filled with holes when extended from variations of empty arrays.
BUG=162085

Review URL: https://chromiumcodereview.appspot.com/11414155

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13056 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-26 14:29:21 +00:00
verwaest@chromium.org
08cfda49f2 Ensure CopyElementsImpl is always executed so it fills in holes even if from_size is 0. Allow FixedDoubleArray::cast to also support FixedArray with size 0.
Review URL: https://chromiumcodereview.appspot.com/11280054

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13000 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-19 15:00:34 +00:00
mvstanton@chromium.org
1d966af2e9 Fix assert failure in array slice
R=verwaest@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12976 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-15 15:41:12 +00:00
verwaest@chromium.org
a08194c83a Support all fast elements kinds in the major array operations.
Currently missing support for unshift.

BUG=

Review URL: https://chromiumcodereview.appspot.com/11377132

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12969 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-15 12:19:14 +00:00
rossberg@chromium.org
4fb992a872 Object.observe: Handle oldValue for elements with accessors properly.
Extended ElementAccessor interface to allow querying PropertyType and
AccessorPair. Also added respective functionality to JSObject.

R=mstarzinger@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12967 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-15 11:31:40 +00:00
rossberg@chromium.org
92e783bc28 Minor cleanup and optimisation of element methods.
R=verwaest@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12927 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-12 11:08:34 +00:00
rossberg@chromium.org
fbc6e0d883 Object.observe: generate change records for indexed properties.
Details:
- Extend ElementAccessors with GetAttributes method.
- Add HasLocalElement, Get[Local]ElementAttribute methods to JSReceiver/JSObject.
- Otherwise, mirror implementation for named properties.

Cannot correctly handle the cases yet where an accessor is redefined or deleted.

Also fixed handling of object info table.

(Based on CL https://codereview.chromium.org/11362115/)

R=verwaest@chromium.org,mstarzinger@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12900 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-08 12:58:08 +00:00
verwaest@chromium.org
14abf05bd5 Ensure reducing the length of an array doesn't make it go holey.
Also only transition and/or change anything to the backing store if we are
actually going to delete anything.

BUG=

Review URL: https://chromiumcodereview.appspot.com/11358011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12840 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-02 10:24:56 +00:00
mstarzinger@chromium.org
b55988625d Get rid of obsolete unchecked accessors.
R=yangguo@chromium.org
BUG=v8:1490

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12813 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-10-25 11:52:37 +00:00
mstarzinger@chromium.org
02490829dd Fix bug in deletion of indexed properties
The delete operator always return true in case of indexed property. It
should return false if an indexed property can't be deleted (eg.
DontDelete attribute is set or a string object is the holder).

Contributed by Peter Varga <pvarga@inf.u-szeged.hu>

BUG=none
TEST=mjsunit/delete-non-configurable

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12736 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-10-15 15:23:22 +00:00
mstarzinger@chromium.org
c012afb6d4 Fix setting array length to zero for slow elements.
R=verwaest@chromium.org
BUG=chromium:146910
TEST=mjsunit/regress/regress-crbug-146910

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12547 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-09-19 11:52:33 +00:00
yangguo@chromium.org
0acc9e13af Make sure double to int conversion is correct.
R=svenpanne@chromium.org
BUG=v8:2260
TEST=test-utils/Utils1

Review URL: https://chromiumcodereview.appspot.com/10820047

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12216 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-30 08:34:26 +00:00
danno@chromium.org
92716a157f Optimization of some packed array cases.
R=jkummerow@chromium.org
TEST=slight improvement in 3d-morph

Review URL: https://chromiumcodereview.appspot.com/10538104

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11777 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-12 15:30:16 +00:00
danno@chromium.org
9910edbb9a Implement tracking and optimizations of packed arrays
R=jkummerow@chromium.org
TEST=jkummerow@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10170030

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11636 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-05-23 14:24:29 +00:00
fschneider@chromium.org
51b569bd21 Declare more functions returing a MaybeObject* with MUST_USE_RESULT.
No violations found this time.

Additionally I changed one function JSDate::GetField that never returns
a failure to return a Object* instead.
Review URL: https://chromiumcodereview.appspot.com/10383088

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11532 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-05-09 14:34:27 +00:00
danno@chromium.org
d9437722da Properly support shrinking arrays in CopyDictionaryToObjectElements.
R=mstarzinger@chromium.org
BUG=chromium:121407
TEST=test/mjsunit/regress/regress-121407.js

Review URL: https://chromiumcodereview.appspot.com/9968056

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11214 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-03 08:13:59 +00:00
svenpanne@chromium.org
30e6cac50e Valgrind cleanliness, part 3: Delete elements accessors on exit.
This fixes 15 leaks, returning 132 bytes of lost memory.

As an additional bonus, elements accessors initialization has bee simplified a bit.

Review URL: https://chromiumcodereview.appspot.com/9836109

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11154 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-27 10:51:13 +00:00
jkummerow@chromium.org
4e405b6945 Fix missing write barrier in CopyObjectToObjectElements.
Passing the write barrier mode as a parameter does not make sense, as the elements kind specific copiers know best whether a write barrier is needed or not.

BUG=119926
TEST=mjsunit/regress/regress-crbug-119926
R=danno@chromium.org

Review URL: https://chromiumcodereview.appspot.com/9808111

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11134 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-25 15:16:06 +00:00
danno@chromium.org
8833c99552 Check double array bounds in HasElementImpl.
R=jkummerow@chromium.org
BUG=chromium:119925
TEST=test/mjsunit/regress/regress-119925.js

Review URL: https://chromiumcodereview.appspot.com/9808110

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11133 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-25 14:21:51 +00:00
danno@chromium.org
9104cfd959 Use CopyElements for SetFastDoubleElementsCapacityAndLength
Review URL: https://chromiumcodereview.appspot.com/9663002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11070 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-16 13:59:59 +00:00
danno@chromium.org
15ffc2e249 Fix presubmit problem with elements template macro
TBR=jkummerow@chromium.org

Review URL: https://chromiumcodereview.appspot.com/9665002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10990 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-09 14:53:02 +00:00
danno@chromium.org
17b7d33d53 Implement efficient element copying in ElementsAccessors.
Review URL: https://chromiumcodereview.appspot.com/9638014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10989 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-09 13:48:29 +00:00
danno@chromium.org
eebf33a94a Consistently order receiver and holder argument in ElementAccessor.
R=jkummerow@chromium.org

Review URL: https://chromiumcodereview.appspot.com/9605006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10943 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-06 12:22:18 +00:00
danno@chromium.org
3e155c66f4 Automatically determine ElementsKind name for debug printing
R=jkummerow@chromium.org

Review URL: https://chromiumcodereview.appspot.com/9618003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10941 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-06 12:03:14 +00:00
danno@chromium.org
5ce20b3387 Recfactor core HasElement functionality into ElementsAccessors
Review URL: https://chromiumcodereview.appspot.com/9572014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10926 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-05 16:14:34 +00:00
mstarzinger@chromium.org
36a91e30f7 Fix redefining of attributes on aliased arguments.
This allows elements of the non-strict arguments object to be redefined
with custom attributes and still maintain an alias into the context.
Such a slow alias is maintained by placing a special marker into the
dictionary backing store of the arguments object.

R=rossberg@chromium.org
BUG=v8:1772
TEST=test262,mjsunit/object-define-property

Review URL: https://chromiumcodereview.appspot.com/9460004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10827 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-02-24 14:34:01 +00:00
fschneider@chromium.org
3f8ed7c30d Add a missing check for a failure result.
Function calls that may return a failure must use the result. Enforce
this by adding missing MUST_USE_RESULT to their declarations.
Review URL: https://chromiumcodereview.appspot.com/9421032

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10748 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-02-20 10:17:25 +00:00
ulan@chromium.org
fd2d480fb0 Rename static methods to avoid shadowing virtual methods
and fix Clang C++11 compile error.

Review URL: https://chromiumcodereview.appspot.com/9420049

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10739 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-02-17 12:59:58 +00:00
erik.corry@gmail.com
40a433c9e0 Split NumberDictionary into a randomly seeded and an unseeded
version. We don't want to randomize the stub cache.
Review URL: http://codereview.chromium.org/9174023

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10402 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-16 09:44:35 +00:00
danno@chromium.org
ef54f5690f Support Smi->Double->HeapObject transitions in constructed Arrays.
Also several bugs with Smi/double elements handling and make Ensure* routines more flexible.

BUG=none
TEST=test/mjsunit/array-construct-transition.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10218 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-09 08:50:19 +00:00
yangguo@chromium.org
5c23e4e57a Avoid explicitly using built-in new operator where possible to appease Windows build.
Review URL: http://codereview.chromium.org/8561011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10028 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-11-18 11:08:46 +00:00
yangguo@chromium.org
6551e8d47d Removing exit time destructors by leaking static members.
Note that some cctests and d8 still contain statical members with exit time destructors.

BUG=v8:1828

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10025 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-11-18 08:59:33 +00:00
mstarzinger@chromium.org
e24c612a5e Fix setting array length to be ES5 conform.
This also refactors the way we set the length of an arrays' backing
store to use the new elements accessor interface. The actual fix is in
DictionaryElementsAccessor::SetLengthWithoutNormalize() where we first
search for non-deletable elements according to ES5 section 15.4.5.2
specifications.

Snippet from the specification: Attempting to set the length property of
an Array object to a value that is numerically less than or equal to the
largest numeric property name of an existing array indexed non-deletable
property of the array will result in the length being set to a numeric
value that is one greater than that largest numeric property name.

R=danno@chromium.org
TEST=test262/15.4.4.??-7-b-16

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9911 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-11-08 11:59:56 +00:00
danno@chromium.org
f48c9f6557 Basic support for tracking smi-only arrays on ia32.
Activated by the flag --smi-only-arrays

Currently not crankshaft support, using flag on non-ia32 platforms will lead to write barrier misses and crashes.

BUG=none
TEST=elements_kind.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9392 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-22 11:30:04 +00:00
danno@chromium.org
9b2de409f9 Mechanical refactor to move ElementsKind type out of JSObject.
R=svenpanne@chromium.org
BUG=none
TEST=all

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9208 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-09 09:35:57 +00:00
jkummerow@chromium.org
1befe0bbbb Remove unnecessary break-after-return in switch statement
BUG=v8:1642

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9043 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-08-29 10:47:00 +00:00
danno@chromium.org
4c460099a0 Unify GetElement handlers in ElementsAccessor
BUG=none
TEST=external-arrays.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8966 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-08-18 09:51:08 +00:00
danno@chromium.org
edd691960f Implement UnionOfKeys for NonStrictArguments
BUG=none
TEST=cctest/test-api/IndexedInterceptorNonStrictArgsWithIndexedAccessor

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8963 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-08-17 16:15:30 +00:00
danno@chromium.org
96f198a4dc Change AddElementsToFixedArray to work on FixedArrayBase rather than JSObject
In the process, make ElementsAccessors work internally more seamlessly with FixedArrayBase.

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

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8930 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-08-12 14:52:03 +00:00
danno@chromium.org
ff13ab4575 Refactor UnionOfKeys into ElementsAccessor
BUG=none
TEST=none

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8870 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-08-10 10:51:01 +00:00