Commit Graph

195 Commits

Author SHA1 Message Date
vegorov@chromium.org
28f9412cbd Generalize virtually dispatched scavenger to virtually dispatched specialized visitors.
Review URL: http://codereview.chromium.org/3066044

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5246 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-11 14:30:14 +00:00
ricow@chromium.org
8402db12c9 Change lazy compilation stub to a builtin.
This change changes the lazy compilation stub to a builtin and
eliminates the argc (argument count for the function for which to
create a lazy stub) parameter.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5244 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-11 13:48:58 +00:00
ricow@chromium.org
36e5743674 Put direct code pointers into JSFunction objects. This is a first step
in allowing more flexible compilation and to simplify builtins lookup. 

This changes a number of places where code objects are assigned to
SharedFunctionInfo objects to also assign this code object to the
JSFunction. In addition, the code flushing is changed slightly to
accomodate this (we need to flush the code from functions pointing to
SharedFunctionInfo objects that has already been flushed).


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5233 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-11 08:12:53 +00:00
whesse@chromium.org
571eca3118 Revert r5147 due to failing assert, with no simple solution. Issue 808.
Review URL: http://codereview.chromium.org/3087001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5167 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-02 15:08:17 +00:00
kaznacheev@chromium.org
d191b9d7d2 Cache maps for slow case objects.
Review URL: http://codereview.chromium.org/3032028

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5147 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-28 15:08:32 +00:00
kaznacheev@chromium.org
db23321704 Create a separate class to encapsulate ScopeInfo serialization.
The static ScopeInfo members moved into this class.
The new class is named ScopeInfoObject which I am not proud of,
better ideas are very welcome.

Also got rid of the sentinels in the serialized scope info which saves 3 words per function
and is not slower.
 
Review URL: http://codereview.chromium.org/2908009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5067 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-14 11:18:09 +00:00
kaznacheev@chromium.org
0243bc875c Move serialized scope info from Code object to SharedFunctionInfo.
The scope info is now stored in a FixedArray referenced from SharedFunctionInfo.


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5056 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-13 13:06:33 +00:00
vegorov@chromium.org
7780bea2f0 Virtually dispatched scavengers
Use virtually dispatched specialized scavengers instead of single generic ScavengeObjectSlow implementation.

Rollback of r5041 with assertion checking callback alignment removed. Map space is iterated in a special fashion during scavenges so special callback alignment is not required.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5047 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-13 08:05:10 +00:00
ager@chromium.org
ef8baf25fc Revert revisions 5041 and 5042 introducing virtual scavenge
behavior. It breaks debug builds with snapshots on my machine.

TBR=vegorov@chromium.org
Review URL: http://codereview.chromium.org/2983001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5046 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-12 16:57:07 +00:00
vegorov@chromium.org
ef6cb2dd0b Use virtually dispatched specialized scavengers instead of single generic ScavengeObjectSlow implementation.
Review URL: http://codereview.chromium.org/2895008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5041 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-12 12:47:09 +00:00
kaznacheev@chromium.org
8a4463306d Extracting relocation info from the code object.
It is now stored in a ByteArray referenced from the code object header.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5020 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-05 11:45:11 +00:00
ricow@chromium.org
eed4ed99c8 Add ES5 Object.isExtensible and Object.preventExtensions.
Review URL: http://codereview.chromium.org/2819034

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5011 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-02 14:36:34 +00:00
serya@chromium.org
c56b92d65d This change allows generating call-stubs for objects with normal (non-fast) objects in the prototype chain. StubCompiler::CheckPrototypes does ne
If the top level object is a normal object the stub is stored in its prototype map.

