Commit Graph

291 Commits

Author SHA1 Message Date
christian.plesner.hansen@gmail.com
77ff957f58 Implemented Object.keys.
Review URL: http://codereview.chromium.org/201114


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2890 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-09-15 11:51:40 +00:00
lrn@chromium.org
88e732edbc Fix bug that errnoeously sets FPU exception.
This has only been caught on Win64 yet.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2881 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-09-14 12:20:13 +00:00
sgjesse@chromium.org
f4d3ff1ac3 Find the correct function for script break points
The algorithm for finding the inner-most function containing a script break point was not correct when the script only contained one function. In that case the script function and not the actual function in the script could be returned depending on the order of the objects in the heap.

TEST=cctest/test-debug/ScriptBreakPointReload
BUG=none

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2862 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-09-09 15:16:26 +00:00
yurys@chromium.org
bbc3c97c2c Support stepping out for recursive functions.Simply flooding JS function from the calling stack frame with one shot breakpoints is not enough to support step out action in all cases since the function on top of the stack may be turn recursive and we may end up flooding itself. To overcome this a pointer to the stack frame where the debugger should be invoked after stepping out is strored in the debugger.Chromium bug:http://code.google.com/p/chromium/issues/detail?id=17967
Review URL: http://codereview.chromium.org/200041

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2850 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-09-09 08:40:59 +00:00
whesse@chromium.org
07e6f6f619 Fix lint error
Review URL: http://codereview.chromium.org/196042

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2846 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-09-08 12:51:08 +00:00
lrn@chromium.org
8f60f1a46f Win64 - Allow returning two values from a runtime function.
(Not yet fully functional)

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2845 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-09-08 11:52:05 +00:00
yurys@chromium.org
ae062d5df1 Added new scope type ScopeIterator::ScopeTypeCatch for with generated from catch blocks.
Removed a false assertion in ScopeIterator that assumed context extension to never be a JSContextExtensionObject.

The context extension object in a 'with' context is JSContextExtensionObject iff the 'with' statement is generated from a catch block in order to extend its local scope with a variable holding exception object. This is how we differentiate 'catch' scope from 'with' scope.

Chrome bug:
http://code.google.com/p/chromium/issues/detail?id=17229
Review URL: http://codereview.chromium.org/202005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2843 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-09-08 10:20:28 +00:00
lrn@chromium.org
2364f20cc5 X64 RegExp - fix RegExp on WIN64.
Use the correct ifdef to detect Win64 (_WIN64, not __MSVC__).

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2823 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-09-04 11:00:07 +00:00
erik.corry@gmail.com
be70d6fc4d Cache the results of slow math operations on machines that don't
have hardware fpu instructions to execute them.
Review URL: http://codereview.chromium.org/179059

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2790 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-09-01 09:03:58 +00:00
sgjesse@chromium.org
717394492d Generate specialized constructor code for constructing simple objects.
For objects which only have simple assignments of the form this.x = ...; a
specialized constructor stub is now generated. This generated code allocates the
object and fills in the initial properties directly. If this fails for some
reason code continues in the generic constructor stub which in turn might pass
control to the runtime system.

Added counter to see how many objects are constructed using a specialized stub.

The specialized stub is only implemented for ia32 architecture in this change.
For x64 and ARM the generic construct stub is used.

This is change is identical to http://codereview.chromium.org/174392 (committed in r2753 and reverted in r2754) except that a few parts have already been committed from http://codereview.chromium.org/173469 (committed in r2762).
Review URL: http://codereview.chromium.org/173470

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2764 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-26 12:22:44 +00:00
sgjesse@chromium.org
681440e273 Handle pre-allocated properties when copying map.
When copying a map always set the descriptor array to describe the pre-allocated properties, even when descriptors are to be dropped.

Added a test which otherwise failed with an assert on ARM in debug mode. The reason for it only surfasing on ARM is that the NewObject runtime function is always used for allocating new JSObjects on ARM.

