Commit Graph

672 Commits

Author SHA1 Message Date
antonm@chromium.org
7f1eda50cc Implement a custom call compiler for Array.pop.
Review URL: http://codereview.chromium.org/870007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4118 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-12 13:45:31 +00:00
sgjesse@chromium.org
16bfc31317 Fix issues with compiling V8 with LLVM Clang
Added this-> in some places where accessing a method on a templated base class.

Added #include <strings.h> for bit_cast, moved it to utils.h and renamed it to BitCast.

Patch by Evan Martin <evan@chromium.org>, see http://codereview.chromium.org/894001 and http://codereview.chromium.org/888003
Review URL: http://codereview.chromium.org/888005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4111 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-12 10:20:01 +00:00
whesse@chromium.org
44d0112b71 Add SSE2 instructions to disassembler and movmskpd SSE2 instruction to assembler.
Review URL: http://codereview.chromium.org/865002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4110 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-12 08:36:01 +00:00
ager@chromium.org
d6e08a41f6 Probe number dictionaries in generated code on ia32.
With my previous change to limit memory for object literals, we get more slow-case elements and this makes up for the slowdown when loading from those slow-case elements.

The most complicated part here is the computation of the integer hash code.  We might want to simplify the integer hash function.
Review URL: http://codereview.chromium.org/857003

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4108 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-11 16:24:31 +00:00
antonm@chromium.org
21af2c360a Reland 4068 which wrapped Array methods into native builtins (reverted in 4075).
Review URL: http://codereview.chromium.org/857002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4104 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-11 13:13:21 +00:00
ager@chromium.org
ef371f3f24 Do not waste space for the fast-case elements backing storage for
object-literals with few elements but large element indices.

We can decide at parse time whether the created object literal should
have fast-case of slow-case elements.

Remove unused runtime function.
Review URL: http://codereview.chromium.org/805004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4100 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-11 10:34:29 +00:00
fschneider@chromium.org
7d933936d3 Fix assigned variables analysis.
This change fixes a bug with the arguments object that occurred with
r4087 and r4088. The fix is not marking the arguments variable as trivial
since it can have side effects.


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4099 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-11 10:28:40 +00:00
sgjesse@chromium.org
e5f27966dc Add fuzzing support for inline runtime functions
The inline runtime functions are now included in the fuzzing of the natives. The chack for the expected number of arguments passed have been moved to the parser which will generate a syntax error if a runtime function (either C++ or inline) is called with a different number of arguments than expected.
Review URL: http://codereview.chromium.org/573056

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4096 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-11 09:27:12 +00:00
whesse@chromium.org
a77411bc70 Revert changes 4088 and 4087 to fix build.
Review URL: http://codereview.chromium.org/805005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4089 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-10 20:41:11 +00:00
fschneider@chromium.org
0143d707a6 Add an assigned variables analysis.
This change adds a pass over the AST that computes the
set of assigned variables for locals and parameters for each expression.

The result of this analysis is used to for two purposes:
1. Recognize variables that are trivial subexpressions. A left sub-expression
   of a binary operation is trivial if it is a local variable or a parameter
   and it is not assigned in the right sub-expression. In the case of a 
   trivial left sub-expression we evaluate the right first.
   Currently only binary operations and compare operations are considered
   when finding trivial left sub-expressions.

2. Recogize certain simple for-loops with a constant trip count where the loop
   variable is always within smi range. If the loop count variable is not
   assigned in the body of the loop (except in the update expression the
   for-loop). This allows omitting smi checks on operation using the loop
   count variable.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4087 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-10 17:19:22 +00:00
ager@chromium.org
5fd33c7527 Revert change to always call builtins for Array functions.
It causes regressions on test shell tests.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4075 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-10 08:45:00 +00:00
antonm@chromium.org
52ec954dd2 Always invoke C++ ArrayPush builtin.
Now this builtin checks if it should go into fast case or resort to JS ArrayPush builtin.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4068 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-09 15:43:04 +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
vegorov@chromium.org
6b47d26217 Port of changes from r3842 (symbol table probing for two character strings) to x64 and arm
Review URL: http://codereview.chromium.org/661469

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4050 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-08 11:58:33 +00:00
erik.corry@gmail.com
00a44ae51a Make more use of the NumberInfo data.
Makes NumberInfo into a real class.
Fix bug where NumberInfo was lost in ToRegister.
Allow 17 bits in safe Smis instead of 16.
Review URL: http://codereview.chromium.org/668151

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4046 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-05 23:54:13 +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
ricow@chromium.org
d3cf6cbf75 Added new ia32 assembler instructions to the diassembler from Math.pow inline implementation.
Review URL: http://codereview.chromium.org/668056

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4020 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-04 12:51:49 +00:00
fschneider@chromium.org
b0e9a9203f Remove a duplicated move instruction for store IC calls on ia32.
Review URL: http://codereview.chromium.org/661461

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4004 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-03 11:43:45 +00:00
antonm@chromium.org
bfe1f02c3f Add cld before doing rep movs.
Review URL: http://codereview.chromium.org/661368

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3996 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-02 13:22:04 +00:00
antonm@chromium.org
38acad676a Faster filling newly allocated arrays with the holes from the Array construction stub.
Review URL: http://codereview.chromium.org/661245

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3995 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-02 12:42:15 +00:00
erik.corry@gmail.com
c2106c13fc Allow snapshots built without -DANDROID to work on Android.
Fix bug in fast code generator on ARM (can't use ip as scratch
in RecordWrite).
Activate normal-sized compilation cache on Android.
This is a port of 3938 from the partial snapshots branch.
Review URL: http://codereview.chromium.org/652227

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3992 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-02 11:54:11 +00:00
peter.rybin@gmail.com
aec90d099e Enable GC update for pointers in GenerateKeyedLoadICDebugBreak
Review URL: http://codereview.chromium.org/660257

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


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3988 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-01 16:24:05 +00:00
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
fschneider@chromium.org
1d330492af Make another small virtual frame function inlined.
Move a constructor to the platform-independent -inl.h file.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3975 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-26 14:02:29 +00:00
ricow@chromium.org
46440e6f77 Moved initialization of xmm3 making sure it is initialized on all paths in GeneratePow - solves the sputnik failure on mac.
Review URL: http://codereview.chromium.org/661177

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3973 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-26 12:28:25 +00:00
ricow@chromium.org
def4980625 Changed GeneratePow ensure xmm1 is loaded with y before making the test for NaN
Review URL: http://codereview.chromium.org/660172

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3966 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-26 11:09:06 +00:00
ricow@chromium.org
496868722f Added fast support for Math.pow. This simply calculates the result using the
same method as the old powi version in runtime.cc and also checks if
the exponent is 0.5 or -0.5 in which case we calculate the square root or 
reciprocal value of the square root.


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3964 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-26 10:24:58 +00:00
fschneider@chromium.org
893637a057 Inlining a few virtual frame functions.
Introducing a virtual-frame-inl.h file containing some platform-independent
virtual frame function which are small enough to be inlined.

