Commit Graph

242 Commits

Author SHA1 Message Date
lrn@chromium.org
02c4e8bfcb Make RegExp objects not callable.
Review URL: http://codereview.chromium.org/6930006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8068 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-26 07:35:09 +00:00
ager@chromium.org
6f775f2fb0 Fix calls of strict mode function with an implicit receiver.
Only IA32 version for now. I'll start porting.

Strict mode functions are to get 'undefined' as the receiver when
called with an implicit receiver. Modes are bad! It forces us to have
checks on all function calls.

This change attempts to limit the cost by passing information about
whether or not a call is with an implicit or explicit receiver in ecx
as part of the calling convention. The cost is setting ecx on all
calls and checking ecx on entry to strict mode functions.

Implicit/explicit receiver state has to be maintained by ICs. Various
stubs have to not clobber ecx or save and restore it.

CallFunction stub needs to check if the receiver is implicit when it
doesn't know from the context.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8040 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-24 14:01:36 +00:00
fschneider@chromium.org
5552dbccdd Rename TypeRecording...Stub into ...Stub.
There is no need for this long name.
Review URL: http://codereview.chromium.org/7063017

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8031 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-24 12:20:16 +00:00
danno@chromium.org
7185ec6ca8 Remaining (forgotten) feedback for pixel array deopt fix
TBR=kmillikin@chromium.org
BUG=none
TEST=none

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7903 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-17 07:22:01 +00:00
danno@chromium.org
daa1be1226 Support conversion of clamped double values for pixel arrays in Crankshaft.
BUG=1313
TEST=test/mjsunit/external-array.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7901 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-16 14:10:56 +00:00
fschneider@chromium.org
48077e89e9 Remove support for branch hints from the IA32 and X64 assembler.
They were not on by default and should not be needed on modern
platforms.
Review URL: http://codereview.chromium.org/7001025

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7866 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-11 13:26:07 +00:00
vitalyr@chromium.org
03c00ee6a6 Support symbol comparison in crankshaft.
Review URL: http://codereview.chromium.org/7000021

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7865 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-11 12:50:04 +00:00
vitalyr@chromium.org
4cc800b3cf Support %_IsUndetectableObject in crankshaft.
Review URL: http://codereview.chromium.org/6995046

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7856 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-11 11:53:43 +00:00
jkummerow@chromium.org
944a388412 Avoid using a register for constant external array indices.
This CL is based on and obsoletes CL 6879037.

TEST=mjsunit/external-array.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7844 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-10 15:25:17 +00:00
vitalyr@chromium.org
c10267f1fa Refactor HCheckInstanceType to allow mask/tag tests.
This allows us to get rid of totally fake LAST_STRING_TYPE and makes
it possible to test for symbols.

I considered splitting HCheckInstanceType into two instructions, but
it seems nice to be able to hide the instance type implementation
details from the hydrogen level.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7840 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-10 14:17:23 +00:00
jkummerow@chromium.org
95ff85112f Merge Label and NearLabel
by adding NearLabel's functionality to Label and introducing a "near" parameter to jump instructions.

TEST=compiles; existing tests still pass.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7832 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-10 09:03:42 +00:00
fschneider@chromium.org
45d07bcd32 Simple elimination of redundant array-hole checks.
If the result of an fast elements load is converted to an untagged
representation we can omit the hole check if the value is not used
anywhere else except for HChange instructions converting it to
an untagged representation since those will deoptimize for the hole
value anyway.
Review URL: http://codereview.chromium.org/6964012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7827 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-09 15:21:40 +00:00
ager@chromium.org
0af052870f Support polymorphic loads of constant functions as well as fields.
R=fschneider@chromium.org
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7792 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-05 09:22:09 +00:00
svenpanne@chromium.org
1b833ff35e Additional minor cleanup regarding CallWrapper: Use the null object pattern.
Review URL: http://codereview.chromium.org/6909026

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7767 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-03 15:12:40 +00:00
ager@chromium.org
eda2a0d4d2 Cleanup: use xorps to zero out an xmm register on ia32 too.
Encoding is one byte shorter.