This change includes a few parts of http://codereview.chromium.org/174392 needed to trigger the error.
Review URL: http://codereview.chromium.org/173469

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2762 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-26 11:03:07 +00:00
sgjesse@chromium.org
3fdbc0848c Reverting 2753.
Review URL: http://codereview.chromium.org/173349

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2754 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-25 15:00:07 +00:00
sgjesse@chromium.org
53531ed48a Generate specialized constructor code for constructing simple objects.
For objects which only have simple assignments of the form this.x = ...; a specialized constructor stub is now generated. This generated code allocates the object and fills in the initial properties directly. If this fails for some reason code continues in the generic constructor stub which in turn might pass control to the runtime system.

Added counter to see how many objects are constructed using a specialized stub.

The specialized stub is only implemented for ia32 architecture in this change. For x64 and ARM the generic construct stub is used.
Review URL: http://codereview.chromium.org/174392

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2753 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-25 12:23:58 +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
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
christian.plesner.hansen@gmail.com
04a6340227 RegExp tweaks
Fixed bug where regexps were not callable across contexts since the
callable test used object identity on the regexp constructor.  Changed
typeof RegExp from 'object' to 'function' for compatibility.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2696 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-17 10:19:00 +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
christian.plesner.hansen@gmail.com
061834200a Fixed issue 19212
Fixed a bug in json parsing.  Refactored compilation code a bit to
make it more obvious what's going on.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2675 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-08-13 10:25:35 +00:00
whesse@chromium.org
78ec956610 Add missing file to last changelist, for NaN Dates.
Review URL: http://codereview.chromium.org/159700

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2602 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-31 13:24:40 +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
kasperl@chromium.org
b2fc0598c1 Fix lint issues. TBR=iposva@chromium.org
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2550 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-28 09:05:05 +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
christian.plesner.hansen@gmail.com
668497b26a Handlified some stack trace code
Fixed some failing sputnik tests by handlifying some code that would
otherwise break on gc.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2542 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-27 13:26:43 +00:00
christian.plesner.hansen@gmail.com
c1581cd5bd Added Error.captureStackTrace function.
Added utility function for capturing stack traces so that efficient
stack trace collection works for custom errors too, not just built-in
ones.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2541 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-27 12:01:32 +00:00
yurys@chromium.org
0da86e1250 Fix an issue with debugger 'step in' when calling function has local variables.Corresponding Chromium bug:http://code.google.com/p/chromium/issues/detail?id=15824
Review URL: http://codereview.chromium.org/149326

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2426 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-10 09:57:53 +00:00
bak@chromium.org
be6dd7a490 Fixed and exposure to the_hole from Runtime_KeyedGetProperty.
Added regression test that fails with previous revisions.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2391 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-08 11:51:43 +00:00
kasperl@chromium.org
b0f411c298 Fix issue 397 and issue 399.
Review URL: http://codereview.chromium.org/149247

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2372 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-07 11:57:09 +00:00
lrn@chromium.org
72de7ab74e Separate native and interpreted regexp by compile time flag, not runtime.
Clean-up of RegExp code.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2366 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-07 08:11:19 +00:00
christian.plesner.hansen@gmail.com
89b77643e9 Enable capture of the top of the stack on error instantiation.
Performance impact on v8 benchmarks seems limited.  Will be backed out
if chrome performance regresses.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2338 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-02 12:26:31 +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
b95dbc3fdd Make global variable initialization consistent with Firefox and Safari
behavior.  Only force the introduction of a variable directly on the
global object if there is an explicit initial value in a variable
declaration.

BUG=http://crbug.com/12548
Review URL: http://codereview.chromium.org/151191

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2326 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-07-02 06:28:37 +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
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
whesse@chromium.org
137f61b85a X64: Implement unary subtraction, ObjectPair. 350 tests still fail.
Review URL: http://codereview.chromium.org/150093

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2304 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-30 12:11:21 +00:00
christian.plesner.hansen@gmail.com
118a2ccc8e When Error.collectStackTraces is set to true all new instances of
Error, ReferenceError, etc. are given a stack property that gives a
stack trace.  Here's an example stack trace:

ReferenceError: FAIL is not defined
    at Constraint.execute (deltablue.js:527)
    at Constraint.recalculate (deltablue.js:426)
    at Planner.addPropagate (deltablue.js:703)
    at Constraint.satisfy (deltablue.js:186)
    at Planner.incrementalAdd (deltablue.js:593)
    at Constraint.addConstraint (deltablue.js:164)
    at Constraint.BinaryConstraint (deltablue.js:348)
    at Constraint.EqualityConstraint (deltablue.js:517)
    at chainTest (deltablue.js:809)
    at deltaBlue (deltablue.js:881)
    at deltablue.js:888

If Error.prepareStackTrace holds a function this function is used to
format the stack trace, for instance allowing code generators to
customize the way stack traces are reported to make them easier to
process.

Next step: performance measurements to see if it is feasible to turn
this on by default.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2302 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-30 11:08:37 +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
kasperl@chromium.org
f1ffd50257 Optimize %ClassOf() on IA-32 and use it instead of the
custom %HasXXXClass() calls.
Review URL: http://codereview.chromium.org/151018

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2293 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-29 10:45:16 +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
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
kasperl@chromium.org
cbda639253 Speculative fix for computing Math.pow(2, -1074) on win32 where
the overloaded pow(double, int) function from math.h produces the
wrong answer. 

TBR=whesse@chromium.org
Review URL: http://codereview.chromium.org/131022

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2214 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-18 05:47:31 +00:00
ager@chromium.org
a7c970c529 Avoid needless creation of handles in regexp runtime routines and use
the stack instead.
Review URL: http://codereview.chromium.org/126268

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2202 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-17 11:44:25 +00:00
kasperl@chromium.org
40213b131f Optimize special cases of Math.pow().
Review URL: http://codereview.chromium.org/125245

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2201 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-17 11:06:32 +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
03356a0e60 Implemented fast case for NumberToString where the result is a single character string.
Review URL: http://codereview.chromium.org/126189

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2175 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-16 06:44:09 +00:00
kasperl@chromium.org
ce7cdbd799 Change the implementation of Math.random to use George
Marsaglia's multiply-with-carry instead of mixing the
bits obtained from calling the system random() twice.

This seems to be a bit faster and gives a better 
distribution than the system random() in particular on 
Windows. 
Review URL: http://codereview.chromium.org/126113

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2159 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-15 08:04:47 +00:00
sgjesse@chromium.org
63dced1331 Move the default return handling to please some versions of gcc.
TBR=ager@chromium.org
Review URL: http://codereview.chromium.org/125043

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2150 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-12 10:25:05 +00:00
sgjesse@chromium.org
882614391f Add scope chain information to the debugger.
For each frame it is now possible to request information on the scope chain. Each scope in the chain can have one of the types local, global, with and closure. For scopes of type global and with the mirror for the actual global or with object is available. For scopes of type local and closure a plain JavaScript object with the materialized content of the scope is created and its mirror is returned. Depending on the level of possible optimization the content of the materialized local and closure scopes might only contain the names which are actually used.

To iterate the scope chain an iterator ScopeIterator have been added which can provide the type of each scope for each part of the chain. This iterator creates an artificial local scope whenever that is present as the context chain does not include the local scope.

To avoid caching the mirror objects for the materialized the local and closure scopes transient mirrors have been added. They have negative handles and cannot be retrieved by subsequent lookup calls. Their content is part of a single response.

For debugging purposes an additional runtime function DebugPrintScopes is been added.

Added commands 'scopes' and 'scope' to the developer shell and fixed the dir command.

BUG=none
TEST=test/mjsunit/debug-scopes.js
Review URL: http://codereview.chromium.org/123021

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2149 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-12 10:03:25 +00:00
kmillikin@chromium.org
2d7d89d831 Get rid of the notion of "parameter pointer" that no longer exists in
the implementation but still lives on in comments and identifier
names.

Where it was used, it has been changed to "caller's stack pointer".
Review URL: http://codereview.chromium.org/118500

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2137 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-10 15:08:25 +00:00
ager@chromium.org
24d22b567a Introduce an API to force the deletion of a property ignoring
interceptors and dont-delete attributes.

