Commit Graph

341 Commits

Author SHA1 Message Date
mikhail.naganov@gmail.com
f8e5c71e18 Rename SmartPointer to SmartArrayPointer.
As pointed out in: http://codereview.chromium.org/7754007/#msg5

"SmartPointer should have been named SmartArrayPointer as it expects an input
allocated using new[] and deallocates it using delete[]. Using it as a simple
scoped pointer for a single object is incorrect."

R=mnaganov@chromium.org

Review URL: http://codereview.chromium.org/7860011
Patch from Thiago Farina <tfarina@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9215 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-09 22:39:47 +00:00
svenpanne@chromium.org
1341ae7c1a Re-use phi reachability information to avoid a fixed-point computation.
When we propagate the information that a value is not convertible to integer,
there is no need for a separate fixed-point computation, we can do things the
"Millikin way" (tm), folding as much computation as possible into a single pass:
;-) We already have the phi node reachability information, so we can easily
propagate this while doing the representation histogram computation.
Review URL: http://codereview.chromium.org/7754010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9212 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-09 13:12:52 +00:00
danno@chromium.org
9b2de409f9 Mechanical refactor to move ElementsKind type out of JSObject.
R=svenpanne@chromium.org
BUG=none
TEST=all

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9208 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-09 09:35:57 +00:00
fschneider@chromium.org
366416f7bd Add a function to compute loop nesting level to HBasicBlock.
Review URL: http://codereview.chromium.org/7857031

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9207 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-09 09:17:57 +00:00
kmillikin@chromium.org
5f1b39e0d5 Remove ExitContextStatement.
All the constructs that used it are now properly bracketed in the AST and we
handle abrupt exits without try/finally.  We can treat normal context exit
as occurring implicitly at the end of a body.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9189 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-08 08:59:14 +00:00
svenpanne@chromium.org
ffb70bc843 Improved phi reachability computation a bit.
The use-def relation between phis is mainly "forwards" (i.e. from phis with
smaller IDs to ones with larger IDs), so the fixed point computation terminates
faster when iterate through the phis in a "backwards" manner. This is quite
visible in complex Mandreel-generated code, where a few hundred phis with
non-trivial use-def chains are generated.
Review URL: http://codereview.chromium.org/7848012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9185 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-08 07:40:11 +00:00
kmillikin@chromium.org
765cf1f25e Fix presubmit failures.
TBR=fschneider@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9163 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-07 11:11:36 +00:00
kmillikin@chromium.org
94777e213d Remove variable rewrites and the unneccesary Slot class.
R=fschneider@chromium.org
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9162 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-07 11:02:31 +00:00
fschneider@chromium.org
913f444cb7 Support declarations of context allocated locals in Crankshaft.
The changes to scopes and parser introduce a VariableProxy
wrapping the function-name variable for function literals.
It seems the easiest way to get an AST id for the HSimulate
after context-slot stores in declarations.
Review URL: http://codereview.chromium.org/7826009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9112 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-01 16:33:57 +00:00
svenpanne@chromium.org
d02dfb301d Tiny change flags cleanups.
Introduced a getter for change flags, making a related helper function private.

Do not print a '*' at the end of hydrogen instruction mnemonics with side
effects, this is subsumed by the 'changes' info.
Review URL: http://codereview.chromium.org/7827009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9092 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-01 11:06:03 +00:00
vegorov@chromium.org
e833f91eb3 Do constant function check earlier in TryCallApply and ensure correct environment for deopt.
R=kmillikin@chromium.org
BUG=v8:1650
TEST=test/mjsunit/regress/regress-1650.js
Review URL: http://codereview.chromium.org/7812033

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9091 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-01 10:33:59 +00:00
fschneider@chromium.org
ffc6c7e56b Introduce local function declarations in Crankshaft and fix issue 1647.
We have to emit code for declarations later into the body block
(and not into the start block) so that the environment contains
the correct values.

In order to capture the environment effect of the declarations
that generate code (function declarations) I inserted a separate
AST id and a HSimulate after the declarations are visited.

Also fixes handling deopt in named function expressions:
BUG=v8:1647
TEST=test/mjsunit/regress/regress-fundecl.js, test/mjsunit/regress/regress-1647.js
Review URL: http://codereview.chromium.org/7776009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9083 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-08-31 13:26:08 +00:00
keuchel@chromium.org
42388ad5c7 Temporal dead zone behaviour for let bindings.
BUG=
TEST=mjsunit/harmony/block-let-semantics.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9070 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-08-30 11:23:57 +00:00
fschneider@chromium.org
a846d482dd Revert r9047 to fix broken build.
I need some more time to properly fix the problem.

TBR=kmillikin@chromium.org
Review URL: http://codereview.chromium.org/7781008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9055 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-08-29 12:19:43 +00:00
fschneider@chromium.org
8ab5b50f1b Introduce support for local function declarations in Hydrogen.
Review URL: http://codereview.chromium.org/7782001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9047 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-08-29 10:50:47 +00:00
fschneider@chromium.org
a58b9ba90b Remove code handling parameters rewritten to properties (aka synthetic properties).
After merging the new arguments branch, there is no need for this code anymore.

TEST=all tests pass
Review URL: http://codereview.chromium.org/7753030

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9031 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-08-29 07:07:39 +00:00
lrn@chromium.org
cd3588d582 Make (some) functions called from builtin functions use the callback's global as receiver.
Changes GetGlobalReceiver() to GetDefaultReceiver(func) that returns undefined
for strict and native functions, and the function's context's global proxy
for "normal" functions.