R=lrn@chromium.org
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7760 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-03 12:00:54 +00:00
svenpanne@chromium.org
5197bff4f2 Unified CallWrapper and PostCallGenerator classes, the former is a
generalization of the latter. This makes CallWrapper architecture-independant,
so it can be pulled up into assembler.h, nuking 3 copy-n-paste classes. Only a
small improvement, but nevertheless...
Review URL: http://codereview.chromium.org/6893156

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7758 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-03 09:30:06 +00:00
sgjesse@chromium.org
37f33a7087 Improve modulo operation in lithium on IA32.
Implement fast paths for the special cases like PowerOfTwo divisors
and the dividend being smaller than the divisor (non-negative).

BUG=v8:1314

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7704 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-28 14:58:45 +00:00
fschneider@chromium.org
cbe2652682 Refactor lithium classes to reduce the number of virtual functions.
This reduces the binary size by making the Is* type-test functions non-virtual.

I had to change Gap and Label instructions to have a common abstract superclass because both act as gap-instructions for the register allocator.
Review URL: http://codereview.chromium.org/6880204

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7691 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-27 11:41:42 +00:00
vegorov@chromium.org
b62bdda7d1 Crankshaft support for IN.
In JavaScriptFrame::Print avoid printing optimized frame as if it is unoptimized.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7682 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-26 15:22:44 +00:00
jkummerow@chromium.org
bc8f6943bb Support Float64Arrays
BUG=None
TEST=mjsunit/external-arrays.js; updated cctest; existing unit tests

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7675 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-21 07:15:43 +00:00
fschneider@chromium.org
a4283a5440 Revert r7665.
Review URL: http://codereview.chromium.org/6873106

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7670 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-20 09:08:26 +00:00
fschneider@chromium.org
6197c1566a Lithium LLabel instruction are no longer used as gap instructions.
Instead we use the first part of the first gap after
the label to insert gap-moves for resolving control-flow
and phis.
Review URL: http://codereview.chromium.org/6873075

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7665 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-19 16:14:42 +00:00
fschneider@chromium.org
ef24af119e Land Kevin's patch for supporting %_CallFunction in Crankshaft.
Original code review: http://codereview.chromium.org/6838018/

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7624 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-15 07:58:22 +00:00
vitalyr@chromium.org
cc782be64e Support string add in crankshaft:
o The type recording binary stub got a new type for string + string.

o Added HStringAdd and LStringAdd based on the new type info.

o Started using HValue types to avoid unneccesary checks.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7622 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-15 06:39:36 +00:00
whesse@chromium.org
5a6ec1a46e Fix optimized code for Math.round on ia32 platform.
Review URL: http://codereview.chromium.org/6838012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7600 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-13 10:32:05 +00:00
mmaly@chromium.org
164e3a4173 Strict mode fixes.
- mutual inlining strict and non-strict functions in crankshaft.
- assignment to undefined variable with eval in scope.
- propagation of strict mode through lazy compilation.

BUG=
TEST=test/mjsunit/strict-mode.js test/mjsunit/strict-mode-opt.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7561 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-08 14:30:10 +00:00
vegorov@chromium.org
8a8d3bbbee In LCodeGen::DoDeferredLInstanceOfKnownGlobal emit safepoint with registers for the call to stub.
Review URL: http://codereview.chromium.org/6793017

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7541 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-07 13:32:45 +00:00
mmaly@chromium.org
76b5dc7bfb Strict mode renamings.
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7522 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-06 20:20:31 +00:00
ricow@chromium.org
3dd575ec0d Add inline non-transcendental cache version of log to lithium.
In addition, this change allows one additional level of inlining. 
Review URL: http://codereview.chromium.org/6720017

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7500 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-05 09:21:02 +00:00
sgjesse@chromium.org
1244225ba8 Extend crankshaft support for global stores
All global stores are now supported in crankshaft by using the normal store IC when other optimizations are not possible due to the state of the global object.

R=fschneider@chromium.org

BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7495 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-04 15:03:34 +00:00
sgjesse@chromium.org
1e8079fcc9 Increase coverage of global loads in optimized code
In the cases where a global property cell cannot be used in the optimized code
use standard load ic to get the property instead of bailing out.

This is re-committing r7212 and r7215 which where reverted in r7239 with the addition of recoring the source position in the hydrogen code for the LoadGlobalCell instruction. To record that position an optional position field has been added to the variable proxy AST node.
Review URL: http://codereview.chromium.org/6758007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7474 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-01 11:54:04 +00:00
danno@chromium.org
5f2b7a0f79 Fix minor issues in typed array load/store implementation
BUG=none
TEST=none

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7466 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-01 08:03:34 +00:00
vitalyr@chromium.org
179aef2b8f VM initialization refactoring.
This patch introduces global once per-process initialization and moves
the OS and CPU setup there. This makes CPU features isolate-independent.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7462 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-31 16:17:37 +00:00
ricow@chromium.org
7293b325f6 Remove unused method, this is not used anymore after 7360.
Review URL: http://codereview.chromium.org/6735012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7391 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-28 13:34:10 +00:00
ager@chromium.org
cdf65ca087 Reimplement the padding of relocation information for lazy deoptimization on ia32.
The previous implementation attempted to keep track of the needed
relocation size for deoptimization while generating the optimized
code. That was error prone. This patch moves the relocation resizing
to the deoptimizer as the last step of creating an optimized code
object.

The down side to this approach is that two relocation information byte
arrays are created for all optimized functions that do not have enough
relocation space for lazy deoptimization.

R=sgjesse@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7360 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-25 10:29:34 +00:00
danno@chromium.org
ea45f6719e Support external arrays in Crankshaft
Add specialized hydrogen and lithium instructions to support loading and storing to external arrays.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7354 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-24 22:14:15 +00:00
fschneider@chromium.org
7d8e6c929d Enable GVN for polymorphic loads by not expanding them at the HIR level.
This change adds a new IR instruction for polymorphic loads. It performs
map compares and loads in one IR instruction instead of splitting each
load into a graph of map-compares and field loads.
 
The advantage is a smaller IR and less basic blocks, plus it allows to
do GVN on polymorphic loads.
Review URL: http://codereview.chromium.org/6708085

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7336 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-24 10:11:51 +00:00
ager@chromium.org
363ef7f750 Ensure enough space for lazy deoptimization relocation information.
Was not done for runtime calls and for recursive calls.

Only ia32 for now. We need to refactor x64 and look into arm as well.

R=sgjesse@chromium.org
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7331 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-23 15:33:49 +00:00
ager@chromium.org
1bdc8031fa Introduce accessors on builtins instance and use them to avoid TLS access when getting builtins.
R=vitalyr@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7327 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-23 13:40:07 +00:00
ager@chromium.org
b69591bc0f Require an isolate parameter for most external reference creation to
avoid TLS access in connection with external references.

Make the isolate accessible via the assembler.

Only for ia32 at this point. If this looks OK to you I will port it.

R=vitalyr@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7305 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-22 13:20:04 +00:00
fschneider@chromium.org
8066271fd2 Optimize calls to object literal properties that are initialized with a function literal.
This allows fast calls and inlining of functions like:

var o = {f: function() { return "foo"; }}
o.f();


Object literals that contain function literals are initially created a dictionary mode
object and only transformed to fast properties once all properties are computed and
added. This allows us to create constant function properties for functions declared
inside the object literal. Function literals inside object literals are marked for
pretenuring so that they work as contant function properties.

