Commit Graph

248 Commits

Author SHA1 Message Date
erik.corry@gmail.com
d6afd05b16 2nd try at fixing invalid Smi issue on 64 bits.
Review URL: http://codereview.chromium.org/174520

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2767 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-26 13:21:38 +00:00
ager@chromium.org
56ad3bf123 Remove shrinking of new space on compaction and only do it on idle
notifications.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2765 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-26 12:51:43 +00:00
erik.corry@gmail.com
ba9efd26b7 Avoid triggering assert on 64 bit version.
Review URL: http://codereview.chromium.org/174519

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2763 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-26 12:22:34 +00:00
christian.plesner.hansen@gmail.com
af6c6a5533 Api inlining. Made some core functionality available in the api and
made inline versions of some hot functions.  Changed api to use
internal Object pointers rather than void pointers.

Speeds up getElementById by ~7%.
Review URL: http://codereview.chromium.org/173348

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2761 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-26 10:33:11 +00:00
erik.corry@gmail.com
a29d4e6762 * Make stack/preemption guard faster on ARM by putting stack
limit in the roots array.
Review URL: http://codereview.chromium.org/174517

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2760 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-26 10:27:32 +00:00
ager@chromium.org
11b317d94f Only pass idle notifications on from the API if V8 has been
initialized.

Minor cleanups.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2757 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-26 08:13:27 +00:00
mike@belshe.com
6f3c50460a Update the Idle collector to do a full GC
after being idle for some time.

Remove the default argument from CollectAllGarbage.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2748 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-25 02:54:39 +00:00
ager@chromium.org
ed05df0053 Shrink new space on compacting collections.
Review URL: http://codereview.chromium.org/174219

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2740 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-21 13:14:53 +00:00
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
lrn@chromium.org
0920be9524 X64: Disabled RSet in 64-bit mode.
Made a few more places use intptr_t instead of int for pointer arithmetic.
Ensure that objects have a declared size that matches heap object alignment.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2007 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-20 08:05:12 +00:00
sgjesse@chromium.org
94879a93b0 Add a script cache to the debugger
When loaded scripts are requested this cache is filled with all the script objects in the heap. Hereafter its content is kept in sync with the active scripts in the heap through the notifications of new scripts compiled and by using weak handles to get notified when a script is collected.

Through the tracking of collected scripts the debugger event OnScriptCollected have been added to notify a debugger that a script previously returned through the scripts command is no longer in use.

Make the ComputeIntegerHash globally available.