BUG=v8:1547
TEST=cctest/api-test/ForeignFunctionReceiver

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9030 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-08-26 13:53:00 +00:00
fschneider@chromium.org
701146a3d7 Perform range analysis after GVN.
This eliminate redundant HChange instructions and allows range information of
converted values propagated across control-flow splits.

It fixes the performance regression on code like:

if (x > 1) {
  y = x - 1;
}

where we should eliminate the overflow check on the sub inside the if-statement.
Review URL: http://codereview.chromium.org/7709025

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8997 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-08-23 11:19:08 +00:00
fschneider@chromium.org
99b4d756fc Insert representation changes before doing range analysis and fix a bug in Range::Copy.
This improves our static type information by calculating the result type
of conversions (HChange) during range analysis. It allows e.g. to eliminate
the write barrier in the following example where it was not possible before:

function f(x) {
  var y = x + 1;
  if (y > 0 && y < 100) {
    a[0] = y;
  }
}


* Fix bug in Range::Copy. The minus-zero flags has to be preserved by default.
Review URL: http://codereview.chromium.org/7634022

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8994 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-08-23 07:34:45 +00:00
vitalyr@chromium.org
633e615b89 Improve memory usage of receiver type feedback.
Some AST nodes (Property, Call, etc.) store either a list of receiver
types or a monomorphic receiver type. This patch merges the two fields
using a small pointer list. GetMonomorphicReceiverType() is now a
purely convenience function returning the first and only recorded
type.

This saves about 500K (of about 39M) on average when compiling V8
benchmark as measured by a simple patch adding a zone allocation
counter (https://gist.github.com/1149397).

R=kmillikin@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8993 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-08-22 14:23:37 +00:00
kmillikin@chromium.org
91553bbacd Simplify handling of exits from with and catch.
Remove the try/finally used for with and catch.  Instead of using
try/finally to handle break and continue from with or catch,
statically track nesting dept and clean up when compiling break or
continue.

And instead of using try/finally to handle throw to handler in a frame
whose pc is inside a with or catch, store the context that the handler
should run in in the handler itself.

BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8922 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-08-12 10:52:49 +00:00
keuchel@chromium.org
3c7ca304fe Preliminary code for block scopes and block contexts.
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8911 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-08-11 16:29:28 +00:00
danno@chromium.org
d5d7185578 Create a common base class for Fixed-, FixedDouble- and ExternalArrays.
Also unify Crankshaft code to load array length.

BUG=v8:1493
TEST=external-arrays.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8901 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-08-11 14:00:16 +00:00
vitalyr@chromium.org
a107387dde Fix fun.apply(receiver, arguments) optimization.
R=kmillikin@chromium.org
BUG=v8:1592
TEST=mjsunit/regress/regress-1592.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8884 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-08-10 16:05:17 +00:00
vegorov@chromium.org
bd8c469cf9 Check phi uses of the arguments object after redundant phies elimination.
This allows to handle code like:

var a = arguments;
while (smth) a[i];

without bailout.

R=kmillikin@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8803 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-08-03 10:40:03 +00:00
vegorov@chromium.org
a547d333f0 Check for phi-uses of arguments object before eliminating dead phi's.
HGraphBuilder::TryArgumentsAccess does not emit any uses for receiver and will generate incorrect code when receiver for a property access is defined by a phi that returns either arguments object or something else.
 
BUG=v8:1582
TEST=test/mjsunit/regress/regress-1582.js
Review URL: http://codereview.chromium.org/7553006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8774 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-08-02 09:32:28 +00:00
fschneider@chromium.org
6c58013b36 Fix presubmit error.
TBR=whesse@chromium.org
Review URL: http://codereview.chromium.org/7470016

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8743 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-07-26 10:24:14 +00:00
fschneider@chromium.org
41ac29d0f4 Landing http://codereview.chromium.org/7514005/
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8742 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-07-26 10:12:37 +00:00
svenpanne@chromium.org
8ebf3993d6 Record ToBoolean's type information in Hydrogen's HBranch instruction, so we can use it in LCodeGen::DoBranch later.
Review URL: http://codereview.chromium.org/7491043

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8736 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-07-25 14:08:36 +00:00
jkummerow@chromium.org
622cf2e091 Fix deopts caused by misplaced COW checks.
TEST=Performance of pixel-array-blur back to normal.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8709 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-07-21 12:01:51 +00:00
jkummerow@chromium.org
c9f2a4325f Add fake data dependencies (instead of disabling GVN) to fix code motion
for HInstructions used in polymorphic array access code.

TEST=existing tests pass.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8699 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-07-20 14:43:10 +00:00
danno@chromium.org
11c7b47430 Crankshaft support for FixedDoubleArrays
BUG=none
TEST=unboxed-double-arrays.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8682 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-07-19 13:04:00 +00:00
jkummerow@chromium.org
d4779286b6 Add map check for COW elements to crankshaft array handling code.
BUG=1560
TEST=mjsunit/regress/regress-1560.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8656 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-07-14 14:45:20 +00:00
ager@chromium.org
9c233c711e Fix shortcutting bug in HInferRepresentation
* src/hydrogen.cc (HInferRepresentation::Analyze): Fix iterative loop
  over phis; the shortcutting behavior of || appears to be accidental
  here, causing O(n^2) convergence.  Not that it matters much, but hey!

While I'm at it, a minor comment fix:

* src/hydrogen-instructions.h (EnsureAndPropagateNotMinusZero): Fix a
  comment about the kinds of instructions that propagate to multiple
  inputs.

BUG=
TEST=passes tools/test.py

Review URL: http://codereview.chromium.org/7350019
Patch from Andy Wingo <wingo@igalia.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8645 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-07-13 14:43:09 +00:00
sgjesse@chromium.org
10bb16f495 Add support for lazy deoptimization from deferred stack checks
The debugger can be entered from the deferred stack check in optimized code. This can cause both lazy deoptimization and debugger deoptimization (setting the first break point and inspecting the stack for optimized code respectively). This required deoptimization support from the deferred stack check.

The lazy deoptimiztion call is inserted when the deferred code is done including restoring the registers. The bailout to the full code is the begining of the loop body as that is where the stack check is sitting in the optimized code. The bailout is not to the stack check in the full code as that is sitting at the end of the loop.

R=kmillikin@chromium.org

BUG=none
TEST=none

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8535 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-07-05 13:21:29 +00:00
whesse@chromium.org
f3d1453f83 As part of allowing different contexts for inlined functions, eliminate most explicit reads of the context from the stack frame in ia32 crankshaft codegen.
Eliminates the enum flag RESTORE_CONTEXT and CONTEXT_ADJUSTED, and adds a context HValue and LOperand to many hydrogen and lithium instructions.

Context is still used from the stack from in CallKnownFunction (this seems safe), and in CallRuntimeFromDeferred in lithium-codegen-ia32.cc, which needs to be fixed.

BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8529 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-07-04 14:13:08 +00:00
fschneider@chromium.org
b12e933e43 Refactor handling of test expressions in the graph builder.
Instead of generating two instructions and combining them
at lithium translation using the EmitAtUses predicate, we
generate the correct branch instruction right from the start.
Review URL: http://codereview.chromium.org/7237024

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8495 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-30 14:19:52 +00:00
ager@chromium.org
0d8c343c90 Do not pass the global object as the receiver to strict-mode and
builtin replace and sort functions.

R=ricow@chromium.org
BUG=v8:1360
TEST=mjsunit/regress/regress-1360.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8488 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-30 12:29:19 +00:00
jkummerow@chromium.org
39b06d8850 Add support for dictionary elements to polymorphic crankshaft code.
Review URL: http://codereview.chromium.org/7285001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8479 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-30 08:40:31 +00:00
sgjesse@chromium.org
7d2be7c0e0 Support debugger inspection of locals in optimized frames
Optimized frames are now handled by the debugger. When discovering optimized frames during stack inspection in the debugger they are "deoptimized" using the normal deoptimization code and the deoptimizer output information is used to provide frame information to the debugger.

Before this change the debugger reported each optimized frame as one frame no matter the number of inlined functuions that might have been called inside of it. Also all locals where reported as undefined. Locals can still be reposted as undefined when their value is not "known" by the optimized frame.

As the structures used to calculate the output frames when deoptimizing are not GC safe the information for the debugger is copied to another structure (DeoptimizedFrameInfo) which is registered with the global deoptimizer data and processed during GC.

R=fschneider@chromium.org

BUG=v8:1140
TEST=test/mjsunit/debug-evaluate-locals-optimized*

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8464 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-29 13:02:00 +00:00
kmillikin@chromium.org
e859416b9f Better placement of argument pushing for a few hydrogen call instructions.
Where it's simple to do so (keyed calls, calls to unknown global variables,
calls to local variables and non-property/non-variable expressions), end the
live range of argument subexpressions immediately after the last use of the
expression rather than at the call.

