Commit Graph

532 Commits

Author SHA1 Message Date
erik.corry@gmail.com
f6df326714 Add 1-element caches to RegExp.exec and String.replace. We
probably want to remove this again if and when Dromaeo is
fixed so this strategy doesn't pay off.
Review URL: http://codereview.chromium.org/817001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4083 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-10 12:21:00 +00:00
peter.rybin@gmail.com
9c9451eff3 Check that function being patched has no activations on any thread stack
Review URL: http://codereview.chromium.org/668246

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4069 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-09 21:45:24 +00:00
sgjesse@chromium.org
800b6df2a6 Correct handling of adding a string and a smal integer
The fast case of looking up the string convertion of the smi did not handle the case where left/reghe operands could be in eax/edx instead of edx/eax which is the default.

Also got rid of creating an internal frame for calling string and instead patched the argument on the stack and performed a tail call.

BUG=http://code.google.com/p/v8/issues/detail?id=636
TEST=test/mjsunit/regress/regress-636.js
Review URL: http://codereview.chromium.org/720001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4061 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-09 09:40:35 +00:00
ricow@chromium.org
b60eba5fc5 Inline Math.sqrt().
Also changed name of GeneratePow and the %_ call name to follow convention based on MathSin and MathCos. Moved GeneratePow down to the other methods. 

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4054 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-08 13:23:54 +00:00
peter.rybin@gmail.com
a934eb1523 Quick fix for r4045
Review URL: http://codereview.chromium.org/668203

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4047 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-06 01:21:34 +00:00
peter.rybin@gmail.com
77d63cc29e Basic implementation of liveedit feature
Review URL: http://codereview.chromium.org/652027

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4045 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-05 22:08:58 +00:00
antonm@chromium.org
08a5332a55 Try to help the builder with the conflict.
TBR=sgjesse@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4043 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-05 15:23:30 +00:00
antonm@chromium.org
1bc04768a9 An attempt to fix the tests.
TBR=sgjesse@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4042 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-05 15:07:53 +00:00
antonm@chromium.org
bdee05b3ce Better diagnostic of tests.
Review URL: http://codereview.chromium.org/669160

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4041 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-05 14:51:24 +00:00
sgjesse@chromium.org
df4471c8f3 Fix stack tweaking in array allocation
When Array(0) or new Array(0) is handled by the generated code it is handled
by the same code as Array() and new Array(). For this to work the stack is
tweaked to remove the argument of value 0. However the argc was still passed
as 1 if a call to the runtime system was made.

When the stack is tweaked argc is also changed to 0.

BUG=634
TEST=test/mjsunittest/mjsunit/regress/regress-634.js
Review URL: http://codereview.chromium.org/668155

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4038 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-05 13:43:53 +00:00
vitalyr@chromium.org
48cc7ed3b0 Fixed filling of char array in StringToArray.
Review URL: http://codereview.chromium.org/669159

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4036 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-05 13:33:33 +00:00
kasperl@chromium.org
5c7fd0e59b Fix weird issue with test case where certain global function
names were being reused.
Review URL: http://codereview.chromium.org/669148

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4028 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-05 07:05:26 +00:00
antonm@chromium.org
61d2ebde63 Fix invalid fast return in splice when returned array is empty.
TBR=vitalyr@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4027 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-04 22:16:58 +00:00
antonm@chromium.org
56eb46e096 Fix a special case (zero length result array).
Review URL: http://codereview.chromium.org/669075

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4026 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-04 21:29:33 +00:00
sgjesse@chromium.org
bc890ec279 Added tests for issue 618
Review URL: http://codereview.chromium.org/668055

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4025 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-04 15:04:04 +00:00
oleg@chromium.org
d49a5db0a4 Fix broken test in WebKit test suite and add the test in question to V8 tests.
Review URL: http://codereview.chromium.org/661466

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3987 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-01 15:33:30 +00:00
vitalyr@chromium.org
dd7b55eb9f Implemented one-char cache lookup in generated code.
This speeds up string,charAt(n) and string[n].

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3980 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-26 20:14:20 +00:00
antonm@chromium.org
0c77912aaf Return length passed instead of receiver to allow chained assignments like
foo = a.length = 7

