Commit Graph

388 Commits

Author SHA1 Message Date
ricow@chromium.org
36e5743674 Put direct code pointers into JSFunction objects. This is a first step
in allowing more flexible compilation and to simplify builtins lookup. 

This changes a number of places where code objects are assigned to
SharedFunctionInfo objects to also assign this code object to the
JSFunction. In addition, the code flushing is changed slightly to
accomodate this (we need to flush the code from functions pointing to
SharedFunctionInfo objects that has already been flushed).


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5233 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-11 08:12:53 +00:00
sgjesse@chromium.org
f75e7855b7 Remove a couple of spill scopes
Review URL: http://codereview.chromium.org/3015066

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5229 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-10 11:52:18 +00:00
lrn@chromium.org
53e22e386c Create a new RegExp object for every evaluation of a RegExp literal.
Changes necessary to following ES5 semantics and matching Safari - in ES3
the same RegExp object was generated by each evaluation of the RegExp literal.
Fixes bug 704.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5198 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-06 13:04:27 +00:00
whesse@chromium.org
3607a9e78e Fix error in optimized x.apply(y, arguments) code generation on ARM. Fixes issue 784. Adds regression test.
Review URL: http://codereview.chromium.org/3048035

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5144 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-28 12:50:27 +00:00
ager@chromium.org
7d5038a3a4 Fixed a couple of issues with store inlining on arm.
Spill and merge virtual frames explicitly in the deferred code.

Account for the fact that the inlined write barrier size depends on
the size of the new space masks.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5122 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-23 08:47:15 +00:00
whesse@chromium.org
9deeec0b08 Change asserts to STATIC_ASSERT if they can be checked at compilation time. Just in the codegen-xxx.cc files on all platforms.
Review URL: http://codereview.chromium.org/3017018

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5121 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-23 08:25:48 +00:00
ager@chromium.org
a36bf8f017 Port inlined in-object property stores to ARM.
Review URL: http://codereview.chromium.org/2878043

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5116 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-22 08:17:40 +00:00
ricow@chromium.org
4957326521 Refactor type checks in v8natives.js and runtime.js.
This includes adding a new inline IsSpecObject method to the code
generator.  The old approach was somehow ineffecient since we would
call both IsObject, IsUndetectable and IsFunction to determine if
something was an object according to the spec. This change introduces
a new macro that determines if something is an object according to the
spec (and this does not include null). 

