Commit Graph

237 Commits

Author SHA1 Message Date
bak@chromium.org
1334adbd40 - Changed the initial size for HashTable.
- Pretenured large expanding hash tables.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4010 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-03 16:22:17 +00:00
kasperl@chromium.org
c309a63369 Remove the deprecated context disposal GC heuristic.
Review URL: http://codereview.chromium.org/661458

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4003 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-03 11:41:22 +00:00
kasperl@chromium.org
a60beefd1b Tweak the new context disposal GC heuristic to cleanly separate
it from the old heuristic (disabled if the new notications are 
used) and make sure to not force a GC if one has already happened
after V8 received the last context disposal notification.
Review URL: http://codereview.chromium.org/660267

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3984 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-01 08:49:33 +00:00
kasperl@chromium.org
9f2f6f4022 Count GlobalHandles::PostGarbageCollectionProcessing() as being
in external code so it's visible when running with --trace-gc.

Landed on behalf of James Robinson (jamesr@chromium.org).

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3981 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-01 07:04:42 +00:00
vitalyr@chromium.org
dd7b55eb9f Implemented one-char cache lookup in generated code.
This speeds up string,charAt(n) and string[n].

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3980 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-26 20:14:20 +00:00
antonm@chromium.org
3051ba1a5b Faster filling of arrays of holes.
Review URL: http://codereview.chromium.org/661105

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3977 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-26 15:19:13 +00:00
bak@chromium.org
4766a592ce - Pushed source code for functions into old space.
- Renamed TryFlattenIfNotFlat to TryFlatten.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3976 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-26 14:37:33 +00:00
bak@chromium.org
0e0594dcbc Removed space to please lint.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3972 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-26 12:00:10 +00:00
kasperl@chromium.org
4abae7a728 Add an explicit API entry to notify V8 that one or more
contexts have been disposed. 
Review URL: http://codereview.chromium.org/661173

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3971 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-26 11:51:33 +00:00
bak@chromium.org
0adf83b10d - Moved the computation of old space limits to after the mandatory scavenge.
This reduces the number of mark sweep operations.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3969 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-26 11:48:18 +00:00
kasperl@chromium.org
57f47e704f Add information about time spent in external callback to
traces produces with --trace-gc.
Review URL: http://codereview.chromium.org/661170

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3960 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-26 08:27:20 +00:00
sgjesse@chromium.org
05ae9effa3 Revert r3952
TBR=ager@chromium.org
Review URL: http://codereview.chromium.org/660086

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3953 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-25 15:43:27 +00:00
sgjesse@chromium.org
8398287070 Refactor the code cache to handle large number of properties on the global object.
A separate object type for the code cache have been added. This object has two different code caches. The first one (default_cache) is a fixed array organized in the same way as the as the code cache was before. The second cache (global_access_cache) is for code stubs to access the global object. This cache is organized as a hash table taking the property name and code flags as the key.

The reason for separating the global access stubs into a hash table representation is that the number of these is not bounded in the same was as the other types.

BUG=613
Review URL: http://codereview.chromium.org/652119

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3952 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-25 14:24:44 +00:00
whesse@chromium.org
2074e4847d Add integer casts to make v8 compile without warnings on 64-bit Visual Studio
Review URL: http://codereview.chromium.org/650140

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3925 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-22 11:42:46 +00:00
sgjesse@chromium.org
ecf4b9fc76 Refactor the check for generating inline constructors
Moved all the logic to a function on SharedFunctionInfo (including the flag check) to make things more readable.

Changed the check for setter to do a lookup for a named setter for each of the properties assigned in the constructor.

Added tests using accessors and interseptors set through the API.

Added fast case objects to the mjsunit test.

TEST=test/mjsunit/setter-on-constructor-prototype.js
TEST=test/cctest/test-api/SetterOnConstructorPrototype
TEST=test/cctest/test-api/InterceptorOnConstructorPrototype
Review URL: http://codereview.chromium.org/619006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3893 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-18 09:07:03 +00:00
sgjesse@chromium.org
1c2b2ac9c6 Fix construction of simple objects with setters on prototype
Simple objects which are constructed without calling the actual constructor function did not take setters defined on prototype chain of the new object into account.

Constructing objects this way is now not done if there are setters involved on the prototype chain of the new object.

This only fixes the case where the setter is found when the first object from a constructor is created. If the prototype chain is changed new objects will on take any change to setters into account.

TEST=test/mjsunit/setter-on-constructor-prototype.js
Review URL: http://codereview.chromium.org/606062

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3879 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-17 06:28:33 +00:00
ager@chromium.org
a9e174f8ea Make sure that the inline_new flag guards all the optimizations for
constructors that only contain simple this assignments.

