Commit Graph

958 Commits

Author SHA1 Message Date
fschneider@chromium.org
38b91a4ffe Fix issue 1076 by resetting labels of switch-clauses before use.
If we compile a function literal twice with the full code generator,
we must make sure that the labels embedded in the AST are reset.

BUG=1076

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6496 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-26 15:28:17 +00:00
sgjesse@chromium.org
9d463bd6a1 ARM: Fix the type recording binary operation stub subtract
Failure exposed by Sputning tests where the generic case tried to string add for subtract.
Review URL: http://codereview.chromium.org/6339013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6488 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-26 12:31:35 +00:00
sgjesse@chromium.org
26a8dc3818 ARM: Make the ARM hardware builder green
Fix a bug in the --debug-code alignment check in the C entry stub.

Don't force the --debug-code flag in the ARM disassembler tests. The framework does support passing flags and the test runner will when running tests in debug mode.

Skip some deserialization tests which crashes from time to time.
Review URL: http://codereview.chromium.org/6393007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6484 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-26 09:52:25 +00:00
ager@chromium.org
0e183035a2 ARM: Merging constants in simulator and assembler header files and other cleanup.
First stab at a general ARM cleanup patch. It merges ARM constants so that they can be used across simulator, assembler and disassembler, and tidies up some syntax and ambiguities.

BUG=none
TEST=none

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6483 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-26 08:32:54 +00:00
erik.corry@gmail.com
591eb3f406 Minor cleanup: Use MaybeObject instead of bool and Failure** in
stub cache generation.
Review URL: http://codereview.chromium.org/6392003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6480 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-26 08:12:56 +00:00
fschneider@chromium.org
1c4dfa30fa Revert r6543 and r6441.
This fixes a crash in the code generator.

BUG=1074

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6479 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-26 08:03:48 +00:00
sgjesse@chromium.org
0282f707af Fix presumbit.
TBR=ager@chromium.org
Review URL: http://codereview.chromium.org/6250031

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6478 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-26 08:00:51 +00:00
sgjesse@chromium.org
06515b6f1b ARM: Change BranchOnSmi/BranchOnNotSmi to JumpIfSmi/JumpIfNotSmi
Review URL: http://codereview.chromium.org/6272019

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6477 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-26 07:44:45 +00:00
sgjesse@chromium.org
12c74ba0c6 ARM: Add subtract to the type recording binary operation stub.
Review URL: http://codereview.chromium.org/6324013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6476 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-26 07:41:02 +00:00
vitalyr@chromium.org
76483f871b Support StringLength in hydrogen (similar to ArrayLength).
To avoid deopts a few extra changes were needed:

o Enable megamorphic state for special property loads on
  primitives. We used to flip between monomorphic stubs.
o Extract pure string (no string wrapper support) version of the
  string length stub.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6472 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-25 15:51:10 +00:00
sgjesse@chromium.org
99a5b9f713 ARM: Initial type recording binary operation stub
This implements the type recording binary operation stub for ARM. This first iteration only supports ADD. Handling of 32-bit integers is currently not implemented but just transitions. The generic case for now delegates to the generic binary operation stub.
Review URL: http://codereview.chromium.org/6342019

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6471 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-25 14:52:35 +00:00
kmillikin@chromium.org
013860d42e Revert "Reapply change to with/arguments interaction."
Revert this change again.  Somewhat mysteriously we sometimes get empty
contexts that we do not expect in the context chain.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6465 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-25 13:01:45 +00:00
ricow@chromium.org
2a741d4946 Do not shuffle parameters when doing sub on ia32 and arm.
Review URL: http://codereview.chromium.org/6283012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6458 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-25 12:17:02 +00:00
fschneider@chromium.org
2444e3f247 Port to ARM and x64: Record the lazy deoptimization environmnent only at LLazyBailout-instructions.
This is a port of the change http://codereview.chromium.org/6348016/
to ARM and x64 platform.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6453 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-25 10:35:57 +00:00
ricow@chromium.org
d5cab38a33 Add support for deoptimization on x64.
I did not take out the code relating to osr from the generate method
since this makes it easier to compare to ia32 (we will abort anyway when we hit the osr code so there should be no issues with having this in)
 

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6449 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-25 07:57:56 +00:00
sgjesse@chromium.org
161d631b5e Change ARM exit frame layout and alingment handling
Change the ARM exit frame to have the same layout as the IA32 exit frame. This basically re-arranges the order of fp and sp and changes the sp location of the entry frame to hold the sp used by the gc and not the sp for popping the arguments. This removes the option of tearing down the frame and returning using one ldm instruction.

The main motivation for this is to avoid pushing an alignment word before generating the entry frame. The GC handling of optimized frames process the registers pushed as part of a safepoint and asumes that these are at the top of the frame, so if an alignment word is pushed this processing will be one off.

The alignment handling in the C entry stub have also been simplified. Now the value of lr is stored to a stack slot already reserved avoiding pushing it and keeping track of "frame skew".

This does result in more instructions in the exit frame on ARM, but we can look into improving this later.
Review URL: http://codereview.chromium.org/6247019

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6448 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-25 07:49:39 +00:00
ager@chromium.org
4c8fbaffa1 Move stack check patching to the architecture dependent deoptimizer
files. On ARM it is not enough to iterate the relocation information
because that will only give us access to the constant pool and not to
the place in the instruction stream where the target in the constant
pool is called.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6444 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-24 14:54:45 +00:00
kmillikin@chromium.org
9c2d52eb0e Fix a bug in delete for lookup slots.
The function Runtime_LookupContext searches the context chain for a
LOOKUP slot and returns the object holding the slot.  It returned the
global context if the slot was not found or if it was found in a
function's context or arguments object.  This is not the correct
object to use for 'delete'.