This change also corrects a few places where undetectable objects was
not allowed even when they should be (priorly they would use only
IS_SPEC_OBJECT_OR_NULL, which would return false on an undetectable
object, the new IS_SPEC_OBJECT returns true on an undetectable object.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5087 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-16 11:21:08 +00:00
ager@chromium.org
6744793c90 Landing for Rodolph Perfetta.
Allow compareStub on ARM to take register in reverse order optionally.

BUG=none
TEST=none

Review URL: http://codereview.chromium.org/2850046/show

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5059 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-13 20:54:06 +00:00
erik.corry@gmail.com
5bc0522ad4 Second half of number alloc change accidentally omitted from
last change.
Review URL: http://codereview.chromium.org/2919001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5039 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-08 13:50:13 +00:00
erik.corry@gmail.com
8c767e02f9 ARM: Add support for the VFP mov literal instruction and mov
between single VFP registers.  Math.pow implementation has
been updated with the new instructions.  This is a commit
of http://codereview.chromium.org/2813046/show for Rodolph
Perfetta.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5037 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-08 12:38:02 +00:00
vitalyr@chromium.org
12e62f316d Make lint happy.
Review URL: http://codereview.chromium.org/2832051

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5028 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-06 13:43:21 +00:00
erik.corry@gmail.com
118a421067 Simplify the transitions in the Binary Op ICs. Now a single call
to the runtime will both patch in the more specialized binary op
stub and calculate the answer.  This eliminates the need to call
both the rest of the binary op and the patching runtime call.  The
runtime routines are altered to be more agressive in returning
Smis so we don't get spurious heap numbers as inputs to binary ops
while we are patching the binary op ICs.
Review URL: http://codereview.chromium.org/2843049

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5026 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-06 12:56:55 +00:00
erik.corry@gmail.com
8da222b010 Specialize GenericUnaryStub so that it knows whether it needs to
take negative zero into account.
Review URL: http://codereview.chromium.org/2850043

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5018 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-05 11:03:16 +00:00
erik.corry@gmail.com
92f2c471d5 ARM: Use VFP for non-Smi bitops results. This is basically Rodolph
Perfettas change from http://codereview.chromium.org/2829032 with
a tiny tweak to the unsigned shift right case.
Review URL: http://codereview.chromium.org/2861043

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5012 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-02 20:03:07 +00:00
erik.corry@gmail.com
f9eb21f950 Simplify ToBoolean if we know we have a Smi.
Review URL: http://codereview.chromium.org/2808039

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5007 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-02 08:42:22 +00:00
erik.corry@gmail.com
5a54b7030d ARM: Don't emit a write barrier for an inlined keyed load
if the right hand side is a literal like true, false, etc.
Also if the value is not a likely Smi we inline the newspace
check.
Review URL: http://codereview.chromium.org/2833048

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4999 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-01 15:06:24 +00:00
sgjesse@chromium.org
97ecc50377 ARM: Correctness fix to Math.pow optimization
The change in r4990 contained a bug in Math.pow when then exponent was a large negative smi. In that case calculating 1/Math.pow(x,-y) did not provide the correct result as Math.pow(x,-y) would overflow ti infinity. This was caught by Sputnik test S8.5_A13_T1.
Review URL: http://codereview.chromium.org/2815039

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4994 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-30 15:19:06 +00:00
sgjesse@chromium.org
bbb2648464 ARM: Fix GC bug with previous change
The change in r4990 contained a bug in Math.pow. One of the arguments for the call to runtime where clobbered if allocation of the heap number for the result failed.

Caught by a couple of Mozilla tests which does a lot of calls to Math.pow.

Fix presubmit error in x64.
Review URL: http://codereview.chromium.org/2847037

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4993 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-30 13:39:03 +00:00
whesse@chromium.org
b122fbd363 Decide that different detectable objects are not equal without calling runtime, on all platforms.
Review URL: http://codereview.chromium.org/2805046

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4992 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-30 13:24:47 +00:00
ager@chromium.org
6044b33766 Implement IC for storing to dictionary case objects.
The IC stub is completely generic, so there will only be one such stub
in the system.

Added a new overloaded version of the macro assembler RecordWrite
method for cases where we have the address we store to computed up
front.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4991 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-30 12:27:49 +00:00
sgjesse@chromium.org
ff6c4fe680 ARM: Special code for raising to the power of an integer
When calculating Math.pow where the exponent is a smi use a simple loop to calculate the result.

Added support for the vmov instruction moving from one doubleword extension register to another.

Added some Math.pow tests which partially covers what is in the Sputnik tests.
Review URL: http://codereview.chromium.org/2804033

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4990 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-30 12:22:15 +00:00
sgjesse@chromium.org
65018d9123 ARM: Use the vsqrt instruction when available
vsqrt is used to calculate Math.sqrt(x), Math.pow(x, 0.5) and Math.pow(x, -0.5). Code size doesn't matter, as %_MathSqrt and %_MathPow are only called in one place each.
Review URL: http://codereview.chromium.org/2885002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4974 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-29 09:40:36 +00:00
erik.corry@gmail.com
bcfaba24c1 Do integer mod via sum-of-digits technique. This benefits the date
code.
Review URL: http://codereview.chromium.org/2876011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4964 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-28 11:47:23 +00:00
vitalyr@chromium.org
8ab6832203 Add "has fast elements" bit to maps and use it in inlined keyed loads.
A potential issue with this change is creating lots of maps when
objects flip between fast/slow elements modes.  We could add special
transitions to avoid this.  Yet testing this on our benchmarks, gmail,
and wave seems to indicate that this is not a real problem.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4941 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-24 13:56:35 +00:00
erik.corry@gmail.com
a4a757d74f ARM: Remove spilled scopes.
Review URL: http://codereview.chromium.org/2848023

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4936 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-24 11:05:38 +00:00
erik.corry@gmail.com
251b1c5f93 ARM: Remove a bunch of spilled scopes. Still a lot to go.
Review URL: http://codereview.chromium.org/2828004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4932 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-24 07:54:48 +00:00
erik.corry@gmail.com
ca8298273a ARM: Fix bug introduced in 4783 (2.2.15) that caused the
result of 1 << x to be miscalculated for some inputs.
Review URL: http://codereview.chromium.org/2848021

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4929 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-23 13:44:11 +00:00
sgjesse@chromium.org
bdbda3b6d0 ARM: Update the generation of the name for GenericBinaryOpStub
Review URL: http://codereview.chromium.org/2840011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4904 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-21 10:34:25 +00:00
erik.corry@gmail.com
694669926c ARM: Load the heap number map into a register and keep it
there throughout the binary op stub (used for checking and
creating heap numbers).
Review URL: http://codereview.chromium.org/2843010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4897 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-17 21:51:51 +00:00
vitalyr@chromium.org
3cafa65462 Track ascii-ness of data in externalized strings.
If a two-byte string only contains ascii characters, then we can save
memory when flattening a cons string containing it. Similarly we can
use this in Array.prototype.join implementation. To track this a new
bit is added to instance type. This bit is used as a hint in generated
code and in runtime functions.

To enable testing a new V8 extension is added controlled by
--expose-externalize-string flag.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4894 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-17 16:19:28 +00:00
erik.corry@gmail.com
d1c60571ae ARM: Minor refactoring of RecordWrite, does not require the offset to
be in a register anymore. Code also updated to use the bitfield
instructions when available.  This is a commit of
http://codereview.chromium.org/2845003/show for Rodolph Perfetta.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4889 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-17 10:45:37 +00:00
sgjesse@chromium.org
50a2e15bbd ARM: Special case for modulus of two smis in the generic binary opration stub
When lhs and rhs are positive smis and rhs is a power of two perform modulus by masking.
Review URL: http://codereview.chromium.org/2873001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4884 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-16 20:03:32 +00:00
kaznacheev@chromium.org
b251f14782 Port KeyedCallIC implementation to x64 and ARM.
Also edited ic-ia32.cc for clarity and better formatting.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4873 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-16 10:03:47 +00:00
ager@chromium.org
ed0fc41723 Change hash computation for transcendental cache to use arithmetic
shifts. Leads to fewer collisions.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4872 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-16 08:29:25 +00:00
sgjesse@chromium.org
1c5a9435ab ARM: Change code generation for function return
Generating code for function return on ARM is now aligned with the other platforms. The first non-shadowed return statement encountered will emit code for function return and all other returns including the fall through at the bottom of a function will jump to that.
Review URL: http://codereview.chromium.org/2815003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4856 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-14 11:37:05 +00:00
erik.corry@gmail.com
142de62819 ARM: Be more smart about switching instructions when immediates
don't fit in the instruction.  Use ubfx and sbfx more.
Review URL: http://codereview.chromium.org/2826001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4855 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-14 11:20:36 +00:00
whesse@chromium.org
317dcabe84 Change tests for string type in RegExpExecStub on all platforms.
Review URL: http://codereview.chromium.org/2772004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4854 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-14 10:21:24 +00:00
ager@chromium.org
a9d252749f Fix thinko in arm transcendental cache probing introduced just before
committing.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4847 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-11 12:26:41 +00:00
ager@chromium.org
89ffd6c2f2 Implement transcendental cache probing in generated code on ARM.
Fixed hash code computation on ia32 and x64 to match the runtime
system (change arithmetic shift right to logical shift right).

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4843 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-11 10:18:44 +00:00
sgjesse@chromium.org
634fb9152c More precise break points and stepping when debugging
Added support for more precise break points when debugging and stepping. To achieve that additional nop instructions are inserted where breaking would otherwise be impossible. The number of nop instructions inserted are sufficient to make place for patching with a call to a debug break code stub. On Intel that is 5 nop's for 32-bit and 13 for 64-bit. Om ARM 3 nop instructions (12 bytes) are required.

In order to avoid inserting nop's in to many places a simple ast checker have been added to check whether there are breakable code in a statement or expression. If it is possible to break in an expression no additional break enabeling code is inserted.

Added break locations to the true and false part of a conditional expression.

Added stepping tests to cover more constructs.

These changes are only in the full compiler.

Changed the default value for the option --debugger in teh d8 shell from true to false. The reason for this is that with --debugger turned on the full compiler will be used for all code in when running d8, which can be unexpeceted.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4820 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-08 12:04:49 +00:00
ager@chromium.org
a40569e5a0 Port fast eval calls to x64 and ARM. For global variables that can
only be shadowed by eval-introduced variables we usually do not need
to do a context lookup in the runtime system.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4803 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-07 07:12:00 +00:00
erik.corry@gmail.com
9fc31e1fed Fix last-minute thinko that I snuck into the last change.
It busted crypto-decrypt.
Review URL: http://codereview.chromium.org/2434005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4784 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-02 10:47:50 +00:00
erik.corry@gmail.com
b600905133 ARM: Track Smis on top 4 stack positions and Smi loop variables.
Improve code generation for known smis and suspected Smis.
Review URL: http://codereview.chromium.org/2452002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4783 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-02 09:37:02 +00:00
vitalyr@chromium.org
26be30912d Fix generated code for String.charCodeAt.
Review URL: http://codereview.chromium.org/2468001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4770 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-01 14:08:19 +00:00
erik.corry@gmail.com
44cfbe392c ARM: Remove LoadConditionAndSpill and VisitAndSpill.
Review URL: http://codereview.chromium.org/2414001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4753 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-31 08:52:57 +00:00
erik.corry@gmail.com
8a2637fba9 Get rid of LoadAndSpill on ARM since Load() knows whether it is
in a spilled scope or not.  Also get rid of some spilled scopes
that we don't need any more.  The generators for the %_ functions,
CodeGenerator::Generate*, are now not spilled by default.  Some
of them (IsObject and related) have been converted to register
allocated operation.
Review URL: http://codereview.chromium.org/2368001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4749 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-28 11:23:07 +00:00
ager@chromium.org
e840870331 Fix presubmit error. Trailing whitespace.
TBR=erik.corry
Review URL: http://codereview.chromium.org/2224007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4746 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-27 13:57:55 +00:00
erik.corry@gmail.com
73256b05af Fix jump targets on ARM to merge virtual frames (really this time).
Use the jump targets to move the first deferred code to not flush
registers in the inlined case (KeyedLoad).
Review URL: http://codereview.chromium.org/2249002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4745 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-27 13:48:52 +00:00
vegorov@chromium.org
fc7c5f789a Cardmarking writebarrier.
Reapply r4715 with fixes reviewed in http://codereview.chromium.org/2276002.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4743 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-27 12:30:45 +00:00
vitalyr@chromium.org
64bc39a726 Fix: make string indexing work with Infinity.
NumberToUint32 that I was trying to use maps -0 to +0 (as desired) but
also maps +/-Infinity to +0, which made +/-Infinity a valid string
index. I fixed it by introducing a new runtime function with the right
semantics.

TEST=LayoutTests/fast/js/char-at.html,mjsunit/string-charat.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4734 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-26 16:11:30 +00:00
vitalyr@chromium.org
ad0e38909f Custom call IC-s for String.prototype.{charAt,charCodeAt}.
These string methods can be composed from two basic blocks: charCodeAt
and fromCharCode, both of which have fast cases for certain types of
inputs. In this patch these two blocks are refactored to allow
generating the fast cases without having to jump around the slow
cases. In the slow cases since they can now be invoked both from
inline runtime functions and from IC stubs we either have to
save/restore state of the current frame or enter/leave a new internal
frame. This is handled by new RuntimeCallHelper interface. Its
implementation for virtual frame is based on FrameRegisterState class
extracted from DeferredCode class.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4733 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-26 14:23:19 +00:00
sgjesse@chromium.org
6de39cd1f0 ARM: Add Ldrd/Strd to the macro assembler
The macro assembler now checks for ARMv7 support and generates instructions for Ldrd/Strd accordingly. INstructions ldrd/strd in the assembler requires ARMv7 support enabled. This removes the a check for CAN_USE_ARMV7_INSTRUCTIONS making the ARMv7 support in the simulator fully controled by the --enable-armv7 flag.
Review URL: http://codereview.chromium.org/2226003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4726 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-26 11:19:39 +00:00
sgjesse@chromium.org
f952df4be1 Make ldrd and strd instructions take two register arguments
Review URL: http://codereview.chromium.org/2122021

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4724 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-26 09:43:54 +00:00
vegorov@chromium.org
e268fbdaba Revert r4715.
TBR=ager@chromium.org
Review URL: http://codereview.chromium.org/2274001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4723 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-26 09:24:44 +00:00
erik.corry@gmail.com
4ad6f2f93e Refactoring of codegen-arm.cc to use the VirtualFrame API.
This is a commit for Rodolph Perfetta.
http://codereview.chromium.org/2159002


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4722 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-26 08:40:11 +00:00
sgjesse@chromium.org
22e4847fde ARM: Update the full compiler to handle all code
The full compiler is now complete on ARM as well. The syntax checker is still used to determine whether to use it for top level code or not during normal execution. When debugging is enabled all code will be compiled with the full compiler.

This change removes the temporary flag --force-full-compiler and now the flag --always-full-compiler enables the full compiler for all code on all platforms.

This also fixes building on Intel platform without debugger support (ENABLE_DEBUGGER_SUPPORT not defined) and adds full check for the full compiler for lazily compiled code.
Review URL: http://codereview.chromium.org/2163006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4716 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-25 14:08:17 +00:00
vegorov@chromium.org
675e711f1c Cardmarking writebarrier.
- New сardmarking write barrier handles large objects and normal objects in a similar fashion (no more additional space for pointer tracking is required, no conditional branches in WB code).
- Changes to enable oldspaces iteration without maps decoding:
-- layout change for FixedArrays: length is stored as a smis (initial patch by
Kevin Millikin)
-- layout change for SharedFunctionInfo: integer fields are stored as smi on
arm, ia32 and rearranged on x64.
-- layout change for String: meaning of LSB bit is fliped (1 now means hash not
computed); on x64 padding is added.
-- layout of maps is _not_ changed. Map space is currently iterated in a special
way.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4715 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-25 13:15:16 +00:00
vegorov@chromium.org
2241d2af45 Reverting r4703.
TBR=ager@chromium.org
Review URL: http://codereview.chromium.org/2073018

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4704 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-21 17:37:47 +00:00
vegorov@chromium.org
8879691793 Cardmarking writebarrier.
Reapplication of r4685 (reviewed http://codereview.chromium.org/2101002) with minor modifications:

- Fix compilation problems on Win64.
- Improve heap verification pass: search for garbage pointers to new space not only in dirty regions but in all regions.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4703 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-21 15:52:38 +00:00
vegorov@chromium.org
955828e437 Reverting r4685, r4686, r4687
TBR=ager@chromium.org
Review URL: http://codereview.chromium.org/2071020

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4688 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-20 14:02:51 +00:00
vegorov@chromium.org
b38a0a719a - Changes to enable oldspaces iteration without maps decoding:
-- layout change for FixedArrays: length is stored as a smis (initial patch by Kevin Millikin)
-- layout change for SharedFunctionInfo: integer fields are stored as smi on arm, ia32 and rearranged on x64.
-- layout change for String: meaning of LSB bit is fliped (1 now means hash not computed); on x64 padding is added.
-- layout of maps is _not_ changed. Map space is currently iterated in a special way.
- Cardmarking write barrier. New barrier handles large objects and normal objects in a similar fashion (no more additional space for pointer tracking is required, no conditional branches in WB code).

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4685 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-20 13:10:38 +00:00
sgjesse@chromium.org
e90d8314fa ARM: Don't require the receiver on the stack for load IC
Previously the receier was passed in both r0 and on the stack for a load IC. With this change the receiver is in r0 only.
Review URL: http://codereview.chromium.org/2119007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4681 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-19 10:29:19 +00:00
sgjesse@chromium.org
d25c36deee ARM: Pass arguments to keyed store IC in registers
The calling convention for keyed store IC on ARM is changed to receive the arguments value, key and receiver in registers r0, r1 and r2 instead of on the stack. When calling keyed store IC with a virtual frame the arguments are passed through the virtual frame and consumed by the call.

Changed the register usage in the IC code to postpone spilling the registers holding value, key and receiver to the stack until making  a call into the runtime system.

Runs all the tests with: 

  --special-command="@ --nofull-compiler"
  --special-command="@ --always-full-compiler"
  --special-command="@ --noenable-vfp3"
Review URL: http://codereview.chromium.org/2116003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4668 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-18 06:57:12 +00:00
mark@chromium.org
e9b5d7855b Allow build-time selection between ia32 and x86_64 in the GYP/Xcode Mac
Chromium build.

v8.gyp no longer sets any V8_TARGET_ARCH_* macro on the Mac. Instead, the
proper V8_TARGET_ARCH_* macro will be set by src/globals.h in the same way as
the V8_HOST_ARCH_* macro when it detects that no target macro is currently
defined. The Mac build will attempt to compile all ia32 and x86_64 .cc files.
#ifdef guards in each of these target-specific source files prevent their
compilation when the associated target is not selected. For completeness,
these #ifdef guards are also provided for the arm and mips .cc files.

BUG=706
TEST=x86_64 Mac GYP/Xcode-based Chromium build (still depends on other changes)
Review URL: http://codereview.chromium.org/2133003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4666 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-17 15:41:35 +00:00
sgjesse@chromium.org
3a7bf08847 Modified codegen-arm.cc to no longer use V8_NATIVE_REGEXP, but to use
V8_INTERPRETED_REGEXP (as per Issue 1635001). 

BUG=none 
TEST=Ran v8 tests, as well as against current Chromium browser.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4655 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-14 13:53:26 +00:00
ager@chromium.org
75cd61a912 Refactor the fast-case code for loading local/global variables and
arguments in the presence of eval to avoid code duplication. Almost
the same code was duplicated for loading properties and calling
properties.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4645 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-12 09:12:23 +00:00
erik.corry@gmail.com
e5a188c2fc ARM: Fix jumptargets to actually merge virtual frames.
Make use of the new functionality to make ++ and --
non-spilled operations.
Review URL: http://codereview.chromium.org/2041010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4644 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-12 09:00:29 +00:00
erik.corry@gmail.com
663f8fa240 ARM: Optimize shifts by constant integers, especially
shifts by zero or arithmetic shifts.  Updated to also
eliminate ASR followed by LSL as per part two of
http://codereview.chromium.org/1987008/show
Review URL: http://codereview.chromium.org/2054007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4641 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-11 08:27:56 +00:00
ager@chromium.org
afdb1dd2bd Added Heap:: prefix to kFixedArrayMapRootIndex in ARM
codegenerator. The missing scoping breaks the build with some
compilers.

TBR=sgjesse@chromium.org
Review URL: http://codereview.chromium.org/2036007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4636 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-10 17:19:48 +00:00
sgjesse@chromium.org
1ae585b0a2 Support both TOS register combinations in inlined keyed load
When popping key and receiver for an inlined keyed load support either order of r0/r1. The possible swap to have key in r0 and receiver in r1 is postponed to the deferred code calling the keyed load IC.
Review URL: http://codereview.chromium.org/1992012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4634 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-10 13:23:42 +00:00
ager@chromium.org
f54b7767c6 Implement fast load and call of arguments in the presence of eval.
Load the arguments object from the context if there are no extensions
objects on the way. Then load the argument with a keyed load ic.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4633 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-10 12:20:06 +00:00
erik.corry@gmail.com
fa7c92eaf5 First step towards making JumpTarget work on ARM. Instead
of having a list of virtual frame pointers in the jump
target we have one virtual frame, which is the frame that
all have to merge to to branch to that frame.  The virtual
frame in the JumpTarget is inside the JumpTarget, rather than
being an allocated object that is pointed to.  Unfortunately
this means that the JumpTarget class has to be able to see
the size of a VirtualFrame object to compile, which in turn
lead to a major reorganization of related .h files.  The
actual change of functionality in this change is intended
to be minimal (we now assert that the virtual frames match
when using JumpTarget instead of just assuming that they do).
Review URL: http://codereview.chromium.org/1961004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4631 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-10 11:32:25 +00:00
sgjesse@chromium.org
b7df730e69 Fix inlined keyed property load on ARM
The change r4608 accidently disabled the inlined keyed load as the key/receiver registers was mixed up. Also make sure that the registers for the keyed load IC is not clobbered before bailout to deferred code. This adds one instriction to the inlined code path.
Review URL: http://codereview.chromium.org/2018005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4629 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-10 10:45:18 +00:00
erik.corry@gmail.com
d5738c0e6d Add ldrd and strd instructions to the ARM port. This is a
commit for zhangk@codeaurora.org.  See
http://codereview.chromium.org/568029 and
http://codereview.chromium.org/2019003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4618 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-07 20:02:57 +00:00
sgjesse@chromium.org
ae4cc3c287 Add a flag to the ARM version of new space allocation in generated code
The flag SIZE_IN_WORDS indicate that the requested size is in words and not in bytes, The default is to specify the size in bytes.
Review URL: http://codereview.chromium.org/2047002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4617 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-07 14:06:55 +00:00
ager@chromium.org
856135af42 Implement fast calls of functions in the presence of eval (if the eval
calls do not introduce new bindings).

The infrastructure is already in place for fast loads from context
slots in the presence of eval.  This change simply uses that
infrastructure for calls as well as loads.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4609 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-07 10:25:11 +00:00
sgjesse@chromium.org
89a7341d3f Pass key and receiver in registers for keyed load IC on ARM
The calling convention for keyed load IC's on ARM now passes the key and receiver in registers r0 and r1.

The code path in the ARM full compiler for handling keyed property load now has the same structure as for ia32 where the keyed load IC is also called with key end receiver in registers.

This change have been tested with an exhaustive combinations of the flags

  --special-command="@ --nofull-compiler"
  --special-command="@ --always-full-compiler"
  --special-command="@ --noenable-vfp3"

to the test runner.
Review URL: http://codereview.chromium.org/2024002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4608 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-07 10:16:11 +00:00
serya@chromium.org
9c245f168a Fixing a performance bug introduced in r4581.
Review URL: http://codereview.chromium.org/1910005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4605 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-06 12:57:11 +00:00
whesse@chromium.org
fc41b41fc2 Allocate the right number of fast context slots on X64 and ARM. Port from ia32.
This is ported from change 3505 on ia32.
Review URL: http://codereview.chromium.org/1992003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4603 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-06 11:59:10 +00:00
erik.corry@gmail.com
d18b73c2fe Add a single-element global positive and negative cache to
the implementation of instanceof.
Review URL: http://codereview.chromium.org/1765012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4599 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-06 09:35:18 +00:00
sgjesse@chromium.org
5a3ea1c83e Add some comments to the ia32 code generator
Review URL: http://codereview.chromium.org/1918002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4586 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-05 06:57:41 +00:00
sgjesse@chromium.org
efe9f30fbe Handle loading the property name for load IC in the virtual frame
Review URL: http://codereview.chromium.org/1946001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4585 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-05 06:50:15 +00:00
sgjesse@chromium.org
a355e45e22 Pass key in register for keyed load IC
The calling convention for keyed load IC is changed to have the key passed both in a register (r0) and on the stack.

Next steps will be first to remove the key from the stack and then pass the receiver in a register (r1).
Review URL: http://codereview.chromium.org/1937003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4584 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-05 06:40:14 +00:00
serya@chromium.org
16d3811d50 Changing string length field type from int to SMI. It will make it be a regular field. Code generated in EmitNamedLoad could be patched for faster access to string.length.
Review URL: http://codereview.chromium.org/1706013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4581 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-04 14:49:50 +00:00
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
sgjesse@chromium.org
528ab2bc7d Refactor assignment in the ARM code generator
This is mainly a port of r3899. It also adds handling of initilization blocks in ARM which had no special handling before.

The "calling conventions" used for

  EmitNamedLoad
  EmitNamedStore
  EmitKeyedLoad
  EmitKeyedStore

are somewhat mixed, but will become more aligned as the use of register allication and passing of argument in registers to IC's is extended.
Review URL: http://codereview.chromium.org/1846002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4574 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-04 09:33:12 +00:00
podivilov@chromium.org
d9587ab8d6 Port string keyed load IC improvements (r4444) to ARM.
Review URL: http://codereview.chromium.org/1769014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4573 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-04 09:32:07 +00:00
erik.corry@gmail.com
9d5f6d0b46 Partial and small update to the codegen to use the new register allocator framework. See http://codereview.chromium.org/1732024. Committed for Rodolph Perfetta.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4564 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-05-03 10:22: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
sgjesse@chromium.org
a788b8ce56 Remove unused code
The SmiOperation function was not used anymore. Remove it and rename VirtualFrameSmiOperation to SmiOperation.
Review URL: http://codereview.chromium.org/1723021

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4548 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-29 13:09:31 +00:00
sgjesse@chromium.org
15a6a43aa8 Add inlining of keyed store on ARM
This ports the inlining of keyed store to the ARM port. As the inlined code does not handle the write barrier it only supports storing of smis.
Review URL: http://codereview.chromium.org/1719021

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4531 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-28 11:14:31 +00:00
erik.corry@gmail.com
ea1d2ad87b Fix keyed load inlining after my last commit accidentally
broke it.
Review URL: http://codereview.chromium.org/1780010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4526 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-28 09:12:04 +00:00
erik.corry@gmail.com
c690c2ba77 Change the LoadIC calling convention so that the receiver
is both on top of the stack and also in r0.  This makes
sense because the receiver is usually in r0 anyway.  We may
remove it from the stack later.  Also removes some spilled
scopes from the code generator allowing it to keep expression
temporaries in registers more.
Review URL: http://codereview.chromium.org/1751019

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4518 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-27 19:24:36 +00:00
podivilov@chromium.org
5a999d8b18 Port number string cache lookup for heap numbers in generatred code to x64 and ARM.
Review URL: http://codereview.chromium.org/1575047


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4516 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-27 14:56:56 +00:00
sgjesse@chromium.org
9b5ca37545 Inline keyed load on ARM
This uses the same infrastructure as is used by the inlining of named property load. The code patching if the inlined code is simpler as the key is provided in a register os the only patching required is the map check directing the inlined code to the deferred code block or not.
Review URL: http://codereview.chromium.org/1735007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4510 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-27 11:16:05 +00:00
sgjesse@chromium.org
2e1298944f Fix presubmit errors
TBR=erik.corry@gmail.com
Review URL: http://codereview.chromium.org/1736018

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4509 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-27 09:23:33 +00:00
sgjesse@chromium.org
daf1ea3970 Avoid constant pool blocking for too long
The generation of the deferred code for named property load where the load was inlined did a constant pool blocking for the whole deferred code. Having large numbers of this type of deferred code generated one ofter the other effectively blocked the constant pool for all the deferred code causing 

Removed the BeforeGenerate/AfterGenerate for the deferred code and made macro assembler StartBlockConstPool/EndBlockConstPool non-public. Re-introduced BlockConstPoolFor instead to use with BlockConstPoolScope to block some more instructions cross function calls.

Also handle the use of native code counters for inlined named property load.
Review URL: http://codereview.chromium.org/1787005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4507 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-27 09:09:51 +00:00
erik.corry@gmail.com
507e9b26a6 Simplify the use of the stm instruction on ARM.
Review URL: http://codereview.chromium.org/1694016

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4501 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-26 14:25:29 +00:00
erik.corry@gmail.com
280af55178 Cosmetic changes to the ARM port.
Review URL: http://codereview.chromium.org/1790002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4492 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-26 11:41:39 +00:00
erik.corry@gmail.com
ed6817d58c Fix a bug where a GC at an unlucky moment caused a wrong
calculation on ARM.
Review URL: http://codereview.chromium.org/1733016

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4491 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-26 11:06:37 +00:00
vitalyr@chromium.org
559ba2ccf0 Don't share function result caches between contexts.
A reference to the caches array was embedded directly into the builtin
code and this allowed sharing objects between contexts.

Unfortunately, clearing the cache on GC won't prevent sharing so we
either have to have per-context builtin code or load the cache
indirectly from the current context. This change implements the second
approach. The first approach may be interesting to consider in the
future for some perfomance critical functions, and the current
approach can still be improved by putting the caches directly into the
global context (or even global objects).

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4486 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-25 10:31:52 +00:00
kaznacheev@chromium.org
3ca99e722b Fix BinaryOpIC implementation on ARM.
On a pair of smis HEAP_NUMBERS stub is significantly slower than GENERIC. This slows
down some tests dramatically (crypto-aes from SunSpider).
With this change HEAP_NUMBERS stub switches to GENERIC stub the first time it sees 2 smis
as its operands.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4483 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-23 10:08:24 +00:00
sgjesse@chromium.org
931f0a031a Changed inlined property load detection on ARM
Instaed of having a nop after all non-inlined calls to load IC use a different nop (mov r1, r1 instead of mov r0, r0) to detect an inlined load IC.

Added more infrastructure to the deferred code handling to make it possbile to block constant pool emitting in a deferred code block, including the branch instruction ending the deferred code block.

Addressed a couple of comments to http://codereview.chromium.org/1715003, including adding an assert to make sure that the patching of an ldr instruction is always possible.
Review URL: http://codereview.chromium.org/1758003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4480 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-23 07:42:45 +00:00
erik.corry@gmail.com
8ceb9ad8de Speed up random on ARM. Patch committed for rodolph.perfetta@googlemail.com. See http://codereview.chromium.org/1689007
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4477 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-22 17:25:42 +00:00
ager@chromium.org
0720377a66 Port apply with arguments optimization to ARM. This avoid allocating
the arguments object when not necessary.
Review URL: http://codereview.chromium.org/1738003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4473 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-22 12:20:36 +00:00
sgjesse@chromium.org
968a524432 Add inlining of property load on ARM
Generate inlined named property load for in-object properties. This uses the same mechanism as on the Intel platforms with the map check and load instruction of the inlined code being	patched by the inline cache code. The map check is patched through the normal constant pool patching and the load instruction is patched in place.
Review URL: http://codereview.chromium.org/1715003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4468 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-22 07:18:30 +00:00
sgjesse@chromium.org
e9f818b242 Fix lint errors
TBR=erik.corry@gmail.com
Review URL: http://codereview.chromium.org/1749002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4458 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-21 10:20:55 +00:00
sgjesse@chromium.org
786c213dc6 Use an object to control the blocking of the constant pool
Instead of indicating for how many instructions the constant pool needs to be blocked the constant pool is now blocked while at least one instance of ScopedConstPoolBlocker exists.
Review URL: http://codereview.chromium.org/1673006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4456 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-21 09:43:45 +00:00
sgjesse@chromium.org
88fc8f1fb5 Add tracking of loop nesting to ARM code.
Review URL: http://codereview.chromium.org/1645008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4429 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-15 14:06:57 +00:00
sgjesse@chromium.org
09aa20da08 Ensure stack alignment in ARM port
In the CEntryStub keep track of the actual skew from the correct alignment to ensure proper alignment before calling the runtime. Add checks to test the expected skew when running on hardware.

Use the PrepareCallCFunction/CallCFunction in a few other places.

Add check to the ARM simulator for correct alignment.

Add option --sim-stack-alignment to set the stack alignment in the simulator. Currntly only values 4 and 8 makes sense. 8 is the default to make snapshots generated with the simulator work on hardware requiring 8 byte stack alignment.
Review URL: http://codereview.chromium.org/1530043

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4425 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-15 09:34:47 +00:00
sgjesse@chromium.org
9b31f11df6 Avoid warning on ARM reported by newer GCC versions
Review URL: http://codereview.chromium.org/1540038

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4424 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-15 08:45:27 +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
sgjesse@chromium.org
d74a8a8014 Port direct call to native RegExp from JavaScript to ARM
The ia32 version was implemented in r3542 and r3543. The x64 was implementeed in r3740, r3741 and r3742.

Minor tweaks to the is32 and x64 code as well.
Review URL: http://codereview.chromium.org/1575035

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4409 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-14 09:25:33 +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
erik.corry@gmail.com
cfad01282c Make binary op stubs in both r0-r1 and r1-r0 versions to reduce
register churn.
Review URL: http://codereview.chromium.org/1606019

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4380 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-09 18:25:51 +00:00
sgjesse@chromium.org
68a0a108c4 Call to C function support in macro assembler
Implement macro assembler operations PrepareCallCFunction and CallCFunction like on both Intel platforms. Used these for direct calls to C functions.
Review URL: http://codereview.chromium.org/1549031

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4374 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-09 11:25:52 +00:00
erik.corry@gmail.com
fbefa72f81 Simple register allocation for ARM. Only top of expression
stack for now.  Next step is probably fixing the binary
op stubs so they can take swapped registers and fixing
the deferred code so it doesn't insist that all registers
except the two operands are flushed.  Generates slightly
worse code sometimes because the peephole push-pop
elimination gets confused when we don't use the same
register all the time (the old code used r0 always).
Review URL: http://codereview.chromium.org/1604002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4368 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-08 22:30:30 +00:00
kaznacheev@chromium.org
aca9cf1bac Re-submitting binary op ICs for ARM. Does not break debug tests
now.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4365 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-08 15:19:06 +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
vitalyr@chromium.org
f1a47d2bbd Inline %_ArgumentsLength.
This makes usage of cmov unnecessary.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4323 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-30 13:55:03 +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
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
0c6a3f4864 Fix GetName and Print for CompareStub
Review URL: http://codereview.chromium.org/1108006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4233 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-23 14:59:36 +00:00
vegorov@chromium.org
b7833cb5f1 Port of optimized ICs for external and pixel arrays from ia32 to ARM.
Review URL: http://codereview.chromium.org/993002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4228 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-23 13:38:04 +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
kasperl@chromium.org
c2427115db Fix issue 656 on ARM.
TBR=iposva@chromium.org
Review URL: http://codereview.chromium.org/1117010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4214 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-23 07:14:25 +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
sgjesse@chromium.org
ef2e46d1cc Use bit fields to calculate compare stub minor key
Review URL: http://codereview.chromium.org/1081010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4208 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-22 14:31:28 +00:00
whesse@chromium.org
fde714bb5b Revert change 4201.
Review URL: http://codereview.chromium.org/1113007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4203 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-22 12:16:11 +00:00
kaznacheev@chromium.org
fafd5dd599 Porting binary op ICs to arm
Review URL: http://codereview.chromium.org/883001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4201 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-22 11:07:22 +00:00
vegorov@chromium.org
ed53268006 Port of string plus smi optimization from ia32 to x64 and ARM.
Review URL: http://codereview.chromium.org/668254

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4138 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-15 17:11:08 +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
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
b4e0375e96 Added sqrt and pow for arm and x64 - to fix build failures.
Review URL: http://codereview.chromium.org/669272

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4055 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-08 13:49:23 +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
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
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
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
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
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