BUG=crbug.com/36854

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3979 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-26 16:12:39 +00:00
yurys@chromium.org
a47746d209 Add maxStrinLength argument to debugger requests
Review URL: http://codereview.chromium.org/647022

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3919 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-19 14:33:08 +00:00
ricow@chromium.org
27eaf97350 Added test for bug 619 - we should move this to object-define-property when the bug has been corrected.
Review URL: http://codereview.chromium.org/651028

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3918 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-19 13:27:43 +00:00
sgjesse@chromium.org
17e80e76e7 Add a test case for issue 618
Review URL: http://codereview.chromium.org/647014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3898 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-18 13:01:58 +00:00
whesse@chromium.org
b9a250d2e6 Fix error in compound assignment to keyed load by making platform-independent full compiler code platform dependent, add test of compound assignments.
Review URL: http://codereview.chromium.org/646009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3897 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-18 12:59:41 +00:00
sgjesse@chromium.org
97d842fa1e Fix issues with commit r3839
Fix broken condition.
Fixe some style issues.
Re-enabel part of a test which was turned off.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3894 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-18 09:41:47 +00:00
sgjesse@chromium.org
ecf4b9fc76 Refactor the check for generating inline constructors
Moved all the logic to a function on SharedFunctionInfo (including the flag check) to make things more readable.

Changed the check for setter to do a lookup for a named setter for each of the properties assigned in the constructor.

Added tests using accessors and interseptors set through the API.

Added fast case objects to the mjsunit test.

TEST=test/mjsunit/setter-on-constructor-prototype.js
TEST=test/cctest/test-api/SetterOnConstructorPrototype
TEST=test/cctest/test-api/InterceptorOnConstructorPrototype
Review URL: http://codereview.chromium.org/619006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3893 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-18 09:07:03 +00:00
antonm@chromium.org
a346644121 Adding checks for the cases when array grows too big.
Review URL: http://codereview.chromium.org/601092

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3887 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-17 13:04:30 +00:00
antonm@chromium.org
be21c71584 Introduce Array.splice builtin.
Review URL: http://codereview.chromium.org/618002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3885 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-17 10:54:49 +00:00
antonm@chromium.org
210e02442e Renaming test/mjsunit/array-splice.js to test/mjsunit/array-functions-prototype-misc.js.
The test array-splice.js following array-shift, array-slice etc would be added in
next commit.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3884 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-17 10:48:29 +00:00
kmillikin@chromium.org
3c0d77f32e Fix stack corruption when calling non-function.
Fix for issue 603.

Revision r3484 removed the property name from the call stack for
call ICs.  When a non-function was called via a call IC and
Function.prototype.call, an extra value was left on the stack that the
caller could not know to clean up.

Fix is to change the JS builtin used for calling non-functions.  It
now gets the callee as receiver, rather than iterating stack frames
and finding it on the expression stack of its JS caller.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3882 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-17 08:26:50 +00:00
antonm@chromium.org
087fedeae8 Normalize the object before updating getter/setter info.
BUG=612

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3880 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-17 06:53:19 +00:00
sgjesse@chromium.org
1c2b2ac9c6 Fix construction of simple objects with setters on prototype
Simple objects which are constructed without calling the actual constructor function did not take setters defined on prototype chain of the new object into account.

Constructing objects this way is now not done if there are setters involved on the prototype chain of the new object.

This only fixes the case where the setter is found when the first object from a constructor is created. If the prototype chain is changed new objects will on take any change to setters into account.