Since this lookup function is only ever used when deleting LOOKUP
slots (those that have to go through a with or a scope with eval), it
is simply replaced with a Runtime_DeleteContextSlot function that does
the appropriate thing for all kinds of context lookups.

This fixes Chromium bug 70066.
http://code.google.com/p/chromium/issues/detail?id=70066

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6442 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-24 14:03:30 +00:00
ager@chromium.org
883a56717d ARM: Implement DoIsObject and DoIsObjectAndBranch in the lithium code generator.
BUG=none
TEST=none

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6438 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-24 12:28:38 +00:00
fschneider@chromium.org
672f5ffab6 Port lithium template classes to ARM.
This is a port of the IA32 version and is needed to allow 
changing the register allocator interface in a later change.



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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6436 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-24 09:43:14 +00:00
ricow@chromium.org
8a1416c78d Fix double allocation of register on arm in DoDeferredMathAbsTaggedHeapNumber.
This should fix the sputnik issue on the arm simulator.

Priorly tmp2 and tmp3 could potentially be the same register as input.


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6434 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-24 07:56:57 +00:00
kbr@chromium.org
cbc1c0fca6 Truncate rather than round to nearest when performing float-to-integer
conversions for external array types, which implement the Typed Array
spec. (Revision of http://codereview.chromium.org/6315004 .)

Prefer SSE2 code path on x86 processors. Non-SSE2 processors now make
a slow runtime call for float-to-int conversions. Use SSE3 for 32-bit
signed and unsigned int array types where possible.

The movement of code from ic-arm.cc to stub-cache-arm.cc caused the
VFP3 code path to be tested for the first time. Fixed bugs in the
register usage and in the constant value stored into integer arrays
for NaN and +/-Infinity.

Added new truncation test to test-api.cc. Storage of NaN and +/-Inf
was already covered. Ran unit tests on x86, x64 and ARM simulator.
Tested ia32 and x64 code in Chromium on Mac and Linux respectively
with Typed Array unit tests and WebGL content.

BUG=http://code.google.com/p/chromium/issues/detail?id=50972
TEST=test-api/ExternalArrays

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6431 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-21 23:58:00 +00:00
kmillikin@chromium.org
8a9eeaf8da Reapply change to with/arguments interaction.
This is svn r6415 with a bugfix.

The bug was that we can have scopes with 0 heap slots (functions with
such scopes do not need a local context) and scopes with at least
Context::MIN_CONTEXT_SLOTS.  The code generator only allocated a local
context if there were strictly more than Context::MIN_CONTEXT_SLOTS.
Before the change to with/arguments, it was impossible to actually get
a function scope with exactly Context::MIN_CONTEXT_SLOTS because every
such scope included a heap-allocated arguments (and arguments shadow)
slot.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6426 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-21 11:28:35 +00:00
vitalyr@chromium.org
7d96f2d40f Fix Smi::IsValid assert in StringCharCodeAt deferred code.
Review URL: http://codereview.chromium.org/6303013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6424 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-21 08:30:13 +00:00
karlklose@chromium.org
f914324293 Implement fast code for the common cases of left hand sides that are less than three times larger as the right hand side and and right hand sides that are powers of two up and including 32.
In the covered special cases the result is computed directly, else the generic stub is called. The implementation deoptimizes only for mod 0 and if the result may be a negative zero.

BUG=none
TEST=none

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6421 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-20 17:42:29 +00:00
ager@chromium.org
49d646b14c ARM: Implement StringLength and StringCharCodeAt in the lithium-arm
backend.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6419 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-20 14:20:54 +00:00
kmillikin@chromium.org
3d15b43393 Begin changing Hydrogen branch instructions.
Rename HBranch (the instruction that coerces an arbitrary HValue to
control flow) to HTest to free up the term Branch to refer to any
control instruction with two successors.

Change the virtual FirstSuccessor and SecondSuccessor functions on
control instructions to a pair of data members.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6417 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-20 12:56:34 +00:00
ager@chromium.org
1c2fddb4c8 ARM: Implement Math.abs in lithium code generator for the integer and
tagged case. I couldn't find a way to test the double case yet so I'm
leaving that unimplemented for now.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6411 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-20 08:08:36 +00:00
vitalyr@chromium.org
b4ff318e4b Support StringCharCodeAt in hydrogen/lithium.
This patch adds H- and L-variants of StringCharCodeAt and StringLength.

StringCharCodeAt is used to inline a constant function call of
String.prototype.charCodeAt and to implement the corresponding inline
runtime function. It does not yet use the recently introduced extra IC
state. (We can specialize on string encoding and avoid deopts because
of out of bounds accesses.)

StringLength needs more work because the stub version of it also
supports strings wrappers and it matters in some cases. (We have to
separate the string only case.)

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6408 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-19 20:05:22 +00:00
ager@chromium.org
f6e177f075 Fix the ARM simulator's stop support and add conditional breakpoint.
BUG=none
TEST=none

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6405 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-19 15:39:40 +00:00
kmillikin@chromium.org
70910af7a0 Fix an assertion failure in the full code generator.
We hit an assertion failure when we tried to record the AST ID of
the (shared) .arguments variable proxy more than once.  This was hit
when we had multiple calls to the same parameter in a function that
used the arguments object.  The fix is to not visit the subexpressions
of the (shared) property access expression.

BUG=1060

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6404 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-19 15:26:54 +00:00
sgjesse@chromium.org
3ff8e4d3fa ARM: Implement DoInstanceOfKnownGlobal stub
BUG=none
TEST=none

Patch by Martyn Capewell from ARM Ltd.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6403 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-19 14:53:38 +00:00
ager@chromium.org
56073b733f ARM: Implement HasInstanceType in lithium backend.
Review URL: http://codereview.chromium.org/6283006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6398 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-19 13:04:21 +00:00
ager@chromium.org
fb43b16e2b ARM: Implement DoCmpJSObjectEqAndBranch.
Review URL: http://codereview.chromium.org/6381001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6396 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-19 11:56:32 +00:00
ager@chromium.org
e65647eafc ARM: Implement StringCharAtStub.
Review URL: http://codereview.chromium.org/6334007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6390 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-19 11:35:41 +00:00
ager@chromium.org
6b4d29766c Revert r6376 and r6373 which changes external array support. The ARM
version did not work.

TBR=kbr@chromium.org
Review URL: http://codereview.chromium.org/6295013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6381 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-19 08:20:42 +00:00
ager@chromium.org
9ab1970860 Fix ARM compilation after external array changes.
TBR=kbr@chromium.org
Review URL: http://codereview.chromium.org/6261014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6376 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-19 07:18:04 +00:00
kbr@chromium.org
27f0ae7aad Truncate rather than round to nearest when performing float-to-integer
conversions for external array types, which implement the Typed Array
spec. The new code paths are for SSE3 and SSE2 capable processors.
The code for non-SSE2 processors is unchanged for now. The ARM port
appears to already be correct.

Moved the generation of the external array load and store intrinsics
to the stub cache (on all platforms) so that they are generated at run
time and can take advantage of CPU features.

This functionality is covered by the array-unit-tests.html test in the
WebGL conformance test suite:
http://khronos.org/webgl/wiki/Testing/Conformance
https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/tests/conformance/array-unit-tests.html

Manually verified all of the SSE3/SSE2/non-SSE2 code paths by enabling
each in turn. Tested in Chromium on 32-bit Mac OS X and 64-bit Linux.

BUG=http://code.google.com/p/chromium/issues/detail?id=50972
TEST=none (see above)

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6373 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-18 21:51:50 +00:00
vitalyr@chromium.org
11a4cb5718 Introduce extra IC state to record additional feedback from IC-s.
Extra IC state is only two bits and only supported for call IC-s for
now. To change its extra state an IC stub jumps to a new miss stub
that goes to runtime as usual but then instead of going megamorphic
generates a monomorphic stub with the updated state.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6370 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-18 16:54:48 +00:00
ager@chromium.org
2729e09caf ARM: Implement double constants in the lithium ARM backend and fix
missing minus zero check in MathFloor implementation.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6362 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-18 11:31:17 +00:00
fschneider@chromium.org
e7610a3e14 Add UseAny to create a LOperand without register preference.
The result can be a register, a stack slot or a constant operand.

Right now it is only used for enviroment uses.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6349 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-17 12:54:52 +00:00
ager@chromium.org
7095d1ec26 ARM: Reenable Div and Mod in the ARM lithium codegenerator. The
crashes uncovered by this were caused by constant pool in safe-point
tables. This should be safe to enable now.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6348 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-17 12:52:06 +00:00
ager@chromium.org
ac320205b9 ARM: Fix ARM safepoint tables by ensuring that constant pools are not
emitted as part of the safepoint tables.

Always emit the constant pool as part of generating deferred code
(whether or not there actually is any deferred code) and ASSERT that
there is no pending relocation info while using db and dd to write
tables.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6347 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-17 12:45:39 +00:00
kmillikin@chromium.org
437914da90 Change the algorithm and generated code for parallel moves on IA32.
Instead of spilling and then immediately restoring eax to resolve
memory to memory moves, the gap move resolver now tracks registers
that are known to be free and uses one if available.  If not it spills
but restores lazily when the spilled value is needed or at the end of
the algorithm.

Instead of using esi for resolving cycles and assuming it is free to
overwrite because it can be rematerialized, the gap move resolver now
resolves cycles using swaps, possibly using a free register as above.

The algorithm is also changed to be simpler: a recursive depth-first
traversal of the move dependence graph.  It uses a list of moves to be
performed (because it mutates the moves themselves), but does not use
any auxiliary structure other than the control stack.  It does not
build up a separate list of scheduled moves to be interpreted by the
code generate, but emits code on the fly.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6344 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-17 11:25:36 +00:00
antonm@chromium.org
fae90d4f32 Make closures optimizable by Crankshaft compiler.
Currently only closures which only read from the context are supported.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6340 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-17 08:11:03 +00:00
ager@chromium.org
0819ac76f6 Landing for Martyn Capewell.
ARM: Implement DoInteger32ToDouble in lithium codegen. Clean up
temporary register use.

Code review URL: http://codereview.chromium.org/6257003/

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6339 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-17 07:26:36 +00:00
sgjesse@chromium.org
da1f6926e1 Avoid trashing the FPSCR when calculating Math.floor
The restoring of FPSCR could restore a random value as the restore point could be jumped to from before FPSCR was loaded.
Review URL: http://codereview.chromium.org/6344002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6332 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-14 15:39:18 +00:00
karlklose@chromium.org
d2d81743c9 Disable DivI and ModI again until the bug with SafepointWithRegistersAndDoubles is solved.
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6330 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-14 15:08:44 +00:00
kmillikin@chromium.org
199846b786 Move class LGapResolver to the platform specific backend implementation files.
This change is in preparation for introducing platform-specific strategies
for resolving parallel moves.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6321 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-14 12:50:03 +00:00
karlklose@chromium.org
0e26f42bc1 ARM: Implement DoModI stub in the lithium code generator.
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6312 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-14 11:48:43 +00:00
ricow@chromium.org
5e557d3624 Add implementations of some more x64 lithium methods.
This puts us very close to being able to compile the empty function.

This changes only has a small number of 64 bit specific assembler instructions.

The remaining changes are much more platform specific and will go in another change.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6306 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-14 10:27:25 +00:00
karlklose@chromium.org
da03f275d2 ARM: Implement DoDivI in the lithium code generator.
This change provides fast code for a few special cases and calls the GenericBinaryOpStub for the rest.

It also changes the register allocation in the generation of lithium instructions to use fixed registers that are compatible with the generic stub. This allocation can be change once we use a more flexible implementation.

Finally, this change provides infrastructure to save double registers at safepoints, which is need to call the stub in deferred code.

BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6304 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-14 08:49:52 +00:00
ager@chromium.org
0ec74d5829 Landing for Rodolph Perfetta.
Implementing Math.floor and Math.sqrt for crankshaft.

BUG=none
TEST=none

Code review URL: http://codereview.chromium.org/6250002/

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6298 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-13 12:21:47 +00:00
vitalyr@chromium.org
9e204dd5df Simplify CheckPrototypeMaps.
This instruction only depends on the prototype and the holder and can
completely ignore the receiver and its map.

This change also fixes a small bug on arm where a cell was loaded
instead of the prototype from new space.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6290 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-13 00:34:08 +00:00
fschneider@chromium.org
ad58227fcf Use hydrogen accessor in a few more places to save space in the lithium IR.
Review URL: http://codereview.chromium.org/6207007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6288 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-12 15:46:39 +00:00
vitalyr@chromium.org
e2f8c938c3 Allow arguments in safepoints with registers.
This should enable calling runtime functions with arguments from
deferred lithium code.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6285 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-12 14:14:14 +00:00
erik.corry@gmail.com
7846721d96 Fixes needed to compile on gcc-4.4.1 on ARM. It is still necessary
to add -fno-strict-aliasing.
Review URL: http://codereview.chromium.org/6123007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6281 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-12 11:56:41 +00:00
sgjesse@chromium.org
8f54606109 ARM: Always use the overflow flag to check for NaNs participating in a floating point compare.
Looks as if we don't need to use the vcmpe instruction instead of the vcmp, as the overflow FPSCR bit suits our purpose. If we at some point need vcmpe lte's implement it as a separate instruction.
Review URL: http://codereview.chromium.org/6197003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6277 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-12 07:47:13 +00:00
whesse@chromium.org
b6ebcd58c6 Crankshaft: Move LEnvironment and LPointerMap classes to platform-independent lithium.h. Move WriteTranslation method from LEnvironment class to LCodeGen class.
Review URL: http://codereview.chromium.org/6142011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6276 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-11 15:51:08 +00:00
fschneider@chromium.org
c1d4d89a31 Remove unused Temp() function form LChunkBuilder.
Review URL: http://codereview.chromium.org/6217003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6273 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-11 14:38:13 +00:00
karlklose@chromium.org
43b0399505 Implement DoApplyArguments.
ARM: Implement DoApplyArguments in the lithium code generator.

This patch also introduces an optional SafepointGenerator argument to InvokeFunction, InvokeCode and InvokeProloque.

BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6272 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-11 14:11:03 +00:00
ager@chromium.org
59c158e43f ARM: Implement ClassOf in the lithium arm backend.
Review URL: http://codereview.chromium.org/6201004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6271 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-11 14:01:53 +00:00
kmillikin@chromium.org
a7c743d3ac Reuse the gap move resolver.
Rather than allocating a fresh gap move resolver for every parallel
move, use a single one per Lithium code generator.  This avoids always
reallocating the temporary zone-allocated lists used by the gap move
resolver.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6270 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-11 13:50:12 +00:00
sgjesse@chromium.org
c4550bc6d5 ARM: Add instructions VFPCompareAndSetFlags and VFPCompareAndLoadFlags to macro assembler
Also removed the SBit from the vcmp instruction as it is not part of the instruction.
Review URL: http://codereview.chromium.org/6117003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6268 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-11 12:45:25 +00:00
ager@chromium.org
a314fa4581 ARM: Add deferred stack overflow checks to goto code generation in ARM
lithium when needed.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6265 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-11 12:32:00 +00:00
fschneider@chromium.org
6b00bdf2f2 Fix ARM debug build by moving an assert.
Review URL: http://codereview.chromium.org/6127005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6263 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-11 12:20:22 +00:00
fschneider@chromium.org
9cace6b5f0 Use HIR accessor for CheckPrototypeMaps to remove the duplicate members in lithium.
Review URL: http://codereview.chromium.org/6221003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6262 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-11 12:10:11 +00:00
ager@chromium.org
b3d4ea357c ARM: use existing transcendental cache stub for tagged inputs.
Review URL: http://codereview.chromium.org/6167004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6261 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-11 11:54:37 +00:00
fschneider@chromium.org
b9f5ab9ef1 Remove duplicate members from some LIR instruction by using the HIR accessors.
Remove unused LOperands from keyed-loads. We do not have multiple representations
for load instructions anymore.

Correct number of output operands as for a couple of instructions form 1 to 0
because they do not produce a result (e.g. PushArgument)

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6258 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-11 11:41:01 +00:00
ager@chromium.org
cd4ae721e2 ARM: Implement delete operation in lithium codegen.
I'm using the post call generator for the macro assembler
InvokeBuiltin call to be consistent with the ia32 version. It only
generates one call, but using the post call generator it should be
easier to catch if we change that at some point.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6247 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-10 12:24:19 +00:00
whesse@chromium.org
a139094016 Crankshaft: Move LParallelMove to lithium.h, add LGap to lithium-x64.h.
Review URL: http://codereview.chromium.org/6132002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6242 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-10 11:31:21 +00:00
ager@chromium.org
5e3381c9c7 Landing for Martyn Capewell.
ARM: Fix comparison of NaN values.

Enables the cumulative exception flag when comparing values, and uses it to
detect NaN results.

BUG=1023
TEST=none

Code review URL: http://codereview.chromium.org/6142004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6236 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-10 08:04:30 +00:00
ager@chromium.org
d9e5078bbc Landing for Martin Maly.
Implement DoCallKeyed for arm lithium compiler.

Code review URL: http://codereview.chromium.org/6139002


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6234 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-10 07:59:13 +00:00
sgjesse@chromium.org
dae44fd3ee ARM: Fix lithium codegeneration of TypeofIs
The previous implementation was incomplete and wrong.

TBR=karlklose@chromium.org
Review URL: http://codereview.chromium.org/6113003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6231 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-07 14:27:32 +00:00
sgjesse@chromium.org
97621e7e32 ARM: Implement lithium codegen for DoTypeof, DoTypeofIs and DoSmiUntag
Review URL: http://codereview.chromium.org/6174001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6227 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-07 13:44:05 +00:00
karlklose@chromium.org
e74b0ae7db ARM: Support DoCallGlobal in lithium code generator.
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6224 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-07 12:34:39 +00:00
whesse@chromium.org
7c94bf13b9 Create platform-independent lithium files, move LGapResolver and LGapNode there
Review URL: http://codereview.chromium.org/6121001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6221 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-07 11:49:22 +00:00
sgjesse@chromium.org
426f13e084 Fix GC issue in instanceof stub
The the call of the builtin in InstanceofStub was not correctly protected with an internal frame leading to the return address being handled as a pointer during GC.

Marked the Instanceof stub as allowing stub calls (the RecordWriteStub was removed some days ago).

This issue was not caught by the assertion designed for this when debug mode is run with --debug-code (which out tests always does) as generating code for Abort set the allow stub calls flag to true. This has been fixed by restoring the allow stub calls flag correctly.
Review URL: http://codereview.chromium.org/6097010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6218 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-07 10:37:26 +00:00
sgjesse@chromium.org
a6c5fa6993 ARM implementations of LoadElements, LoadKeyedFastElement, StoreNamedField, StoreKeyedFastElement.
BUG=none
TEST=none

Patch by Martyn Capewell from ARM Ltd.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6214 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-07 07:33:46 +00:00
karlklose@chromium.org
1eb68a859f Fix presubmit (r6209).
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6213 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-06 16:20:45 +00:00
fschneider@chromium.org
5fbaece14c Use a separate marker value to allocate the arguments object on deoptimzation.
Before we used the hole value for this purpose, but this does not work once we
start using the hole value for other purposes in the optimizing compiler.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6210 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-06 15:53:56 +00:00
karlklose@chromium.org
d4bbad8e4e ARM: Support DoCheckInstanceType in lithium codegenerator.
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6209 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-06 15:25:03 +00:00
kmillikin@chromium.org
dde853a4ad Small change to stack checks in unoptimized code.
The stack checks include a loop nesting depth encoded in the code stream
after the call to the stack check stub.  Change the code to jump around this
instruction as well as the call when the stack check is OK.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6204 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-06 13:48:12 +00:00
danno@chromium.org
90445b33a4 Implement DoFunctionLiteral on ARM.
Review URL: http://codereview.chromium.org/6112001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6199 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-06 12:53:59 +00:00
sgjesse@chromium.org
2b7596a516 Instanceof slow case bind is incorrect.
Currently, the bind for the slow label is after the pushing of the
args registers which renders the args pushing dead code because there
is a Ret preceeding it. The comments also imply that the arg pushing
should be part of the InvokeBuiltins tail call.

Patch by Mark Lam from Hewlett-Packard Development Company, LP

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6198 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-06 12:41:41 +00:00
sgjesse@chromium.org
68ddff5f90 ARM: Change a number of lithium instruction operands to be in registers
Using operands which could possible be in stack slots would require a load instruction anyway, so having the register allocator putting them into registers seems most logical.
Review URL: http://codereview.chromium.org/6046014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6196 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-06 12:21:06 +00:00
sgjesse@chromium.org
7c0c72eb2c ARM: Fix a bug in the lithium arguments support
Got the comparison wrong and fortot to actually set the flags.
Review URL: http://codereview.chromium.org/6085010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6195 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-06 10:56:23 +00:00
ager@chromium.org
af09d94ecd ARM: support regexp literals in lithium-codegen-arm. Also, update
comment on the AllocateInNewSpace macroassembler method.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6192 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-06 08:56:29 +00:00
sgjesse@chromium.org
c26bd162f8 ARM: support arguments access in lithium-codegen-arm.
Review URL: http://codereview.chromium.org/5989013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6188 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-06 07:28:51 +00:00
sgjesse@chromium.org
f5fb75ce09 Fix comparison bug on ARM.
Retrieves the result of VFP comparison from the VFP status register.

BUG=none
TEST=none

Patch by Martyn Capewell from ARM Ltd.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6176 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-05 12:06:32 +00:00
sgjesse@chromium.org
0cd558a355 Fix the build breakge on x64 and ARM after r6173
The instanceof changes was not fully ported to x64 and ARM.
Review URL: http://codereview.chromium.org/6031013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6175 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-05 12:01:53 +00:00
danno@chromium.org
498841c743 Implement ARM lithium support for ObjectLiteral.
Review URL: http://codereview.chromium.org/6099006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6166 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-05 09:04:06 +00:00
danno@chromium.org
d44f3a0223 Implement Lithium ARM support for ArrayLiteral.
TBR=kasperl@chromium.org
Review URL: http://codereview.chromium.org/5988008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6165 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-04 14:48:25 +00:00
sgjesse@chromium.org
806368bc92 Fix presumbit error
TBR=karlklose@chromium.org
Review URL: http://codereview.chromium.org/6046012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6164 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-04 14:35:34 +00:00
fschneider@chromium.org
5bd44d212a Remove unused policy from register allocator.
DefineSameAsAny is never used and currently does exactly the 
same as DefineSameAsFirst.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6163 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-04 14:35:01 +00:00
sgjesse@chromium.org
71d863e5de Set a fixed scratch register for ARM code generation
r9 is now set as a fixed scratch register for ARM code generation. removed some unneeded allocation of temporary registers and use the scratch register instead.
Review URL: http://codereview.chromium.org/5976014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6162 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-04 14:32:54 +00:00
karlklose@chromium.org
20c858d514 First part of lithium ARM port.
Implement LoadNamedField, CallConstantFunction, CmpMapAndBranch, JSArrayLength, BoundsCheck, IsNull, CallFunction, and CallStub in the ARM lithium codegenerator.

BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6155 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-04 13:02:51 +00:00
sgjesse@chromium.org
d5b94e9704 Addresses some performance regression in the GenericBinaryOpStub on ARM following Crankshaft introduction.
BUG=none
TEST=none

Patch by Rodolph Perfetta from ARM Ltd.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6146 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-04 11:02:58 +00:00
kmillikin@chromium.org
c1fd8bcf60 Fix a bug in deoptimization environments.
The function HEnvironment::SetExpressionStackAt did not update the
environment's history.  This function is used to patch the bailout
environment for count operations and global function calls.

Reorganize class HEnvironment to make it fit V8's style a bit better
and to try to add some sanity to which C++ functions are intended to
be inlined.

Remove the flag --trace-environment which merely duplicated data in
the hydrogen.cfg file except without enough context to be useful.

BUG=1004

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6137 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-03 16:57:46 +00:00
whesse@chromium.org
3d7d258339 Remove RecordWriteStub from X64 and ARM platforms.
Review URL: http://codereview.chromium.org/5986014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6136 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-03 14:59:12 +00:00
fschneider@chromium.org
0a128e5ae7 Optimize array-length and fast element loads.
1. Separating out the instance-type check from the array-length operation.

2. I also changed the bounds-check on keyed loads to use the length property
for JS arrays (like we do for array stores).

The new pattern should use less registers and allow more checks to be eliminated.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6125 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-30 19:30:42 +00:00
karlklose@chromium.org
16800adf57 Fix inlining of instanceof stub for ARM (r6093).
Review URL: http://codereview.chromium.org/6055006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6117 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-23 16:33:30 +00:00
vitalyr@chromium.org
c5916f552f Support load function prototype in hydrogen/lithium.
Review URL: http://codereview.chromium.org/6009005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6112 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-22 15:43:32 +00:00
karlklose@chromium.org
16837c1f33 Implement inlining of instanceof tests on ARM.
TBR=sgjesse

BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6093 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-21 10:52:50 +00:00
whesse@chromium.org
5656d64ece Add untagged double versions of Math.sin and Math.cos. Merge classes TranscendentalCacheStub and TranscendentalCacheSSE2Stub.
Review URL: http://codereview.chromium.org/5996002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6083 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-20 13:52:14 +00:00
sgjesse@chromium.org
d559d8c6c0 IA32: Optimize instanceof
The instanceoff stub now supports arguments in registers and checks for null,
smi and string values without going to runtime.

Needs porting to X64 and ARM.
Review URL: http://codereview.chromium.org/5828004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6042 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-16 08:58:42 +00:00
kmillikin@chromium.org
ace6290452 Fix issue 974.
When entering a finally block in unoptimized code, we unconditionally
save the accumulator register in the stack in case it holds a return
value or an exception.  In the case of a break, continue, or falling
off the end of the try or catch block, this value is unpredictable and
not necessarily safe for GC.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6035 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-15 16:14:29 +00:00
fschneider@chromium.org
b93a0f5d9a Second attempt: Improve our type feedback by recogizining never-executed IC calls for binary operations.
This is an improved version of my earlier change r5970. It avoids degrading the
non-optimized code.

Initially we emit a conditional branch that is either always- or never-taken
after a smi-check (depending on whether we test for smi for for non-smi)
Since test-eax always sets the carry-flag to 0 we use jump-if-carry and
jump-if-not-carry.

The first invocation of the stub patches a jc with a jz and
jnc with a jnz-instruction so that the code looks exactly as it was
without patching. The only difference is the test- or nop-instruction
after the IC-call.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6030 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-15 13:56:41 +00:00
erik.corry@gmail.com
2996dca6aa Support %_IsObject in Crankshaft.
Review URL: http://codereview.chromium.org/5806001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6027 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-15 12:32:19 +00:00
karlklose@chromium.org
5f962f2eb2 Add array bound checks to code generated for SwapElements. This fixes a bug that lead to a segfault when an array was modified while it was sorted.
Review URL: http://codereview.chromium.org/5686006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6020 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-15 09:52:58 +00:00
vitalyr@chromium.org
57e072298f Merge math function ids and custom call generator ids.
Two old id types are replaced by builtin function ids. We can use
these in the code generators to emit custom code for the selected
functions.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6013 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-14 18:53:48 +00:00
whesse@chromium.org
c23c244add Reapply change 5989, adding untagged double calls to Math.pow, with problem in generated code for TranscendentalCacheSSE2Stub (unguarded SSE 4.1 code) fixed.
Review URL: http://codereview.chromium.org/5726008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6010 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-14 13:21:29 +00:00
kmillikin@chromium.org
4c02d3cd4c Fix assignment compilation bug on ARM and x64.
SVN revision 5993 ported changes to the unoptimizing compiler from
ia32 to ARM and x64.  A call to AstContext::Plug was moved out of
FullCodeGenerator::EmitVariableAssignment and into the callers.  One
call site was missed in both ports.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6003 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-14 09:47:28 +00:00
kmillikin@chromium.org
645ba163d3 Fix ARM and x64 compilation.
Fix compilation on ARM and x64 due to a change in the architecture-shared
API of the nonoptimizing code generator.  Also added new PrepareForBailout
to ARM (they are not yet fully implemented on x64).

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5993 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-13 17:49:55 +00:00
whesse@chromium.org
fdf44a4bc7 Revert change 5989, which causes failures in some benchmarks.
Review URL: http://codereview.chromium.org/5804003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5991 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-13 16:34:59 +00:00
whesse@chromium.org
1a008f28d5 Allow optimizing compiler to compute Math.log using untagged doubles.
Review URL: http://codereview.chromium.org/5741003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5989 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-13 14:37:19 +00:00
fschneider@chromium.org
b1a2cc1e48 Revert r5970 and r5975.
Review URL: http://codereview.chromium.org/5717005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5977 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-13 10:41:50 +00:00
fschneider@chromium.org
b16df72475 Improve our type feedback by recogizining never-executed IC calls for binary operations.
In the case of inlined smi code in non-optimzied code we could not 
distinguish between the smi-only case and the case that the operation was
never executed.

With this change the first execution of a binary operation always jumps
to the stub which in turn patches the smi-check into the correct
conditional branch, so that we benefit from inlined smi code after the
first invocation.

A nop instruction after the call to the BinaryOpIC indicates that no
smi code was inlined. A "test eax" instruction says that there was smi
code inlined and encodes the delta to the patch site and the condition
code of the branch at the patch site to restore the original jump.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5970 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-10 14:33:20 +00:00
ager@chromium.org
48d884de48 ARM: Fix heap number allocation in lithium-codegen-arm that assumed
that ip can be used as a scratch register. This is not true because
ip is already used for something else in AllocateInNewSpace in the
macro assembler.

Explicitly allocate a temp register for use in the heap number
allocation instead.
Review URL: http://codereview.chromium.org/5788001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5967 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-10 14:10:54 +00:00
ager@chromium.org
5e80d5df5d ARM: Fix missing SetCC in crankshaft code emitted when running with
the --debug-code flag.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5963 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-10 12:12:06 +00:00
whesse@chromium.org
5423649f0a Fix compilation on ARM when adding Math.pow optimization in 5949.
Review URL: http://codereview.chromium.org/5546006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5950 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-08 15:03:08 +00:00
vegorov@chromium.org
7c87f90c62 Remove NearestNextGapPos. It is not used anymore.
Remove uses of NearestGapPos in splitting helpers. We can split at any position.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5937 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-07 14:51:49 +00:00
vegorov@chromium.org
d693ff9918 Fix ARM sim build.
Review URL: http://codereview.chromium.org/5618005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5931 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-07 12:43:23 +00:00
kasperl@chromium.org
90b3370374 Update V8 to version 3.0 (re-land r5920).
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5922 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-07 11:31:57 +00:00
kasperl@chromium.org
51b494d096 Revert r5920. Will re-land shortly.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5921 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-07 11:01:02 +00:00
kasperl@chromium.org
e5860bd6a8 Update V8 to version 3.0.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5920 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-07 09:11:56 +00:00
erik.corry@gmail.com
bca83462d8 Improve code generated for AllocInNewSpace. This is a commit of http://codereview.chromium.org/5512004 for Rodolph Perfetta.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5917 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-06 09:59:08 +00:00
whesse@chromium.org
66836efbba Add generated code to calculate Math.log and to search Transcendental cache for logs. Implemented on all platforms.
Review URL: http://codereview.chromium.org/5437002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5912 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-02 11:20:44 +00:00
vitalyr@chromium.org
b0e4479e70 Save full source position state to avoid forced positions.
Review URL: http://codereview.chromium.org/5277008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5908 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-30 13:17:36 +00:00
ager@chromium.org
57b045a921 Landing for Martyn Capewell.
Implement string constructor stub on ARM.

BUG=none
TEST=none

Codereview URL: http://codereview.chromium.org/5322009/

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5892 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-26 08:43:34 +00:00
erik.corry@gmail.com
72de9278d5 ARM: Defer the prefix/postfix code generation. This is a fixed
version of http://codereview.chromium.org/3666001/ by ZhangK with
an added call to ForgetTypeInfo to fix a debug mode assert.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5884 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-24 09:55:58 +00:00
sgjesse@chromium.org
0c064efdb0 Make randomized allocations along 64k granularity boundaries to avoid comitting unused memory.
BUG=56036
TEST=None.

Patch by Justin Schuh <jschuh@chromium.org>

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



git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5883 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-24 09:40:58 +00:00
ager@chromium.org
4c6f79ecec Fix crashes during GC caused by partially initialized objects. The
inline allocation code used the expected number of properties to
calculate the number of inobject properties for an object instead of
getting the actual number from the initial map.

It is safer to use the inobject property count from the initial map in
any case because that is the amount the instances will get. I think
this disconnect got introduced when adding shrinking of objects.

Unfortuntely I haven't been able to create a simple reproduction for a
test case but this fixes the webpage that exhibits the crash. I'll see
if I can create a reproduction tomorrow.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5879 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-24 06:26:36 +00:00
ager@chromium.org
1e8413e188 Force pretenuring of closures that are immediately assigned to
properties. For these closures we would like to be able to use
constant functions and for that we need the closures allocated in old
space.
Review URL: http://codereview.chromium.org/5220007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5866 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-22 09:57:21 +00:00
whesse@chromium.org
1d11e32a01 Add a fast case to Array.join when all the elements and the separator are flat ascii strings.
Review URL: http://codereview.chromium.org/5122005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5860 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-19 09:25:46 +00:00
serya@chromium.org
bc42d95cc3 Avoiding repacking payload for v8::Arguments and v8::AccessorInfo (arm)
Review URL: http://codereview.chromium.org/5107002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5859 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-19 09:06:00 +00:00
ager@chromium.org
5205fd4417 Landing for Rodolph Perfetta.
Add missing Stub implementations on ARM.

BUG=none
TEST=none

Codereview URL: http://codereview.chromium.org/5128004/

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5857 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-19 08:41:24 +00:00
ager@chromium.org
60659dd1c6 Landing for Martyn Capewell.
Replace some hard-coded return address calculations with Call. 

BUG=none 
TEST=none

Codereview URL: http://codereview.chromium.org/5158002/

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5843 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-17 14:48:43 +00:00
sgjesse@chromium.org
010f35f478 Change the order of evaluation of sub-expressions for keyed call
The expression of the key is now evaluated before the arguments, so all expressions in a keyed call are evaluared from left to right.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5842 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-17 13:59:07 +00:00
erik.corry@gmail.com
f42de7dcae Implement Math.floor stub on ARM. Uses VFP when available. This is a commit of http://codereview.chromium.org/5075002/ for Martyn Capewell
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5835 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-17 09:24:44 +00:00
erik.corry@gmail.com
ca7a438713 Improve support for vmrs/vmsr in ARM disassembler. This is a commit of http://codereview.chromium.org/4904001 for Martyn Capewell.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5824 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-15 10:21:57 +00:00
fschneider@chromium.org
582a3bde4f Move ComputeCallInitialize from the codegen.cc to stub-cache.cc.
Review URL: http://codereview.chromium.org/4760003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5812 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-11 10:33:51 +00:00
fschneider@chromium.org
8673e6497c Move common static helpers from codegen to the macro-assembler files.
Review URL: http://codereview.chromium.org/4654002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5807 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-10 17:00:20 +00:00
erik.corry@gmail.com
8ebe8e4756 ARM: The Simulator will now handle different VFP rounding modes. RZ and RM are implemented. This is a commit of
http://codereview.chromium.org/4295003/show for Alexander Rames of ARM.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5790 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-09 08:26:02 +00:00
vegorov@chromium.org
9b96a9d592 Fix presubmit errors introduced by r5768.
Review URL: http://codereview.chromium.org/4409003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5770 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-04 15:39:06 +00:00
whesse@chromium.org
861a66fb67 Fix a potential error in Add() macro-instruction on ARM.
Review URL: http://codereview.chromium.org/4247004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5769 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-04 15:30:04 +00:00
vegorov@chromium.org
746d72420c Improve positions recording for calls.
Review URL: http://codereview.chromium.org/4469002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5768 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-04 15:12:03 +00:00
lrn@chromium.org
e1458503d1 Remove regexp caching.
Review URL: http://codereview.chromium.org/4308001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5755 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-02 13:37:59 +00:00
ager@chromium.org
5f1f2adb3b Landing for Rodolph Perfetta.
Reduces the number of movw/movt instructions generated in ProbeTable. It
improves code size for CompileCallMegamorphic by about 10%.

BUG=none
TEST=none

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5744 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-01 08:55:40 +00:00
ager@chromium.org
2122827893 Landing for Rodolph Perfetta.
Fix the ARM simulator, the ARM disassembler and extend the stop feature. 
The stop feature in the simulator now support enabling, disabling and 
counting. 

BUG=None 
TEST=None 

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5723 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-28 07:35:07 +00:00