R=fschneider@chromium.org
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8445 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-28 12:51:21 +00:00
ager@chromium.org
3f6043d370 Cleanup to HEnvironment::CopyForInlining
* src/hydrogen.cc (HEnvironment::CopyForInlining): As the code for both
  the ::HYDROGEN and ::LITHIUM compilation phases is the same, just use
  one code path and remove the arg.

* src/hydrogen.h (HEnvironment): Remove now-unused CompilationPhase
  enum type and arg to CopyForInlining.

* src/arm/lithium-arm.cc (LChunkBuilder::DoEnterInlined):
* src/ia32/lithium-ia32.cc (LChunkBuilder::DoEnterInlined):
* src/x64/lithium-x64.cc (LChunkBuilder::DoEnterInlined): Adapt
  callers.

* AUTHORS: Add Igalia.

BUG=
TEST=I ran tools/test.py.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8442 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-28 08:54:09 +00:00
sgjesse@chromium.org
54d6072332 Change the handling of stack check on backward branches
The hydrogen stack check instruction is now added to each loop and the stack check handling on the back edge has been removed.

This change causes regression on small tight loops as the stack check is now at the top of the loop instead of at the bottom, and that requires one additional unconditional jump per loop iteration. However the reason for this change is to avoid worse regressions for upcoming changes to correctly support debugger break in optimized code.

R=fschneider@chromium.org

BUG=none
TEST=none

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8428 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-27 12:12:27 +00:00
keuchel@chromium.org
628a2e2a1f Better codegen for '<expression> === void <literal>'.
Detect the pattern in both, the full compiler and crankshaft and generate direct pointer
comparisons. Along the way I cleaned up 'typeof <expression> == <string literal>' comparisons
as well by lifting platform independent code and checking the symmetric case.

