Commit Graph

686 Commits

Author SHA1 Message Date
erik.corry@gmail.com
43e8d5fa7f Some optimizations for packer.js.
Review URL: http://codereview.chromium.org/409007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3336 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-20 10:11:45 +00:00
yurys@chromium.org
cc0ce24331 Make accessors for hidden properties object not touch interceptors.
Interceptors cannot provide a meaningful result for hidden_symbol anyway and some of them crash on empty property name.


Related Chromium issue: http://code.google.com/p/chromium/issues/detail?id=27385

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3294 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-12 16:34:52 +00:00
lrn@chromium.org
d53f05e3e2 Fix warnings on Win64.
Set warning level to /W3 and change implicit conversions from size_t
to int. Most "fixes" are simply manifesting the implicit casts or using
a special strlen replacement that returns int.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3273 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-11 09:50:06 +00:00
erik.corry@gmail.com
78a8f5973d Restore info needed to register profile ticks in functions from
the snapshot.  Still needed: info to register profile ticks in
stubs.
Review URL: http://codereview.chromium.org/385035

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3272 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-11 09:19:39 +00:00
ager@chromium.org
2252cc1bc9 Fix inline constructor code bailout.
Remove variable that is currently unused.

BUG=http://code.google.com/p/v8/issues/detail?id=502
Review URL: http://codereview.chromium.org/392001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3267 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-11 09:00:09 +00:00
sgjesse@chromium.org
851b9b2f73 Remove sliced string string type
As a first step to reduce the complexity of the string hierachy the sliced string type is removed. Whenever a sub-string is created it is allocated as a fresh flat string.
Review URL: http://codereview.chromium.org/385004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3259 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-10 13:23:05 +00:00
erik.corry@gmail.com
6a3921fc0e Keep natives source code in external strings instead of putting
it in regular flat strings that are part of the snapshot.
After this change we don't need libraries-empty.cc any more.  In
this change libraries-empty.cc is just a the same as libraries.cc
and the scons build builds it but does not use it.  We can move
in stages to a situation where it is not generated at all for all
the build systems that we have.
Review URL: http://codereview.chromium.org/360050

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3238 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-06 13:48:33 +00:00
christian.plesner.hansen@gmail.com
a1b2f47600 Reverting 3174. Aka reapplying 3150, 3151 and 3159. Aka api accessor
ics.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3209 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-04 08:51:48 +00:00
kmillikin@chromium.org
3eb69a34fa Begin using the top-level code generator for code that is inside
directly-applied function literals that are themselves compiled with
the top-level code generator.

The choice is guarded by a test that the function is anonymous (thus
not expected to be recursive) and not in a loop.

A compilation hint is set in the shared function info and used to make
the choice.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3206 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-03 14:48:59 +00:00
sgjesse@chromium.org
be769f6a24 Reverting 3159, 3151 and 3150
TBR=christian.plesner.hansen@gmail.com
Review URL: http://codereview.chromium.org/343035

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3174 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-29 13:17:11 +00:00
sgjesse@chromium.org
6768703d24 Derive string size constants
* The maximum length of short and medium sized strings is now derived from other constants.
* Remove the redundant String part of their names.
Review URL: http://codereview.chromium.org/347002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3162 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-28 13:10:36 +00:00
christian.plesner.hansen@gmail.com
895f1d22e5 Implemented specialized stubs for API getters. This includes a number
of individual changes:

  - Added infrastructure for custom stub caching.
  - Push the code object onto the stack in exit calls instead of a
    debug/non-debug marker.
  - Remove the DEBUG_EXIT frame type.
  - Add a new exit stub generator for API getters.


