Commit Graph

3060 Commits

Author SHA1 Message Date
antonm@chromium.org
ea1b4f0eb1 Introduce builtin for Array.slice function.
Review URL: http://codereview.chromium.org/604059

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3871 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-16 12:14:23 +00:00
mikhail.naganov@gmail.com
899bef8226 Use binary search in GetScriptLineNumber.
Patch by Ilya Tikhonovsky <loislo@chromium.org>
Original issue http://codereview.chromium.org/593108

TBR=sgjesse@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3870 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-16 12:08:10 +00:00
ager@chromium.org
69b96e608a Land thumb2 assembler update.
Review URL: http://codereview.chromium.org/596065

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3869 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-16 11:40:56 +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
yurys@chromium.org
0630b1fd9f Object.getOwnPropertyNames should return string names for indexed properties
Land original change by pfeldman: http://codereview.chromium.org/596117
Review URL: http://codereview.chromium.org/596124

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3866 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-16 10:08:39 +00:00
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
ager@chromium.org
7f422b2a35 Remove caching of ToBoolean on the global context. This was used for
API operations but the API C++ code no longer performs a call to the
JavaScript code for ToBoolean.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3864 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-16 09:24:14 +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
82341d28b3 Fix arm build.
Change the function declarations in the arm virtual frame header 
file to match the other platform.

TBR=kmillikin@chromium.org
Review URL: http://codereview.chromium.org/608007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3862 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-15 14:47:03 +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
mikhail.naganov@gmail.com
d3ce4347d9 Add GetScriptOrigin and GetScriptLineNumber functions for Timeline panel.
Patch by Ilya Tikhonovsky <loislo@chromium.org>.
Original issue: http://codereview.chromium.org/565007

TBR=sgjesse@chromium.org

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

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3859 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-15 13:25:06 +00:00
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
whesse@chromium.org
58b04396bf Change CallIC interface on ARM. Remove name from the stack, and pass it in register r2.
Review URL: http://codereview.chromium.org/598065

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3855 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-15 12:01:46 +00:00
whesse@chromium.org
4507ca1523 Simplify compilation of CallIC interceptor stub.
Review URL: http://codereview.chromium.org/604054

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

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3850 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-12 17:17:13 +00:00
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
whesse@chromium.org
077d785842 Fix CallIC stub for CallInterceptor on ARM
Review URL: http://codereview.chromium.org/593080

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3848 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-12 16:01:38 +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
sgjesse@chromium.org
f937e7daa5 Fix array allocation in generated code on x64
The porting of array allocation in generated code from ia32 to x64 wrongly assumed that a smi contained the actual number times 2. Removed the constant times_half_pointer_size, as it will probably not be needed.
Review URL: http://codereview.chromium.org/596084

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

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

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

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

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3839 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-12 10:16:30 +00:00
whesse@chromium.org
4831b79421 Port change in CallIC interface to x64 platform. Name of called function is now passed in rcx.
Review URL: http://codereview.chromium.org/596036

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3837 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-12 08:10:25 +00:00
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
mikhail.naganov@gmail.com
4f7b9e4da3 Report code stubs to OProfile.
Patch from Dineel D Sule <dsule@codeaurora.org>.
Original issue: http://codereview.chromium.org/600019

TBR=sgjesse@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3831 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-10 17:50:16 +00:00
whesse@chromium.org
9344612bef Change StoreIC interface on ARM platform
Review URL: http://codereview.chromium.org/554152

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3830 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-10 15:06:08 +00:00
antonm@chromium.org
5ecfd4bfe9 Refactor prototype setting code and expose SetPrototype to public V8 API.
Review URL: http://codereview.chromium.org/598020

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

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3828 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-10 13:46:15 +00:00
antonm@chromium.org
a9664cbd0d Making lint happy.
Review URL: http://codereview.chromium.org/593014

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

Add tests that would fail without the restrictions.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3826 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-10 09:18:55 +00:00
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
lrn@chromium.org
96127b68e5 Ported ia32 optimization of revision 3487 to x64.
Review URL: http://codereview.chromium.org/597005

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


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3819 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-09 12:15:34 +00:00
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