Commit Graph

290 Commits

Author SHA1 Message Date
sgjesse@chromium.org
91cfb3730a Add generated code for ascii string comparison
Careted a stub for string comparison and used part of the code from that to inline string comparison in the compare stub.
Review URL: http://codereview.chromium.org/525115

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3569 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-08 11:58:15 +00:00
lrn@chromium.org
2cb1f8271f Fix potential length-miscalculation in %StringBuilderConcat.
Review URL: http://codereview.chromium.org/521074


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3568 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-08 11:27:37 +00:00
lrn@chromium.org
40d6cbca89 Forgot patch to make it compiler on Linux.
Review URL: http://codereview.chromium.org/525087


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3562 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-07 14:04:56 +00:00
lrn@chromium.org
dddadf9f7e Fixed potential length miscalculations by limiting max size of arrays and strings.
Review URL: http://codereview.chromium.org/525064

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3560 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-07 13:17:18 +00:00
fschneider@chromium.org
c4416d628d Fix runtime function StringCharAt where an argument was not checked.
Review URL: http://codereview.chromium.org/523126

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3559 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-07 12:31:45 +00:00
fschneider@chromium.org
903301248e Improve keyed loads on strings by using a new stub.
Instead of going through a runtime function for keyed loads
on strings we invoke a separate specialized stub that
assumes string as receiver type and the key to be a number.

The stub calls a JS builtin function to return the corresponding one-character string.


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3556 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-07 10:25:20 +00:00
sgjesse@chromium.org
3d36c712aa Use generated code to create sub strings.
Added a stub to allocate and fill a string object with a substring from another string.

Use the rep movs instruction to copy the string data as it turned out to be the fastest way.

While preparing this I experimented with some SSE2 instructions, so the instructions movdqa and movdqu are still in the IA-32 assembler even though they are not used.
Review URL: http://codereview.chromium.org/525085

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3554 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-07 09:59:37 +00:00
kasperl@chromium.org
1fdbaa1d10 Improve performance of Array.prototype.join and String.prototype.substring
by tweaking the JavaScript implementation of these functions.
Review URL: http://codereview.chromium.org/519061

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3545 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-06 14:40:21 +00:00
bak@chromium.org
0ba452b5c6 - Fixed a bug in the array concat implementation causing the elements in the result to be lost.
Review URL: http://codereview.chromium.org/523055

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3538 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-05 12:33:55 +00:00
kasperl@chromium.org
15fe7a8ad6 Make the ResolvePossiblyDirectEval faster by avoiding the
stack traversal code.
Review URL: http://codereview.chromium.org/523051

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3533 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-05 09:38:02 +00:00
fschneider@chromium.org
fd03f6c153 Faster handling of string indexing using [] with a SMI index.
Instead of falling back to calling GetObjectProperty we call GetCharAt
directly if the object is a string and the key in a SMI.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3528 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-28 13:01:03 +00:00
kasperl@chromium.org
b1721d4c3e Improve performance of allocating closures for nested
functions by allocating them in new space without
entering the runtime system.
Review URL: http://codereview.chromium.org/506037

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3477 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-16 15:43:20 +00:00
iposva@chromium.org
fe952d7237 - Ensure the stack trace limit is not negative.
- Enable fuzzing of the CollectStackTrace runtime call.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3451 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-10 18:33:34 +00:00
fschneider@chromium.org
4dee8d81bd Create literal boilerplate as part of cloning in the top-level compiler.
When generating code for object and array literals we performed
the check if the a boilerplate already exists in generated code.

In the top-level compiler we now do this check in a new runtime
function. This makes the generated code more compact for top-level code.


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3437 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-09 13:06:08 +00:00
kmillikin@chromium.org
7266bd0b9a Fix issue 540 by handling the case that a declaration is in the
arguments object.