Removed unnecessary #include of virtual-frame.h from register-allocator-inl.h
and added the necessary explicit includes in a number of files.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3962 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-26 09:32:48 +00:00
whesse@chromium.org
a3a3a1f0be Change KeyedStoreIC interface to take value, key, and receiver in registers.
Review URL: http://codereview.chromium.org/608031

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3955 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-25 18:04:25 +00:00
serya@chromium.org
164daeda7a Adding 'static const' for arg numbers used with CallCFunction.
Review URL: http://codereview.chromium.org/660078

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3950 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-25 13:06:05 +00:00
serya@chromium.org
2c872c26fd AllignFrame/CallCFuntion moved from regexp-macro-assembler-ia32 to macro-assembler-ia32 (like in x64 version).
Review URL: http://codereview.chromium.org/657080

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3947 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-25 12:18:55 +00:00
vitalyr@chromium.org
e76f06a1e2 Fix miss in smi check when doing fast api call.
BUG=http://crbug.com/36604

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3942 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-24 19:26:10 +00:00
vitalyr@chromium.org
3d76502914 Fix uninitialized memory read in CallOptimization.
BUG=http://crbug.com/36602

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3941 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-24 19:14:21 +00:00
serya@chromium.org
43d074985a Review URL: http://codereview.chromium.org/652118
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3937 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-24 08:33:51 +00:00
whesse@chromium.org
ce1f6b2a3c Add comment to generated code that says which code generator compiled it.
Review URL: http://codereview.chromium.org/652110

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3932 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-23 12:40:36 +00:00
lrn@chromium.org
3135110af8 IA32: Native access to TranscendentalCache for sin/cos.
Review URL: http://codereview.chromium.org/652041

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3929 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-23 10:29:02 +00:00
whesse@chromium.org
d931c9b70a Improve stores to global variables.
Review URL: http://codereview.chromium.org/650028

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3921 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-19 15:04:16 +00:00
kmillikin@chromium.org
a9202fc45d Begin using a list of bailouts instead of a singleton in the fast code generator.
A list of bailout descriptions is kept in the CompilationInfo
structure that is shared between the primary and secondary code
generators.  The primary adds a description to the list for each
bailout position.

Responsibility for binding labels is moved from the primary to the
secondary code generator. All the labels still target the start of the
secondary code and the compilation state of the primary is still
ignored.

Move the compilation mode flag to the CompilationInfo.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3920 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-19 14:52:39 +00:00
vitalyr@chromium.org
c03db75853 Some string optimizations:
* Inlined checks for strings and regexps.
 * Rewrote split for the non-regexp case.
 * Implemented one-char case for lastIndexOf.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3917 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-19 13:07:37 +00:00
kmillikin@chromium.org
49a336e5be Reorder code in fast-codegen-ia32.cc.
Reorder code so that helper functions and simple accessors come before
all the visit function.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3912 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-19 11:39:12 +00:00
whesse@chromium.org
d2dd02152c Improve load of global variables.
Review URL: http://codereview.chromium.org/651019

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3911 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-19 10:05:33 +00:00
fschneider@chromium.org
62d62cb8e2 Fix missing includes.
TBR=kmillikin@chromium.org, 
Review URL: http://codereview.chromium.org/650025

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3909 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-19 09:59:47 +00:00
fschneider@chromium.org
226769d8bf Temporarily move the ia32 fast code generator into the platform-specific directory.
This allows us to make changes to one platform without affecting the others.


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3907 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-19 09:17:37 +00:00
kmillikin@chromium.org
e1041c9f9c Introduce 'trivial' expressions, use them for this property assignments.
Add a (currently) syntactic predicate to AST expression nodes telling
whether they are 'trivial'.  Trivial expressions have no side effects,
do not require storage to be allocated for them, and can be evaluated
out of order (because their value does not change between when they
are visited by the code generator as expressions in the AST and when
it is consumed).

Mark 'this' and literals as trivial.  Allow them to be pushed on the
virtual frame.  Make use of them to push 'this' more lazily in this
property assignments.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3906 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-19 09:01:31 +00:00
antonm@chromium.org
f70dd176a6 Make setting length on arrays faster.
Review URL: http://codereview.chromium.org/647013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3902 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-18 17:30:32 +00:00
ager@chromium.org
806c15e4b5 Remove the LookupResult IsValid method because it is confusing.
Replaced IsValid by IsPropertyOrTransition and used IsProperty in most
of the places where IsValid was used before.  Most of the time when
inspecting a lookup result we really want to know if there is a real
property present.  Only for stores are we interested in transitions.

BUG=http://crbug.com/20104
TEST=cctest/test-api/NamedInterceptorMapTransitionRead
Review URL: http://codereview.chromium.org/647015

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3901 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-18 15:10:35 +00:00
kmillikin@chromium.org
e5584e45e2 Refactor assignments in the ia32 code generator.
Change compilation of assignment expressions in the ia32 code
generator to no longer use the Reference helper class.  This gives us
more explicit control over which subexpressions are evaluated and
when.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3899 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-18 13:02:17 +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
whesse@chromium.org
70c7e513af Change KeyedLoadIC interface on ia32 to take receiver and name in registers.
Review URL: http://codereview.chromium.org/601080

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3895 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-18 10:09:54 +00:00
kmillikin@chromium.org
68246ec4a9 Remove a generated mov and jmp.
Remove a move and jump from the fast-path code in the speculative
backend. Ultimately, this code belongs to the bailout and not the
fast path.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3890 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-17 14:18:47 +00:00
whesse@chromium.org
1b526cc700 Remove obsolete bug TODO
Review URL: http://codereview.chromium.org/618006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3888 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-17 13:16:53 +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
fschneider@chromium.org
fc67ad346a Pass the complete number type information into the GenericBinaryOpStub.
Currently we only pass a boolean parameter indicating whether
the input operands to the GenericBinaryOpStub are guaranteed
to be numbers or not. 