Object literals without functions should just function as before.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7283 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-21 12:25:31 +00:00
vitalyr@chromium.org
7976ca2cbc Merge isolates to bleeding_edge.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7271 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-18 20:35:07 +00:00
vitalyr@chromium.org
76e226f832 Revert r7268: it borked the history.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7269 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-18 19:41:05 +00:00
vitalyr@chromium.org
6ff7fdebd3 Merge isolates to bleeding_edge.
Review URL: http://codereview.chromium.org/6685088

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7268 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-18 18:49:56 +00:00
mmaly@chromium.org
55906eb46e Implement fast path for strict closure creation.
Review URL: http://codereview.chromium.org/6677036/

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7251 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-17 20:28:30 +00:00
mmaly@chromium.org
1d1018aec7 Strict mode ThrowTypeError functions for
- function.caller
- function.arguments

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7250 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-17 20:28:17 +00:00
vitalyr@chromium.org
02a4ce8cb0 Emit slightly more compact code in untag double.
Review URL: http://codereview.chromium.org/6677111

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7243 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-17 15:46:42 +00:00
ricow@chromium.org
d6caa8872a Revert revisions 7215 and 7212.
This caueses line positions to be off by one in certain cases, causing webkit http/tests/inspector/console-xhr-logging to fail.
Review URL: http://codereview.chromium.org/6667077

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7239 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-17 14:30:48 +00:00
lrn@chromium.org
2038178fbe Add support for unary plus in hydrogen compiler.
Also strength-reduction of unary minus.
Fixes issue 1248.

BUG=1248

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7217 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-17 10:37:29 +00:00
sgjesse@chromium.org
1a6c821b05 Increase coverage of global loads in optimized code
In the cases where a global property cell cannot be used in the optimized code use standard load ic to get the property instead of bailing out.
Review URL: http://codereview.chromium.org/6665026

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7212 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-17 08:16:12 +00:00
fschneider@chromium.org
a20ee85139 Refactor lithium CheckSmi instruction into two separate instructions CheckSmi and CheckNonSmi.
There is no need to store the branch condition separately in the LIR.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7206 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-16 16:28:06 +00:00
ager@chromium.org
6428822811 Revert "Strict mode ThrowTypeError functions for"
TBR=mmaly@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7173 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-15 11:01:21 +00:00
mmaly@chromium.org
80bd958df2 Strict mode ThrowTypeError functions for
- function.caller
- function.arguments

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7168 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-14 17:46:37 +00:00
vitalyr@chromium.org
8700f796e4 Remove unused StringCharCodeAt stub.
Review URL: http://codereview.chromium.org/6690014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7163 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-14 16:54:51 +00:00
vitalyr@chromium.org
269b19b447 Crankshaft support for StringCharFromCode.
This allows more efficient implementations of string keyed access,
String.prototype.chatAt, and String.fromCharCode.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7160 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-14 15:36:00 +00:00
vegorov@chromium.org
9b311c21b1 Reduce strength of ModI for power-of-2 divisor.
This is ia32 only. I will port it to other platforms if this looks good to you.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7158 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-14 14:42:14 +00:00
danno@chromium.org
9cca7d2733 Combine typed and pixel arrays.
Worth mentioning:
- Specialized versions of pixel array and store/loads inside the generic stubs have been removed, since to have parity for all external arrays, 8 different versions would have to be inlined/checked.
- There's a new constant in v8.h for external arrays with pixel array elements.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7106 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-09 15:01:16 +00:00
karlklose@chromium.org
822ddaa7d1 ARM: Implement MathPowStub and DoMathPowHalf.
Review URL: http://codereview.chromium.org/6613015

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7086 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-08 10:29:40 +00:00
kmillikin@chromium.org
c3172a6b7e Refactor polymorphic load and inline function graph construction.
Change the way we construct the graph for polymorphic loads to match that of
polymorphic stores.

Introduce a stack-allocated helper for saving and restoring all the
function-specific graph builder state that needs to change when we begin
translating an inlined function.  Make this class authoritative by moving
redundant state out of the builder and deferring to the current function's
state.

