Commit Graph

140 Commits

Author SHA1 Message Date
ager@chromium.org
fdf70d37fa Land change to bail out from post garbage collection processing if
another post gc processing was trigger because of weak callbacks.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2737 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-21 08:52:24 +00:00
sgjesse@chromium.org
88588df8c5 Fix a GC issue.
When descriptor arrays where allocated with the initial map the handling of allocation failures was not correct. This could cause the map returned could possible have been collected.
Review URL: http://codereview.chromium.org/173188

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2736 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-21 08:44:21 +00:00
whesse@chromium.org
cd4d95bc1c Fix build error
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2727 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-20 08:08:18 +00:00
feng@chromium.org
855c654b25 Add LowMemoryNotification to the API on Android platform.
Android system provides a unique feature that it sends a notification to the
browser in low memory condition, and the browser cleans up cache and frees
resources. Forcing a GC in low memory condition can free DOM objects and also
can shrink the old spaces.

This patch addresses the last comment in 
http://codereview.chromium.org/173016/show

	
Mads Ager 2009/08/19 17:24:23 
I would prefer to not use the flags to signal that a compacting collection is
requested.

TBR = ager
Review URL: http://codereview.chromium.org/173102

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2725 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-20 00:07:19 +00:00
ager@chromium.org
0efbd40baf Add support for forceful termination of JavaScript execution.
The termination is achieved by throwing an exception that is uncatchable by JavaScript exception handlers.
Review URL: http://codereview.chromium.org/174056

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2723 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-19 15:14:11 +00:00
ager@chromium.org
469259cd88 Reapply the semispace growth policy change in isolation.
Additionally fix NewSpace capacity bug by removing the duplicated
capacity and maximum capacity book keeping.  The capacity and maximum
capacity of NewSpace is the capacity and maximum capacity of one of
it's semispaces.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2717 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-19 10:36:19 +00:00
ager@chromium.org
f68b81b084 Put back the reduction of semispace sizes as an isolated change.
The growth policy change is next.
Review URL: http://codereview.chromium.org/173050

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2713 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-19 08:48:17 +00:00
ager@chromium.org
5e0a513e29 Temporarily revert the reduction of semispace sizes and the growth
policy change.

I will put the changes back one at a time so we can see the effect of
them in isolation.  Also, there is a bug in the growth policy change
that I will fix before putting it back again.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2712 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-19 08:12:12 +00:00
sgjesse@chromium.org
4e03645dc4 Analyze functions for assignment to this properties.
During parsing functions are analyzed for statements of the form this.x = ...;. These assignments are categorized in two types: simple and non simple. The simple ones are where the right hand side is known to be either a constant or an argument to the function. If a function only contains statements of this type the property names are collected and for the simple assignments the index of the argument or the constant value assigned are stored as well.

When the initial map for a function is created and the function consists of only this type of assignemnts the initial map is created with a descriptor array describing these properties which will be known to always exist in an object created from the function.

The information on this property assignments is not collected during pre-parsing so if compiling using pre-parse data these optimization hints are not available.

Next step will be to use the information collected for the simple assignments to generate constructor code which will create and initialize the object from this information without calling the code for the function.
Review URL: http://codereview.chromium.org/172088

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2710 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-19 07:30:20 +00:00
whesse@chromium.org
e9365fb39b Increase new space size and limits on 64-bit platforms.
Review URL: http://codereview.chromium.org/171105

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2707 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-18 11:26:14 +00:00
whesse@chromium.org
d0d03d9980 Avoid map transitions and multiple backing arrays for builtin prototypes
while adding functions and other properties.  This gives around 2% on
context-create, more if we don't GC on every new context.  Also fix
accounting bug in cell space.
Review URL: http://codereview.chromium.org/165449

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2681 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-13 12:35:59 +00:00
bak@chromium.org
bd5b5e52fc - Added simple memory reduction behavior for IdleNotification.
- This also include a one line change approved by lrh.
     http://codereview.chromium.org/164469

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2677 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-13 12:03:42 +00:00
bak@chromium.org
d7449ddebf - Reduced the maximum capacity of a semi space from 8MB to 4MB.
- Changed the semi space growth policy from doubling to increasing by 50%.
This slows down V8BenchmarkSuite with 1.32% but reduces the memory footprint with 8MB per V8 instance.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2667 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-12 13:54:43 +00:00
lrn@chromium.org
6f21761ea8 X64: Fix bug in boolean conversion of empty string.
Review URL: http://codereview.chromium.org/165043


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2632 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-06 10:22:38 +00:00
lrn@chromium.org
fd8b376989 X64: Reenabled RSet.
Review URL: http://codereview.chromium.org/160453


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2607 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-03 11:05:26 +00:00
sgjesse@chromium.org
cffc051177 Avoid dictionary expansion during bootstrapping.
Allocate the code stubs dictionary and non monomorphic cache dictionary with an initial size which avoids these dictionaries to be expanded during bootstrapping. This gets rid of 9 dictionary expansions during bootstrapping.