See http://code.google.com/p/v8/issues/detail?id=540
Review URL: http://codereview.chromium.org/460070

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3421 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-04 11:59:09 +00:00
mikhail.naganov@gmail.com
d84d47961a When executing 'profile' request, delegate to api function, not to internal one.
Review URL: http://codereview.chromium.org/466006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3403 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-03 08:44:33 +00:00
sgjesse@chromium.org
53fbd5932a Perform string add in generated code on IA-32 platforms
This adds a code stub which can do most of what Heap::AllocateConsString can do. It bails out if the result cannot fit in new space or if the result is a short (flat) string and one argument is an ascii string and the other a two byte string. It also bails out if adding two one character strings as Heap::AllocateConsString has special handling of this utilizing the symbol table. The stub is used both for the binary add operation and for StringAdd calls from runtime JavaScript files. Extended the string add test to cover all sizes of flat result stings.
Review URL: http://codereview.chromium.org/442024

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3400 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-03 07:56:21 +00:00
mikhail.naganov@gmail.com
dd38c22699 Add pause / resume profiling commands to debugger protocol.
This allows to profile "unresponsive" web pages in the same way
as it is possible to break into them with the debugger.

BUG=http://code.google.com/p/chromium/issues/detail?id=28689

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3382 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-30 14:56:20 +00:00
antonm@chromium.org
93d6199de0 When processing global vars initialization account for the case of splitted
global object (using hidden prototypes):

1) setters might be not on the global object itself, but on its prototypes;
2) if property on one of prototypes is readonly, we could shadow it.
Review URL: http://codereview.chromium.org/434035

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3362 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-25 15:45:37 +00:00
sgjesse@chromium.org
4bc5aee624 Fix compilation error in r3350
TBR=ager@chromium.org
Review URL: http://codereview.chromium.org/435021

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3352 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-24 14:45:27 +00:00
sgjesse@chromium.org
eb4d261e24 Remove the different length string types
The different length string types was used to encode the string length and the hash in one field. This is now split into two fields one for length and one for hash. The hash field still encodes the array index of the string if it has one. If an array index is encoded in the hash field the string length is added to the top bits of the hash field to avoid a hash value of zero.

On 32-bit this causes an additional 4 bytes to be used for all string objects. On 64-bit this will be half on average dur to pointer alignment.
Review URL: http://codereview.chromium.org/436001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3350 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-24 14:10:06 +00:00
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
ager@chromium.org
3cf9ce4736 Fix crash in string replace with regexp. If the suffix of the subject
string is larger than 2047 chars we will encode the slice as two Smis
instead of one.  The calculation of the max size of the string builder
did not take this into account.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3334 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-18 18:48:04 +00:00
lrn@chromium.org
1bc9a21e9a Sorry, this should have gone to http://codereview.chromium.org/391014
I added some tests and swapped the lhs and rhs of the && operator in v8natives.js as requested.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3319 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-17 13:54:05 +00:00
erik.corry@gmail.com
41749529dd Speed up charCodeAt on very large cons strings, by insisting on
flattening the strings and not trying too hard to traverse a big
cons tree from generated code.
Review URL: http://codereview.chromium.org/402008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3317 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-17 10:28:04 +00:00
christian.plesner.hansen@gmail.com
d5ca1178cb Fixed a few cases where allocators did not respect always_allocate,
potentially leading to bogus FatalProcessOutOfMemory situations.  Also
fixed a few cases where callers relied on getting a NewSpace object
back (to avoid write barrier overhead) which they can't when
always_allocate is in effect.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3285 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-11 15:25:51 +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
yurys@chromium.org
cd9660f77c All hidden properties of an object are stored in a value of a regular property with empty name. This property may confuse user if returned among regular properties. It should not be exposed directly by ObjectMirror. Should we want an access to these properties from debugger we need to implement an explicit method for that.
Current patch filters the hidden_symbol from property names returned to ObjectMirror.

See http://crbug.com/26491

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3265 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-10 16:13:21 +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
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
sgjesse@chromium.org
b4c11d0816 Don't use string slices when processing RexExp replace (re-apply r3153)
Re-apply r3153 with a fix for issue 490. Except for the change in line 1756 and the added test this change is identical to http://codereview.chromium.org/342015.