Moved clearing of the mirror cache to when debugger is really left. Previously recursive invocations of the debugger cause the mirror cache to be cleared causing handles to become either stale or reference other objects.
Review URL: http://codereview.chromium.org/115462

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1988 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-18 13:14:37 +00:00
bak@chromium.org
81af5beefa Changed FuncNameInferrer and ScopeInfo to support zone allocation.
Yields a 2% speedup when running compiler-benchmark.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1985 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-18 09:41:16 +00:00
kmillikin@chromium.org
e097183f22 Fix debug builds.
Review URL: http://codereview.chromium.org/113462

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1976 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-15 15:02:03 +00:00
kmillikin@chromium.org
566d088ee3 Fix debug build with a cast.
TBR=bak@chromium.org


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1974 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-15 14:46:59 +00:00
kasperl@chromium.org
f9790085ed Revert r1971. Doesn't compile.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1972 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-15 14:39:34 +00:00
kmillikin@chromium.org
3c73ec8ac9 Change the scavenging collector so that promoted objects do not reside
in the old generation while its remembered set is being swept for
pointers into the young generation.  This is done by delaying the
copying of promoted objects from when they are first encountered and
promoted to only when their body is visited.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1971 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-15 13:52:14 +00:00
kmillikin@chromium.org
4bc0e7cf8c Reapply r1900, r1897, r1895 with a fix.
When a paged space shrinks by an even multiple of the chunk size,
ensure that the cached last page in the space is updated.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1944 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-14 08:55:34 +00:00
ager@chromium.org
00addb277a Revert r1900, r1897 and r1895 which are all gc changes. The changes
to the page iterator leads to occasional crashes in tests.
Review URL: http://codereview.chromium.org/113262

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1915 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-12 13:02:15 +00:00
kmillikin@chromium.org
d6a506c66e Change the structure of the scavenge collector's loop. Move
scavenging of objects pointed to by weak handles earlier.  Rename
"mark" => "front" and "top" => "rear" to make it clearer which end is
which.
Review URL: http://codereview.chromium.org/113097

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1900 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-07 12:36:18 +00:00
kmillikin@chromium.org
3299f63c0d Before a scavenge collection in debug builds with ENABLE_SLOW_ASSERTS,
we verify that there are no pointers to new space from the code space.
Add the old data space to this verification.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1897 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-07 10:43:33 +00:00
erik.corry@gmail.com
ad23017469 When strings can change from an ASCII representation to a
UC16 representation we need to be careful about flat strings.
Flat strings can be sliced or cons strings that have a flat
string under them, so when we ask a flat cons or a slice whether
it is ASCII or not we should ask the underlying string about
its representation.  This should fix
http://code.google.com/p/chromium/issues/detail?id=10971
Review URL: http://codereview.chromium.org/100249

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1830 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-01 11:16:29 +00:00
christian.plesner.hansen@gmail.com
1f7e96743d - Extended lazy loading to general objects, not just functions.
- Added lazily loaded JSON object.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1784 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-24 08:13:09 +00:00
feng@chromium.org
ea48d53bad Add ENABLE_DEBUGGER_SUPPORT macro.
ENABLE_DEBUGGER_SUPPORT is enabled by default unless it is on Android platform.
On Android platform, it can also enabled by passing -DENABLE_DEBUGGER_SUPPORT flag to the compiler.

This should not affect any existing build (I hope, cross my fingers) except the build in real Android environment (in other word, it only affects me now).

There are lot of room for code refactoring in stead of using #ifdef all over the place. I will leave this to v8 folks.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1745 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-20 16:36:13 +00:00
kasperl@chromium.org
66f7a367f7 Fix build issue on Mac.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1703 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-14 14:01:00 +00:00
kasperl@chromium.org
5decd39b51 Move STATIC_ASSERT to IsShortcutCandidate to fix the
broken build.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1700 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-14 12:10:32 +00:00
kasperl@chromium.org
bca37da6af Verify the symbol table contents before and after all
GCs (not just mark-compacts) and make the mark-compact
shortcutting of cons-strings identical to the scavenge
version.
Review URL: http://codereview.chromium.org/67125

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1699 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-14 12:00:56 +00:00
kasperl@chromium.org
850d5ed380 Fixed issue 303 by not shortcutting cons-symbols and added
symbol table verification after mark-compact GCs.
Review URL: http://codereview.chromium.org/73029

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1698 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-14 09:58:42 +00:00
mikhail.naganov@gmail.com
3c2a7bdf21 Add name inference for anonymous functions to facilitate debugging and profiling of JS code.
Currently function name inference is wired with AST optimization pass to avoid introducing another pass over AST. A better solution would be to rewrite AST visitors so they can be naturally combined together in a single pass, as their current implementation doesn't allow it.

For examples of cases where function names can be inferred, see the tests file.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1696 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-14 00:51:59 +00:00
kmillikin@chromium.org
d3ee29a7f6 Add just enough state changes from EXTERNAL (outside V8) to OTHER
(generic state inside V8) in the API to allow the V8 shell to run all
the mjsunit tests with heap protection on.

These state changes are only taken when built with
ENABLE_HEAP_PROTECTION.  The two states OTHER and EXTERNAL are treated
the same because we will not properly reenter OTHER through the API.
Review URL: http://codereview.chromium.org/56060

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1643 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-30 13:32:28 +00:00
kmillikin@chromium.org
bc3fb11881 Add basic infrastructure for protecting V8's heap when leaving the VM
and unprotecting it when (re)entering.  The functionality is enabled
by the flag --protect-heap and requires V8 to be built with
ENABLE_HEAP_PROTECTION and ENABLE_LOGGING_AND_PROFILING defined.

