Commit Graph

277 Commits

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