Minor change to the behavior of eval: throw exception when calling
eval in a context for which the global has been detached.  This
matches the behavior of both Firefox and Safari post navigation in the
browser.
Review URL: http://codereview.chromium.org/118374

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2118 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-06-08 09:46:09 +00:00
sgjesse@chromium.org
8ed81aca8a Improve debugger property lookup.
before performing debugger property lookup make sure the current context is set to the context active before the debugger was entered.

Make the use of the LookupResult GC safe in debugger property lookup.
Review URL: http://codereview.chromium.org/115855

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2071 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-28 11:30:54 +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
yurys@chromium.org
6e29fadb72 When inspecting a function with a native getter return result of execution of the getter function in the client context. This is useful for debugging DOM elements.
Review URL: http://codereview.chromium.org/113821

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2044 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-25 15:07:21 +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
sgjesse@chromium.org
3e76ba9a78 Propagate information on whether a non function was called as constructor or not.The Arguments object passed to the callback now has IsConstructCall set accordingly.BUG=http://crbug.com/3285
Review URL: http://codereview.chromium.org/113634

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2020 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-20 19:33:44 +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
erik.corry@gmail.com
421b501fdb Add 2 asserts in search-replace implementation.
Review URL: http://codereview.chromium.org/115507

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1997 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-19 09:11:30 +00:00
lrn@chromium.org
2ff3901cf7 Fix for issue 349: Make initial boundary check for BM text search.
There was a case where the BMH algorithm bailed out exactly at the end of the string, and the BM algorithm that takes over wasn't expecting this.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1995 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-19 09:01:03 +00:00
sgjesse@chromium.org
5a82d8e3d4 Remove unused parameter.
Review URL: http://codereview.chromium.org/113523

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1990 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-18 13:16:48 +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
ager@chromium.org
57da353113 Consistently use CompilationZoneScope instead of ZoneScope to ensure
that the FrameElement constants list gets cleared.
Review URL: http://codereview.chromium.org/115352

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1953 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-14 13:17:28 +00:00
lrn@chromium.org
142fe3431a X64: General fixes - added inline definitions and changed some places to intptr_t.
Review URL: http://codereview.chromium.org/113199


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1913 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-12 10:33:40 +00:00
erik.corry@gmail.com
a3b2c7cf55 Fix intermittent crashes caused by unexpected GCs in
HasLocalProperty (bug introduced in r1882 et al.)
Review URL: http://codereview.chromium.org/115106

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1903 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-08 12:39:37 +00:00
erik.corry@gmail.com
275a27d6bd Fix Chromium bug 1717 by emulating JSCs somewhat strange hidden
prototypes on some built in types.
Review URL: http://codereview.chromium.org/109004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1882 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-06 12:54:57 +00:00
yurys@chromium.org
beb5161b84 Add function inferred name to FunctionMirror and its json representation.
Review URL: http://codereview.chromium.org/109026

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1871 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-05 18:12:03 +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
lrn@chromium.org
83d1d02df7 Made sort on non-arrays also affect elements on the prototype, for JSC compatability.
Made sort on non-objects with inherited elements JSC compatible.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1829 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-01 10:06:55 +00:00
lrn@chromium.org
889eac7f13 Fix Issue 326. Handle sorting of non-array objects correctly.
Change handling of sorting to be the same for all JS-arrays.
Collect undefined values as well while removing holes.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1800 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-27 11:16:59 +00:00
christian.plesner.hansen@gmail.com
4a909a7a62 - When cloning maps to set the 'lazy loading' bit remember to clone
the properties as well.  This fixes some failing tests.
- Moved json parsing into native code.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1789 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-24 12:45:29 +00:00
christian.plesner.hansen@gmail.com
d26e6dd0b4 force-set
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1751 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-21 13:28:11 +00:00
feng@chromium.org
19c95ff39a Fix style issues caught by presubmit script.
TBR = erikcorry

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1746 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-20 17:44:39 +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
sgjesse@chromium.org
f5eb2cbe65 Remove unused runtime function.
The CompileScript runtime function is not used by any builtins any more.
Review URL: http://codereview.chromium.org/80003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1744 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-20 12:15:27 +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
iposva@chromium.org
e05c2e3693 Start addressing massive arrays on the stack. There is hardly ever
a reason to stack allocate large chunks of stack space.
- Runtime_GetCFrames used to allocate a frame size of 52040 bytes.
- PreallocatedMemoryThread::Run used to allocate 32784 bytes.
- Fixed StringStream overflow conditions.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1729 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-16 21:01:05 +00:00
erik.corry@gmail.com
4d18959446 Avoid a call to the runtime system when doing binary fp ops on ARM
(at the moment only if we do not need to allocate a heap number).
Find a few more oportunities to avoid heap number allocation on IA32.
Add some infrastructure to test coverage of generated ARM code in our
tests.
Review URL: http://codereview.chromium.org/67163

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1720 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-04-16 09:30:23 +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
mikhail.naganov@gmail.com
d3c4a658f9 Fix issue 289: check external source strings validity in Runtime_DebugGetLoadedScripts
Review URL: http://codereview.chromium.org/56002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1630 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-27 11:22:52 +00:00
lrn@chromium.org
bd8816efb0 Moved String.prototype.match implementation to C++.
Some extra runtime assertions added.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1608 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-25 12:14:10 +00:00
ager@chromium.org
d4e6613760 Fix bug in context stores, where the store was ignored if there was a
read-only property in the prototype chain.  Stores should only be
ignored if there is a read-only property on the object itself.
Review URL: http://codereview.chromium.org/42508

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1584 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-24 08:27:43 +00:00
erik.corry@gmail.com
aa81281b3d Reapply portability fixes, this time without 64 bit system bug.
Review URL: http://codereview.chromium.org/52010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1574 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-23 12:37:53 +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
erik.corry@gmail.com
80ce1b2500 Reverse latest build tweaks since they fail on some 64 bit systems
TBR=ager

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1567 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-20 17:01:15 +00:00
erik.corry@gmail.com
77b963ca04 More compatibility changes.
Review URL: http://codereview.chromium.org/47004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1566 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-20 16:37:18 +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
c918bec9df Reuse output array instead of creating a new one for each call in Date.parse
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1544 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-19 09:40:38 +00:00
erik.corry@gmail.com
b37b9af182 Spolling.
Review URL: http://codereview.chromium.org/42327

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1543 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-19 09:12:24 +00:00
lrn@chromium.org
89f466659c Flatten strings before parsing them as Date strings, and work on Vector of chars instead.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1525 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-17 13:27:21 +00:00
sgjesse@chromium.org
37d7dcd20c Add thread information to the debugger.
Each thread running V8 code is assigned an id in thread local storage the first time V8 code is run in it. The thread information returned to the debugger contains the number of threads, the id of each of these threads and which one is the current thread.