Implemented on Linux and Windows but not yet for other platforms.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1595 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-24 12:47:53 +00:00
ager@chromium.org
4d6b3a54ad Fix lint.
TBR=iposva
Review URL: http://codereview.chromium.org/50026

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1551 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-19 19:29:23 +00:00
iposva@chromium.org
ea653021fc - Allow hidden properties to be set on any JSObject through the V8 C++ API.
- Use the hidden properties to expose a IdentityHash accessor.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1550 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-19 18:50:00 +00:00
ager@chromium.org
2fcad0aec1 Revert change 1509 that flush ICs when adding setters on an object or
when setting a __proto__ to an object that holds a setter.

This seems to cause a major page load regression, so we need to tune
the clearing.
Review URL: http://codereview.chromium.org/50011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1548 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-19 15:06:00 +00:00
lrn@chromium.org
eb656c723b Moved subject and index before matches in RegExp lastMatchInfo.
Some minor changes, and removed the new handlescope in the inner loop of replace. Only really affects replaces on extremely long strings.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1524 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-17 12:44:20 +00:00
erik.corry@gmail.com
608a99a90c Remove all uses of StringShape variables, since that has proven
to be error-prone and of little benefit in terms of performance.
Review URL: http://codereview.chromium.org/45010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1521 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-17 09:33:06 +00:00
davemoore@chromium.org
46f753a184 - Added ability to call histograms from within v8
- Changed the StatsRates to use the new HistogramTimers

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1510 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-13 16:06:31 +00:00
christian.plesner.hansen@gmail.com
8dffcb9efa Flush ICs when adding setters to an object or setting a __proto__ to
an object that holds a setter.  If there are no store ics then no
flushing is done.  The implementation has been tweaked so that no ICs
are cleared during normal context creation.
This may cost us some performance but I'm submitting it as it is and
if there are problems we can either decide to be smarter about when,
what and/or how we clear, or back this change out altogether.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1509 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-13 13:43:07 +00:00
sgjesse@chromium.org
b74c5b1e39 Moved the storage of the last script id into the heap to make it part of the serialized data when starting V8 on a snapshot.
Currently the script ids wrap when positive smi value is exhausted.
Review URL: http://codereview.chromium.org/43008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1474 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-10 12:05:20 +00:00
kasperl@chromium.org
567d9a603e Tweak the context disposal GC heuristic: If the garbage collector
interface is exposed through the global gc() function, we avoid 
being clever about forcing GCs when contexts are disposed and leave 
it to the embedder to make informed decisions about when to force 
a collection.
Review URL: http://codereview.chromium.org/40154

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1422 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-05 07:44:13 +00:00
iposva@chromium.org
f5966c3815 Align code entry points to 32 bytes.
Review URL: http://codereview.chromium.org/27269

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1386 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-27 11:19:31 +00:00
kasperl@chromium.org
c7c959632a Experimental (somewhat): Force GCs when disposing contexts, but
make sure not to do it repeatedly for bursts of context 
disposals.
Review URL: http://codereview.chromium.org/27201

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1375 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-26 12:40:50 +00:00
iposva@chromium.org
c093e94546 - Pass the knowledge whether the old GC is compacting to the GC prologue and epilogue. This allows us to skip frame cooking and uncooking when doing a mark-sweep GC.
- Add the ability for the code to refer to its code object by adding a handle to the code object in the MacroAssembler.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1368 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-25 16:52:15 +00:00
iposva@chromium.org
be6b490fb0 Remove experimental ExternalSymbolCallback feature. This is not needed
since we can now transform String objects to be external when needed.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1260 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-12 16:58:55 +00:00
iposva@chromium.org
1bf2c7405e Allow the morphing of strings to external strings to avoid having to
create copies in the embedding code (aka WebKit V8 bindings) on every
external use.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1252 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-11 23:52:52 +00:00
sgjesse@chromium.org
d131ecf3dd Changed the debugger API to allow only one debug event listener to be registered. The public API now only has SetDebugEventListener instead of AddDebugEventListener and RemoveDebugEventListener.
Moved the registrered debug event listener from the context to a global handle in the Debugger class. Storing it in the context did not make much sense.

