Commit Graph

133 Commits

Author SHA1 Message Date
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