Make sure that constructors with declarations are not treated as
constructors with only simple this property assignments.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3875 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-16 15:14:34 +00:00
sgjesse@chromium.org
6093d0dbf5 Inline NumberToString
NumberToString in runtime JavaScript is inlined through a call to a stub. Currently the stub only checks the number string cache and only if the number is a smi. Code is shared with the inlining of number string cache lookup when adding a smi to a string.
Review URL: http://codereview.chromium.org/604062

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3865 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-16 09:41:11 +00:00
serya@chromium.org
862909e762 Review URL: http://codereview.chromium.org/561049
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3814 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-08 13:44:49 +00:00
leonclarke@gmail.com
04c4d90868 DebugBreak shouldn't be used when ENABLE_DEBUGGER_SUPPORT isn't defined.
Review URL: http://codereview.chromium.org/568017

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3784 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-03 11:54:57 +00:00
whesse@chromium.org
b57ca72b90 Fix build error on Win32, fix spelling of DebugerStatementStub.
Review URL: http://codereview.chromium.org/570001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3778 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-03 08:33:19 +00:00
serya@chromium.org
0045327b7d Review URL: http://codereview.chromium.org/555164
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3775 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-02 18:35:53 +00:00
sgjesse@chromium.org
10910394e6 Handle insertion order for simple constructors
When functions only have simple assignments of the form this.x = ... the object is created in generated code without actually calling the constructor. In this case the initial map for the function already contains the properties assigned in the constructor. The field descriptors in this initial map now has an enumeration index assigned to make property enumeration order the insertion order. The insertion order here is the order of the this.x assignments in the code.

BUG=http://crbug.com/3867
TEST=test/mjsunit/regress/regress-crbug-3867.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3768 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-02 13:33:29 +00:00
kasperl@chromium.org
6c605d1fe0 Revert r3758.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3759 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-01 15:27:51 +00:00
kasperl@chromium.org
5e96a8ca4b Temporarily allocate all function contexts in old space and
force the system to use the full compiler to momentarily get 
better test coverage.

This change will be reverted once the unit tests have finished
running.
Review URL: http://codereview.chromium.org/552257

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3758 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-01 15:16:26 +00:00
serya@chromium.org
9239bbdd91 Removing redundant stub for runtime native calls.
Review URL: http://codereview.chromium.org/543207

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3745 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-29 12:41:11 +00:00
kasperl@chromium.org
048fe9b980 RFC: Try to be much more careful with where we skip the write barrier by:
1. Avoid using SKIP_WRITE_BARRIER when we don't have to (smis).
  2. Check and document the remaining uses of SKIP_WRITE_BARRIER.
  3. Only allow GetWriteBarrierMode when in an AssertNoAllocation scope.

The only functional change should be in DeepCopyBoilerplate where we
no longer use the write barrier mode (because of allocations). I'm
running benchmarks to see if this has a measurable impact on performance.
Review URL: http://codereview.chromium.org/558041

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3743 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-29 11:46:55 +00:00
kasperl@chromium.org
25c6b59b1e Make sure to initialize all fields in the special maps
created during bootstrapping. Without this change we 
risk having weird flags set on the map for the null
value (among others), which can lead to crashes.
Review URL: http://codereview.chromium.org/552195

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3725 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-27 20:14:46 +00:00
ricow@chromium.org
7985bf73c8 Set iIsExtensible to true as default in the map.
Review URL: http://codereview.chromium.org/556041

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3718 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-27 13:51:04 +00:00
erik.corry@gmail.com
90045ddd5e Another step on the way to context snapshots. We can now refer to
objects in the startup heap from a partial snapshot.  This happens
through the partial snapshot cache.  A startup snapshot and a
partial snapshot are created together so that the startup snapshot
contains the partial snapshot cache entries needed.
Review URL: http://codereview.chromium.org/548149

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3713 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-27 08:25:48 +00:00
erik.corry@gmail.com
2f0ad64db9 Increase young generation size on Android.
Review URL: http://codereview.chromium.org/556018

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3705 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-26 10:03:44 +00:00
antonm@chromium.org
29af9c54a4 Merge ObjectIterator::has_next and ObjectIterator::next methods.
This reduces chances of improper usage, see http://code.google.com/p/v8/issues/detail?id=586
for more details.

BUG=586

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3696 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-25 22:53:18 +00:00
antonm@chromium.org
6619154580 A simple test for map compact.
Review URL: http://codereview.chromium.org/543113

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3655 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-19 16:34:37 +00:00
erik.corry@gmail.com
bc334df1a8 * Improve the interface to the memory-reservation functionality.
* Add a test case that generates a serialization of a single flat string.
Review URL: http://codereview.chromium.org/542073

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3606 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-14 14:46:31 +00:00
lrn@chromium.org
dddadf9f7e Fixed potential length miscalculations by limiting max size of arrays and strings.
Review URL: http://codereview.chromium.org/525064

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3560 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-07 13:17:18 +00:00
bak@chromium.org
1f3eba4470 - Adjust the number to string cache based on the max semispace size.
Flushed at compacting mark sweep.
- Simplified FindEntry by eliminating the counter.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3543 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-06 11:19:28 +00:00
kmillikin@chromium.org
b74ab45077 Simplify checking during allocation when Heap::always_allocate() is
true.  The rules are:

1. Heap::AllocateRaw can normally handle allocation requests in new
   space even when always_allocate() is true.  It properly retries
   failed allocation in the second 'retry' space.