Changed a lot of tests to handle the API change.

BUG=1242707
Review URL: http://codereview.chromium.org/19753

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1212 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-03 07:59:12 +00:00
ager@chromium.org
db1896c253 Make sure that the prototype of the initial map is created in the
right context.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1157 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-26 15:09:44 +00:00
deanm@chromium.org
b7c1200462 Fix a bunch of spelling mistakes :\
Review URL: http://codereview.chromium.org/18094


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1088 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-15 19:08:34 +00:00
ager@chromium.org
12854e6c67 Allocate as many object-literal properties as possible inobject.
This can lead to large objects which wastes a lot of space if we normalize properties.  We therfore clear the inobject properties when normalizing properties.  This is done by adjusting the instance size in the new map and overwriting the inobject properties with a filler.
Review URL: http://codereview.chromium.org/17308

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1051 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-12 10:59:58 +00:00
christian.plesner.hansen@gmail.com
d7c933e7ae Added support in the profiler for creating 'regions' that cover part
of the generated code.  These can be used by the profiler to
categorize the ticks that occur within generated code and thereby show
more detailed information about where time is spent in generated code.
For instance, this is what the profiler displayed for a simple regexp
benchmark with irregexp-native before:

[JavaScript]:
   total  nonlib   name
   87.2%   87.2%   RegExp: (?:\w*\W+)*

This is what we can display now:

[JavaScript]:
   total  nonlib   name
   87.2%   87.2%   RegExp: (?:\w*\W+)*
                   -  53.0%  56.7% BranchOrBacktrack
                   -  14.9%  59.8% CheckCharacterLT
                   -  13.7%  20.4% CheckStackLimit
                   -   6.7%   6.7% SafeCall
                   -   2.7%   7.0% CheckCharacterGT
                   -   2.4%   2.4% SafeReturn
                   -   2.1%   2.1% LoadCurrentCharacter
                   -   1.8%   1.8% PushRegister
                   -   0.9%   0.9% PopRegister
                   -   0.9%   0.9% AdvanceRegister
                   -   0.3%   0.3% PopCurrentPosition
                   -   0.3%   0.3% CheckGreedyLoop
                   -   0.0%  20.4% PushBacktrack
                   -   0.0%  22.3% CheckCharacter
                   -   0.0%   2.4% IfRegisterLT


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1010 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-12-19 13:12:43 +00:00
olehougaard
392e6f849b Fixing a subtle bug in receiver resolution when a thrown and caught function is called from a catch-block.
Second attempt - now with better memory efficiency.
Review URL: http://codereview.chromium.org/14834

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@999 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-12-18 11:28:13 +00:00
christian.plesner.hansen@gmail.com
b57b4a15cd Merge regexp2000 back into bleeding_edge
Review URL: http://codereview.chromium.org/12427

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@832 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-11-25 11:07:48 +00:00
ager@chromium.org
6e931081e3 Ensure that external symbols have hash codes.
Review URL: http://codereview.chromium.org/11443

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@785 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-11-18 10:55:50 +00:00
ager@chromium.org
96d15ef6b4 Add experimental support for external two-byte symbols.
This might be a big win in a browser setting where a lot of string
conversions can be avoided.  On the other hand it adds extra pressure
on the global handle system.
Review URL: http://codereview.chromium.org/11404

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@772 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-11-17 15:13:40 +00:00
erik.corry@gmail.com
b4e7335c0c Removed some unsafe uses of StringShape.
Simplified some uses of StringShape.
Removed unused function SlicedStringFlatten.
Review URL: http://codereview.chromium.org/9408

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@695 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-11-05 10:26:08 +00:00
erik.corry@gmail.com
eca89dc765 Create an abstraction for the string type flags so that they can be cached.
Read the objects.h change first to understand what's going on here.
Review URL: http://codereview.chromium.org/9038

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@675 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-11-03 10:16:05 +00:00
kasperl@chromium.org
a2be3b6f84 Make sure that allocations through CALL_HEAP_FUNCTION
and runtime calls from JavaScript will always succeed
eventually if we have enough memory.
Review URL: http://codereview.chromium.org/8700

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@646 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-30 09:15:58 +00:00
kmillikin@chromium.org
af989d9e94 Check the growth of the old generation before expanding the paged
spaces (during normal allocation) and when allocating large objects.
If the promotion limit is reached, fail allocation to trigger a
garbage collection.
Review URL: http://codereview.chromium.org/8657

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@632 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-29 09:27:59 +00:00
erik.corry@gmail.com
6e00a80354 You can't use BinarySearch on an unsorted array and other
sillinesses found while trying to get rid of medium-sized strings.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@595 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-26 20:50:05 +00:00
bak@chromium.org
d296a22917 - Fixed performance regression caused by ComputeContextSlotReceiver.
- Eliminated a few write barriers.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@573 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-23 14:55:45 +00:00
bak@chromium.org
187879a25a - Added conditional write barrier to object accessors.
- Sped up allocation of Arguments object.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@567 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-23 08:46:32 +00:00
ager@chromium.org
8e0979e2ff Introduce a lookup cache class in the runtime system and use it for
keyed loads that enter the runtime.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@561 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-23 07:04:56 +00:00
bak@chromium.org
b26322d4c1 - Applied FixedArray::WriteBarrierMode to NewArgumentsFast.
Review URL: http://codereview.chromium.org/8052

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@551 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-22 09:47:20 +00:00
erik.corry@gmail.com
1aae797ddd Use direct copy and templates to speed up flattening of strings.
Review URL: http://codereview.chromium.org/8011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@549 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-22 09:09:07 +00:00
bak@chromium.org
bf948c8313 - Optimized CopyFixedArray and CopyJSObject.
- Refactored block copying.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@548 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-22 08:21:18 +00:00
feng@chromium.org
42ef2c3d77 Split window support from V8.
Here is a description of the background and design of split window in Chrome and V8:
https://docs.google.com/a/google.com/Doc?id=chhjkpg_47fwddxbfr

This change list splits the window object into two parts: 1) an inner window object used as the global object of contexts; 2) an outer window object exposed to JavaScript and accessible by the name 'window'. Firefox did it awhile ago, here are some discussions: https://wiki.mozilla.org/Gecko:SplitWindow. One additional benefit of splitting window in Chrome is that accessing global variables don't need security checks anymore, it can improve applications that use many global variables.

V8 support of split window:
  There are a small number of changes on V8 api to support split window:
Security context is removed from V8, so does related API functions;
A global object can be detached from its context and reused by a new context;
Access checks on an object template can be turned on/off by default;
An object can turn on its access checks later;

  V8 has a new object type, ApiGlobalObject, which is the outer window object type. The existing JSGlobalObject becomes the inner window object type. Security checks are moved from JSGlobalObject to ApiGlobalObject. ApiGlobalObject is the one exposed to JavaScript, it is accessible through Context::Global(). ApiGlobalObject's prototype is set to JSGlobalObject so that property lookups are forwarded to JSGlobalObject. ApiGlobalObject forwards all other property access requests to JSGlobalObject, such as SetProperty, DeleteProperty, etc.

  Security token is moved to a global context, and ApiGlobalObject has a reference to its global context. JSGlobalObject has a reference to its global context as well. When accessing properties on a global object in JavaScript, the domain security check is performed by comparing the security token of the lexical context (Top::global_context()) to the token of global object's context. The check is only needed when the receiver is a window object, such as 'window.document'. Accessing global variables, such as 'var foo = 3; foo' does not need checks because the receiver is the inner window object.

  When an outer window is detached from its global context (when a frame navigates away from a page), it is completely detached from the inner window. A new context is created for the new page, and the outer global object is reused. At this point, the access check on the DOMWindow wrapper of the old context is turned on. The code in old context is still able to access DOMWindow properties, but it has to go through domain security checks.