Ensure that we always print a tracing message when abandoning an inlining
attempt.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7074 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-07 11:52:36 +00:00
ricow@chromium.org
e772d9ea45 Remove unused label from lithium-codegen-ia32
Review URL: http://codereview.chromium.org/6615007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7056 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-04 09:07:31 +00:00
whesse@chromium.org
8ff9165055 Simplify test for typeof x == 'y' on all platforms.
Review URL: http://codereview.chromium.org/6606005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7041 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-03 12:16:21 +00:00
sgjesse@chromium.org
98d82ea9de Add lithium support for %_GetCachedArrayIndex for IA32 and X64
BUG=v8:1093
Review URL: http://codereview.chromium.org/6611014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7037 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-03 09:33:08 +00:00
whesse@chromium.org
9d89ec5c00 Add ArithmeticD(MOD) to x64 optimizing code generator. Minor changes to ArithmeticD on other platforms.
Review URL: http://codereview.chromium.org/6594118

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7029 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-02 15:04:20 +00:00
mmaly@chromium.org
1d040083b0 Assignment to read only properties throws in strict mode.
Review URL: http://codereview.chromium.org/6594037/

Revert "Revert "Assignment to read only properties throws in strict mode.""

This reverts commit aefcd82e1d36d458dd071ebf4777340f08aa67b1.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7007 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-02 04:53:43 +00:00
fschneider@chromium.org
8a72161585 Add lazy deoptimization environment to instanceof by marking it as a call.
This fixes an assert when an exception is thrown inside instanceof.

BUG=v8:1207
TEST=mjsunit/regress/regress-1207.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6999 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-01 15:37:24 +00:00
vegorov@chromium.org
97aecae1cb Fix several evaluation order sensitive GC-unsafe places.
Review URL: http://codereview.chromium.org/6596070

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6991 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-01 13:16:57 +00:00
mmaly@chromium.org
749b69853a Revert "Assignment to read only properties throws in strict mode."
This reverts commit 503f2a501e504f330821f247074e731aa649b1f0.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6977 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-01 06:10:41 +00:00
mmaly@chromium.org
98aea3c353 Assignment to read only properties throws in strict mode.
Review URL: http://codereview.chromium.org/6594037/

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6976 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-01 01:42:37 +00:00
ricow@chromium.org
cfd6268256 Fix wrong assertion in assembler causing the shell to crash with --code-comments.
Since writting a code comment can include a pc-jump the assertion
should just check that we are greater than or equal to
kMinRelocCommentSize (renamed from kRelocCommentSize), not that we are
actually equal to.


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6928 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-24 10:29:01 +00:00
rossberg@chromium.org
3af35dc96f Optimize functions needing a local context.
Allocate the context in the prologue. Two issues had to be solved:
(1) deoptimization needs to handle functions with a local context,
(2) we need a safepoint in the prologue.
(Thanks to Kevin.)

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6903 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-22 16:56:57 +00:00
ricow@chromium.org
45c63ffa6a Add more generic version of reloc info padding to ensure enough space for reloc patching during deoptimization (fixes issue 1174).
The old version only added extra space when we did indirect calls, but
the problem remains the same with normal calls that can be represented
as a single byte. When doing patching each call will always be at
least 2 bytes long because we use RUNTIME_ENTY as the reloc mode.


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6894 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-22 12:28:33 +00:00
ager@chromium.org
ea0dda89bb Unifying the handling of storing and loading from safepoint stack
slots across architectures.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6862 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-21 11:29:45 +00:00
whesse@chromium.org
4ac9f20601 X64 Crankshaft: Implement MathRound, MathFloor, MathSqrt, and MathPowHalf UnaryMathOperations in optimizing code generator. Remove unneeded bailout on Math.pow(-0, 0.5) from ia32 and x64 platforms - we produce the correct value without bailing out.
Review URL: http://codereview.chromium.org/6532054

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6856 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-18 14:34:17 +00:00
ager@chromium.org
c52e397db6 Fix presubmit.
TBR=lrn@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6854 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-18 14:10:42 +00:00
ager@chromium.org
b8f0b88b54 x64: Implement regexp literals and string CharCodeAt in lithium backend.
Review URL: http://codereview.chromium.org/6469052

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6853 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-18 14:00:46 +00:00
danno@chromium.org
12b4e0efe7 Implement crankshaft support for pixel array stores.
Review URL: http://codereview.chromium.org/6528013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6817 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-16 13:31:12 +00:00
ricow@chromium.org
a8d4360d65 Make sure we always have room for patching the reloc info during lazy deoptimization (fixes issue 1156).
Before we could have calls to builtins that would not be in the
relocation info since this used a register as target. Whenever we have
this case (from lithium codegen) we now emit a comment in the reloc
info.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6795 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-15 14:36:12 +00:00
mmaly@chromium.org
9adaeb6a17 Strict mode delete of non-configurable property.
Strict mode flag is passed to runtime DELETE function
and then to JSObject::Delete(Property/Element) as STRICT_DELETION enum.
When deleting non-configurable property/eleemnt, TypeError is thrown.
Adding mozilla test to .gitignore.
Incorporate CR feedback.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6782 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-14 23:41:47 +00:00
whesse@chromium.org
7233a930b5 X64 Crankshaft: Add test that fails on x64 Crankshaft build to list of skipped mjsunit tests. Fix comments and remove unused function from date.js.
BUG=1153
TEST=mjsunit/date-parse
Review URL: http://codereview.chromium.org/6516011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6775 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-14 13:57:15 +00:00
fschneider@chromium.org
56f6cbbeae Revert r6748.
I'm seeing some crashes after this change which I need to investigate.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6755 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-11 14:34:02 +00:00
fschneider@chromium.org
bbba0dbd61 Add a genuine unary minus instruction to Crankshaft.
This change introduces an instruction for negation instead
of generating a multiplication with -1.

