Commit Graph

107 Commits

Author SHA1 Message Date
ager@chromium.org
6230f5397d Port inline swapping of elements for the sort function in array.js
from ia32 to arm.

Original change: http://codereview.chromium.org/1709008


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4575 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-04 11:06:59 +00:00
ager@chromium.org
cf54120a58 Port inlined version of swap primitive for sorting from ia32 to x64.
Original code review for ia32 version: http://codereview.chromium.org/1709008
Review URL: http://codereview.chromium.org/1858002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4569 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-03 18:18:25 +00:00
antonm@chromium.org
55e32d2f3b Introduce faster swapping primitives.
Keyed store stub sits high in sorting profiles.

Swapping allows to save us additional type checks as we could both read and
write elmenets (on fast path) without them.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4551 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-29 15:14:39 +00:00
podivilov@chromium.org
1872574f4d Port string keyed load IC improvements (r4444) to x64.
http://compute1.aar:9013/golem/r4502-v8-podivilov-string-char-at2-x64-vs-4502-v8-x64.html
Review URL: http://codereview.chromium.org/1750017

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4542 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-28 17:16:51 +00:00
vitalyr@chromium.org
b8ba4deacc Reapply: Inline fast cases in string keyed load IC.
(Fixed handling of out-of-bounds keys.)

String keyed load used to call STRING_CHAR_AT builtin that performs
two steps (get a char code, construct a one-char string from the
code), both of which have fast cases implemented as inline runtime
functions. In this chage most of the code from these functions is
extracted to a set of common generator functions in StringStubBase and
the fast cases are grouped together in the IC code.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4450 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-20 17:33:14 +00:00
vitalyr@chromium.org
fae2b0f175 Revert r4444 "Inline fast cases in string keyed load IC."
Review URL: http://codereview.chromium.org/1633024

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4445 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-20 09:26:32 +00:00
vitalyr@chromium.org
e504873d2a Inline fast cases in string keyed load IC.
String keyed load used to call STRING_CHAR_AT builtin that performs
two steps (get a char code, construct a one-char string from the
code), both of which have fast cases implemented as inline runtime
functions. In this chage most of the code from these functions is
extracted to a set of common generator functions in StringStubBase and
the fast cases are grouped together in the IC code.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4444 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-20 08:27:48 +00:00
antonm@chromium.org
a713b27428 Introduce fast native caches and use it in String.search.
Review URL: http://codereview.chromium.org/1563005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4418 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-14 14:46:15 +00:00
lrn@chromium.org
285d5bc48a Native construction of RegExp result objects, with in-object index and input.
Avoid cloning using CloneRegExpResult for results that are just arrays.
Made a more direct path for string.match with string argument.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4395 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-13 09:31:03 +00:00
antonm@chromium.org
400b1be449 Faster invocation of custom comparator function.
Review URL: http://codereview.chromium.org/1623004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4381 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-12 07:05:24 +00:00
whesse@chromium.org
c33886c9b7 Change Math.random() to return 32 bits of random goodness, instead of 30 random bits. Math.random now allocates a HeapNumber inline, and calls a C funciton directly to put the random bits into it.
Review URL: http://codereview.chromium.org/1599019

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4354 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-07 08:18:51 +00:00
kmillikin@chromium.org
155a9cdd08 Simplify IA32 code generator API.
Cut down on the number of arguments passed to the various binary operation
code generator functions by passing along the expression itself, rather than
a subset of its fields.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4319 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-30 12:12:31 +00:00
ricow@chromium.org
65e099e277 Land http://codereview.chromium.org/1311003/diff/8001/9001 to allows us to push to trunk. Corrected the ASSERT from the review.
Review URL: http://codereview.chromium.org/1404001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4290 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-26 07:55:38 +00:00
whesse@chromium.org
a255a71181 Speed up conversion of untagged int32 result if we know it must be a smi.
Review URL: http://codereview.chromium.org/1233003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4273 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-25 13:22:37 +00:00
fschneider@chromium.org
0737ec8dcb Rename NumberInfo to TypeInfo.
Since we add more type (StringType, PrimitiveType) the name
NumberInfo does not make sense anymore.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4268 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-25 12:44:15 +00:00
sgjesse@chromium.org
6a63910650 Re-apply "Inline floating point compare"
This re-applies r4220 and r4233, which was reverted in r4254 due to a bug. This bug has now been fixed, with the only change being line 2884 changed from

  __ SmiTag(left_side->reg());

to

  __ SmiTag(operand->reg());

Added a regression test.

BUG=http://crbug.com/39160
TEST=test/mjsunit/regress/regress-crbug-39160.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4261 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-25 12:04:34 +00:00
kmillikin@chromium.org
c0c1ebcaa4 Revert "Inline floating point compare"
This reverts svn revisons r4220 and r4233.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4254 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-24 14:26:14 +00:00
sgjesse@chromium.org
9240342ad6 Inline floating point compare
Inline floating point compare instead of calling the stub when the following conditions are met:
  * Code is in a loop
  * Compare is not a for loop condition
  * Compare is not an equal comparison

This inlined code handles heap number to heap number and heap number to smi compare. It can also handle smi to smi compare, but whenever there is a chance of comparing two smis the smi compare is inlined before the inlined floating point compare. Support for non SSE2 hardware is included.

A new set of variants of the compare stub without the floating point comparison code is called if the inline comapre fails due to the operands not beeing heap numbers or smis.

The virtual frame has been extended with a branch taking two live results to be carried through to the destination. This makes this change much simpler as the inlined code have two live results in registers and a number of bailouts.

CompareStub::GetName needs to be updated as well. I will do that as a separate change.

Also inlined equality check if both operands can't be NaN. This can only provide positive equals if it is the same object.
Review URL: http://codereview.chromium.org/1117011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4220 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-23 12:36:31 +00:00
iposva@chromium.org
a1ec99c05d - Remove function boilerplate objects and use SharedFunctionInfos in
their place.
- Add one field to the SharedFunctionInfo to remember the number of
  literals used in this function.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4211 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-23 06:04:44 +00:00
fschneider@chromium.org
03089b6644 Fix code generation for fast smi loops to support parameters as well.
This change fixes an assert we hit when we recognized a fast smi loop
with a parameter as the loop variable.

BUG=650


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4202 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-22 11:55:12 +00:00
erik.corry@gmail.com
dda96b61c6 Fix formatting around * and &.
Review URL: http://codereview.chromium.org/1000007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4169 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-17 14:53:16 +00:00
whesse@chromium.org
4751f36492 Use untagged int32 values in evaluation of side-effect free expressions.
Review URL: http://codereview.chromium.org/975001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4148 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-16 16:07:19 +00:00
whesse@chromium.org
7abbd29826 Add static analysis to AST expressions that records whether a negative zero will be treated identically to a positive zero in the expression's context. Use this flag to avoid some tests in inlined smi code.
Review URL: http://codereview.chromium.org/965001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4130 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-15 14:03:36 +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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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