It is debatable on how to implement the outer window object. Currently each property access function has to check if the receiver is ApiGlobalObject type. This approach might be error-prone that one may forget to check the receiver when adding new functions. It is unlikely a performance issue because accessing global variables are more common than 'window.foo' style coding.

I am still working on the ARM port, and I'd like to hear comments and suggestions on the best way to support it in V8.


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@540 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-21 19:07:58 +00:00
feng@chromium.org
00c0784acc Make one-ascii-character-string a symbol in its cache.
Review URL: http://codereview.chromium.org/7521

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@539 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-21 16:28:44 +00:00
bak@chromium.org
000825645c - Cleaned up Heap::CopyObject. Inlined fast case.
Review URL: http://codereview.chromium.org/8004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@532 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-21 08:48:11 +00:00
bak@chromium.org
d73595a2a4 -Fixed non debug build with an ifdef.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@526 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-20 07:37:51 +00:00
bak@chromium.org
63670beae0 - Changed gc-greedy to ignore boostrapping.
This change reduces the running time of tests without snapshotting.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@525 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-20 07:31:33 +00:00
bak@chromium.org
9276b48a5b - Optimized copying of FixedArray.
Review URL: http://codereview.chromium.org/7516

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@524 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-20 06:35:28 +00:00
ager@chromium.org
fc6ff0fa20 Allow larger semispaces.
Review URL: http://codereview.chromium.org/7476

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@521 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-17 11:33:13 +00:00
bak@chromium.org
7cd44cea9b - Removed a few indirections by making the two SemiSpaces
part of NewSpace and made NewSpace statically allocated.
- Eliminated indirection in MigrateObject.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@517 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-17 09:13:27 +00:00
iposva@chromium.org
6d97b325db - Fix instance size calculation to ensure that the object cannot
overflow the maximum object size.
- Added a test that will crash previous revisions.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@507 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-16 05:45:33 +00:00
iposva@chromium.org
d09fcf70b7 Allocate room for expected number of properties based on the
constructor in the JSObject. This removes the need to allocate
a properties array if the object is never assigned any extra
properties.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@501 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-15 06:03:26 +00:00
christian.plesner.hansen@gmail.com
dc32c82ce9 Reverted the changes to jscre because the arm cross-compiler dies with
an internal error when compiling templateified jscre.  We really need
to update that damn arm compiler.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@478 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-09 12:18:48 +00:00
christian.plesner.hansen@gmail.com
a7230abb92 - Specialized jscre on the type of the string involved.
- Specialized jscre on the type of the string involved.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@476 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-09 10:30:33 +00:00
christian.plesner.hansen@gmail.com
76b1efea2d - Specialized slow-case string equality nine ways based on the
underlying string representation of the two strings involved.
- Renamed ascii and two byte string classes to sequential ascii and
  sequential two byte, and renamed IsAscii and friends to
  IsAsciiRepresentation.  This is to make a clear distinction between
  strings with an ascii/two-byte representation, of which there is
  four, and flat sequential ascii/two-byte string.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@474 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-09 08:08:04 +00:00
kasperl@chromium.org
614d78367f Minor adjustments to the object migration code: When copying
large objects we use memcpy. If this turns out to be a wash
on the benchmarks, I'd be happy to rip it out again.
Review URL: http://codereview.chromium.org/6576

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@469 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-08 09:01:10 +00:00
christian.plesner.hansen@gmail.com
097d35065a Rolled back eager hash calculation during flattening. Introduced
eager flattening of really short strings and lookup of one-character
strings in the one-character symbol cache.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@462 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-07 13:04:56 +00:00
christian.plesner.hansen@gmail.com
17096cab78 Calculate string hash during flattening and convert flat strings to
symbols.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@456 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-07 10:10:03 +00:00
ager@chromium.org
70dcba4024 Exclude the bit-field bits from string hash codes. String hash codes
are always odd if the bit-field bits are included.