Preallocate the dictionary when normalizing an object to a size sufficient for holding the number of properties which is expected to be added to the object. This is used when ceating an object from an object literal boilerplate where multiple properties are known to be added.  This gets rid of 10 dictionary expansions during bootstrapping.

There are now 3 dictionary expansions left during bootstrapping.
Review URL: http://codereview.chromium.org/160382

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2584 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-30 09:13:48 +00:00
sgjesse@chromium.org
d8563e4d1e Allocate global object as a normalized object.
The global object is now allocated and initialized as a normalized object.
Review URL: http://codereview.chromium.org/159587

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2582 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-30 07:33:05 +00:00
antonm@chromium.org
0d2c81584b Compile precanned answers for the case of failed interceptor for some combinations.
Review URL: http://codereview.chromium.org/140069

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2577 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-29 12:34:21 +00:00
mikhail.naganov@gmail.com
9e8216ef22 Introduce first approximation of constructor heap profile for JS objects.
It is activated with '--log-gc' flag.

JS object size is calculated as its size + size of 'properties' and 'elements' arrays, if they are non-empty. This doesn't take maps, strings, heap numbers, and other shared objects into account.

As Soeren suggested, I've moved ZoneSplayTree from jsregexp to zone, and removed now empty jsregexp-inl header file.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2570 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-29 08:10:19 +00:00
iposva@chromium.org
1ce28eda0b - Expose CanvasPixelArray functionality directly in JavaScript
indexed property accesses.
- The IC stubs have not been updated to handle these directly, but
  at least we do not have to leave the VM to access bytes.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2549 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-28 08:43:51 +00:00
ager@chromium.org
2183309385 Introduce a external allocation limit.
If V8 is holding on to a lot of external memory, we attempt to clean
it up even if we do not get an allocation failure.  Since tiny V8
objects can hold on to a lot of external memory, we might run out of
external memory while waiting for a normal allocation failure.
Review URL: http://codereview.chromium.org/155916

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2519 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-22 10:01:25 +00:00
mikhail.naganov@gmail.com
ec526df16f Heap profiling: add logging of heap memory stats (capacity, used) under 'log-gc' flag.
Also changed time reporting to system time to be able to get synchronized with other memory (e.g. DOM) size status.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2509 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-20 09:38:44 +00:00
whesse@chromium.org
76833936b7 Make Array::kHeaderSize protected, and only use kHeaderSize of its subclasses.
Many X64 bugs have been due to the difference between (unaligned) Array::kHeaderSize and (aligned) FixedArray::kHeaderSize.
Review URL: http://codereview.chromium.org/155687

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2502 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-17 12:12:24 +00:00
feng@chromium.org
9b58a0c856 Adjust kPagesPerChunk to 16 instead of 64 on Android.
Renamed some macros to ANDROID.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2460 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-14 22:38:06 +00:00
feng@chromium.org
d52990b2e2 Add a trace_gc_verbose flag.
The flag is only turned on when --trace_gc is one. It prints out used and available bytes in each space. To enable it, ENABLE_LOGGING_AND_PROFILING must be defined.

This is a mini version of --heap_stats, but don't need DEBUG macro to be turned on.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2449 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-13 21:24:54 +00:00
kmillikin@chromium.org
726c29c0be Skip the write barrier for global property cell writes. The heap
verification code was refactored to avoid verifying that property
cells have correct remembered sets.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2423 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-09 14:34:08 +00:00
kmillikin@chromium.org
e0ac466589 During a scavenge, instead of sweeping remembered-set bits for global
property cells, sweep the cell values themselves.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2420 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-09 13:28:22 +00:00
kmillikin@chromium.org
266ce3fdb0 Fix x64 build.
Review URL: http://codereview.chromium.org/149385

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2414 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-09 11:46:12 +00:00
kmillikin@chromium.org
d0c35af612 Create a new paged heap space for global property cells. The new
space is similar to map space in that it has fixed-size objects.  A
common superclass for a space with fixed size objects is used for the
map space and cell space.