BUG=v8:1440
TEST=cctest/test-api.cc

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8420 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-24 14:30:10 +00:00
ager@chromium.org
5ea7238814 Fix renaming patch to also compile in debug mode.
R=ricow@chromium.org
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8387 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-23 06:33:38 +00:00
ager@chromium.org
03fc1660b3 HBasicBlock::CreateSimulate argument name clarity
* src/hydrogen.h:
* src/hydrogen.cc (HBasicBlock::CreateSimulate): Rename "id" arg to
  "ast_id".

BUG=
TEST=

Review URL: http://codereview.chromium.org/7234010
Patch from Andy Wingo <wingo@igalia.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8385 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-23 06:26:50 +00:00
fschneider@chromium.org
01a8cda43e Remove redundant hydrogen- and lithium instruction for symbol comparison.
We had two instructions HCompareJsObjectEq and HCompareSymbolEq that behave
exactly the same. I removed one and renamed the remaining instruction into
HCompareObjectEq.
Review URL: http://codereview.chromium.org/7206040

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8349 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-21 11:18:15 +00:00
sgjesse@chromium.org
4fa40ebc78 Include the loop header block when eliminating stack checks
In simple unconditional loops - like the following - the hydrogen stack check elimination did not detect the call as the loop header block itself was not considered.

function f(o) {
  while(true) {
    o.a();
  }
}

R=fschneider@chromium.org

BUG=none
TEST=none

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8329 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-20 12:29:03 +00:00
jkummerow@chromium.org
b789cb8c94 Crankshaft support for polymorphic array handling
Review URL: http://codereview.chromium.org/7170012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8325 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-20 10:19:00 +00:00
karlklose@chromium.org
f4e4bc43a8 Merge arguments branch to bleeding edge (second try).
Review URL: http://codereview.chromium.org/7187007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8315 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-16 14:12:58 +00:00
karlklose@chromium.org
cc19d1e278 Revert "Merge arguments branch to bleeding merge."
This reverts commit ceb31498b9d69edca3260820fb4047045891ce6d.

TBR=kmillikin@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8308 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-16 06:37:49 +00:00
karlklose@chromium.org
6cfeb2d400 Merge arguments branch to bleeding merge.
Review URL: http://codereview.chromium.org/7167006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8300 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-15 15:09:28 +00:00
vitalyr@chromium.org
d254298e3a Make valgrind happy with SparseSet.
R=ager@chromium.org
BUG=crbug.com/83626

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8279 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-14 12:48:25 +00:00
svenpanne@chromium.org
a4cf7be941 First steps towards better code generation for LBranch:
* AST Expression nodes get a separate testing ID to record type info in
   ToBooleanStub later. This is necessary to avoid clashes with other uses of
   already existing IDs.

 * In order to avoid threading the condition expression through tons of places,
   TestContexts carry it now with them. Note that we will probably only need the
   testing ID of the expression, but having the whole thing at hand makes
   debugging easier. Probably we will change this later...
Review URL: http://codereview.chromium.org/7046073

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8274 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-14 09:15:25 +00:00
fschneider@chromium.org
5a236ce6fd Add support for hydrogen control instructions with >2 successor blocks.
This change makes the number of successors of a control instruction
configurable with a template parameter and changes the existing instructions
to use it.

To iterate over all successors I added an iterator instead of always calling
First- and SecondSuccessor.
Review URL: http://codereview.chromium.org/7114004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8262 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-10 12:09:48 +00:00
danno@chromium.org
7c26e7143f Fix bogus unreachable in debug code.
BUG=none
TEST=none
TBR=jkummerow@chromium.org

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8247 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-09 16:20:41 +00:00
fschneider@chromium.org
424407c727 Simplify the check when to perform loop invariant code motion.
Allow HChange instructions to be hoisted out of loops. To avoid
unnecessary code motion we don't hoist instructions from blocks that
have been marked containing an unconditional deoptimization.
Review URL: http://codereview.chromium.org/7003087

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8245 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-09 15:49:21 +00:00
danno@chromium.org
9f432cd159 Dispatch on ElementsKind rather than ExternalArrayType when generating ICs and Crankshaft code for many element operations. This is preparation to be able to share more code in the various element accessor implementations.
Merge logic to maintain external array and fast element stub caches.

BUG=none
TEST=none

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8244 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-09 15:19:37 +00:00
whesse@chromium.org
c40aa827bf Add boolean flag to HChange and LNumberUntagD to not convert undefined to NaN.
This is needed so that HCompare, optimized for double inputs, works correctly on undefined inputs.
BUG=v8:1434
TEST=mjsunit/bugs/bug-1434.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8237 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-09 12:27:28 +00:00
kmillikin@chromium.org
371af773cf A collection of context-related refactoring changes.
Introduce separate maps for function and with contexts.  Use the function
context map for testing whether a context is a function context (global
contexts are no longer function contexts).

Split the paths for allocating with and catch contexts.

Rename some functions.  Generally refactor code to make it simpler.

R=ager@chromium.org
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8231 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-09 11:26:01 +00:00
fschneider@chromium.org
68eab4a8d8 Fix bug with GVN on array loads.
This fixes a bug where an array load was incorrectly hoisted by GVN.