Modified a couple of debugger tests that relied on the ordering of
elements in descriptor arrays.  Descriptor arrays are sorted by
hash-code values, so the order changes if we change the hash code.
Review URL: http://codereview.chromium.org/6489

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@440 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-06 09:35:52 +00:00
erik.corry@gmail.com
b65c24f67e Recommit reverted change, now with fixes to make it work with gcc-4.2.
Allow gcc to use strict (type-based) aliasing when optimizing.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@431 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-03 15:53:44 +00:00
kasperl@chromium.org
6d8a21ee34 Revert 428. Breaks 64-bit compilation.
Review URL: http://codereview.chromium.org/6446

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@430 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-03 13:32:43 +00:00
erik.corry@gmail.com
70fa44ecea Allow gcc to use strict-aliasing rules to control pointer aliasing when
optimizing.  Obfuscate a few casts with bit_cast to avoid warnings from
gcc.
Review URL: http://codereview.chromium.org/6236

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@428 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-03 13:11:19 +00:00
christian.plesner.hansen@gmail.com
6d47b29765 - Added new object type, RegExp, for regular expressions.
- Renamed some ::kSizes to ::kHeaderSizes to avoid confusion.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@362 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-23 11:45:43 +00:00
erik.corry@gmail.com
cd50f9f865 Move the initial code space to be before the young space instead of after it.
The old arrangement meant that the alignment requirements of young space were
likely to nullify ASLR.
Review URL: http://codereview.chromium.org/2925

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@326 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-17 10:59:19 +00:00
deanm@chromium.org
77196c5771 This is a new static flag system, designed to have all flags in a central place, and compiled into the binary without requiring static constructors for registration. All flags are moved out of the specific modules and into flags.defs, with different sections for debug, release, etc. The flag variables are always defined. For example, a debug flag in release mode still exists, but is read only and set to the default value.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@296 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-12 10:19:33 +00:00
kasperl@chromium.org
b5a72a1645 Generalized the EvalCache into a CompilationCache and enabled
it for scripts too. In the context of Chromium, this should 
have a very positive impact on memory consumption for web apps
that run multiple tabs from the same domain with a lot of the
same JavaScript code.

For now, the cache retirement policy is really simple:
Whenever a mark-sweep collection is started we clear the
cache. This guarantees that this change will not have a
huge negative impact on memory consumption, but it may
not be ideal. We should consider a more sophisticated LRU
scheme.
Review URL: http://codereview.chromium.org/1933

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@270 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-11 10:51:52 +00:00
christian.plesner.hansen@gmail.com
9bed566bdb Changed copyright header from google inc. to v8 project authors.
Added presubmit step to check copyright.



git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@242 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-09 20:08:45 +00:00
feng@chromium.org
a2c12046ca fix lint errors
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@176 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-05 16:58:18 +00:00
feng@chromium.org
ebfa9d37b6 Added a EvalCache that caches eval'ed scripts and compiled function boilerplate.
The cache is a hashtable that takes String as key and JSFunction as the value.

Caches are cleared before mark-compact GC's.

Currently I don't put caps on cache size, string size, etc.

This cuts date-parse-totfe.js runtime by half.


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@173 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-05 16:27:56 +00:00
erik.corry@gmail.com
388c1094b7 * Split up code_space into old_data_space and code_space.
* Make old_data_space non-executable on OSs and hardware that support it.
* Rename old_space to old_pointer_space (can contain pointers, esp. to new space).
* Ensure that individual pages allocated for old_space are only executable when
they are for code objects.
* Ensure Space::Setup can cope with non-aligned memory.
* Make some methods on Spaces virtual.  Make a way to iterate over all spaces.
* Replace executability flag with Executability enum in order to make intent at
call site clearer.
* Fix serialization/deserialization to allocate write barrier memory for large
arrays.