Added a threads command to the developer shell debugger for showing information on threads.
Review URL: http://codereview.chromium.org/48009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1523 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-17 11:40:47 +00:00
erik.corry@gmail.com
223ea84e56 Lint...
Review URL: http://codereview.chromium.org/42276

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1522 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-17 10:46:53 +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
lrn@chromium.org
014f0fd841 ReplaceRegExpWithString: Avoid extending handle scope by adding scope inside loop.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1517 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-16 09:49:14 +00:00
erik.corry@gmail.com
99063fe0f8 Fix GC related crash bug in search-replace.
Review URL: http://codereview.chromium.org/42214

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1513 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-15 22:28:26 +00:00
erik.corry@gmail.com
3aa57f7f65 Revert 1432, 1433, 1469 and 1472 due to a bug with literal objects.
Review URL: http://codereview.chromium.org/46088

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1511 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-15 16:18:20 +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
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
olehougaard
860508f3e2 Optimizing generation of nested literals for both object and array literals.
Review URL: http://codereview.chromium.org/40295

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1469 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-10 08:59:00 +00:00
sgjesse@chromium.org
747e20c449 Mark the empty script object, the script for the empty function and the D8 utility script as native scripts.
This is mainly to avoid these scripts showing up in the debugger when showing normal scripts.

Removed the check for the empty script in the debugger function returning loaded scripts as this check only filtered out the empty script from the debugger context and not empty scripts in all other contexts. Also this filter did not take the script for the empty function into account.
Review URL: http://codereview.chromium.org/39322

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1443 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-03-09 08:44:59 +00:00