Lookup result of type NORMAL is not covered (since the normal stub currently doesn't check the prototype chain).
Review URL: http://codereview.chromium.org/2801018

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5010 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-02 14:15:04 +00:00
ager@chromium.org
47b5b3f951 Use the number of in-object properties when deciding how many fast
properties to allow on an object. If there are many in-object
properties it is unlikely that the object is used as a dictionary and
we allow more map transitions to keep such objects in fast case.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5008 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-02 11:27:57 +00:00
vitalyr@chromium.org
8ab6832203 Add "has fast elements" bit to maps and use it in inlined keyed loads.
A potential issue with this change is creating lots of maps when
objects flip between fast/slow elements modes.  We could add special
transitions to avoid this.  Yet testing this on our benchmarks, gmail,
and wave seems to indicate that this is not a real problem.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4941 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-24 13:56:35 +00:00
vitalyr@chromium.org
3cafa65462 Track ascii-ness of data in externalized strings.
If a two-byte string only contains ascii characters, then we can save
memory when flattening a cons string containing it. Similarly we can
use this in Array.prototype.join implementation. To track this a new
bit is added to instance type. This bit is used as a hint in generated
code and in runtime functions.

To enable testing a new V8 extension is added controlled by
--expose-externalize-string flag.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4894 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-17 16:19:28 +00:00
ricow@chromium.org
316092c364 Flushing of code from functions that we expect not to use again.
This adds an additional step to full gc, removing code from functions
that are no longer in the compilation cache. The code is replaced with
a lazy compile version enabling us to recompile the function in case
we do actually need it again.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4814 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-07 15:39:10 +00:00
vegorov@chromium.org
53923e9233 Revert r4782. Fix issues 728, 732.
Review URL: http://codereview.chromium.org/2701003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4806 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-07 09:36:30 +00:00
kaznacheev@chromium.org
ff61618c4b Extend CallIC to support non-constant names.
This speeds up constructs like this: 
var zz='replace'; '123'[zz]('3','4');

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4804 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-07 08:27:32 +00:00
lrn@chromium.org
5b7e77acea Fix bug that could cause a string to be incorrectly tagged as an array index.
We should only mark a string as an array index if we can store the entire value
of the number in the hash field. We sometimes failed to reject larger numbers.

Fixes http://code.google.com/p/v8/issues/detail?id=728

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4782 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-02 09:31:01 +00:00
vegorov@chromium.org
fc7c5f789a Cardmarking writebarrier.
Reapply r4715 with fixes reviewed in http://codereview.chromium.org/2276002.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4743 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-27 12:30:45 +00:00
vegorov@chromium.org
e268fbdaba Revert r4715.
TBR=ager@chromium.org
Review URL: http://codereview.chromium.org/2274001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4723 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-26 09:24:44 +00:00
vegorov@chromium.org
675e711f1c Cardmarking writebarrier.
- New сardmarking write barrier handles large objects and normal objects in a similar fashion (no more additional space for pointer tracking is required, no conditional branches in WB code).
- Changes to enable oldspaces iteration without maps decoding:
-- layout change for FixedArrays: length is stored as a smis (initial patch by
Kevin Millikin)
-- layout change for SharedFunctionInfo: integer fields are stored as smi on
arm, ia32 and rearranged on x64.
-- layout change for String: meaning of LSB bit is fliped (1 now means hash not
computed); on x64 padding is added.
-- layout of maps is _not_ changed. Map space is currently iterated in a special
way.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4715 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-25 13:15:16 +00:00
vegorov@chromium.org
2241d2af45 Reverting r4703.
TBR=ager@chromium.org
Review URL: http://codereview.chromium.org/2073018

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4704 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-21 17:37:47 +00:00
vegorov@chromium.org
8879691793 Cardmarking writebarrier.
Reapplication of r4685 (reviewed http://codereview.chromium.org/2101002) with minor modifications:

- Fix compilation problems on Win64.
- Improve heap verification pass: search for garbage pointers to new space not only in dirty regions but in all regions.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4703 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-21 15:52:38 +00:00
vegorov@chromium.org
955828e437 Reverting r4685, r4686, r4687
TBR=ager@chromium.org
Review URL: http://codereview.chromium.org/2071020

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4688 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-20 14:02:51 +00:00
vegorov@chromium.org
b38a0a719a - Changes to enable oldspaces iteration without maps decoding:
-- layout change for FixedArrays: length is stored as a smis (initial patch by Kevin Millikin)
-- layout change for SharedFunctionInfo: integer fields are stored as smi on arm, ia32 and rearranged on x64.
-- layout change for String: meaning of LSB bit is fliped (1 now means hash not computed); on x64 padding is added.
-- layout of maps is _not_ changed. Map space is currently iterated in a special way.
- Cardmarking write barrier. New barrier handles large objects and normal objects in a similar fashion (no more additional space for pointer tracking is required, no conditional branches in WB code).

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4685 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-20 13:10:38 +00:00
vitalyr@chromium.org
91cbd98dfc Try flattening strings before comparing for equality.
Review URL: http://codereview.chromium.org/2076010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4684 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-20 09:01:39 +00:00
vitalyr@chromium.org
4724826f4a Refactored custom call IC generators:
* All generators are listed in a single place.
 * Generators are installed as a separate pass in the bootstrapper.
 * Replaced pointers to generator functions with integer ids.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4606 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-06 13:21:53 +00:00
antonm@chromium.org
6617fac3d4 Clean JS function results cache on each major GC.
We don't want to retain cached objects for too long.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4582 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-04 16:42:11 +00:00
serya@chromium.org
16d3811d50 Changing string length field type from int to SMI. It will make it be a regular field. Code generated in EmitNamedLoad could be patched for faster access to string.length.
Review URL: http://codereview.chromium.org/1706013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4581 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-04 14:49:50 +00:00
dgozman@chromium.org
8fee5e810a Added ability to remove prototype from function. In this case, [[Construct]] from function will not be allowed.
Added runtime function %FunctionRemovePrototype for this.
Removed prototypes from all builtin functions.
Some sputnik tests marked as fixed.
Added test to check builtins behavior.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4536 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-28 12:05:40 +00:00
ager@chromium.org
07db17ce1b Remove some remaining references to boilerplate functions.
Review URL: http://codereview.chromium.org/1605037

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4440 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-19 12:39:07 +00:00
vitalyr@chromium.org
1d8ec1e47b One less dependent load in InvokeBuiltin.
Review URL: http://codereview.chromium.org/1638006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4423 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-14 20:16:19 +00:00
kmillikin@chromium.org
3c2964a723 Make check for writes without remembered set updates less restrictive.
One doesn't have to update remembered set if it already contains a mark for
the given address.

BUG=39766

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

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4334 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-01 06:57:31 +00:00
vitalyr@chromium.org
9117dfcff9 Some string optimizations:
* Faster hashing for sequential strings.

 * When adding short external two-byte strings try to convert them
   back to ascii. Chances are high the embedder uses two-byte
   representation even for ascii strings. This optimization saves
   memory and makes hashing faster.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4300 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-26 23:33:37 +00:00
kasperl@chromium.org
7d6a3b433f Merge the partial_snapshots branch back into bleeding_edge. For
now, the custom call generator stuff is disabled.
Review URL: http://codereview.chromium.org/1094014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4217 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-23 11:40:38 +00:00
iposva@chromium.org
a1ec99c05d - Remove function boilerplate objects and use SharedFunctionInfos in
their place.
- Add one field to the SharedFunctionInfo to remember the number of
  literals used in this function.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4211 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-23 06:04:44 +00:00
oleg@chromium.org
825a5d741f Improve Math.round(). Fix the bug in r4146. Further improve performance by checking the exponent instead of comparing doubles. Add several tests for numbers near the limits of SMI and several tests from WebKit.
Review URL: http://codereview.chromium.org/1008004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4180 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-18 13:00:57 +00:00
antonm@chromium.org
de070ccfa6 First take on custom call generators.
Review URL: http://codereview.chromium.org/669061

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4108 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-11 16:24:31 +00:00
sgjesse@chromium.org
504664365d Refactor the code cache to handle large number of properties on the global object (take 2).
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.

This is a remake of r3952 (http://codereview.chromium.org/652119) which have the additional ability to look for the index of code stubs for access to the global object.

BUG=http://code.google.com/p/v8/issues/detail?id=613

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4066 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-09 10:49:41 +00:00
kaznacheev@chromium.org
7d58852374 Implementing inline caches for binary operations (ia32).
This is a subset of a CL reviewed earlier(http://codereview.chromium.org/551093).
The register usage optimisation part has been reviewed and submitted separately.
Two fast cases supported: HeapNumber operands and String operands for ADD.


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3988 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-01 16:24:05 +00:00
antonm@chromium.org
d4cb1ba3c5 Faster moving FixedArray elements around.
Review URL: http://codereview.chromium.org/660245

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3987 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-01 15:33:30 +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
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
lrn@chromium.org
024faf1105 Fix test for overflow in memory allocation Failure payload.
It bailed out too early, and could give a DEBUG assertion failure due
to right shift being artihmetic. Changed values to unsigned to be safe.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3948 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-25 12:28:35 +00:00
antonm@chromium.org
f70dd176a6 Make setting length on arrays faster.
Review URL: http://codereview.chromium.org/647013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3902 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-18 17:30:32 +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
0b13c6be28 Strengthen a few assertions and add zapping of allocated
memory blocks filling them out with recognizable non-zero
bit pattern in debug mode.
Review URL: http://codereview.chromium.org/558016

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3729 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-28 08:46:56 +00:00