BUG=85177
TEST=mjsunit/regress/regress-85177.js
Review URL: http://codereview.chromium.org/7003054

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8230 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-09 11:15:03 +00:00
kmillikin@chromium.org
e9a1ffde92 Stop using with explicitly to implement try/catch.
The AST for TryCatch gives us enough structure that we do not need to expand
it to explicitly include a with.  Try/catch is still handled the same as
before at runtime.

R=ager@chromium.org
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8224 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-08 13:55:33 +00:00
fschneider@chromium.org
7c9cf0b3a1 Re-land r8140: Deoptimize on never-executed code-paths.
Original cl: http://codereview.chromium.org/7105015

I'm removing the test GlobalLoadICGC test that was introduced for testing
inlined global cell loads (in the classic backend) and has an invalid assumption
about the number of global objects referenced from a v8 context. We don't have
this feature with Crankshaft anymore.
Review URL: http://codereview.chromium.org/7112032

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8185 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-06 14:57:25 +00:00
fschneider@chromium.org
ff76d1ab0c Revert r8140.
It breaks test when running with nosnapshot.
TBR=ager@chromium.org
Review URL: http://codereview.chromium.org/7027029

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8145 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-01 13:34:15 +00:00
kmillikin@chromium.org
27f2f6aa0b Delay processing of declarations for inlining candidates.
Processing the declarations in an inlining candidate must be performed
after constructing the Hydrogen environment of the candidate function.

R=fschneider@chromium.org
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8144 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-01 13:26:30 +00:00
fschneider@chromium.org
0aa422923c Eagerly deoptimize on never-executed code-paths.
If type-feedback indicates that an expression was never executed in
the non-optimized code, we insert a forced deoptimization right away
to enable re-optimization if we ever hit this path.

With this change we still continue to build the graph. As a next step, we
should remove the dead code after the deoptimize.

I had to remove one assert about the optimization status in a test since
we now immediately deoptimize after exiting the loop that triggers OSR.

Also remove a restriction that control-flow from an inlined function in a
test context always reaches both true- and false-target.
Review URL: http://codereview.chromium.org/7105015

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8140 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-01 11:04:40 +00:00
kmillikin@chromium.org
d985af520e Disable context-allocated const variables.
We intended them to be fully disabled for now, but there was a missing
check at initialization time.

R=fschneider@chromium.org
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8139 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-01 09:12:22 +00:00
svenpanne@chromium.org
15cb93ed62 Ooops, forgot to commit the renamings in Hydrogen for issue 6976028....
TBR=danno@chromium.org
Review URL: http://codereview.chromium.org/7105014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8132 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-01 07:11:25 +00:00
rossberg@chromium.org
670f947a5c Implement set trap for proxies, and revamp class hierarchy in preparation:
- Introduce a class JSReceiver, that is a common superclass of JSObject and
  JSProxy. Use JSReceiver where appropriate (probably lots of places that we
  still have to migrate, but we will find those later with proxy test suite).

- Move appropriate methods to JSReceiver class (SetProperty,
  GetPropertyAttribute, Get/SetPrototype, Lookup, and so on).

- Introduce new JSFunctionProxy subclass of JSProxy. Currently only a stub.

- Overhaul enum InstanceType:
  * Introduce FIRST/LAST_SPEC_OBJECT_TYPE that ranges over all types that
    represent JS objects, and use that consistently to check language types.
  * Rename FIRST/LAST_JS_OBJECT_TYPE and FIRST/LAST_FUNCTION_CLASS_TYPE
    to FIRST/LAST_[NON]CALLABLE_SPEC_OBJECT_TYPE for clarity.
  * Eliminate the overlap over JS_REGEXP_TYPE.
  * Also replace FIRST_JS_OBJECT with FIRST_JS_RECEIVER, but only use it where
    we exclusively talk about the internal representation type.
  * Insert JS_PROXY and JS_FUNCTION_PROXY in the appropriate places.

- Fix all checks concerning classification, especially for functions, to
  use the CALLABLE_SPEC_OBJECT range (that includes funciton proxies).

- Handle proxies in SetProperty (that was the easiest part :) ).

- A few simple test cases.

R=kmillikin@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8126 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-31 16:38:40 +00:00
kmillikin@chromium.org
00f2ff321e Support optimization of named function literals.
Introduce a Hydrogen value for the value denoted by the function name.

R=fschneider@chromium.org,mnaganov@chromium.org
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8121 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-31 11:54:46 +00:00
svenpanne@chromium.org
dcb558fdf0 Push the general AST id field down from ASTNode to Expression.
Almost all uses were below Expression already, only a single use in IfStatement
had to be handled explicitly (probably an oversight from earlier changes?). This
is a small step towards a less ad-hoc handling of IDs in the front end.
Review URL: http://codereview.chromium.org/7054034

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8118 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-31 09:34:37 +00:00
ager@chromium.org
017935408d Reapply change to Pass undefined to JS builtins when called with
implicit receiver.

A couple of corner cases have to be treated specially to not break
everything: eval and getter/setter definitions.

R=fschneider@chromium.org
BUG=v8:1365
TEST=mjsunit/regress/regress-1365.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8110 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-30 13:49:22 +00:00
fschneider@chromium.org
e0985887bf Simple support for const variables in Crankshaft.
The approach is to handle the common case in the optimizing
compiler and to bailout for the rare corner cases.