git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@165 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-05 12:34:09 +00:00
kasperl@chromium.org
57fcbc370c Add I-cache flushing to Code::Relocate. No need to call it
from Heap::CopyCode anymore.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@161 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-05 11:23:00 +00:00
christian.plesner.hansen
968facb9ff - Fixed issue when building samples and cctests on 64-bit machines.
- Fixed mozilla test breakage caused by python's obscure module
  loading rules.
- Made sure test.py propagates test failures out as the exit code of
  the script.
- Remove runtime calls to get number constants. Remove Heap roots for
  some special numbers.
- Fix typo in accessors.h.
- Changes CopyMap to not copy descriptors.  Adds
  CopyMapRemoveTransitions that copies non-transition descriptors.
  Changes interface of DescriptorArray::Copy operations to simplify
  them.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@21 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-08-27 13:47:52 +00:00
christian.plesner.hansen
05bbf90b3a Changed shell sample to take flags directly from the command-line. Added api call that implements this.
Added better test support.

Added load, quit and version functions to the shell sample so it's easier to run benchmarks and tests.



git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-08-27 10:11:39 +00:00
christian.plesner.hansen
c42f5829a1 Included mjsunit JavaScript test suite and C++ unit tests.
In the shell sample don't print the result of executing a script, only
evaluating expressions.

Fixed issue when building samples on Windows using a shared V8
library.  Added visibility option on Linux build which makes the
generated library 18% smaller.

Changed build system to accept multiple build modes in one build and
generate seperate objects, libraries and executables for each mode.

Removed deferred negation optimization (a * -b => -(a * b)) since this
visibly changes operand conversion order.

Improved parsing performance by introducing stack guard in preparsing.
Without a stack guard preparsing always bails out with stack overflow.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-08-22 13:33:59 +00:00
mads.s.ager@gmail.com
769cc962a0 Improved performance of unary addition by avoiding runtime calls.
Fixed the handling of '>' and '<=' to use right-to-left conversion and left-to-right evaluation as specified by ECMA-262.

Fixed a branch elimination bug on the ARM platform where incorrect code was generated because of overly aggressive branch elimination.

Improved performance of code that repeatedly assigns the same function to the same property of different objects with the same map.

Untangled DEBUG and ENABLE_DISASSEMBLER defines.  The disassembler no longer expects DEBUG to be defined.

Added platform-nullos.cc to serve as the basis for new platform implementations.


git-svn-id: http://v8.googlecode.com/svn/trunk@9 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-08-06 10:02:49 +00:00
kasper.lund
7276f14ca7 Changed all text files to have native svn:eol-style.
Added a few samples and support for building them. The samples include a simple shell that can be used to benchmark and test V8.

Changed V8::GetVersion to return the version as a string.

Added source for lazily loaded scripts to snapshots and made serialization non-destructive.

Improved ARM support by fixing the write barrier code to use aligned loads and stores and by removing premature locals optimization that relied on broken support for callee-saved registers (removed).

Refactored the code for marking live objects during garbage collection and the code for allocating objects in paged spaces. Introduced an abstraction for the map word of a heap-allocated object and changed the memory allocator to allocate executable memory only for spaces that may contain code objects.

Moved StringBuilder to utils.h and ScopedLock to platform.h, where they can be used by debugging and logging modules. Added thread-safe message queues for dealing with debugger events.

Fixed the source code reported by toString for certain builtin empty functions and made sure that the prototype property of a function is enumerable.

Improved performance of converting values to condition flags in generated code.

Merged disassembler-{arch} files.


git-svn-id: http://v8.googlecode.com/svn/trunk@8 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-07-30 08:49:36 +00:00
christian.plesner.hansen
43d26ecc35 Initial export.
git-svn-id: http://v8.googlecode.com/svn/trunk@2 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-07-03 15:10:15 +00:00