Instead we pass the complete number type as a parameters. This 
allows to use more precise type information for code generation
in the stub.

Also make the computation of the result type more precise and correct on both ia32 and x64.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3873 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-16 13:03:16 +00:00
sgjesse@chromium.org
58207806fe Fix inline NumberToString
Glitch in pre-commit cleanup.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3868 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-16 11:16:10 +00:00
ager@chromium.org
51b5df388c Port arguments object allocation in generated code to ARM and x64.
BUG=v8:611
Review URL: http://codereview.chromium.org/605024

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3867 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-16 10:50:56 +00:00
sgjesse@chromium.org
6093d0dbf5 Inline NumberToString
NumberToString in runtime JavaScript is inlined through a call to a stub. Currently the stub only checks the number string cache and only if the number is a smi. Code is shared with the inlining of number string cache lookup when adding a smi to a string.
Review URL: http://codereview.chromium.org/604062

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3865 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-16 09:41:11 +00:00
kmillikin@chromium.org
edfc3c31b3 Remove printf committed by mistake
Review URL: http://codereview.chromium.org/600126

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3863 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-16 07:54:28 +00:00
fschneider@chromium.org
dbe99e405a Introduce number type information in the virtual frame.
Each frame element gets a new attribute with number type information. A frame element can be: 

- smi 
- heap number 
- number (i.e. either of the above) 
- or something else. 

The type information is propagated along with all virtual frame operations. 
Results popped from the frame carry the number information with them.

Two optimizations in the code generator make use of the new 
information: 
- GenericBinaryOpSyub omits map checks if input operands are numbers. 
- Boolean conversion for numbers: Emit inline code for converting a number (smi or heap number) to boolean. Do not emit call to ToBoolean stub in this case.


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3861 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-15 14:24:38 +00:00
kmillikin@chromium.org
a2bb215611 Change the interface of CallStubCompiler::CompileCallInterceptor.
Move responsibility for a typecast into the caller so that it can be
locally verified to succeed.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3858 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-15 13:20:49 +00:00
antonm@chromium.org
3d4d5e9e34 Refactoring various pieces of post interceptor caching.
Review URL: http://codereview.chromium.org/596096

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3857 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-15 12:32:27 +00:00
kmillikin@chromium.org
61ce433d82 Change interface to CodeGenerator::LoadFromSlot.
Change the interface to LoadFromSlot, LoadFromSlotCheckForArguments,
and LoadFromGlobalSlotCheckExtensions in the ia32 classic code
generator.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3849 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-12 16:39:07 +00:00
antonm@chromium.org
62a9497787 Compile very thin code to access objects on which indexed interceptor is set.
Review URL: http://codereview.chromium.org/603028

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3847 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-12 14:21:18 +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
sgjesse@chromium.org
e60efbff28 Optimize string plus smi
When adding a string with a smi value the number string cache is checked in generated code. If the there is a string value in the number string cache the resulting string is produced in generated code.
Review URL: http://codereview.chromium.org/596082

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3843 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-12 11:55:04 +00:00
sgjesse@chromium.org
46020b3169 Probe the symbol table for two character strings in native code
All two character string results from adding two strings and from sub string used to be handled in the runtime system as a lookup in the symbol table was done before allocating a new string. The native code for string add and sub string now probes the symbol cache for two character strings to avoid the runtime call. If the result string is not found in the symbol table within a fixed number of probes a new string is just allocated. Newly allocated two character strings are not added to the symbol table immediately.
Review URL: http://codereview.chromium.org/598062

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3842 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-12 11:43:00 +00:00
whesse@chromium.org
c7fe99d3ff Change LoadIC interface on ia32 to take arguments in registers.
Review URL: http://codereview.chromium.org/573009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3841 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-12 10:32:24 +00:00
kmillikin@chromium.org
85c24cee57 Change the interface of CodeGenerator::InstantiateBoilerplate.
Begin changing the interface of the virtual-frame-based code generator
to avoid pushing short-lived temporaries on the frame.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3840 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-12 10:28:40 +00:00
ager@chromium.org
4c929953b4 Port FastCloneShallowArrayStub to ARM and x64.
Review URL: http://codereview.chromium.org/597022

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3835 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-11 12:28:49 +00:00
ager@chromium.org
51a7ecc1f7 Fix problem with GenericBinaryOperationStub::GenerateCall for a Smi
left operand.  For non-commutative operations the right operand could
be overwritten with the Smi left operand.

We need better testing of all of these cases.  We will add more test
cases as a separate commit.
Review URL: http://codereview.chromium.org/598059

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3834 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-11 12:26:08 +00:00
kmillikin@chromium.org
9b47ae91d1 Simple type tracking in the fast code generator.
Initial implementation of ad hoc must-be-smi tracking in the fast code
generator.  Type information is used to avoid the write barrier for
smi property stores and to avoid the smi check for the inputs/output
of bitwise OR.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3833 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-11 08:41:19 +00:00
ager@chromium.org
638cb4f91d Always load the JavaScript builtins code entry from the JavaScript
function instead of baking in the address of the first one that we see
in code.