This is done by initializing all local const-variables with
the hole value and disallowing any use of the hole value statically.
Review URL: http://codereview.chromium.org/6026006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8104 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-30 11:31:41 +00:00
danno@chromium.org
c2394e0a71 Prevent deopt on double value assignment to typed arrays
Implement truncation of double and tagged values when assigning to an element of a typed arrays in order to avoid depots.

BUG=1313
TEST=test/mjsunit/external-array.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8077 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-26 12:07:22 +00:00
ager@chromium.org
c832c467a4 Revert "Pass undefined to JS builtins when called with implicit receiver."
Presubmit and failing test.

TBR=lrn@chromium.org
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8075 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-26 11:22:29 +00:00
ager@chromium.org
19b718fe73 Pass undefined to JS builtins when called with implicit receiver.
A couple of corner cases have to be treated specially to not break
everything: eval and getter/setter definitions.

R=lrn@chromium.org
BUG=v8:1365
TEST=mjsunit/regress/regress-1365.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8073 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-26 11:07:48 +00:00
kmillikin@chromium.org
68e2d1bfed Do not allow inlining functions with direct arguments access.
Our implementations of arguments without materializing the arguments
object (based on inspecting the stack frame) does not work for inlined
functions.  Guard all attempts by disallowing them if possible or else
bailing out of the optimizing compiler.

R=fschneider@chromium.org
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8072 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-26 10:56:07 +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
kmillikin@chromium.org
47157e8a56 When inlining fails, disable optimization of the proper function.
Also, refactor disabling of optimization to make it easier to ensure
that both SharedFunctionInfo and Code get disabled.

R=whesse@chromium.org
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7963 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-19 13:15:57 +00:00
whesse@chromium.org
7878391841 Refactor TraceInlining method of hydrogen so it works correctly.
Fix TraceInline.

BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7961 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-19 12:53:50 +00:00
vitalyr@chromium.org
85edb5f96b Make GVN side effect analysis more precise.
When descending the dominator tree we used to collect side effects from all blocks between the dominator and the dominated blocks in the block ordering. This could include blocks that do not appear on paths from the dominator to the dominated and unnecessarily removed available values from the GVN map.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7943 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-18 17:18:35 +00:00
fschneider@chromium.org
66911961cf Fix bug in optimized compiler's switch-statement.
In the case where the default-clause occurs as the first clause,
the case-blocks were not wired up correctly.

BUG=v8:1394
TEST=mjsunit/compiler/regress-1394.js
Review URL: http://codereview.chromium.org/7037023

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7927 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-18 11:06:07 +00:00
whesse@chromium.org
0eca2b4fc1 Fix error in postfix ++ in Crankshaft.
Add HForceRepresentation, to represent the implicit ToNumber applied to the input of a count operation.

BUG=v8:1389

TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7913 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-17 11:41:59 +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
svenpanne@chromium.org
fe2074f580 Removed a "feature envy" bad smell: Moved AssumeRepresentation method to where
it belongs.
Review URL: http://codereview.chromium.org/7015039

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7890 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-13 13:29:02 +00:00
svenpanne@chromium.org
78f4dd1208 Use type feedback for unary minus, improving the performance on e.g. 3d-cube by
7.2% and math-cordic by 5.7%.
Review URL: http://codereview.chromium.org/7013025

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7882 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-13 08:21:35 +00:00
fschneider@chromium.org
5f29f9bd8e Don't use environment values at certain deoptimize-instructions.
If a HDeoptimize does not cut away parts of the control-flow-graph
we don't need to insert uses to correctly elimiate dead phis since
the full function is visible to the optimizing compiler.

This is a small improvement of the change r7221 which fixed a problem
when deoptimizing on never executed case-clauses.
Review URL: http://codereview.chromium.org/7012010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7877 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-12 14:56:56 +00:00
svenpanne@chromium.org
a3afc9a896 Made the output of the --trace-representation flag a bit more informative and
centralized its handling.
Review URL: http://codereview.chromium.org/6969034

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7874 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-12 13:36:49 +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
whesse@chromium.org
bf06fbdbf1 Recommit "First step in letting Crankshaft inline functions with a different context.""
This reverts r7810, thus recommitting 7807.

BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7851 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-11 11:03:12 +00:00
svenpanne@chromium.org
9f3f90ddc0 Improved c1visualizer output a bit: Emit a human-readable description for
changes instead of a bit-pattern. Fixed logic when ranges are emitted. Improved
indentation in hydrogen.cfg (aesthetical change only). Some minor additional
cleanup.
Review URL: http://codereview.chromium.org/6995024

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7849 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-11 09:19:28 +00:00
svenpanne@chromium.org
986ed5358e Reverted some code which got accidentally committed as part of another commit.
TBR=vitalyr@chromium.org
Review URL: http://codereview.chromium.org/6994011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7842 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-10 14:39:19 +00:00
vitalyr@chromium.org
5ac2a3acfc Fix lint.
TBR=svenpanne@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7841 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-10 14:21:23 +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
svenpanne@chromium.org
4912c0371b A few "extract method" refactorings, trying to get individual method definitions
onto a sinlge 30" screen. A lot of times, the AST visitor stops a bit too early,
so we have to do the rest of the dispatch by hand. This is caused by the fact
that the kind of the AST nodes are a bit too coarse for some traversals (e.g. a
single node type for all binary ops), perhaps one could try to refine this a
little bit more.
Review URL: http://codereview.chromium.org/6963008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7839 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-10 13:29:57 +00:00
whesse@chromium.org
912ec759da Revert "First step in letting Crankshaft inline functions with a different context."
This reverts commit r7807.  TBR=kmillikin@chromium.org.

BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7810 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-06 15:02:15 +00:00
whesse@chromium.org
efc43746df First step in letting Crankshaft inline functions with a different context.
Use a special slot for HContext, and fetch the value from there each time it is used.  Allocate space for special slots in every HEnvironment.  Fill them with constant undefined.  Do not copy them to LEnvironment.

BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7807 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-06 13:26:22 +00:00
whesse@chromium.org
788db8aedc Tiny refactoring - change compilation phase parameter for CopyForInlining from a boolean to an enum.
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7782 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-04 15:00:04 +00:00
fschneider@chromium.org
3e94ac952d Change heuristics for deciding phi-representation types to use int32 more frequently.
Until now we conservatively chose a double representation if
at least one use occurs in a double operation. This causes performance
degradation in many cases where there are mixes uses (integer and double)

e.g.:

for (int i = 0; i < 10; i++) {
  var t = i / 3.5;
  a[i] = t;
}

where the use in i/3 requires a double, where as the keyed store requires i
as an integer.

For these cases we want to have i as an integer and convert it only before the
double division.

In order to avoid unconditional deoptimization in some rare cases, we check
phis if there is any conversion that will always fail when converting a
heap-number constant to int32.
Review URL: http://codereview.chromium.org/6905166

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7757 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-03 08:31:35 +00:00
kmillikin@chromium.org
d0fcbb4ece Simplify include dependencies.
Try to make sure that accessors.h, data-flow.h, list-inl.h, and
scopeinfo.h are included only where needed, but without introducing
implicit dependencies.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7756 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-03 08:23:58 +00:00
kmillikin@chromium.org
1af840ad4c Be more discriminating about uses of the arguments object in optimized code.
Because we track the value of the arguments object, we need to check
values whenever plugged into a forbidden value context.  It is not
enough to check at only variable references as we did previously.

R=fschneider@chromium.org
BUG=1351
TEST=regress-1351.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7739 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-05-02 11:35:51 +00:00
whesse@chromium.org
4f41d895b0 Use type info for count operation in Crankshaft.
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7717 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-29 09:21:18 +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
kmillikin@chromium.org
4d1b2b1d38 Change the Hydrogen representation of uses.
Rather than representing a use as a pointer to an HValue and then searching
for the specific (ambiguous) operand, we now represent a use as a pair of an
HValue and the input operand index.  Additionally, use a linked list instead
of a growable array list since we never use random access.

This allows us to remove a bunch of similarly named and subtly different
functions from the HValue API.  The cost in extra zone allocation per use is
partially offset by reusing use list nodes when replacing a use of one value
with another.

R=danno@chromium.org,fschneider@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7674 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-20 10:38:08 +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
kmillikin@chromium.org
db91b43ace Fix a just-introduced bug in polymorphic inlining.
When inlining a polymorphic variant, the inlined function indicates we
should bailout of the entire compilation by setting the stack overflow flag
on the visitor.  We need to check this flag and bailout if a call to
TryInline succeeds and it is not in tail position in a graph builder
function.

R=fschneider@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7604 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-13 11:59:23 +00:00
kmillikin@chromium.org
6d7b88b5bc Fix typo which broke build.
TBR=fschneider@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7602 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-13 11:30:36 +00:00
kmillikin@chromium.org
c25c2784d9 Relax assumptions about control flow in the hydrogen graph.
Previously we assumed that control was always live after visiting an
expression, and that control was live to both basic block targets of an
expression in a test context.

Now we allow any expression to exit the graph.

R=fschneider@chromium.org,danno@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7601 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-13 11:24:06 +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
whesse@chromium.org
85363049ac Restart AST node numbering when we enter a function.
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7543 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-07 14:45:34 +00:00
danno@chromium.org
fa69fd0817 Fix opmitized external array access for compound assignments and count operations, also implement missing ARM typed array Hydrogen loads and stores.
BUG=none
TEST=none

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7536 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-07 09:51:25 +00:00
fschneider@chromium.org
f983244124 Remove unnecessary AST node for ++ and -- operations.
Instead of adding an extra AST node we can just use an auxiliary
bailout id for named and keyed property count operations.
Review URL: http://codereview.chromium.org/6810015

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7524 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-07 07:56:43 +00:00
vitalyr@chromium.org
38e328d469 Use placement new for zone objects in hydrogen.
Review URL: http://codereview.chromium.org/6794041

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7506 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-05 18:47:46 +00:00
fschneider@chromium.org
7ef5cec9ae Remove environment length from HSimulate instructions.
It was only used in an ASSERT when reconstructing environments
at lithium translation time.
Review URL: http://codereview.chromium.org/6693062

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7501 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-05 09:55:18 +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
vitalyr@chromium.org
0b40589e73 Fix multi-isolate build:
o Make ia32 macro assembler work without an isolate and use it in the
  custom memcpy creation code.
o Remove isolate-dependent code from the custom memcpy and modulo
  functions creation code.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7482 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-01 14:46:30 +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
vegorov@chromium.org
ae65366f0b Fix SlotRef::SlotAddress for parameters indices.
Fix %NewObjectFromBound to correctly handle optimized frames (including those with inlined functions).

Fix %_IsConstructCall handling in hydrogen: when called from inlined function return false constant directly instead of emiting HIsConstructCall.