Committed: http://code.google.com/p/v8/source/detail?r=3130
Review URL: http://codereview.chromium.org/330017

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3150 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-27 15:38:49 +00:00
erik.corry@gmail.com
fb2317b63b New snapshot framework. Doesn't work on ARM yet (code targets
are different).  Is able to deserialize the whole heap and run
some stuff.  Not available as the primary snapshot system yet.
Review URL: http://codereview.chromium.org/335009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3142 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-27 11:54:01 +00:00
christian.plesner.hansen@gmail.com
2880be71ea Reverted 3130-3131 since they don't work on mac.
Review URL: http://codereview.chromium.org/335027

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3133 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-26 15:16:42 +00:00
christian.plesner.hansen@gmail.com
53b93464d1 Implemented specialized stubs for API getters. This includes a number
of individual changes:

  - Added infrastructure for custom stub caching.
  - Push the code object onto the stack in exit calls instead of a
    debug/non-debug marker.
  - Remove the DEBUG_EXIT frame type.
  - Add a new exit stub generator for API getters.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3130 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-26 13:54:47 +00:00
kbr@chromium.org
46e6297e3e Added infrastructure for optimizing new CanvasArray types in WebGL
specification under development. The optimizations are patterned after
those previously done for CanvasPixelArray. This CL adds all of the
necessary framework but continues to use the generic KeyedLoadIC and
KeyedStoreIC code, to create a baseline for benchmarking purposes. The
next CL will add the optimized ICs to ic-ia32.cc and ic-x64.cc.

These new CanvasArray types have different semantics than
CanvasPixelArray; out-of-range values are clamped via C cast
semantics, which is cheaper than the clamping behavior specified by
CanvasPixelArray. Out-of-range indices raise exceptions instead of
being silently ignored.

As part of this work, pulled FloatingPointHelper::AllocateHeapNumber
up to MacroAssembler on ia32 and x64 platforms. Slightly refactored
KeyedLoadIC and KeyedStoreIC. Fixed encoding for fistp_d on x64 and
added a few more instructions that are needed for the new ICs. The
test cases in test-api.cc have been verified by hand to exercise all
of the generated code paths in the forthcoming specialized ICs.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3096 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-20 15:26:17 +00:00
lrn@chromium.org
c8b0f822ee Fix overflow in failure "requested size" field.
Review URL: http://codereview.chromium.org/275016


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3059 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-14 09:26:16 +00:00
lrn@chromium.org
5767628039 Removed 31-bit smis.
Review URL: http://codereview.chromium.org/267049


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3046 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-12 11:19:20 +00:00
lrn@chromium.org
aed6a37c10 X64: Convert smis to holding 32 bits of payload.
Review URL: http://codereview.chromium.org/196139


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3037 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-08 12:36:12 +00:00
mikhail.naganov@gmail.com
572a050102 Fix a crash in Logger::LogCompiledFunctions due to a presence of scripts with disposed source.
When starting JS profiling under Chromium, a map from function addresses to function names is created. During it, for sourceful scripts, an attempt to access script source is made. This can cause a crash, if a source is an external string, which already has been disposed. We had a similar problem in the past with DebugGetLoadedScripts.

BUG=http://crbug.com/23768
TEST=test-log/Issue23768

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3027 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-07 12:20:02 +00:00
whesse@chromium.org
b026021215 Stop "cooking" targets of jumps and calls in code objects. Do not convert jump and call targets to absolute pointers to Code objects during GC, heap verification, and serialization.
Review URL: http://codereview.chromium.org/203070

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2941 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-09-21 10:35:47 +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
whesse@chromium.org
1dfac258a3 Change some integer types to make the x64 Win32 platform happier.
Review URL: http://codereview.chromium.org/173115

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2743 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-24 11:56:29 +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
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
vitalyr@chromium.org
d6fcda0044 API: added function to find instance of template in prototype chain.
Also inlined Object::IsInstanceOf.