This removes the need for fixups processing and makes the stubs safe
when there is no natives cache and therefore multiple versions of the
builtin functions.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3832 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-11 08:05:33 +00:00
vitalyr@chromium.org
d1d56d9891 ia32: Fuse map and type checks in call ICs for API functions.
This uses the fact that if a map stayed the same then the object
still passes the type check. A new builtin is added to handle the
API call in this case.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3825 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-09 16:14:14 +00:00
whesse@chromium.org
ad83e411e1 Eliminate unused function KeyedStoreIC::GenerateExtendStorage, and unused parameter from StubCompiler::GenerateStoreField.
Review URL: http://codereview.chromium.org/575022

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3824 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-09 15:18:37 +00:00
whesse@chromium.org
c00dcbe5f2 Fix error introduced in version 3820. Add optimization suggested by the error.
Review URL: http://codereview.chromium.org/597006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3823 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-09 14:19:23 +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
whesse@chromium.org
503bbeb8c4 Change GenerateLoadStringLength to have two scratch registers on all platforms. This is needed so that the LoadIC can pass the receiver in a register, and not have it overwritten, and also simplifies the code.
Review URL: http://codereview.chromium.org/596011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3820 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-09 13:06:37 +00:00
kmillikin@chromium.org
0d6b85b812 Added helper functions for fixed register allocation.
Added helper functions to the fast code generator for temporary, ad hoc
fixed register allocation.  Also inlined some helper functions that had only
one call site to simplify the code generator API for now.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3818 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-09 10:18:51 +00:00
whesse@chromium.org
f449fded97 Eliminate *IC::Generate() function on all platforms.
Review URL: http://codereview.chromium.org/583008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3817 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-08 16:08:26 +00:00
serya@chromium.org
862909e762 Review URL: http://codereview.chromium.org/561049
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3814 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-08 13:44:49 +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
lrn@chromium.org
dd85270967 ARM native string addition.
Review URL: http://codereview.chromium.org/571005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3806 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-05 12:00:42 +00:00
sgjesse@chromium.org
9b4312fd76 Fixed random style violations.
Review URL: http://codereview.chromium.org/574009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3801 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-04 21:32:02 +00:00
sgjesse@chromium.org
3fdc489658 Fix presubmit errors.
TBR=ager@chromium.org
Review URL: http://codereview.chromium.org/570024

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3796 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-04 15:21:05 +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
kmillikin@chromium.org
c174657e9e Incorporate the arguments to the code generator constructors and their
MakeCode functions in the CompilationInfo structure.  This makes it
easier to add new arguments and makes all arguments uniformly
available to the various backends.
Review URL: http://codereview.chromium.org/566008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3789 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-03 16:12:55 +00:00
whesse@chromium.org
b57ca72b90 Fix build error on Win32, fix spelling of DebugerStatementStub.
Review URL: http://codereview.chromium.org/570001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3778 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-03 08:33:19 +00:00
ager@chromium.org
dc49c566a4 Use the virtual-frame based optimizing compiler for split-compilation
bailouts.  For now the virtual-frame state at entry of a function is
hard-coded when using the virtual-frame based compiler as the
secondary compiler.

Setup frame pointer correctly on function entry on ARM in
fast-codegen-arm.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3776 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-03 07:58:47 +00:00
serya@chromium.org
0045327b7d Review URL: http://codereview.chromium.org/555164
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3775 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-02 18:35:53 +00:00
antonm@chromium.org
3ec70cab81 Port caching of lookup followups for interceptors to ARM
Review URL: http://codereview.chromium.org/551191

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3766 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-02 11:32:17 +00:00
whesse@chromium.org
7556a16cd2 Change StoreIC interface on x64 to pass receiver in rdx, not on stack.
Review URL: http://codereview.chromium.org/558069

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3765 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-02 09:20:19 +00:00
kasperl@chromium.org
325d3ef224 Remember to update the write barrier when storing into
the context in the full compiler.

Clobber all input registers in the RecordWrite code
when the debug-code flag is set.
Review URL: http://codereview.chromium.org/569008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3761 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-02 07:58:09 +00:00
kmillikin@chromium.org
41865cd677 Implement simple fast-path code for functions containing this property stores and global variables.
Code is specialized to the initial receiver.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3760 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-01 17:01:58 +00:00
kasperl@chromium.org
ae4fd1e54f Avoid using RecordWrite with the context (esi, rsi, cp) as
one of the arguments since this may clobber the register.
Review URL: http://codereview.chromium.org/556101

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3757 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-01 13:20:43 +00:00
ager@chromium.org
05e8784136 Allow the optimizing compiler to use an existing macro assembler.
This is the first towards using the optimizing compiler for split
compilation bailouts.
Review URL: http://codereview.chromium.org/557079

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3756 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-01 13:07:53 +00:00
whesse@chromium.org
d450fe1ed3 Remove StoreIC::Generate, and inline StoreIC::GenerateInitialize.
Review URL: http://codereview.chromium.org/558067

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3754 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-01 11:07:41 +00:00
whesse@chromium.org
866eac3057 StoreIC interface changed on ia32 to take receiver in edx, not on stack.
Review URL: http://codereview.chromium.org/555162

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3750 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-01 08:35:38 +00:00
serya@chromium.org
9239bbdd91 Removing redundant stub for runtime native calls.
Review URL: http://codereview.chromium.org/543207

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3745 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-29 12:41:11 +00:00
kmillikin@chromium.org
8588518851 Introduce a stack-allocated structure to encapsulate compile-time information.
Use it to hold the possible shared function info, the possible
receiver, and the compilation loop nesting depth.  Remove loop nesting
from FunctionLiteral AST nodes.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3744 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-29 11:55:40 +00:00
sgjesse@chromium.org
2498d5cb7b Fix debug build breakage from r3740
TBR=lrn@chromium.org
Review URL: http://codereview.chromium.org/555161

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3742 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-29 11:34:37 +00:00
sgjesse@chromium.org
8ced9b99be Port direct call from JavaScript to native RegExp to x64
Code tested on both Linux and Windows.

Added a bit more abstraction to calling a C function from generated code.