The code for x64 and ARM is not included in this change.


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6748 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-11 12:56:30 +00:00
kmillikin@chromium.org
bea46a2723 Port bug fixes to optimized Function.prototype.apply to ARM.
There were a couple of bug fixes to this code on IA32 which have not yet
been ported to ARM.  They are: failure to correctly handle non-JSObject
receivers and failure to restore the context register after calling JS code.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6744 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-11 11:24:38 +00:00
danno@chromium.org
1bd9f602be Implement crankshaft support for pixel array loads.
Review URL: http://codereview.chromium.org/6410112

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6725 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-10 12:02:36 +00:00
kmillikin@chromium.org
ebebcae4c2 Allow esi to be an allocatable register on IA32.
Make esi available to the register allocator rather than dedicating it
permanently to the context.

The context is still passed in register esi to JavaScript and to the runtime
as part of the calling convention.  Because some stubs might end up calling
JS or the runtime, it is also conservatively passed to stubs.

Roughly half the calls have been modified to use the context as an input
value in fixed register esi.  The other half are marked as calls or deferred
code so esi is spilled and can be explicitly set.

It is no longer necessary to restore the context to esi after a call that
might change it.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6713 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-10 09:00:50 +00:00
kmillikin@chromium.org
dc91c4218b Make optimized Function.prototype.apply safe for non-JSObject first arguments.
If we have a property access of the form this.x, where the access site sees
the global object, we can specialize the IC stub so that it performs a map
check without first performing a heap object check.

Ensure that we do not get in JS code with a non-JSObject this value by
deoptimizing at Function.prototype.apply if the first argument is not a
JSObject.

BUG=v8:1128

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6707 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-09 16:43:23 +00:00
whesse@chromium.org
602d5cf427 Fix a bug that occurs when functions are defined with more than 16,382 parameters.
Review URL: http://codereview.chromium.org/6447007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6697 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-09 12:46:22 +00:00
fschneider@chromium.org
eec7bc8e60 Change the code for materializing double constants on ia32.
Instead of using the stack, use a temporary integer register
and avoid memory access.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6696 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-09 12:39:15 +00:00
ricow@chromium.org
f64966085e x64: Add MulI and DivI to lithium instructions.
Review URL: http://codereview.chromium.org/6448001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6681 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-08 14:37:50 +00:00
vegorov@chromium.org
76cf30d9c8 Support %_IsConstructCall in the Crankshaft pipeline.
Provide special case for f.bind(obj).

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6671 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-08 10:08:47 +00:00
ager@chromium.org
52cfd6ab16 Fixed a number of issues on x64 crankshaft port:
- Don't use SmiSub when overflow can occur. It asserts that overflow
  does not happen.