This new function is intended to be used to speed up DOM bindings.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2636 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-06 13:35:21 +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
kasperl@chromium.org
84d8e51df4 Change the check for builtin functions to not be based on identity,
which seems shaky in the presence of multiple builtin objects.
Review URL: http://codereview.chromium.org/159583

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2573 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-29 09:51:41 +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
kasperl@chromium.org
4f2cc4104e Patch by Vitaly Repeshko. Improve performance of internal fields
operations by adding a fast-case check for JS_OBJECT_TYPE in
JSObject::GetHeaderSize().
Review URL: http://codereview.chromium.org/155684

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2497 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-17 09:16:23 +00:00
kasperl@chromium.org
067b3af8b7 Attempt at work-around for http://crbug.com/16276 by explicitly checking
for global objects in the assembly code for dictionary loads.
Review URL: http://codereview.chromium.org/155418

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2435 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-13 13:24:32 +00:00
ager@chromium.org
00cdc3f1a3 Remove the descriptor stream abstractions.
The abstractions have led to bugs because it looks like descriptor
streams are GC safe but they are not.

I have moved the descriptor stream helper functions to descriptor
arrays and I find most of the code just as readable now as it was
before.
Review URL: http://codereview.chromium.org/149458

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2428 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-10 19:25:18 +00:00
kasperl@chromium.org
875dbe6584 Re-enable ICs for loads and calls that skips a global object during
lookup through the prototype chain.
Review URL: http://codereview.chromium.org/155344

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2425 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-10 09:40:47 +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
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
whesse@chromium.org
2cba313a49 X64: Ignore extra bits in Smi::value()
Review URL: http://codereview.chromium.org/155046

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2347 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-03 09:22:22 +00:00
bak@chromium.org
70f67d6ec5 Reverted change to ASSERT is void Dictionary<Shape, Key>::SetEntry.
Review URL: http://codereview.chromium.org/150212

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2332 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-02 08:07:56 +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
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
whesse@chromium.org
29bcccb4e0 X64 Implementation: Implement Generate_Function(Call,Apply)
Review URL: http://codereview.chromium.org/147205

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2287 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-29 08:04:39 +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
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
ager@chromium.org
885259ffab Inline fast case of the method that ensures that an array has a
certain size.
Review URL: http://codereview.chromium.org/126265

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2200 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-17 10:55:58 +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
bak@chromium.org
977ad65073 - Changed fast case for computing object size based on usage histogram.
- Added fast case to String.prototype.split (Mads's idea).
- Made minor other optimizations in String.prototype.split.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2191 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-16 13:31:31 +00:00
sgjesse@chromium.org
d498361c5f Add more debugging information to scripts compiled through eval.
Scripts now have a compilation type which can be host, eval or JSON. Host scripts are compiled through the API, eval scripts are compiled through call to evan and JSON scripts are compiled as a result of calling JSON.parse.

For scripts scripts compiled through eval the JavaScript function in top of the stack and the pc offset into the code is stored in the script object. This makes it possible to calculate the source position of the eval call later when requested. This information can be obtained through the script mirror object and is part of the script mirror JSON serialization for the debugger protocol.

Moved the enumeration ScripType into class Script and remamed to Type. The new compilation type enumeration is also inside the class Script.

This information is now shown when using the scripts command in he developer shell debugger.
Review URL: http://codereview.chromium.org/119108

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2119 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-08 10:47:49 +00:00
kasperl@chromium.org
dfbc850ebc Revert revision 2108. This brings back the changes
submitted in revisions 2093, 2094, 2099, and 2106.
There's no evidence that supports that these changes
should be the cause of the unexplained performance
regressions on the intl2 and DHTML page cyclers. 


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2109 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-05 08:07:15 +00:00
kasperl@chromium.org
84c09c6de4 Experimental revert of revisions 2093, 2094, 2099, and
2106 to try to isolate a performance regression on the
page cyclers.

I'll roll the changes back in if this doesn't fix the
regression.

TBR=antonm@chromium.org
Review URL: http://codereview.chromium.org/118302

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2108 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-05 06:57:30 +00:00
antonm@chromium.org
06fdc01543 In case of holder with fast properties that allows to fetch the property
immediately if holder has this property or saves binary search on holder if
property doesn't belong to holder.  Of course, in the cases when named getter
returns nothing.

That gives ~20% for dom benchmark/Document Object String Get, speeds up overall
dom_perf (not dramatically) and overall score for peacekeeper.  Strange, but DOM
part of peacekeepr runs somewhat slower.
Review URL: http://codereview.chromium.org/118118

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2093 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-03 11:25:34 +00:00
erik.corry@gmail.com
01f7c87f22 This patch much improves our tracking of whether function is
called from within a loop or not.  In the past we lost the
information if a call site went megamorphic before a lazily
compiled callee was called for the first time.  Now we track
that correctly (this is an issue that affects richards).
We still don't manage to track the in-loop state through a
constructor call, since constructor calls use LoadICs instead
of CallICs.  This issue affects delta-blue.  So in this patch
we assume that lazy compilations that don't happen through a
CallIC happen from inside a loop.  I have an idea to fix this
but this patch is big enough already.
With our improved tracking of in-loop state I have switched
off the inlining of in-object loads for code that is not in
a loop.  This benefits compile speed.  One issue is that
eagerly compiled code now doesn't get the in-object loads
inlined.  We need to eagerly compile less code to fix this.
Review URL: http://codereview.chromium.org/115744

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2046 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-25 18:29:02 +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
13a96b3aa0 X64: Checked and slightly modified Object layouts to be compatible with 64-bit pointers.
Review URL: http://codereview.chromium.org/113522


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1986 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-18 12:13:20 +00:00
sgjesse@chromium.org
b32d7d2e67 Added context information to scripts.
Added a simple initial version of a context mirror object which just holds the user data from the context, and does not preserve handle identity.

A script object now holds a reference to the custom data from the context it was compiled in. This data is included in the debugger protocol for scripts.

Changed the serialization for the scripts command to use the mirror objects instaed of custom serialization. This included passing options from the debugger request to the serializer for including the full source of scripts in the response.
Review URL: http://codereview.chromium.org/111001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1877 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-06 08:52:48 +00:00
lrn@chromium.org
0e76f83bfc X64: Made hash computation in serializer accept 64-bit pointers.
Also changed api Wrap function to only wrap suitably small pointers as Smis.
Added Smi validity check and factory meethod for intptr_t.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1875 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-06 07:53:08 +00:00
lrn@chromium.org
d423dea519 Changed some int casts to intptr_t.
Removed a drop in an ocean of compile errors in x64 mode.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1843 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-04 13:11:38 +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
sgjesse@chromium.org
b8dc312b25 Make it possible to add a user data object to each script compiled.
Review URL: http://codereview.chromium.org/90003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1748 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-21 07:22:06 +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
ager@chromium.org
59d4539f38 If an external string enters the symbol table, make sure to set the
resource to NULL when removing it from the symbol table.  This makes
sure that the debugger can recognize the external string as being
"deleted".  Now, whenever an external resource is deleted, the
resource pointer is set to NULL.

This is really a workaround of a debugger problem.  We need to make
sure that the debugger only finds scripts in the heap that are
actually live.
Review URL: http://codereview.chromium.org/69029

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1734 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-17 09:17:04 +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
lrn@chromium.org
c8c5d9820d Test a few assertions that should hold.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1589 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-24 10:16:30 +00:00
olehougaard
a8c50151fc Reapply revisions 1432, 1433, 1469 and 1472 while fixing issue 279.
Review URL: http://codereview.chromium.org/48006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1571 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-23 07:27:47 +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
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
olehougaard
74722e199f Implementing __defineSetter__ and __defineGetter__ with an array index as argument as described in issue 242. For performance reasons, the change is not applied to arrays. This conforms to the behavior of Safari.
Review URL: http://codereview.chromium.org/46030

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1507 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-13 11:40:09 +00:00
lrn@chromium.org
e2af4529c3 String.replace implemented in C++.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1506 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-13 10:22:38 +00:00
erik.corry@gmail.com
912c8eb03a * Reapply revisions 1383, 1384, 1391, 1398, 1401, 1402,
1418, and 1419 from bleeding_edge, reverted in 1429.
* Fix of $1 accessor on sliced strings.
* Fix of lastParen method when last parenthesis did not match.
Review URL: http://codereview.chromium.org/43075

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1491 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-11 14:00:55 +00:00
sgjesse@chromium.org
9d17b0d4c8 Whenever a script object is created it is assigned a unique id. Currently this id is assigned from an 32 bit integer counter.
Changed the script break points to be able to handle both break points based on script names and script ids. When break points are set through a script id the position is relative to the script itself. This is different from the script break points set through script names where the line/coulmn offset is taken into account.

This has the side effect that function break points are not converted into script break points for named scripts.

Show the script id in the D8 shell debugger when listing all scripts using the 'scripts' command.
Review URL: http://codereview.chromium.org/40317

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1468 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-10 08:10:50 +00:00
kasperl@chromium.org
e9e8628380 Revert revisions 1383, 1384, 1391, 1398, 1401, 1402,
1418, and 1419 from bleeding_edge until we have a fix
for the crashers we see on the distributed test infra-
structure.

We know that revision 1383 is causing issues, but I 
had to revert some of the other recent RegExp changes
in order to get this part out.
Review URL: http://codereview.chromium.org/39186

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1429 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-05 15:23:17 +00:00
lrn@chromium.org
50e042dfcd All RegExp data are set on a single FixedArray instead of nesting them three deep.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1398 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-02 13:58:37 +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
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
mikhail.naganov@gmail.com
3835e915c4 Adding src_file_name:line_number into perf log entries for compiled JS functions.
Thus, instead of the following profiler records:
   1.5%    1.5%   LazyCompile: <anonymous>
we'll now have these:
   1.5%    1.5%   LazyCompile: <anonymous> richards.js:309

Basically, I translated two functions from messages.js into C++.
In the next CL I will update messages.js to use added native functions.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1216 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-03 10:52:02 +00:00
erik.corry@gmail.com
50e5ad72cb Fix bug where strings were not flattened before regexp.
Review URL: http://codereview.chromium.org/18552

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1142 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-26 08:35:41 +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
d4dae20a12 Fix issue 186:
http://code.google.com/p/v8/issues/detail?id=186

Create a new instance type for context extension objects.  Use it to
not use the __proto__ accessor for context extension objects.
Review URL: http://codereview.chromium.org/18044

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1072 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-14 12:13:26 +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
sgjesse@chromium.org
bbbab4821c Refactor the convertion of a target address into a code object from the debugger to the Code class.
Review URL: http://codereview.chromium.org/13285

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@952 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-12-09 12:53:59 +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
erik.corry@gmail.com
c390485090 Fix place where linter complains about lonely {
Fix place where ARM compiler loses track of whether variables were initialized.
Review URL: http://codereview.chromium.org/9244

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@678 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-11-03 12:08:01 +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
ager@chromium.org
2013421859 Add support for API accessors that prohibit overwriting by accessors
defined in JavaScript code by using __defineGetter__ and
__defineSetter__.

Also, disable access checks when configuring objects created from
templates.
Review URL: http://codereview.chromium.org/8914

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@656 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-30 12:51:06 +00:00
whessev8
28cee257b6 Remove unused maps during marking garbage collections.
Review URL: http://codereview.chromium.org/8831

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@637 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-29 10:37:14 +00:00
ager@chromium.org
44340e39c5 Change the order of two assignments, to make sure that the script type
field is always initialized to a Smi before we get any GCs.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@624 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-28 13:46:04 +00:00
ager@chromium.org
721b7298e2 Allow inline caching for getting the length of string wrapper objects.
Review URL: http://codereview.chromium.org/8620

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@608 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-27 14:36:08 +00:00
whesse@chromium.org
d08b095bce Revert changes 601 and 602. TBR
Review URL: http://codereview.chromium.org/8190

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@605 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-27 12:45:24 +00:00
erik.corry@gmail.com
0fc72f2b4e Serendipitously arrange the tags so that String.length() becomes a branch-free
operation.  I have another version of this change that does not remove the
special inline caches for difference sized strings.  The other version is ever
so slightly faster, but the nice thing about this version is that it removes
253 lines of code.
Review URL: http://codereview.chromium.org/8187

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@603 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-27 12:39:34 +00:00
whesse@chromium.org
6941a4f389 Collects unused maps that are only kept alive by map transitions.
If a map has descendents in the map transition tree that are alive,
it is kept.  Only maps such that they and all their descendants
have no live objects are collected.  This happens in mark-sweep and
mark-compact garbage collections.
Review URL: http://codereview.chromium.org/8099

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@601 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-27 11:55:31 +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
christian.plesner.hansen@gmail.com
9d9f608a38 - Added caching of regexp data in the compilation cache.
- Changed the structure of regexp objects from having two internal
  fields to having a single field containing a fixed array, since it's
  easier to store the whole fixed array in the cache.
- Move printing of the command to after printing std{err,out} in the
  compact progress indicators in the test framework.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@579 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-24 08:40:02 +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
kasperl@chromium.org
b727198587 Fix issue 124 by computing the receiver correctly when
the property is found in a context slot.
Review URL: http://codereview.chromium.org/8097

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@566 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-23 08:42:22 +00:00
christian.plesner.hansen@gmail.com
c7ed0707a3 - Added const in a few places.
- Changed WeakReferenceCallback to take a Persistent<Value> instead of
  a Persistent<Object>.
- Removed Message::GetUnderline and Message::GetScriptData.
- Added Value::IsDate, Date::Cast and Date::Value.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@564 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-23 08:25:23 +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
kasperl@chromium.org
b75da76a2b Apply Daniel's patch for array index strings.
Review URL: http://codereview.chromium.org/7869

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@560 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-23 06:20:57 +00:00
kasperl@chromium.org
50d9f5e256 Incorporate patches by Paolo Giarrusso to allow profiling
C++ functions in shared libraries, building in directories
containing spaces, and using named constants better.
Review URL: http://codereview.chromium.org/7864

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@550 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-22 09:46:09 +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
christian.plesner.hansen@gmail.com
2b7c9edbb1 Added string equality by reading int-sized blocks of characters for
flat strings with the same representation.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@528 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-20 11:38:32 +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
bak@chromium.org
884345a789 -Eliminated a excessive memory traffic in CopyObject.
Review URL: http://codereview.chromium.org/7432

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@509 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-16 07:17:26 +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
bak@chromium.org
80098968d8 - Inlined JSArray::SetContent.
- Implemented Runtime_KeyedGetProperty to make slow case faster.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@487 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-10 10:27:44 +00:00
erik.corry@gmail.com
89ac41aff9 If an allocation is so huge that we cannot code the size needed in the failure
object then we just return an out of memory failure object (instead of a retry
after GC failure object).  Not all places that checked for retry-after-GC were
able to handle an immediate out of memory failure.

This fixes http://code.google.com/p/v8/issues/detail?id=70
Review URL: http://codereview.chromium.org/6340

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@477 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-09 11:26:37 +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
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
lrn@chromium.org
ca7668ee32 Fixed typo
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@454 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-07 09:04:23 +00:00
lrn@chromium.org
c7c7b8b0e7 Fast direct-access version of KPM string match.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@452 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-10-07 08:11:44 +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
bak@chromium.org
e05eba857e - Added a map cache for literal objects. This will
canonicalize maps for object literals. JSON objects
  with the same set of properties names will then
  share the same map.
  This reduces the amount of generated code associated 
  with object literals.
- Added a flag canonicalize_object_literal_maps.
  (default true)
- Changed the format of a function's literal array.
  Only the global context is now stored in the literal prefix.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@371 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-25 07:46:07 +00:00
christian.plesner.hansen@gmail.com
16bfefe012 Fixed lint error.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@364 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-23 12:23:20 +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
deanm@chromium.org
ab377a3f42 TryFlatten is inlined, while Flatten is not. Make an optimization to avoid the call to Flatten when we're already flat. This gives me 5% on some simple indexOf experiments.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@347 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-19 11:06:35 +00:00
ager@chromium.org
57e2aa1b26 Use null instead of undefined for deleted elements in code caches.
Update the lookup and update code for code caches to deal with deleted
elements.

Do not clear the code cache for the builtins object.  If there was a
matching element in the code cache, we would have hit the monomorphic
prototype failure case and removed it.
Review URL: http://codereview.chromium.org/3140

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@340 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-18 11:18:27 +00:00
ager@chromium.org
6a3d1868e4 Revert revision 331. The propagation of monomorphic prototype failure
information does not work.  In certains situations, it will keep
alternating between unrelated monomorphic states instead of going
megamorphic.
Review URL: http://codereview.chromium.org/2959

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@338 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-18 10:22:46 +00:00
ager@chromium.org
950ad34a94 Propagate the information that a monomorphic prototype failure has
occured.  After a monomorphic prototype failure has been detected,
other monomorphic inline caches for the same type will have a code
object in the map's code cache which is not the current target.  We
recognize this case and use the code object that is in the cache
instead of going megamorphic.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@331 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-18 06:55:14 +00:00
kasperl@chromium.org
3f67d5b90f Stop adapting the arguments passed to the builtin implementations
of Array.prototype.push and Array.prototype.pop. Avoid going 
through the arguments adaptor trampoline for call ICs that end
up calling a builtin that does not need arguments adaption.
Review URL: http://codereview.chromium.org/2884

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@312 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-16 07:24:46 +00:00
kasperl@chromium.org
64923a6a83 Generalize the Function.prototype.call hooks in the
arguments adaptor code to allow builtins to work without
argument adaptor frames. Get rid of unused JavaScript
implementation of call and apply and the associated
code generation hooks.
Review URL: http://codereview.chromium.org/2850

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@311 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-15 15:02:38 +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
christian.plesner.hansen@gmail.com
0b0c2f2979 Applied Rene Rebe's patch to fix compilation with gcc-4.3 (identical
to Seo Sanghyeon and Koda's).  Yay, our first patch!



git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@119 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-03 08:19:44 +00:00
feng.qian.v8
194baea8ca Move JS_VALUE_TYPE ahead of JS_OBJECT_TYPE to save one comparison in
KeyedLoadIC::GenerateGeneric (on IA32), and the same on ARM.
Re-assignmed FIRST_JS_OBJECT_TYPE to JS_VALUE_TYPE.

Also changed JS_OBJECT_TYPE to FIRST_JS_OBJECT_TYPE in several places where
FIRST_JS_OBJECT_TYPE is intended.



git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@113 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-02 23:52:50 +00:00
mads.s.ager@gmail.com
96ae958eb1 Updated V8 API documentation.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@82 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-01 18:22:49 +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
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
kasper.lund
212ac23f82 Fixed building on Mac OS X by recognizing i386 and friends as IA-32 platforms.
Added propagation of stack overflow exceptions that occur while compiling nested functions.

Improved debugger with support for recursive break points and handling of exceptions that occur in the debugger JavaScript code.

Renamed GetInternal to GetInternalField and SetInternal to SetInternalField in the API and moved InternalFieldCount and SetInternalFieldCount from FunctionTemplate to ObjectTemplate.


git-svn-id: http://v8.googlecode.com/svn/trunk@5 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-07-16 07:07:30 +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