Minor tweaks to the ia32 version.
Review URL: http://codereview.chromium.org/548179

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3740 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-29 10:33:27 +00:00
whesse@chromium.org
e9263697cb Remove some unneeded restorations of a register in StoreIC.
Review URL: http://codereview.chromium.org/548181

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3737 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-28 14:01:14 +00:00
whesse@chromium.org
8999064435 Move a line, in codegen-*.cc. Make formatting of ic-*.cc uniform.
Review URL: http://codereview.chromium.org/552210

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3734 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-28 12:41:27 +00:00
kasperl@chromium.org
7db4279d22 Add missing break.
TBR=ager@chromium.org
Review URL: http://codereview.chromium.org/548178

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3730 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-28 09:08:01 +00:00
ager@chromium.org
9879490308 Implement SUB and BIT_NOT unary operations in full codegenerator.
This change depends on landing the BIT_NOT unary op stub on arm. That
change is out for review.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3727 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-28 08:15:00 +00:00
kmillikin@chromium.org
2b62886dab Refactor the selection of code generator and add the possibility of a
simpler backend for non-toplevel code.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3721 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-27 15:23:48 +00:00
whesse@chromium.org
62f3e48d2d Refactor Reference so that SetValue and GetValue pop the reference state.
Review URL: http://codereview.chromium.org/487017

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3720 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-27 14:07:12 +00:00
ager@chromium.org
68f537d2b1 Port code to load an integer directly from a heap number from ia32 to x64.
For now, this is a direct port from ia32, so there is probably still
stuff that can be improved here.
Review URL: http://codereview.chromium.org/555131

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3717 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-27 13:34:29 +00:00
kmillikin@chromium.org
f866a574ae Enable references and assignments to lookup slots in the toplevel code
generator.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3716 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-27 12:14:26 +00:00
kmillikin@chromium.org
97e3aae5ef Refactoring and small optimization of the smi code for binary op stubs
on ia32.

1. Operate on the values in edx,eax when possible (all operations
except DIV and MOD).  This saves moving them on entry and when falling
out to the non-smi code.

2. Do not perform ADD and SUB before the smi check of their inputs.
This saves undoing the operation in the case that we fall through to
the non-smi case due to non-smi inputs (probably common?), and we can
avoid emitting the smi check code twice (code size reduction).

3. Don't perform OR twice (once to smi check the inputs and once to
smi check the result).

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3712 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-26 14:43:40 +00:00
ager@chromium.org
400b62a1f7 Implement unary addition in the full (non-optimizing) code generator.
Review URL: http://codereview.chromium.org/555099

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3711 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-26 13:57:11 +00:00
sgjesse@chromium.org
cf78ed05ee Don't pass the "at start" parameter to native RegExp
As the start index is already passed it is easy to calculate the "at start" boolean in generated code. Also as direct entry has been implemented this needs to be done in generated code anyway, and therefore might as well be moved to the generated code for RegExp. The "at start" value is now calcualted as a local variable on the native RegExp frame based on the value of the start index argument.

The x64 version have been tested on both Linux and 64-bit Windows Vista.