- Actually use CompareICs and signal to crankshaft whether or not smi
  code was inlined.

- Fix bug in CmpI where 64 bits were compared instead of 32 bits.

- Implement Throw, DeferredStackCheck, StoreKeyedFastElement in
  lithium backend.

BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6669 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-08 07:49:59 +00:00
vegorov@chromium.org
10f715e3ff Restore context after LApplyArguments.
BUG=v8:1099
TEST=test/mjsunit/regress/regress-1099.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6649 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-04 15:42:02 +00:00
kmillikin@chromium.org
32cd13ebf1 Remove the redundant load on every context lookup.
There was an unnecessary load on every statically-resolved context lookup.
Remove it.

This revealed a hidden bug in const initializers inside 'with'.  They claim
to be statically resolved (having slot type CONTEXT) but they occur in a
spot where the runtime context chain and the static scope chain do not
agree.  This is fixed by special casing const initializers in the backend.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6635 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-04 12:06:41 +00:00
kmillikin@chromium.org
97ccdd1e99 Introduce a hydrogen value for contexts, support context slot assignment.
Each context in the context chain has a corresponding hydrogen value.
The context values are used for global object lookup and context slot
lookup.  Add simple (non-compound) assignment to context slots.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6615 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-03 13:10:28 +00:00
kmillikin@chromium.org
e4a4804546 Streamline the code for patching optimized code for lazy deopt.
Rewrite the lazy deopt patching code on IA32 to use addresses throughout,
rather than offsets and a base address.