Allocate all cells in cell space.  Handle it during all GCs.  Modify
the free-list node representation (so that the size is not at a fixed
offset in all cells) to allow two-pointer free-list nodes.  Clean up
some stuff in the MC collector.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2411 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-09 11:13:08 +00:00
erik.corry@gmail.com
8f73ae0325 * Move almost all roots into an array ready for use by a constant-pool
register on ARM.
* Make some compile-time loops into run-time loops for compactness.
Review URL: http://codereview.chromium.org/149324

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2398 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-08 19:12:58 +00:00
bak@chromium.org
9aa0f380a6 Fixed arm/mac errors and presubmitting 2324.
Review URL: http://codereview.chromium.org/151193

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2328 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-02 06:50:43 +00:00
ager@chromium.org
e75a173ff7 Revert r2324 until we can fix build and test errors.
TBR=bak@chromium.org

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2325 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-01 16:49:54 +00:00
bak@chromium.org
5cbb209425 Removed virtual behavior from Dictionaries.
Review URL: http://codereview.chromium.org/150168

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2324 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-01 15:38:25 +00:00
kasperl@chromium.org
35137dd8f9 Always scavenge when doing GCs.
Review URL: http://codereview.chromium.org/151149

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2321 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-01 13:20:09 +00:00
kasperl@chromium.org
6cfc5f1ef9 Treat the builtins object like other global objects (with
cells in old space for properties) and avoid allocating tons
of unused properties in new space when creating new contexts.
Review URL: http://codereview.chromium.org/151146

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2319 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-01 11:44:37 +00:00
erik.corry@gmail.com
5d5cb0bfa8 Young space should be same size on snapshot builder and snapshot users
because this gets backed into the generated code.
Review URL: http://codereview.chromium.org/151083

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2311 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-30 17:34:41 +00:00
sgjesse@chromium.org
a54a4ada5c Changed the global object representation.The global object is now always in dictionary (slow) mode with each of its properties stored in a cell object. A cell object has one field containing the actual value for the property. Inline caches for access to global properties which uses direct to the cell are now created for load, store and call to properties of the global object. When properties of the global object are deleted the cell for that property is kept with an indcation of that the property is deleted.Added counters to track the use of the global property inline caches.Added additional information on IC's in the disassembler.
Review URL: http://codereview.chromium.org/151019

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2300 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-30 10:05:36 +00:00
feng@chromium.org
9f252dad52 Workaround a gcc 4.4 bug.
Gcc generates wrong vtable entries for certain code pattern. The change in heap.cc has detailed explanation.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2299 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-29 21:15:03 +00:00
bak@chromium.org
252514ca23 - Inlined the code for make simple cons strings.
- Simplify generated code for Runtime_** functions.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2283 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-26 13:09:50 +00:00
bak@chromium.org
ab3d1e1a43 Added descriptor lookup cache to eliminate some search overhead.
Reduced the KeyedLookupCache length to 64.
Review URL: http://codereview.chromium.org/141046

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2239 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-22 14:29:35 +00:00
bak@chromium.org
c078783c36 Implemented a ContextSlotCache for compiled code.
Review URL: http://codereview.chromium.org/141038

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2230 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-22 08:09:57 +00:00
kasperl@chromium.org
5f5fbd4e4a Allow functions to have custom construct stubs that are called
when the function is instantiated.
Review URL: http://codereview.chromium.org/132063

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2222 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-19 07:36:16 +00:00
bak@chromium.org
7dab62ee96 Changed allocation to allow large objects to be allocated in new space.
This avoids back-to-back mark-sweep collections.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2219 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-18 14:06:36 +00:00
bak@chromium.org
1155ba8e8e Reimplemented the KeyedLookupCache to speed up access.
Review URL: http://codereview.chromium.org/126262

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2195 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-17 06:07:49 +00:00
erik.corry@gmail.com
0fcf27bcb1 Make young space smaller on ARM.
Review URL: http://codereview.chromium.org/126121

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2165 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-15 11:44:04 +00:00
bak@chromium.org
492705657a Changed the expansion of new space to depend on how much has survived scavenge.
This replaces the fixed expansion policy based on number of scavenges.
Increased the max new space size to 8MB (only reserved space).
Increased the defalt new space size to 512KB.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2151 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-12 11:11:04 +00:00
mikhail.naganov@gmail.com
d7cccf6b8d Add log compression ability.
This is a trivial per-row compression:
- short aliases are introduced for events and code creation tags;
- in tick events, offsets are used instead of absolute addresses;
- removed 'code-allocation' event, as it seems not used.

The first two options are depend on the new flag: 'compress-log', which is off by default.

On benchmarks run w/o snapshot, this gives 45% log size reduction.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2122 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-08 13:39:48 +00:00
iposva@chromium.org
34218e5540 - Introduce histograms collecting data about the number of set remembered set
bits in a page.
Review URL: http://codereview.chromium.org/113819

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2045 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-25 16:33:00 +00:00
mikhail.naganov@gmail.com
30a0a7de43 Split nested namespaces declaration in two lines in accordance with C++ Style Guide.
This issue was raised by Brett Wilson while reviewing my changelist for readability. Craig Silverstein (one of C++ SG maintainers) confirmed that we should declare one namespace per line. Our way of namespaces closing seems not violating style guides (there is no clear agreement on it), so I left it intact.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2038 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-25 10:05:56 +00:00
lrn@chromium.org
e9f1a09f9d X64: Omitted creating native builtins and using them in test-heap.
This allows test-heap to run successfully.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2034 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-22 14:01:06 +00:00