BUG=490
TEST=test/mjsunit/regress/regress-490.js
Review URL: http://codereview.chromium.org/341064

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3197 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-02 12:21:43 +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
9b6a1cca5d Reverting 3153
TBR=erik.corry@gmail.com
Review URL: http://codereview.chromium.org/341031

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3170 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-29 07:31:23 +00:00
sgjesse@chromium.org
abbc6b9147 Don't use string slices when processing RexExp replace.
String slices from RegExp replace results is now encoded in either one or two smis. Substrings are not used any more.

If the existing one smi encoding cannot hold the start/length information two smis are used the first having the negative length and the second having the start.

This is in preparation for removing string slices.
Review URL: http://codereview.chromium.org/342015

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3153 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-28 09:11:45 +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
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
lrn@chromium.org
6f1d641fb6 X64/Win64: Alternative implementation of fmod in general.
Review URL: http://codereview.chromium.org/303034


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3116 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-23 09:18:19 +00:00
kbr@chromium.org
d5f00cf6cc Add optimized ICs for new CanvasArray types introduced in WebGL
specification under development. This is a follow-on CL to
http://codereview.chromium.org/293023 .

Based on review feedback, defined the behavior of storing NaN and
+/-Infinity into external arrays of integer types as storing 0. Added
test cases. Added fucomi instruction to assembler. Fixed bug in
KeyedLoadIC::GenerateExternalArray when allocation of HeapNumber
failed. Fixed bug in encoding of 16-bit immediate arithmetic
instructions in 64-bit port.

Removed raising of exceptions for negative array indices passed to
external arrays and associated tests. Based on current discussion in
WebGL working group, will probably end up removing the exception
throwing altogether.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3113 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-22 14:49:00 +00:00
kmillikin@chromium.org
fbc0eaa13d Added support for array literals to the toplevel compiler. They are
currently compiled the same as with the optimizing compiler: they are
cloned from a boilerplate object and the boilerplate objects are
lazily constructed.

Also changed argument pushing on ARM to use stm (store multiple),
which required changing the order of arguments to the runtime
functions DeclareGlobals and NewClosure.  They were only used from
generated code.

Finally, changed the toplevel code generator so that stack pops to
discard a temporary became addition to the stack pointer on ia32 and
x64.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3110 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-22 10:07:45 +00:00
peter.rybin@gmail.com
d8f7b36624 Add "Version" command
Review URL: http://codereview.chromium.org/274080


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3108 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-21 17:07:43 +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
kmillikin@chromium.org
6f5ed57683 Untangle some #include dependencies.
"jsregexp.h" and "jump-target.h" required "macro-assembler.h" to
always be included first.  Instead the include of "macro-assembler.h"
has moved into those header files.

"dateparser-inl.h" required "dateparser.h" to always be included
first.  Instead the include of "dateparser.h" has moved into
"dateparser-inl.h".

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3074 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-15 15:01:36 +00:00
christian.plesner.hansen@gmail.com
f1354a299e Add trim, trimLeft and trimRight methods to String
Based on a recent patch for Webkit.
trim is defined in ES 5 section 15.5.4.20.

Author: Jan de Mooij <jandemooij@gmail.com>


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3052 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-13 08:13:45 +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
christian.plesner.hansen@gmail.com
2c51696fc3 Changed Object.keys to return strings for element indices.
Review URL: http://codereview.chromium.org/246077


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3012 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-02 13:43:16 +00:00
ager@chromium.org
e9acdc7a00 Follow the spec in disallowing function declarations without a name. We
used to allow these for compatibility, but both Safari and Firefox now
disallow them.
Review URL: http://codereview.chromium.org/242124

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3009 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-02 12:47:15 +00:00
ager@chromium.org
576ae4c115 Land change by Jan de Mooij to change the toString behavior of
|function|.toString() for builtin functions.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2913 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-09-17 11:11:01 +00:00
sgjesse@chromium.org
40471b41da Fix GC bug and ARM simulator timeout.
In the Runtime_DebugGetPropertyDetails the raw object pointers from a LookupResult could be used after a GC might have happened. Fixed the bug and restructured the code to make it less likely for changes to the code to re-introduce the bug.

Skipped a long running test from the ARM simulator in debug mode (and renamed the test).
Review URL: http://codereview.chromium.org/204039

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2902 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-09-16 13:09:26 +00:00
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