For ARM I have tested cctest/test-regexp on ARM hardware, but the rest of the tests have only been run on the ARM simulator.
Review URL: http://codereview.chromium.org/554078

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3709 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-26 11:08:42 +00:00
kaznacheev@chromium.org
c33dfa5a1d Support register arguments in more cases.
1. MUL and DIV on SMIs.
2. When calling GenericBinaryOpStub from a virtual frame.
3. When generating code for a loop counter.
Overall performance gain is about 0.6%.
Review URL: http://codereview.chromium.org/555098

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3708 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-26 10:27:27 +00:00
kaznacheev@chromium.org
921540510c Fixing style issues in codegen-ia32.*
See Kevin's comments for http://codereview.chromium.org/554062.
Review URL: http://codereview.chromium.org/543193

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3695 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-25 17:47:53 +00:00
kaznacheev@chromium.org
e138669a1f Fixing an assertion fail introduced in 3692.
Also fixing some formatting issues.
Review URL: http://codereview.chromium.org/556002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3694 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-25 17:03:34 +00:00
kaznacheev@chromium.org
36477ee160 Use registers to pass arguments to GenericBinaryOpStub.
Currently arguments are never passed on registers (due to the way ArgsInRegistersSupported is written) and
if they were, the stub would break in several places because registers are not preserved properly in the
course of execution. This CL makes use of registers more often (than never) and makes sure that registers are
handler properly.
A peformance gain is small (0.2-0.3%) but stable.
This CL was extracted from the one sent out earlier (http://codereview.chromium.org/551093).

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3692 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-25 16:00:03 +00:00
fschneider@chromium.org
4d3a5968a5 Inline smi code in count operations in the full code generator.
We now test for a smi before calling ToNumber and inline
the smi increment/decrement for ++ and --. There only a small
increase in code size but loops in top-level code are
becoming much faster as a result.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3681 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-22 14:07:25 +00:00
antonm@chromium.org
c7445d9284 Make KeyedLoadIC::generic_stub go into slow case if receiver has an indexed interceptor.
BUG=589,27967.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3680 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-22 13:56:12 +00:00
sgjesse@chromium.org
69915136fa Add support for two byte strings in direct call to RegExp
The stub for calling RegExp directly now also handles two byte strings.

Support for flat cons strings added for both ascii and two byte.

Some code code simplifications and added a few constants.
Review URL: http://codereview.chromium.org/545151

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3678 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-22 08:31:33 +00:00
lrn@chromium.org
9c6335929b Implement inline string compare on ARM.
Backport optimizations from x64 version to ia32.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3670 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-21 12:10:56 +00:00
kmillikin@chromium.org
1405258621 Rename the fast-codegen* files to full-codegen*.
Review URL: http://codereview.chromium.org/549109

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3662 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-20 16:28:21 +00:00
fschneider@chromium.org
c757fa4604 Refactor GenericBinaryOperation and its helper functions to always return a Result.
This is a preparation step for including number type information
in the virtual frame. We need a common place where we can update
the number type information of the result of a binary operation
since we should not modify the state of the virtual frame elements
directly.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3661 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-20 16:13:53 +00:00
kmillikin@chromium.org
6ad58b53f4 Rename the toplevel code generator from "Fast" to "Full". It was
always ambiguous whether it tried to generate fast code, or generate
it quickly.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3660 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-20 15:51:03 +00:00
sgjesse@chromium.org
f9b80f139c Add conditional counter update to IA-32
Review URL: http://codereview.chromium.org/554001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3652 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-19 14:17:34 +00:00
sgjesse@chromium.org
67f9e191f9 Fix some usage of "this" in builtins
The implementation of Object.prototype.valueOf and Object.prototype.toString now calls ToObject on "this" as mandated by the spec.
Review URL: http://codereview.chromium.org/542112

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3651 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-19 14:15:47 +00:00
kmillikin@chromium.org
3e8539d873 First step of refactoring expression contexts in the toplevel code
generator.

Contexts are no longer stored in the AST but in the code generator's
state.  This means that the running the code generator selector is not
required to use the toplevel code generator (for instance, if we
already know that we can and should use it).

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3645 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-19 12:41:02 +00:00
kmillikin@chromium.org
6f91d1bfd6 Add missing break in continue.
TBR=fschneider@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3640 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-18 23:18:09 +00:00
kmillikin@chromium.org
35c85237f0 Fix a bug in the short-circuit logical operations in the toplevel
code generator.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3636 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-18 16:23:24 +00:00
kmillikin@chromium.org
9095abb776 Introduce 'top-of-stack caching' to the toplevel code generator by
allowing the value of the rightmost subexpressions to be evaluated
into an accumulator register (eg, eax, rax, or r0) rather than onto
the stack.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3630 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-18 14:04:55 +00:00
lrn@chromium.org
eee6c6405e RegExp bitmap test for word character.
Review URL: http://codereview.chromium.org/547024

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3626 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-18 09:49:50 +00:00
sgjesse@chromium.org
562f90d375 Ensure correct boxing of values when calling functions on them
When a function is called with a value type as the receiver this is now boxed as an object.

This is a low-impact solution where the receiver is only boxed when required. For IC calls to the V8 builtins values are not boxed and as most of the functions on String.prototype, Number.prototype and Boolean.prototype are sitting there most IC calls on values will not need any boxing of the receiver.

For calls which are not IC calls but calls through the CallFunctionStub a flag is used to determine whether the receiver might be a value and only when that is the case will the receiver be boxed.

No changtes to Function.call and Function.apply - they already boxed values. According to the ES5 spec the receiver should not be boxed for these functions, but current browsers have not adopted that change yet.

BUG=223
TEST=test/mjsunit/value-wrapper.js
TEST=test/mjsunit/regress/regress-crbug-3184.js
Review URL: http://codereview.chromium.org/542087

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3617 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-15 13:42:32 +00:00
vitalyr@chromium.org
bd06358b93 Optimized calling of C++ builtins (and HandleApiCall
in particular).

  * Called function is passed on the stack instead of
    using a static variable.

  * Builtins that don't need the called function don't
    get it.

  * Made is_construct statically known to HandleApiCall
    by setting custom construct stub for API functions.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3613 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-15 12:25:24 +00:00
fschneider@chromium.org
1cc579ff4e Fix issue 541 and some refactoring of the top-level compiler.
* Refactor VisitProperty to use the platform-specific methods for emitting the IC calls.
* Refactor recording of source positions in the top-level compiler.
* Correct the recorded source positions for assignments and property loads.
* Fix bug on x64 where source positions were not recorded before a calling a call-IC.
* Correct some inconsistencies between IA-32 and X64 top-level code generator.

We now pass all regression tests with 
--always-fast-compiler.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3612 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-15 12:00:59 +00:00
fschneider@chromium.org
acf74b04a7 Fix a problem when compiling built-ins with the top-level compiler.
Replace runtime call to NumberAdd with call to binary op stub.

Until now the top-level compiler always called a runtime function
for count operations. 

In some places we expected in the JS builtins smis as arguments.
If we perform a count operation before all smis would get converted into
heap numbers by the runtime number add function and result in a runtime 
assert.

Also: Add missing debugger information in the top-level compiler for 
do-while loops.


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3610 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-14 17:22:59 +00:00
kmillikin@chromium.org
ede65c19a1 Remove a pair of problematic uses of the Reference utility class from
the code generators.

These uses broke the rules of the class because it was safe to do so,
but there was no real reason to do it that way.
Review URL: http://codereview.chromium.org/543041

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3598 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-13 16:01:15 +00:00
fschneider@chromium.org
3dd2420511 Fix bug in top-level code generator with global receiver.
We did not correcty pass the global receiver object in some cases. 
This change fixes this bug on all three platforms.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3596 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-13 12:13:37 +00:00
kmillikin@chromium.org
39b9f57f19 Cleanup the handling of control flow in the toplevel code generator.
Do abstract the setting and restoring of 'argument' state into a
function that takes arguments.

Do not set the argument state in the code generator unless it
represents arguments to a recursive call to Visit.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3594 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-13 11:29:08 +00:00
fschneider@chromium.org
fdba189730 Fix a problem with const initialization in the top-level code generator.
When initializing the special local variable containing the reference to the enclosing 
function in named functions we now (correctly) emit an INIT_CONST instead of INIT_VAR,
and we correctly bail out in the top-level code generator.

Also part of this change is adding missing statement position information 
for some statements in the top-level code generator.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3587 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-12 17:22:57 +00:00
kmillikin@chromium.org
c891a7a683 Fix lint error. I must have been following the Standard ML style
guide.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3581 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-12 09:58:50 +00:00
kmillikin@chromium.org
f0b8c2d97a Some cleanup of the toplevel code generator:
* Rename the operation of filling a context with a value.  Formerly it
  was 'Move', now it's 'Apply' so as to avoid confusion with various
  other Moves (eg, in the toplevel codegen, in the macro assemblers).

* Use the abstraction Drop rather than math on the stack pointer.

* Add a predicate on AST expression nodes to abstract a repeated test
  whether we should us a regular (named) IC or a keyed IC.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3580 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-12 08:48:26 +00:00
ager@chromium.org
c1cafb7cf1 Port FastNewClosureStub introduced for ia32 in r3477 to x64 and arm.
BUG=552
Review URL: http://codereview.chromium.org/543010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3578 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-12 07:16:49 +00:00
sgjesse@chromium.org
658ca2f174 Add missing instructions to the IA-32 disasembler
Added newly added instructions to test-disasem-ia32.cc and implemented the missi
ng ones in the disasembler.

Added some asserts to 8-bit instructions which only work with eax, ebx, ecx and
edx (al, bl, cl and dl).

Removed the loope instruction.
Review URL: http://codereview.chromium.org/548002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3577 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-11 15:19:53 +00:00
fschneider@chromium.org
c860533020 Added two missing instructions to disassembler.
The subb and the loop instructions are also added to the IA-32 disassembler.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3576 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-11 12:59:17 +00:00
sgjesse@chromium.org
8c2620112c Fixed wrong cmov operand order
TBR=erik.corry@gmail.com
Review URL: http://codereview.chromium.org/518082

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3572 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-08 14:17:26 +00:00
erik.corry@gmail.com
1670dce1bf Fix same Windows compiler error in another place.
Review URL: http://codereview.chromium.org/518081

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3571 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-08 13:48:27 +00:00
erik.corry@gmail.com
a5247c039c Fix Windows build.
Review URL: http://codereview.chromium.org/527031

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3570 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-08 12:42:58 +00:00
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
erik.corry@gmail.com
dcd89af437 Lint, schmlint!
Review URL: http://codereview.chromium.org/525114

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3567 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-08 10:41:25 +00:00
erik.corry@gmail.com
eb6b3f601a Speed up compares with characters ie single-character strings.
Make use of it when we know that something can't be a NaN.
Review URL: http://codereview.chromium.org/524059

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3566 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-08 09:54:11 +00:00
lrn@chromium.org
46504c1557 Attempt to make \b\w+ faster. Slight performance increase on, e.g., string unpacking.
Review URL: http://codereview.chromium.org/507051


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3563 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-07 19:01:23 +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
sgjesse@chromium.org
99fbea324b Make the direct call to native RegExp work
Single glitch in r3542 which caused the direct call to native regexp code to always bail out to the runtime system.

TBR=erik.corry@gmail.com
Review URL: http://codereview.chromium.org/523091

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3544 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-06 12:21:28 +00:00
sgjesse@chromium.org
429f3cf9f2 Direct call to native RegExp code from JavaScript.
Calls to RegExp no longer have to be via a call to the runtime system. A new stub have been added which can handle this call in generated code. The stub checks all the parameters and creates RegExp entry frame in the same way as it is created by the runtime system. Bailout to the runtime system is done whenever an uncommon situation is encountered or when the static data used is not initialized. After running the native RegExp code the last match info is updated like in the runtime system.

Currently only ASCII strings are handled.

Added another argument to the RegExp entry frame. It indicated whether the call is direct from JavaScript code or through the runtime system. This information is used when RegExp execution is interrupted. If an interruption happens when RegExp code is called directly a retry is issued causing the interruption to be handled via the runtime system. The reason for this is that the direct call to RegExp code does not support garbage collection.
Review URL: http://codereview.chromium.org/521028

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3542 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-06 11:09:30 +00:00
fschneider@chromium.org
e06c581232 Use cmov instructions to avoid some conditional branches in stub code.
This change improves the ConstructStub and the ArgumentsAccessStub slightly
by using the cmov instruction (if available) to eliminate a 
conditional branch. It only applies to the IA-32 and X64 platforms.


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3537 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-05 12:02:18 +00:00
kmillikin@chromium.org
a1bf879720 More cleanup of slot handling in the nonoptimizing code generator.
Rename CreateSlotOperand so that it's clear it can emit code.  Use it
where possible.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3534 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-05 11:29:27 +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
kmillikin@chromium.org
b74daccff0 Style cleanup of switches over Slot::Type in the nonoptimizing code
generator.

The Slot::Type enumeration has four values.  It should never be
necessary to use a default to handle the case of a value out of range
of the enumeration.  Doing so silences a useful warning when one of
the enumeration values is actually forgotten or when a new enumeration
value is added.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3532 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-05 09:11:10 +00:00
fschneider@chromium.org
637a21952f Added general pre- and postfix count operations to top-level compiler.
Until now we only supported postfix operations on global variables.
This change add generic count operations to the top-level compiler.

I tried to re-use code from the code generator used for assignment expressions
where possible.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3530 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-04 13:56:31 +00:00
fschneider@chromium.org
f7ef880041 Use a loop in generated code to allocate stack slots for function with many local variables.
If a function contains more than a certain number of locals (IA32: 9, X64: 6, ARM: 4) 
a loop for initializing the locals with 'undefined' is more compact. 
For less locals we unroll that loop by emitting a sequence of push instructions.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3521 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-23 15:06:21 +00:00
bak@chromium.org
c3fa79ab2b - Reordered the instructions in the inlined allocation code to space dependent instructions.
- Replaced the or instruction with lea. 

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3520 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-23 13:27:58 +00:00
kasperl@chromium.org
afabb5a9bc Make the FastCloneShallowArrayStub a bit prettier.
TBR=fschneider@chromium.org
Review URL: http://codereview.chromium.org/507069

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3518 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-22 13:10:24 +00:00
ager@chromium.org
2409b4b7ba Revert r3514 and r3515. The new cache is too large for some tests
that attempt to run with a small heap.  Additionally, it can
potentially keep a lot of string data alive and it is never flushed.
Can we make it grow dynamically if used so that we can still start the
VM with a small heap size?
Review URL: http://codereview.chromium.org/503081

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3517 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-22 13:07:27 +00:00
fschneider@chromium.org
735aee05f0 Use one runtime call for creating object/array literals in
the code generator.

The runtime function checks if it needs to create a boilerplate
object or if it can clone from an existing boilerplate.

This is already done in the top-level compiler. 

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3516 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-22 12:41:45 +00:00
kasperl@chromium.org
f034c31bb2 Fix linto.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3515 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-22 12:39:56 +00:00
bak@chromium.org
6742d62c30 - Increased size of number string cache.
- Change the instruction order for inlined allocation.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3514 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-22 11:35:05 +00:00
kasperl@chromium.org
6ca5876419 Add fast case stub for BIT_NOT.
Review URL: http://codereview.chromium.org/503079

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3513 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-22 10:16:27 +00:00
ager@chromium.org
af6971d883 Check for undefined in the binary operation stub when convertion to
int32 for bitops.  undefined converts to zero in ToInt32 conversions.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3512 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-22 09:48:55 +00:00
kasperl@chromium.org
8d6a8e2451 Very experimental fix for issue 555.
Review URL: http://codereview.chromium.org/508006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3509 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-21 15:09:26 +00:00
erik.corry@gmail.com
14975f3dd0 Optimize implementation of Math.floor a little by special casing
the comparison it uses in the code generator.  Use Math.floor for
date operations.
Review URL: http://codereview.chromium.org/509007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3508 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-21 15:04:00 +00:00
ager@chromium.org
fc26307487 Remove complicated Math.sin and Math.cos optimizations that do not buy
us much.
Review URL: http://codereview.chromium.org/509006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3507 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-21 13:30:10 +00:00
ager@chromium.org
827575b0e9 Optimize sine and cosine by checking up front if the fsin or fcos
operation can throw an exception.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3506 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-21 12:08:59 +00:00
kasperl@chromium.org
9c627d6ba3 The number of heap slots stored in a scope includes the
fixed contexts slots. Take this into account when using
the new, fast context creation path to avoid allocating
too many slots (wasteful).
Review URL: http://codereview.chromium.org/501148

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3505 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-21 10:24:11 +00:00
erik.corry@gmail.com
73fcafd650 Bring back the fisttp instruction on machines with SSE3, but check the
input so we don't have to check the exception flags afterwards.
Review URL: http://codereview.chromium.org/509001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3504 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-21 08:32:20 +00:00
kmillikin@chromium.org
e1b13fc351 Disallow garbage collection at another site in the LoadCallback ICs.
MacroAssembler::PopHandleScope emits a runtime call (through a stub),
which should not be allowed to perform a GC but return a failure
instead.

BUG=30790
TEST=none

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3501 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-20 08:40:13 +00:00
kasperl@chromium.org
64e443768e Recommit r3494 after fixing stupid mistake where the deferred code stub didn't know it was reversed.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3499 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-18 13:47:58 +00:00
lrn@chromium.org
9b0a967cae Fast-codegen: Adding support for try/catch and throw.
Still no support for lookup-variables, so we bailout if using the catch variable.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3498 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-18 13:38:28 +00:00
kasperl@chromium.org
12866185ea Revert r3495 - some weird corner case is broken.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3496 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-18 13:14:37 +00:00
kasperl@chromium.org
0b4e755047 Improve code generated for left shifts where the left side
is a constant by avoiding a few checks.
Review URL: http://codereview.chromium.org/504057

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3495 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-18 13:07:02 +00:00
kasperl@chromium.org
56a6b0cdff Convert the rest of the sar(xxx, kSmiTagSize) to SmiUntag(xxx).
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3494 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-18 11:20:25 +00:00
kasperl@chromium.org
546b99b79f Refactor smi tagging and untagging on IA-32.
Review URL: http://codereview.chromium.org/501113

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3493 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-18 11:13:33 +00:00
erik.corry@gmail.com
0553c7feb9 Optimize bitops with non-Smi inputs. Instead of converting both inputs
to floating point and then converting back we convert directly to a
32 bit integer.  In addition the bit twiddling implementation of float-
to-integer conversion has been ported from ARM.  Testing has shown that
this runs faster than the x87 or SSE3 rounding instructions.  This change
is IA32 only.  There may be a smaller benefit from doing the same on x64.
Review URL: http://codereview.chromium.org/506052

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3492 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-18 09:33:24 +00:00
bak@chromium.org
93bbe2acdc added else
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3488 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-18 06:58:45 +00:00
bak@chromium.org
07742f5672 -Inlined double variant of compare iff one of the sides is a constant smi and it is not a for loop condition.
Review URL: http://codereview.chromium.org/507040

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3487 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-18 06:38:12 +00:00
iposva@chromium.org
13febb2585 - Handle HeapNumbers in deferred code instead of jumping to stub
for DeferredInlineBinaryOperations.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3486 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-18 01:43:50 +00:00
kasperl@chromium.org
914d4f801d Optimize the allocation of small, non-nested literal
arrays and argument objects on IA-32.
Review URL: http://codereview.chromium.org/503042

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3485 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-17 15:35:15 +00:00
kmillikin@chromium.org
6af6a82ae3 Streamline the calling convention of the call ICs by passing the
property name in a register rather than on the stack below the
receiver and arguments.

Implemented only for IA32, passing the name in the ecx register to
match the calling convention of the load ICs.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3484 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-17 10:23:20 +00:00
kasperl@chromium.org
f4251cc42c Enable fast allocation of context objects on IA-32.
Review URL: http://codereview.chromium.org/507035

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3482 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-17 08:53:19 +00:00
kasperl@chromium.org
51aa605e62 Fix ARM and x64 tests in debug mode after r3477.
TBR=ager@chromium.org
Review URL: http://codereview.chromium.org/500090

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3480 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-17 07:35:12 +00:00
iposva@chromium.org
4380812b39 - Undo unfortunate renaming of StaticType.
Review URL: http://codereview.chromium.org/506050

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3478 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-17 06:21:50 +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
lrn@chromium.org
482d434f4d Fast codegen: Implement with.
Review URL: http://codereview.chromium.org/491077


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3473 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-16 09:51:07 +00:00
lrn@chromium.org
9ff5f9daed Fast-codegen: Implementing try/finally on top of nesting context.
Review URL: http://codereview.chromium.org/492002


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3461 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-14 11:09:25 +00:00
fschneider@chromium.org
4c9874195d Fix lint error.
TBR=kmillikin@chromium.org
Review URL: http://codereview.chromium.org/491063

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3456 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-11 22:48:14 +00:00
fschneider@chromium.org
c25151faa6 Adding compound assignments to the top-level compiler.
Review URL: http://codereview.chromium.org/486008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3455 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-11 16:09:16 +00:00
erik.corry@gmail.com
a4ad7b8bf3 Give the binary op stubs better names to make profiles more informative.
Review URL: http://codereview.chromium.org/488017

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3454 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-11 10:40:01 +00:00
ager@chromium.org
483828660d Reapply keyed load cache probing in generated code. I introduced a
bug just before committing which broke snapshot builds.  The code is
nearly identical to the previous submit.

TBR=erik.corry@gmail.com
Review URL: http://codereview.chromium.org/491004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3449 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-10 15:10:50 +00:00
lrn@chromium.org
aef02ccccb Fast codegen: Working break and continue.
Started framework for all intra-functional outward control transfers,
including handling of try/finally.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3448 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-12-10 14:06:08 +00:00