TEST=test/mjsunit/setter-on-constructor-prototype.js
Review URL: http://codereview.chromium.org/606062

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3879 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-17 06:28:33 +00:00
antonm@chromium.org
ea1b4f0eb1 Introduce builtin for Array.slice function.
Review URL: http://codereview.chromium.org/604059

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3871 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-16 12:14:23 +00:00
yurys@chromium.org
0630b1fd9f Object.getOwnPropertyNames should return string names for indexed properties
Land original change by pfeldman: http://codereview.chromium.org/596117
Review URL: http://codereview.chromium.org/596124

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3866 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-16 10:08:39 +00:00
antonm@chromium.org
e02a5aa602 Introduce builtin for Array.unshift function.
Review URL: http://codereview.chromium.org/600124

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3859 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-15 13:25:06 +00:00
antonm@chromium.org
976ab7d7b5 Elaborating test for Array.shift a bit.
Review URL: http://codereview.chromium.org/596116

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3855 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-15 12:01:46 +00:00
antonm@chromium.org
01b1176e08 Introduce builtin for Array.shift function.
Review URL: http://codereview.chromium.org/606017

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3853 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-15 09:17:38 +00:00
yurys@chromium.org
f5eb70e411 Land 598061(Process //@ scriptURL=url comment for scripts that don't have name set)
Review URL: http://codereview.chromium.org/596088

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3850 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-12 17:17:13 +00:00
lrn@chromium.org
2e6ab729ef Added optimization for div/mod by constant power of 2.
Review URL: http://codereview.chromium.org/597059

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3844 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-12 13:37:10 +00:00
fschneider@chromium.org
4a2c81d3b0 Add last use data flow information to the fast code generator.
This change add simple local live variable information to 
the fast code generator.  It supports only AST nodes that 
are accepted by the syntax checker.

Each variable use points to a variable definition structure
which contains the last use of the definition.

To determine whether a variable is live after a certain point
we can check whether its last use occurs later in the evaluation
order defined by the AST labeling number.

The new information is currently only printed out together with
the IR and not yet used for code generation.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3839 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-12 10:16:30 +00:00
kmillikin@chromium.org
29776256ab Add a regression test for chromium issue 35344.
Review URL: http://codereview.chromium.org/600069

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3837 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-12 08:10:25 +00:00
kmillikin@chromium.org
b04a26dc31 Harden global variable accesses in the fast code generator.
Explicitly check that global variables do not have accessors or
interceptors in the fast code generator syntax checker.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3828 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-10 13:46:15 +00:00
kmillikin@chromium.org
30cf88af6b Restrict the syntax that we aggressively optimize.
Do not use the speculative compiler for functions with other than one
statement in the body, and do not use it if subexpressions can have
side effects.  Bailing out to the beginning of the full code is not
sound if side effects have already occurred.

Add tests that would fail without the restrictions.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3826 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-10 09:18:55 +00:00
kmillikin@chromium.org
9b5c312bfc Initial implementation of fast path operation for bitwise OR.
Support a binary operation (bitwise OR) so long as it's not nested in
the left subexpression.  This ensures that the expression stack never
has height greater than two and so can be kept fully in registers.

The bounded expression stack height and the absence of any side
effects on the fast path allows us to still bailout out to the very
beginning of the function if any of our fast-path checks fail.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3822 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-09 13:44:43 +00:00
ricow@chromium.org
df1df78c48 Changed fuzzer to randomly remove half of the arguments when running
on functions that takes five or more arguments. Original version runs
for a long time when there is 5 arguments in a runtime function (45+
seconds). The fuzzer can be run with all arguments on all functions
regardless of the number of arguments by setting
RUN_WITH_ALL_ARGUMENT_ENTRIES to true in fuzz-natives.js


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3819 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-09 12:15:34 +00:00
mikhail.naganov@gmail.com
5ebc1a68ef Fix tests after r3811.
TBR=sgjesse@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3813 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-08 08:55:01 +00:00
fschneider@chromium.org
2f0f6face1 Fast compiler: Load globals variables directly from property cells.
This is a first step towards loading globals directly from property cells instead
of going through a load IC.

This change supports only properties with the DontDelete attribute since
we are only able to bailout into the generic code generated by the secondary 
code generator the beginning of a function. The resulting fast-case code is 
specialized for a specific context. When invoked with a different global object, 
it will always bailout to the secondary code.

When loading a property that does not exist at compile-time or a property
that is deleteable we still generate the generic load IC.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3808 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-05 13:57:18 +00:00
sgjesse@chromium.org
a6a7c75ae0 MIPS port initial commit
This is the first step in the MIPS port of V8. It adds assembler, disassembler and simulator for the MIPS32 architecture.

Contains stubbed out implementation of all the compiler/code generator infrastructure to make it all build.

Patch by Alexandre Rames from Sigma Designs Inc.

This is the landing of http://codereview.chromium.org/543161.
Review URL: http://codereview.chromium.org/561072

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3799 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-04 20:36:58 +00:00
ricow@chromium.org
a28143c77c Added extra tests to the DefineOrRedefineAccessorProperty and
DefineOrRedefineDataProperty to avoid invalid input.

Added tests to object-define-property.js to test that it does not crash 
on invalid input. 


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3798 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-04 19:43:56 +00:00
ricow@chromium.org
4f179b09ba Added IsProperty() check to result in DefineOrRedefineAccessor - if no check
this causes the debug check to fails since type() asserts that the 
lookup_type != NOT_FOUND. This does not change any functionality since we 
explicitly checked if it was one of the three types that we need to delete.
Also changed defineProperties in v8natives to actually return the object
being defined (as specified by spec)

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3794 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-04 11:28:03 +00:00
lrn@chromium.org
f0ef4d7bac ARM: Implement native substring copying.
Review URL: http://codereview.chromium.org/552186

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3793 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-04 09:11:43 +00:00