2. Heap::Allocate can normally handle allocation requests in new
   space.

3. We only need to check always_allocate() when explicitly requesting
   allocation in new space via Heap::new_space().AllocateRaw().

4. The exception to these rules is fixed arrays with size such that
   MaxObjectSizeInPagedSpace < size <= MaxObjectSizeInNewSpace (ie,
   those that will be allocated in new space and promoted to large
   object space).  They cannot be allocated in new space via
   Heap::Allocate or Heap::AllocateRaw, because the retry logic does
   not know to allocate extra remembered set bits when retrying in
   large object space.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3535 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-05 11:30:05 +00:00
kmillikin@chromium.org
c114f17efa When promoting objects during a copying collection, promote all
non-large objects that cannot contain non-map-word pointers to other
heap objects into the old data space.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3519 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-22 13:34:02 +00:00
ager@chromium.org
2409b4b7ba Revert r3514 and r3515. The new cache is too large for some tests
that attempt to run with a small heap.  Additionally, it can
potentially keep a lot of string data alive and it is never flushed.
Can we make it grow dynamically if used so that we can still start the
VM with a small heap size?
Review URL: http://codereview.chromium.org/503081

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3517 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-22 13:07:27 +00:00
bak@chromium.org
6742d62c30 - Increased size of number string cache.
- Change the instruction order for inlined allocation.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3514 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-22 11:35:05 +00:00
antonm@chromium.org
f8b9e6dd5b Force mark sweep instead of compcation if size of map space is too big to allow forward pointers encoding.
Review URL: http://codereview.chromium.org/507025

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3497 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-18 13:38:09 +00:00
kasperl@chromium.org
914d4f801d Optimize the allocation of small, non-nested literal
arrays and argument objects on IA-32.
Review URL: http://codereview.chromium.org/503042

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3485 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-17 15:35:15 +00:00
sgjesse@chromium.org
44b7c59eb5 Extend the maximum size map space
On 32-bit the maps are now aligned on a 32-byte boundary in order to encode more maps during compacting GC. The actual size of a map on 32-bit is 28 bytes making this change waste 4 bytes per map.

On 64-bit the encoding for compacting GC is now using more than 32-bits and the maps here are still pointer size aligned. The actual size of a map on 64-bit is 48 bytes and this change does not intruduce any waste.

My choice of 16 bits for kMapPageIndexBits for 64-bit should give the same maximum number of pages (8K) for map space. As maps on 64-bit are larger than on 32-bit the total number of maps on 64-bit will be smaller than on 32-bit. We could consider raising this to 17 or 18.

I moved the kPageSizeBits to globals.h as the calculation of the encoding really depended on this.

There are still an #ifdef/#endif in objects.h and this constant could be moved to globaks.h as well, but I kept it together with the related constants.

All the tests run in debug mode with additional options --gc-global --always-compact as well (except for a few tests on which also fails before this change when run with --gc-global --always-compact).

BUG=http://code.google.com/p/v8/issues/detail?id=524
BUG=http://crbug.com/29428
TEST=test/mjsunit/regress/regress-524.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3481 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-17 08:53:18 +00:00
kasperl@chromium.org
b1721d4c3e Improve performance of allocating closures for nested
functions by allocating them in new space without
entering the runtime system.
Review URL: http://codereview.chromium.org/506037

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3477 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-16 15:43:20 +00:00
ager@chromium.org
483828660d Reapply keyed load cache probing in generated code. I introduced a
bug just before committing which broke snapshot builds.  The code is
nearly identical to the previous submit.

TBR=erik.corry@gmail.com
Review URL: http://codereview.chromium.org/491004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3449 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-10 15:10:50 +00:00
ager@chromium.org
1a6893cda9 Revert keyed load cache probing in generated code.
Crashes on Windows.

TBR=erik.corry@gmail.com
Review URL: http://codereview.chromium.org/488006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3446 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-10 12:52:28 +00:00
ager@chromium.org
87496c61aa Probe keyed load cache in generic keyed load stub.
Only implemented on ia32 and x64 for now.  The generic keyed load stub
on arm is falling behind and it is time to fix that, but that will be
a separate change.


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3445 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-10 09:21:23 +00:00
vitalyr@chromium.org
41eb2f22d0 External string table.
Instead of weak handles external strings use a separate table.  This
table uses 5 times less memory than weak handles.  Moreover, since we
don't have to follow the weak handle callback protocol we can collect
the strings faster and even on scavenge collections.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3439 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-09 14:32:45 +00:00
christian.plesner.hansen@gmail.com
cbce986ff0 Changed recording of heap stats on OOM to store data directly in local
variables rather than in a stack-allocated struct.  The struct field
values turned out not to be available in minidumps.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3417 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-04 10:18:30 +00:00
christian.plesner.hansen@gmail.com
1d9eac1b7c Added recording of heap and global handle stats in a stack-allocated
struct on fatal out of memory.  This should cause the information to
be included in minidumps so we can get a better idea of the state of
v8 on OOMs.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3406 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-03 10:16:37 +00:00