Fix success case in TraceInline.

BUG=v8:1229
TEST=test/mjsunit/regress/regress-1229.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7472 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-01 11:41:36 +00:00
antonm@chromium.org
71431d79a0 Do not create a SharedFunctionInfo for closures on each recompilation.
Unoptimized code should already keep a reference to the SharedFunctionInfo,
let's use it instead of allocating a new object and prohibiting SharedFunctionInfo
specific optimizations.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7467 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-01 10:20:39 +00:00
sgjesse@chromium.org
2531480d10 Re-establish mips basic infrastructure.
This commit adds current working versions of assembler, macro-assembler,
disassembler, and simulator.

All other mips arch files are replaced with stubbed-out versions that
will build.

Arch independent files are updated as needed to support building and
running mips.

The only test is cctest/test-assembler-mips, and this passes on the
simulator and on mips hardware.

TEST=none
BUG=none

Patch by Paul Lind from MIPS.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7388 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-28 13:05:36 +00:00
fschneider@chromium.org
6fadb5257f Fix hydrogen statistics output when no code gets optimized.
In that case print 0 instead of NaN for normalized time and bytes allocated.

R=kmillikin@chromium.org
Review URL: http://codereview.chromium.org/6696070

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7359 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-25 10:02:42 +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
vitalyr@chromium.org
1dc8f7edb3 Store HValue uses in a custom small list structure.
This saves about 700K of zone allocation when compiling the V8
benchmark suite.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7330 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-23 14:44:19 +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
0dce18e6c2 Clean up Isolate usages in ast visitor and hydrogen.
Review URL: http://codereview.chromium.org/6688066

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7282 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-21 11:57:59 +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
antonm@chromium.org
6311105e00 Refactor fast API call.
Make it use custom call generator infrastructure.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7246 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-17 17:25:54 +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
vegorov@chromium.org
c83f0a715e Make HDeoptimize to explicitly use environment values.
Otherwise dead phi elimination can actually remove some of the implicitly used phis.

BUG=1257
TEST=test/mjsunit/regress/regress-1257.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7221 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-17 12:22:49 +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
1a343b3004 Fix infinite recursion in the compiler introduced in r7212
In most situations tests passed just causing a bailout from the compiler due to stack overflow. On Mac some tests actually did crash and of cause some benchmarks showed regressions due to this.
Review URL: http://codereview.chromium.org/6665064

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7215 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-17 09:55:57 +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
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
antonm@chromium.org
7b6e295021 Faster invocation for most of API calls.
For most of API calls we generate better stub which is faster than invocation
via builtin, so use IC instead of direct call in Hydrogen.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7149 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-11 13:25:01 +00:00
whesse@chromium.org
7175dc09ef Crankshaft: Fix error in range analysis of compare operations.
Review URL: http://codereview.chromium.org/6658035

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7130 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-10 13:34:56 +00:00
fschneider@chromium.org
48832819b7 Normalize statistics about compilation time and allocation size.
Now we print compilation time and zone allocation per KB of compiled
source code to better compare with previous revisions.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7128 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-10 13:26:51 +00:00
fschneider@chromium.org
241e4d364e Initialize zone lists in the register allocator with more reasonable initial capacities.
Also replace fixed length zone lists with embedded vectors for the fixed live ranges.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7122 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-10 11:54:55 +00:00
fschneider@chromium.org
012db51660 Reuse backing store of two zone lists by using Rewind(0) instead of Clear().
Review URL: http://codereview.chromium.org/6647019

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7108 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-09 15:50:24 +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
kmillikin@chromium.org
a05a492254 Remove class HSubgraph.
Review URL: http://codereview.chromium.org/6647018

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7100 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-09 12:37:56 +00:00
kmillikin@chromium.org
d31594feae Refactor construction of switch statements to avoid subgraphs.
Refactor construction of switch statements so it doesn't use class
HSubgraph.

There are also a few improvements.  We do not use an auxiliary list of
comparisons because they're embedded as a linked list in the graph
under construction.  We share a common break block for all breaks from
the same switch.  We do not insert empty blocks unless necessary to
maintain edge-split form.

There is also a bug fix.  The entry to a clause body is a potential
join and must have a join ID set, otherwise deoptimization within the
body can go to an unpredictable place in the unoptimized code.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7099 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-09 12:06:54 +00:00
fschneider@chromium.org
4d2c3ee82d Avoid allocation of temporary zone lists when inserting representation changes.
Instead of allocating fresh temporary lists for every instruction, reuse
the same instance and reset it between instructions.

This reduces the amount of zone memory used for inserting the HChange
instructions roughly by half.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7094 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-08 15:08:36 +00:00
fschneider@chromium.org
12ba2dd435 Improve dead phi elimination.
This change splits the existing phi elimination into two phases:
1. Remove redundant phis
2. Remove dead phis with a fixed point iteration.

The new approach allows us to remove dead phis that are connected
in a cycle.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7085 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-08 10:04:23 +00:00
mmaly@chromium.org
927f341d3c Strict mode arguments do not share binding with formal parameters.
Move strict mode flag from TemporaryScope to Scope so that it can be accessed from variable binding code.
Arguments do not alias in strict mode (ia32, x64 and arm, codegen and full codegen).
Hydrogen tolerates null arguments_shadow().
In codegen-<arch> arguments object is allocated eagerly to capture values before they get modified.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7083 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-07 19:23:46 +00:00