Also, rename a couple of ambiguous Code fields from _start to _offset.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6611 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-03 10:07:22 +00:00
fschneider@chromium.org
26287403ae Fix bug in pretenuring function literals from optimized code.
Review URL: http://codereview.chromium.org/6368074

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6610 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-03 09:10:54 +00:00
kmillikin@chromium.org
f1149734fc Partial fix for V8 issue 1079.
Record a safepoint with a deoptimization id for throw in optimized code.  We
don't seem to much care what the AST ID is because we will not be using it
for lazy deoptimization (throw doesn't return to the point of throw).  For
hygiene we use the actual ID of the throw expression.  Throw is no longer a
control-flow instruction, but it's followed by an unconditional abnormal
exit.  This is required to insert a simulate between the throw and the exit.

Make our optimized treatment of Function.prototype.apply act like a call and
have side effects.  This ensures that it will get a lazy deoptimization
environment.  Use that deoptimization ID in the safepoint for the call.

Deleting a property was also missing a deoptimization ID, though there was a
deoptimization environment assigned to the instruction.  Record the
environment and use the deoptimization ID at the safepoint.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6576 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-02 13:55:29 +00:00
whesse@chromium.org
a5f94a4862 Fix Math.pow(-0, 0.5) and Math.pow(-0, -0.5). These are not equal to sqrt(-0) and 1/sqrt(-0). Add tests for these cases. Fixes V8 issue 1088.
BUG=1088
TEST=test/mjsunit/math-pow.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6573 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-02 12:54:58 +00:00
ager@chromium.org
dc61921bbf Fix reintroduction of global variables that have been deleted.
Deletion of global properties puts 'the hole' in the global property
cell and updates the property details in the property dictionary with
the information that the property has been deleted. When setting
global properties that have been deleted in generated code we just
store the new value in the global property cell. This does not update
the property details in the property dictionary. Therefore, it looks
like the property is not there eventhough it was just reintroduced.

Perform 'the hole' checks in generated code for global property stores
and bail out of ICs and optimized code if storing to a property cell
that contains 'the hole'.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6508 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-27 08:35:39 +00:00
karlklose@chromium.org
3141494c3e Refactor recording of safepoints.
Refactor SafepointTableBuilder::DefineSafepoint and ARM LCodeGen::RecordSafepoint to use an enum for different kinds of safepoints. This change removes a lot of duplicated code and makes it easier to include new kinds of safepoints in the future. The remaining variants of LCodeGen::RecordSafepoint remain as a convinient way to record common safepoint kinds.

BUG=http://code.google.com/p/v8/issues/detail?id=1043
TEST=none

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6505 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-26 20:48:48 +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
fschneider@chromium.org
811e778592 Record the lazy deoptimization environmnent only at LLazyBailout-instructions.
This saves one pointer per LIR instructions. The change relies on the fact
that there is a LazyBailout instruction at all the places where we need
to register a lazy deoptimization environment.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6441 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-24 13:29:39 +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
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
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
lrn@chromium.org
e66ceb9079 X64 Crank: Implemented DoBranch and all *AndBranch comparisons.
Review URL: http://codereview.chromium.org/6374002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6385 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-19 10:17:18 +00:00
fschneider@chromium.org
2ecfe94997 Fix operand type for keyed calls.
Record the key as a input operand for keyed call instructions instead
of wrongly making it a temp operand.

This bug does currently not show up as a problem because the 
uses are recorded only in the instruction summary.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6365 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-18 14:25:05 +00:00
fschneider@chromium.org
87e82b0452 Remove the remaining LOperand-members from concrete LIR instructions.
This change introduces the third template parameters for LIR instructions
to specify the number of temp-operands. This is one step towards
removing the instruction-summaries.

I also added hydrogen-accessors in more places and refactored
the LIR-branch instructions to have common super-classes to 
avoid code duplication.

Added MUST_USE_RESULT to the functions that record uses
and definitions so that all LOperands are stored in the
LIR instructions (and not only in the summaries).



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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6345 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-17 12:22:31 +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
whesse@chromium.org
5187615943 Fix accidental change to ia32 in r6329.
Review URL: http://codereview.chromium.org/6362001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6335 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-14 16:10:00 +00:00
whesse@chromium.org
2810c2c044 X64 Crankshaft: Add DoParallelMove to x64
Review URL: http://codereview.chromium.org/6290004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6329 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-14 15:07:44 +00:00
lrn@chromium.org
9f5c1bfba1 X64 Crnakshaft: Added GeneratePrologue implementation.
Review URL: http://codereview.chromium.org/6326003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6324 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-14 13:16:48 +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
ricow@chromium.org
4ea3e060bb Fix the xcode build by not including x64 specific code when generating
32 bit code.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6299 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-13 14:10:26 +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
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
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
vitalyr@chromium.org
404fbb5b0b SSE2 truncating double-to-i.
Review URL: http://codereview.chromium.org/6049008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6269 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-11 13:48:49 +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
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
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
7311e10fdb Optimize instanceof further
If the instance of is performed against what is beliwed to be a constant global function inline the instance of check and have the call to the instanceof stub in deferred code. The inlined check will be patched by the instanceof stub when called from deferred code. This is indicated by the lithium instruction LInstanceOfKnownGlobal.

To help the patching the delta from the return address to the patch site is placed just below the return address in the edi slot of the pushad/popad ares. This is safe because the edi register (which is pushed last) is a temporary for the lithium instruction.

As the instanceof stub can call other JavaScript an additional marking for saving all double registers have been added.

Also tweaked the instanceof stub to produce true/false objects instead of 0/1 for the case with deferred code.
Review URL: http://codereview.chromium.org/5990005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6173 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-05 11:17:37 +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
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
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
whesse@chromium.org
4330070e32 Use Assembler::Set() to assign constants to registers in more places. Commit of http://codereview.chromium.org/6016007/ .
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6104 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-22 09:55:19 +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
ager@chromium.org
06a684d353 Fix deoptimization from %_MathPow. Do not prepare the stack for a C
call and then bailout without performing the call.

In order to not duplicate code, convert both heap number and smi to a
double in an xmm register if possible. Then setup the stack and call
the C function.

BUG=http://code.google.com/p/v8/issues/detail?id=986

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6032 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-15 15:25:53 +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
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
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
whesse@chromium.org
3ef0c5dd21 Allow the optimizing code generator to call Math.pow with untagged doubles.
Review URL: http://codereview.chromium.org/5640004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5949 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-08 14:32:40 +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