Commit Graph

414 Commits

Author SHA1 Message Date
mstarzinger
e9e8ac7afc [turbofan] Project exception value out of calls.
TEST=cctest/test-run-jsexceptions

Review URL: https://codereview.chromium.org/989123003

Cr-Commit-Position: refs/heads/master@{#27537}
2015-03-31 12:26:39 +00:00
rmcilroy
00477a5d72 Ensure that GC idle notifications either make progress or stop requesting more GCs.
The V8::IdleNotification will only return 'True' when the gc idle time handler
thinks there is no more GC which can be done. However, the gc idle task handler
can end up repeatedly making no progress (e.g., if it can't finalize a sweep)
which causes idle tasks to be repeatedly scheduled in Chrome which do nothing
but wake up Chrome. Fix this by returning Done if we can't make any progress
within an Idle Round.

BUG=chromium:470615
LOG=Y

Review URL: https://codereview.chromium.org/1042483002

Cr-Commit-Position: refs/heads/master@{#27529}
2015-03-30 17:05:02 +00:00
vogelheim
ee9c738929 Re-work the 'external snapshot' related build rules.
This prepares for re-landing crrev.com/956373002

This pulls all decision about the snapshot [no|internal|external] into one rule. Previously, this logic was in separate places and not /quite/ the same, which causes build problems.

BUG=

Review URL: https://codereview.chromium.org/1016603004

Cr-Commit-Position: refs/heads/master@{#27523}
2015-03-30 14:54:27 +00:00
hpayer
bffde6f4ab Allow more scavenges in idle notification by increasing the new space limit distance.
BUG=chromium:468554
LOG=n

Review URL: https://codereview.chromium.org/1034403002

Cr-Commit-Position: refs/heads/master@{#27517}
2015-03-30 11:40:06 +00:00
baptiste.afsa
f5a6f73ce6 Reland "Match fneg for -0.0 - x pattern."
R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/1040053002

Cr-Commit-Position: refs/heads/master@{#27516}
2015-03-30 10:53:02 +00:00
hpayer
eda9a88f2f Finalize sweeping in idle notification when all pages are swept.
A follow-up CL will implement incremental sweeping during idle time.

BUG=

Review URL: https://codereview.chromium.org/1038283003

Cr-Commit-Position: refs/heads/master@{#27513}
2015-03-30 10:05:35 +00:00
bmeurer
8dad78cdbd [turbofan] Add backend support for float32 operations.
This adds the basics necessary to support float32 operations in TurboFan.
The actual functionality required to detect safe float32 operations will
be added based on this later. Therefore this does not affect production
code except for some cleanup/refactoring.

In detail, this patchset contains the following features:
- Add support for float32 operations to arm, arm64, ia32 and x64
  backends.
- Add float32 machine operators.
- Add support for float32 constants to simplified lowering.
- Handle float32 representation for phis in simplified lowering.

In addition, contains the following (related) cleanups:
- Fix/unify naming of backend instructions.
- Use AVX comparisons when available.
- Extend ArchOpcodeField to 9 bits (required for arm64).
- Refactor some code duplication in instruction selectors.

BUG=v8:3589
LOG=n
R=dcarney@chromium.org

Review URL: https://codereview.chromium.org/1044793002

Cr-Commit-Position: refs/heads/master@{#27509}
2015-03-30 07:34:04 +00:00
yangguo
98580e4b83 Revert of [turbofan][arm64] Match fneg for -0.0 - x pattern. (patchset #1 id:1 of https://codereview.chromium.org/1013743006/)
Reason for revert:
Revert due to crash.

Original issue's description:
> [turbofan][arm64] Match fneg for -0.0 - x pattern.
>
> Note that this patch add an extra bit to the ArchOpcodeField.
>
> R=bmeurer@chromium.org
>
> Committed: https://crrev.com/fe7441225100660d01e66ce3bcaefe368f62df81
> Cr-Commit-Position: refs/heads/master@{#27494}

TBR=bmeurer@chromium.org,baptiste.afsa@arm.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1041633002

Cr-Commit-Position: refs/heads/master@{#27495}
2015-03-27 09:12:07 +00:00
baptiste.afsa
fe74412251 [turbofan][arm64] Match fneg for -0.0 - x pattern.
Note that this patch add an extra bit to the ArchOpcodeField.

R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/1013743006

Cr-Commit-Position: refs/heads/master@{#27494}
2015-03-27 08:32:30 +00:00
hpayer
c293448f3e Simplified garbage collection idle handler.
The current GC idle time handling heuristics are getting too complicated. Moreover, with longer idle time we are getting more full garbage collections. This CL shrinks the idle round window and reduces complexity in the case where we cause a full garbage collection.

BUG=chromium:468554
LOG=n

Review URL: https://codereview.chromium.org/1024043003

Cr-Commit-Position: refs/heads/master@{#27493}
2015-03-27 08:00:51 +00:00
mstarzinger
1a1e53a311 [turbofan] Remove obsolete JSDebugger operator.
R=titzer@chromium.org

Review URL: https://codereview.chromium.org/1029583009

Cr-Commit-Position: refs/heads/master@{#27437}
2015-03-25 12:43:47 +00:00
titzer
9ac4ab799c [turbofan] Remove Instruction::IsControl() and Instruction::MarkAsControl()
R=dcarney@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1031803004

Cr-Commit-Position: refs/heads/master@{#27409}
2015-03-24 14:05:35 +00:00
dcarney
0a835afb29 [turbofan] add non fixed slot constraint to register allocator
R=jarin@chromium.org

BUG=

Review URL: https://codereview.chromium.org/1018853003

Cr-Commit-Position: refs/heads/master@{#27373}
2015-03-23 16:03:21 +00:00
balazs.kilvady
86a6b6ff91 MIPS: [turbofan] Turn Math.clz32 into an inlinable builtin.
Port 3aa206b865

BUG=v8:3952
LOG=n

Review URL: https://codereview.chromium.org/1020223002

Cr-Commit-Position: refs/heads/master@{#27343}
2015-03-20 14:05:36 +00:00
bmeurer
ff89876bb9 [turbofan] Fix lowering of Math.max for integral inputs.
R=jarin@chromium.org
BUG=chromium:468162
LOG=y

Review URL: https://codereview.chromium.org/1027753002

Cr-Commit-Position: refs/heads/master@{#27341}
2015-03-20 12:05:19 +00:00
Benedikt Meurer
3aa206b865 [turbofan] Turn Math.clz32 into an inlinable builtin.
R=dcarney@chromium.org, yangguo@chromium.org
BUG=v8:3952
LOG=n

Review URL: https://codereview.chromium.org/1021183002

Cr-Commit-Position: refs/heads/master@{#27329}
2015-03-20 08:37:34 +00:00
Benedikt Meurer
c16b91e84a [turbofan] Fix unit test coverage for JSIntrinsicLowering.
R=dcarney@chromium.org

Review URL: https://codereview.chromium.org/1028553002

Cr-Commit-Position: refs/heads/master@{#27328}
2015-03-20 08:26:56 +00:00
titzer
cd33978480 [turbofan] Remove last_use_ field from Node.
R=mstarzinger@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1022783002

Cr-Commit-Position: refs/heads/master@{#27319}
2015-03-19 15:44:35 +00:00
jarin
b7dc9c580a [turbofan] Remember types for deoptimization during simplified lowering.
With this change, we remember the types of frame state inputs (in a new
operator, called TypedStateValues). Instead of inferring the value types
when building translations, we used the recorded types.

The original approach was not reliable because the passes after
simplified lowering can change node types, and this in turn confuses
the translation builder.

BUG=chromium:468727
LOG=n
R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/1015423002

Cr-Commit-Position: refs/heads/master@{#27310}
2015-03-19 14:00:33 +00:00
jacob.bramley
3fdfe613f8 [ARM64] [turbofan] Support uxtb/uxth for add/sub.
Add support for appending extend modes uxtb or uxth to add and subtract
instructions, and using them in the instruction selector.

BUG=

Review URL: https://codereview.chromium.org/1021533002

Cr-Commit-Position: refs/heads/master@{#27303}
2015-03-19 12:44:23 +00:00
Benedikt Meurer
a75e4cea8f [turbofan] Remove indirection in JSToBoolean/JSUnaryNot lowering.
This reduces the overhead of typed lowering, because we lower
JSToBoolean/JSUnaryNot directly if possible, instead of first lowering
to AnyToBoolean, and then letting the SimplifiedOperatorReducer do the
further lowering.

Also remove some obsolete tests from the cctest suite that have since
been removed by proper unittests. And improve unitttest coverage for the
typed lowering cases.

R=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/999173003

Cr-Commit-Position: refs/heads/master@{#27295}
2015-03-19 10:13:12 +00:00
bmeurer
ed082f2adc [turbofan] Eliminatable JS/call nodes should not have a control input.
The control input is only relevant for operations that may "write" (to
prevent hoisting) or "throw" (because they are part of the control chain).

R=jarin@chromium.org

Review URL: https://codereview.chromium.org/1015353004

Cr-Commit-Position: refs/heads/master@{#27288}
2015-03-19 07:47:55 +00:00
jarin
0cde253c9e [turbofan] Support lazy deopt for truncating store to a typed array.
The change introduces a second frame state (for the state before
the operation) for the StoreProperty nodes. If the store writes
into a typed array, the frame state is used for lazy deopt from
the to-number conversion that is performed by the store.

BUG=v8:3963
LOG=n
R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/997983004

Cr-Commit-Position: refs/heads/master@{#27285}
2015-03-19 05:46:30 +00:00
svenpanne
736fa1d21e Add IBM people to PPC owners.
Review URL: https://codereview.chromium.org/1014063002

Cr-Commit-Position: refs/heads/master@{#27278}
2015-03-18 16:12:14 +00:00
bmeurer
45434d575e [turbofan] Improve ChangeLowering.
- Use representation information provided by the type system to skip SMI
  checks.
- Fix combining of ChangeTaggedToFloat64 with JSToNumber now that JS
  operators can produce control.
- Remove the unnecessary abstraction of smi/field offsets.
- Improve unit test coverage.
- Various cosmetic fixes.

R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/1018873002

Cr-Commit-Position: refs/heads/master@{#27250}
2015-03-18 07:27:44 +00:00
titzer
c6004a3211 [turbofan] Clean up TRACE macros and use variadic macros.
R=mstarzinger@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1014853002

Cr-Commit-Position: refs/heads/master@{#27248}
2015-03-17 18:51:19 +00:00
jarin
ca3abde2fa [turbofan] Variable liveness analysis for deopt.
This change introduces a liveness analyzer for local variables in frame states.

The main idea is to use the AstGraphBuilder::Environment class to build the control flow graph, and record local variable loads, stores and checkpoints in the CFG basic blocks (LivenessAnalyzerBlock class).

After the graph building finishes, we run a simple data flow analysis over the CFG to figure out liveness of each local variable at each checkpoint. Finally, we run a pass over all the checkpoints and replace dead local variables in the frame states with the 'undefined' value.

Performance numbers for Embenchen are below.

----------- box2d.js
Current --turbo-deoptimization: EmbenchenBox2d(RunTime): 11265 ms.
d8-master --turbo-deoptimization: EmbenchenBox2d(RunTime): 11768 ms.
d8-master: EmbenchenBox2d(RunTime): 10996 ms.
----------- bullet.js
Current --turbo-deoptimization: EmbenchenBullet(RunTime): 17049 ms.
d8-master --turbo-deoptimization: EmbenchenBullet(RunTime): 17384 ms.
d8-master: EmbenchenBullet(RunTime): 16153 ms.
----------- copy.js
Current --turbo-deoptimization: EmbenchenCopy(RunTime): 4877 ms.
d8-master --turbo-deoptimization: EmbenchenCopy(RunTime): 4938 ms.
d8-master: EmbenchenCopy(RunTime): 4940 ms.
----------- corrections.js
Current --turbo-deoptimization: EmbenchenCorrections(RunTime): 7068 ms.
d8-master --turbo-deoptimization: EmbenchenCorrections(RunTime): 6718 ms.
d8-master: EmbenchenCorrections(RunTime): 6858 ms.
----------- fannkuch.js
Current --turbo-deoptimization: EmbenchenFannkuch(RunTime): 4167 ms.
d8-master --turbo-deoptimization: EmbenchenFannkuch(RunTime): 4608 ms.
d8-master: EmbenchenFannkuch(RunTime): 4149 ms.
----------- fasta.js
Current --turbo-deoptimization: EmbenchenFasta(RunTime): 9981 ms.
d8-master --turbo-deoptimization: EmbenchenFasta(RunTime): 9848 ms.
d8-master: EmbenchenFasta(RunTime): 9640 ms.
----------- lua_binarytrees.js
Current --turbo-deoptimization: EmbenchenLuaBinaryTrees(RunTime): 11571 ms.
d8-master --turbo-deoptimization: EmbenchenLuaBinaryTrees(RunTime): 13089 ms.
d8-master: EmbenchenLuaBinaryTrees(RunTime): 10957 ms.
----------- memops.js
Current --turbo-deoptimization: EmbenchenMemOps(RunTime): 7766 ms.
d8-master --turbo-deoptimization: EmbenchenMemOps(RunTime): 7346 ms.
d8-master: EmbenchenMemOps(RunTime): 7738 ms.
----------- primes.js
Current --turbo-deoptimization: EmbenchenPrimes(RunTime): 7459 ms.
d8-master --turbo-deoptimization: EmbenchenPrimes(RunTime): 7453 ms.
d8-master: EmbenchenPrimes(RunTime): 7451 ms.
----------- skinning.js
Current --turbo-deoptimization: EmbenchenSkinning(RunTime): 15564 ms.
d8-master --turbo-deoptimization: EmbenchenSkinning(RunTime): 15611 ms.
d8-master: EmbenchenSkinning(RunTime): 15583 ms.
----------- zlib.js
Current --turbo-deoptimization: EmbenchenZLib(RunTime): 10825 ms.
d8-master --turbo-deoptimization: EmbenchenZLib(RunTime): 11180 ms.
d8-master: EmbenchenZLib(RunTime): 10823 ms.

BUG=

Review URL: https://codereview.chromium.org/949743002

Cr-Commit-Position: refs/heads/master@{#27232}
2015-03-17 09:38:43 +00:00
jarin
cd67e97a7e [turbofan] Cache for reusing parts of value vector nodes in frame states.
Instead of the current approach of storing flat vectors in frame states (and possibly reusing the last vector in AST graph builder), this change list builds a tree for the values and tries to reuse the nodes for different frame states. At the moment, we only use this for the local variable part of frame state, but nothing prevents us from using this for all parts.

This change provides two new classes: one for creating the tree (StateValuesCache) and one for iterating the trees (StateValuesAccess).

BUG=

Review URL: https://codereview.chromium.org/1008213002

Cr-Commit-Position: refs/heads/master@{#27222}
2015-03-16 13:43:13 +00:00
dusan.milosavljevic
17ada20c17 MIPS64: Unify and improve Word32 compares to use same instructions as Word64 compares.
The CL enables the same instructions are selected for Word32 and Word64 compare
operations which is possible due to a fact 32-bit inputs and produced values
are always sign-extended.

TEST=
BUG=

Review URL: https://codereview.chromium.org/1005123002

Cr-Commit-Position: refs/heads/master@{#27212}
2015-03-16 11:00:12 +00:00
bmeurer
83f157bc18 [turbofan] Use builtin inlining mechanism for Math.abs and Math.sqrt.
Reduces the amount of custom support code for Math functions in TurboFan
and allows for more general inlining (i.e. independent of parameter
types).

BUG=v8:3952
LOG=n
R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/1004083002

Cr-Commit-Position: refs/heads/master@{#27172}
2015-03-13 07:06:15 +00:00
bmeurer
99f8d57f3c [turbofan] Introduce optional Float64Min and Float64Max machine operators.
Basically recognize certain x < y ? x : y constructs and turn that into
Float64Min/Float64Max operations, if the target machine supports that.
On x86 we lower to (v)minsd/(v)maxsd.

R=dcarney@chromium.org

Review URL: https://codereview.chromium.org/998283002

Cr-Commit-Position: refs/heads/master@{#27160}
2015-03-12 14:07:39 +00:00
bmeurer
1982186b6f [turbofan] Use builtin inlining mechanism for Math.floor.
BUG=v8:3952
LOG=n
R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/997513002

Cr-Commit-Position: refs/heads/master@{#27098}
2015-03-10 11:59:31 +00:00
bmeurer
022ea7e057 [turbofan] Unify Math.floor / Math.ceil optimization.
Provide an intrinsic %MathFloor / %_MathFloor that is used to optimize
both Math.ceil and Math.floor, and use the JS inlining mechanism to
inline Math.ceil into TurboFan code. Although we need to touch code
outside of TurboFan to make this work, this does not affect the way we
handle Math.ceil and/or Math.floor in CrankShaft, because for CrankShaft
the old-style builtin function id based inlining still kicks in first.

Once this solution is stabilized, we can use it for Math.floor as well.
And once that is settled, we can establish it as the unified way to
inline builtins, and get rid of the specialized builtin function id
based inlining at some point.

Note that "builtin" applies to basically every piece of internal
JavaScript/intrinsics based code, so this also applies to the yet to be
defined JavaScript based code stubs and handlers.

BUG=v8:3953
LOG=n
R=yangguo@chromium.org,svenpanne@chromium.org

Review URL: https://codereview.chromium.org/990963003

Cr-Commit-Position: refs/heads/master@{#27086}
2015-03-10 08:42:53 +00:00
Benedikt Meurer
d18bfa1130 [x86] Faster/shorter code for stack checks.
Avoid loading the stack pointer and the stack limit into allocatable
registers first, but generate a cmp rsp,[limit] instead.

R=dcarney@chromium.org

Review URL: https://codereview.chromium.org/989203002

Cr-Commit-Position: refs/heads/master@{#27065}
2015-03-09 11:06:45 +00:00
Jaroslav Sevcik
02e318517f [turbofan] Add an extra frame state for deoptimization before binary op.
BUG=
R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/983153002

Cr-Commit-Position: refs/heads/master@{#27060}
2015-03-09 08:37:17 +00:00
svenpanne
4e7acce180 Merged INLINE_OPTIMIZED intrinsic type into INLINE.
BUG=v8:3947
LOG=n

Review URL: https://codereview.chromium.org/978123003

Cr-Commit-Position: refs/heads/master@{#27039}
2015-03-06 11:01:52 +00:00
bmeurer
4436c2642a [turbofan] Support for %_DoubleHi, %_DoubleLo and %_ConstructDouble.
This adds support for the double bits intrinsics to TurboFan, and is
a first step towards fast Math functions inlined into TurboFan code
or even compiled by themselves with TurboFan.

Review URL: https://codereview.chromium.org/974313002

Cr-Commit-Position: refs/heads/master@{#27006}
2015-03-05 09:22:38 +00:00
bmeurer
8df194c14a [turbofan] Fix ControlFlowOptimizer to also handle non-control nodes in the control chain.
Review URL: https://codereview.chromium.org/971223002

Cr-Commit-Position: refs/heads/master@{#26949}
2015-03-03 06:11:52 +00:00
Benedikt Meurer
e1c2c9016e [turbofan] Strength reduction of Word32And with Int32Mul.
- (x * (K << L)) & (-1 << L) => x * (K << L)
- ((K << L) * x) & (-1 << L) => x * (K << L)

R=dcarney@chromium.org

Review URL: https://codereview.chromium.org/972653002

Cr-Commit-Position: refs/heads/master@{#26942}
2015-03-02 13:54:09 +00:00
Benedikt Meurer
5f3914fc19 [turbofan] Use the typer to statically detect Smis.
R=rossberg@chromium.org

Review URL: https://codereview.chromium.org/968773004

Cr-Commit-Position: refs/heads/master@{#26939}
2015-03-02 13:10:42 +00:00
bmeurer
936ae2b814 [turbofan] Avoid generating dead BooleanNot nodes in typed lowering.
Without this shortcut we generate one BooleanNot per JSUnaryNot with
number input, which is quite common in asm.js. These dead nodes then
survive until the late control reducer runs, and may prevent
optimizations in the mean time.

R=dcarney@chromium.org

Review URL: https://codereview.chromium.org/963713002

Cr-Commit-Position: refs/heads/master@{#26911}
2015-02-27 10:25:05 +00:00
bmeurer
0f783c676b [turbofan] Fix bogus covering of Word64Equal w/ zero.
Review URL: https://codereview.chromium.org/960783002

Cr-Commit-Position: refs/heads/master@{#26870}
2015-02-26 07:18:42 +00:00
dcarney
e928c9d52b [turbofan] remove dependence of InstructionBlock on BasicBlock
BUG=

Review URL: https://codereview.chromium.org/951553005

Cr-Commit-Position: refs/heads/master@{#26859}
2015-02-25 16:37:58 +00:00
bmeurer
b1c2a34956 [turbofan] Don't introduce additional computation when hoisting out of loops.
Review URL: https://codereview.chromium.org/958533002

Cr-Commit-Position: refs/heads/master@{#26841}
2015-02-25 08:11:48 +00:00
dcarney
95df1bc266 [turbofan] optimize moves into merges
BUG=

Review URL: https://codereview.chromium.org/755323011

Cr-Commit-Position: refs/heads/master@{#26819}
2015-02-24 12:49:33 +00:00
bmeurer
dcf193f18c [turbofan] Strength reduction for inline comparisons.
Perform strength reduction on machine operators with inline comparisons:

  CMP & 1 => CMP
  1 & CMP => CMP
  CMP << 31 >> 31 => CMP

Also strength reduce the following constructs:

  x + (0 - y) => x - y
  (0 - y) + x => x - y

R=dcarney@chromium.org

Review URL: https://codereview.chromium.org/951903003

Cr-Commit-Position: refs/heads/master@{#26817}
2015-02-24 12:26:29 +00:00
mstarzinger
b33f552f34 Make sure exception handlers are deferred.
R=bmeurer@chromium.org
TEST=unittests/SchedulerTest.CallException

Review URL: https://codereview.chromium.org/944903002

Cr-Commit-Position: refs/heads/master@{#26816}
2015-02-24 11:44:57 +00:00
dcarney
43c7345b35 [turbofan] only use two gaps
BUG=

Review URL: https://codereview.chromium.org/948033002

Cr-Commit-Position: refs/heads/master@{#26814}
2015-02-24 11:09:20 +00:00
bmeurer
0882d3ff81 [turbofan] Initial version of branch cloning.
This implements a special case of block cloning to recognize constructs like

 if (a ? b : c) { ... }

that happen to be generated by Emscripten quite often.

Review URL: https://codereview.chromium.org/947963002

Cr-Commit-Position: refs/heads/master@{#26808}
2015-02-24 07:41:36 +00:00
bmeurer
61ac461330 Revert of [x64] Improve instruction selection for TruncateInt64ToInt32. (patchset #1 id:1 of https://codereview.chromium.org/936323004/)
Reason for revert:
Breaks SQLite

Original issue's description:
> [x64] Improve instruction selection for TruncateInt64ToInt32.
>
> R=svenpanne@chromium.org
>
> Committed: https://crrev.com/64a2717529e2197f3a789adabf86ca36f5eb764c
> Cr-Commit-Position: refs/heads/master@{#26739}

TBR=svenpanne@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/928723003

Cr-Commit-Position: refs/heads/master@{#26791}
2015-02-23 07:09:26 +00:00
mstarzinger
eb3bbd3da4 Cleanup scheduler unit test a bit.
R=bmeurer@chromium.org
TEST=unittests/SchedulerTest,unittests/SchedulerRPOTest

Review URL: https://codereview.chromium.org/927653004

Cr-Commit-Position: refs/heads/master@{#26778}
2015-02-20 14:38:11 +00:00
mstarzinger
7dba829be9 Add missing test for CollectControlProjections on calls.
R=bmeurer@chromium.org
TEST=unittests/NodePropertiesTest.CollectControlProjections_Call

Review URL: https://codereview.chromium.org/941993002

Cr-Commit-Position: refs/heads/master@{#26777}
2015-02-20 14:05:18 +00:00
Benedikt Meurer
9e6181d5c3 [turbofan] Finally get rid of the generic algorithm.
R=svenpanne@chromium.org

Committed: https://crrev.com/5bbe693e4817011b6a496c638c9f09026fd3dac9
Cr-Commit-Position: refs/heads/master@{#26760}

Review URL: https://codereview.chromium.org/944803002

Cr-Commit-Position: refs/heads/master@{#26767}
2015-02-20 10:12:00 +00:00
mstarzinger
6881d7609a Model exceptional edges from call nodes in TurboFan.
R=titzer@chromium.org,bmeurer@chromium.org

Review URL: https://codereview.chromium.org/928213003

Cr-Commit-Position: refs/heads/master@{#26766}
2015-02-20 09:55:00 +00:00
machenbach
c7810004bb Revert of [turbofan] Finally get rid of the generic algorithm. (patchset #2 id:20001 of https://codereview.chromium.org/944803002/)
Reason for revert:
Breaks dbg builds.

Original issue's description:
> [turbofan] Finally get rid of the generic algorithm.
>
> R=svenpanne@chromium.org
>
> Committed: https://crrev.com/5bbe693e4817011b6a496c638c9f09026fd3dac9
> Cr-Commit-Position: refs/heads/master@{#26760}

TBR=svenpanne@chromium.org,bmeurer@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/941963003

Cr-Commit-Position: refs/heads/master@{#26763}
2015-02-20 09:14:44 +00:00
Benedikt Meurer
5bbe693e48 [turbofan] Finally get rid of the generic algorithm.
R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/944803002

Cr-Commit-Position: refs/heads/master@{#26760}
2015-02-20 08:42:51 +00:00
Benedikt Meurer
64a2717529 [x64] Improve instruction selection for TruncateInt64ToInt32.
R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/936323004

Cr-Commit-Position: refs/heads/master@{#26739}
2015-02-19 09:41:53 +00:00
mstarzinger
7e7e85f32e Introduce and test NodeProperties::CollectControlProjections.
R=bmeurer@chromium.org
TEST=unittests/NodePropertiesTest.CollectControlProjections

Review URL: https://codereview.chromium.org/935033004

Cr-Commit-Position: refs/heads/master@{#26720}
2015-02-18 13:55:32 +00:00
bmeurer
39515a685a [x64] Recognize zero extension of 8-bit and 16-bit values.
R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/938513003

Cr-Commit-Position: refs/heads/master@{#26712}
2015-02-18 07:06:16 +00:00
bmeurer
acd9c46ca7 [turbofan] Optimize certain chains of Branch into a Switch.
This adds a new ControlFlowOptimizer that - for now - recognizes chains
of Branches generated by the SwitchBuilder for a subset of javascript
switches into Switch nodes. Those Switch nodes are then lowered to
either table or lookup switches.

Also rename Case to IfValue (and introduce IfDefault) for consistency.

BUG=v8:3872
LOG=n

Review URL: https://codereview.chromium.org/931623002

Cr-Commit-Position: refs/heads/master@{#26691}
2015-02-17 13:29:46 +00:00
jarin
8bd0bd522e [turbofan] Make the representation type component independent of the semantic component.
R=rossberg@chromium.org
BUG=

Review URL: https://codereview.chromium.org/904863002

Cr-Commit-Position: refs/heads/master@{#26621}
2015-02-12 15:21:33 +00:00
bmeurer
4465836c8a Fix invalid use of int in Zone.
Review URL: https://codereview.chromium.org/924453002

Cr-Commit-Position: refs/heads/master@{#26609}
2015-02-12 12:47:18 +00:00
mstarzinger
ec4305e48b Mark some common operator with Property::kNoThrow.
R=bmeurer@chromium.org
TEST=unittests/CommonOperatorTest

Review URL: https://codereview.chromium.org/912393002

Cr-Commit-Position: refs/heads/master@{#26584}
2015-02-11 15:02:41 +00:00
svenpanne
d1b5aa0716 Removed most of the bogus CompilationInfo constructor calls.
A CompilationInfo constructed from just an Isolate* and a Zone* is in
weird an inconsistent state (calling e.g. flags() on it will crash),
so we need to avoid them. This CL removes almost all of them, the
remaining 2 call sites in (for testing only) will be handled in a
separate CL. Things which have been changed:

  * Linkage is basically a decorator for CallDescriptor now.

  * ChangeLowering doesn't need Linkage at all.

  * JSGenericLowering doesn't need a full CompilationInfo*, just a
    single flag.

  * JSContextSpecializer doesn't need the full CompilationInfo, just a
    Context.

  * Removed unused CompilationInfo from SimplifiedLoweringTester.

This nicely decouples things already a bit more, but there's still
work to do...

Review URL: https://codereview.chromium.org/899803003

Cr-Commit-Position: refs/heads/master@{#26580}
2015-02-11 14:12:15 +00:00
vogelheim
2ea8df76ba Fix cctest + unittest to work with an external snapshot.
To do so, extract startup_data_util from d8 and use it those executables.

BUG=

Review URL: https://codereview.chromium.org/913703002

Cr-Commit-Position: refs/heads/master@{#26547}
2015-02-10 15:38:09 +00:00
dcarney
4045b72ce3 [turbofan] remove one level of indirection in phi inputs
BUG=

Review URL: https://codereview.chromium.org/910753002

Cr-Commit-Position: refs/heads/master@{#26524}
2015-02-09 13:02:53 +00:00
bmeurer
feb2890711 [turbofan] Initial support for Switch.
Adds Switch and Case operators to TurboFan and handles them
appropriately in instruction selection and code generation.

BUG=v8:3872
LOG=n

Review URL: https://codereview.chromium.org/892513003

Cr-Commit-Position: refs/heads/master@{#26515}
2015-02-09 08:56:12 +00:00
dcarney
996fa7d36e [turbofan] Remove global InstructionOperand caches.
Review URL: https://codereview.chromium.org/904693002

Cr-Commit-Position: refs/heads/master@{#26479}
2015-02-06 09:00:50 +00:00
michael_dawson
308d913a92 Contribution of PowerPC port (continuation of 422063005) - PPC dir update
Contribution of PowerPC port (continuation of 422063005, 817143002 and 866843003)
This patch brings the ppc directories up to date with our repo. We have
removed 5 individual optimizations which require changes in both the ppc and common
directories so they can be more easily reviewed on their own in subsequent patches.

Subsequent patches will cover:
- individual optimizations for PPC (5)
- remaining AIX changes not resolved by 4.8 compiler (4.8 is only recently available
for AIX)
- incremental updates required to ppc directories due to platform specific changes
made in google repos while we complete the above steps.

With the update there are still some timeouts seen when run in simulated mode which
may be a result of the missing optimizations.  Once we have the optimizations in
we will review the simulation results and address/exclude tests as necessary so that
the simulated runs are clean.

	new file:   src/compiler/ppc/code-generator-ppc.cc
	new file:   src/compiler/ppc/instruction-codes-ppc.h
	new file:   src/compiler/ppc/instruction-selector-ppc.cc
	new file:   src/compiler/ppc/linkage-ppc.cc
	modified:   src/ic/ppc/handler-compiler-ppc.cc
	modified:   src/ic/ppc/ic-compiler-ppc.cc
	modified:   src/ic/ppc/ic-ppc.cc
	modified:   src/ic/ppc/stub-cache-ppc.cc
	modified:   src/ppc/assembler-ppc.cc
	modified:   src/ppc/assembler-ppc.h
	modified:   src/ppc/builtins-ppc.cc
	modified:   src/ppc/code-stubs-ppc.cc
	modified:   src/ppc/code-stubs-ppc.h
	modified:   src/ppc/codegen-ppc.cc
	modified:   src/ppc/constants-ppc.h
	modified:   src/ppc/deoptimizer-ppc.cc
	modified:   src/ppc/disasm-ppc.cc
	modified:   src/ppc/full-codegen-ppc.cc
	modified:   src/ppc/interface-descriptors-ppc.cc
	modified:   src/ppc/lithium-codegen-ppc.cc
	modified:   src/ppc/lithium-codegen-ppc.h
	modified:   src/ppc/lithium-ppc.cc
	modified:   src/ppc/lithium-ppc.h
	modified:   src/ppc/macro-assembler-ppc.cc
	modified:   src/ppc/macro-assembler-ppc.h
	modified:   src/ppc/regexp-macro-assembler-ppc.cc
	modified:   src/ppc/regexp-macro-assembler-ppc.h
	modified:   src/ppc/simulator-ppc.cc
	modified:   src/ppc/simulator-ppc.h
	new file:   test/unittests/compiler/ppc/instruction-selector-ppc-unittest.cc

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

BUG=

Review URL: https://codereview.chromium.org/901083004

Cr-Commit-Position: refs/heads/master@{#26471}
2015-02-05 19:02:07 +00:00
marja
d21b9a1422 Add strong mode.
It doesn't do anything for now, but it implies strict mode. Added tests to
test-parsing.cc to test that.

BUG=

Review URL: https://codereview.chromium.org/898983002

Cr-Commit-Position: refs/heads/master@{#26460}
2015-02-05 14:11:47 +00:00
Benedikt Meurer
9dff8185dd Revert "[turbofan] Make Factory::NewNumber() always return the minus_zero_value."
This reverts commit f578d35ba8 because
(immutable) heap numbers are surprisingly mutable in V8. Someone else
might want to cleanup the mess, otherwise we'll just keep it this way.

TBR=jkummerow@chromium.org
BUG=chromium:454894
LOG=y

Review URL: https://codereview.chromium.org/898973003

Cr-Commit-Position: refs/heads/master@{#26447}
2015-02-05 04:58:49 +00:00
dcarney
4116900d8f [turbofan] Don't allocate UnallocatedOperands in Zone memory during instruction selection
R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/889843003

Cr-Commit-Position: refs/heads/master@{#26424}
2015-02-04 12:39:07 +00:00
marja
c7851da4ae Introduce LanguageMode, drop StrictMode.
This enables adding more language modes in the future.

For maximum flexibility, LanguageMode is a bitmask, so we're not restricted to
use a sequence of language modes which are progressively stricter, but we can
express the language mode as combination of features.

For now, LanguageMode can only be "sloppy" or "strict", and there are
STATIC_ASSERTS in places which need to change when more modes are added.

LanguageMode is a bit like the old LanguageMode when "extended" mode was still
around (see https://codereview.chromium.org/8417035 and
https://codereview.chromium.org/181543002 ) except that it's transmitted through
all the layers (there's no StrictModeFlag).

BUG=

Review URL: https://codereview.chromium.org/894683003

Cr-Commit-Position: refs/heads/master@{#26419}
2015-02-04 09:34:26 +00:00
Benedikt Meurer
d8cfbc633d [turbofan] Split pure nodes in the scheduler if beneficial.
If a (pure) node has two or more uses, but there exists a path from the
common dominator of these uses to end, which does not contain a use,
then we split the node such that no unnecessary computation takes place.
Note however, that this only applies if the node cannot be hoisted out
of a loop.

BUG=v8:3864
LOG=n
R=jarin@chromium.org

Review URL: https://codereview.chromium.org/899433005

Cr-Commit-Position: refs/heads/master@{#26404}
2015-02-03 14:51:08 +00:00
dcarney
81091e62b9 [turbofan] push virtual register field down to InstructionOperand
BUG=

Review URL: https://codereview.chromium.org/893913004

Cr-Commit-Position: refs/heads/master@{#26377}
2015-02-02 11:38:46 +00:00
bmeurer
c65ae4f10c Reland "Initial switch to Chromium-style CHECK_* and DCHECK_* macros.".
R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/877753007

Cr-Commit-Position: refs/heads/master@{#26346}
2015-01-30 09:29:41 +00:00
Benedikt Meurer
883852293a Revert "Make GCC happy again." and "Initial switch to Chromium-style CHECK_* and DCHECK_* macros.".
This reverts commit 6a4c0a3bae and commit
0deaa4b629 for breaking GCC bots.

TBR=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/893533003

Cr-Commit-Position: refs/heads/master@{#26342}
2015-01-30 07:19:57 +00:00
bmeurer
0deaa4b629 Initial switch to Chromium-style CHECK_* and DCHECK_* macros.
R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/888613002

Cr-Commit-Position: refs/heads/master@{#26340}
2015-01-30 06:25:36 +00:00
bmeurer
1df5fed50a [turbofan] Cleanup the NodeProperties.
R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/883613006

Cr-Commit-Position: refs/heads/master@{#26316}
2015-01-29 09:18:09 +00:00
jarin
3c9f98516c [turbofan] Use unboxed doubles in range types.
BUG=
R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/882063002

Cr-Commit-Position: refs/heads/master@{#26307}
2015-01-28 13:55:45 +00:00
mstarzinger
c5833e8596 Add missing FrameState to JSToName nodes.
R=jarin@chromium.org
TEST=mjsunit/regress/regress-crbug-451770
BUG=chromium:451770
LOG=N

Review URL: https://codereview.chromium.org/880963002

Cr-Commit-Position: refs/heads/master@{#26305}
2015-01-28 11:40:02 +00:00
jarin
5bd8407f8c Reland of "Steps towards unification of number bitset and range types."
This reverts commit 7619374979.

BUG=

Review URL: https://codereview.chromium.org/877643002

Cr-Commit-Position: refs/heads/master@{#26301}
2015-01-28 08:42:32 +00:00
bmeurer
59a02ebdbe [turbofan] Ensure that NTLs are always properly connected to the end.
Up until now we used a special Terminate node to artifically connect non
terminating loops to the End node, but this was kind of adhoc and didn't
work for the CFG. So without all kinds of weird hacks, the end block in
the CFG will not be connected to NTLs, which makes it impossible to
compute post dominance / control dependence in the current setting.

So instead of Terminate, we add a special Branch to NTLs, whose
condition is the special Always node, which corresponds to True, except
that it cannot be folded away. This way we don't need any special
machinery in the scheduler, since it's just a regular Branch.

R=titzer@chromium.org

Review URL: https://codereview.chromium.org/875263004

Cr-Commit-Position: refs/heads/master@{#26294}
2015-01-27 14:02:28 +00:00
bmeurer
d93c4d19f1 [x86] Disable AVX unless the operating system explicitly claims to support it.
BUG=chromium:452033, v8:3846
LOG=y
R=jkummerow@chromium.org

Review URL: https://codereview.chromium.org/878063002

Cr-Commit-Position: refs/heads/master@{#26288}
2015-01-27 09:59:24 +00:00
bmeurer
44f1b9d148 [turbofan] Some cleanup for scheduler unittests.
R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/877033002

Cr-Commit-Position: refs/heads/master@{#26283}
2015-01-27 07:48:10 +00:00
danno
c6ae373335 Convert compiler cctest to unittests: SchedulerTest
R=mstarzinger@chromium.org
LOG=N

Review URL: https://codereview.chromium.org/863213003

Cr-Commit-Position: refs/heads/master@{#26267}
2015-01-26 11:21:24 +00:00
bmeurer
4f1597a92d [turbofan] Add new JSIntrinsicsLowering reducer.
The lowering of intrinsics is therefore now decoupled from the general
inlining logic.

TEST=cctest,unittests
R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/872363002

Cr-Commit-Position: refs/heads/master@{#26263}
2015-01-26 09:06:03 +00:00
danno
d1e45d9b00 Distinquish TestWithIsolateAndZone from TestWithZone
Allows unit tests that just need a zone and no isolate to avoid the overhead of
creating one.

R=mstarzinger@chromium.org
LOG=N

Review URL: https://codereview.chromium.org/871843004

Cr-Commit-Position: refs/heads/master@{#26256}
2015-01-23 16:29:57 +00:00
danno
c7b09aac31 Remove the dependency of Zone on Isolate
Along the way:
- Thread isolate parameter explicitly through code that used to
  rely on getting it from the zone.
- Canonicalize the parameter position of isolate and zone for
  affected code
- Change Hydrogen New<> instruction templates to automatically
  pass isolate

R=mstarzinger@chromium.org
LOG=N

Review URL: https://codereview.chromium.org/868883002

Cr-Commit-Position: refs/heads/master@{#26252}
2015-01-23 15:20:00 +00:00
bmeurer
cd2bc96808 [turbofan] Move GetCommonDominator to BasicBlock.
Also add some unittests for the dominator stuff.

R=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/865393004

Cr-Commit-Position: refs/heads/master@{#26241}
2015-01-23 09:55:48 +00:00
danno
87e1426ce5 Convert compiler cctest to unit tests, part 1
R=bmeurer@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/867583002

Cr-Commit-Position: refs/heads/master@{#26222}
2015-01-22 14:16:55 +00:00
bmeurer
c9283148d1 [turbofan] Cleanup Schedule and related classes.
- Move unit tests to schedule-unittests.cc.
- Remove pre-C++11 cruft.
- Fix some include weirdness.

R=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/864293002

Cr-Commit-Position: refs/heads/master@{#26220}
2015-01-22 13:01:13 +00:00
mstarzinger
558efe21f0 Add missing BailoutId and FrameState to with statements.
R=bmeurer@chromium.org
TEST=mjsunit/regress/regress-crbug-450642
BUG=chromium:450642
LOG=N

Review URL: https://codereview.chromium.org/865833002

Cr-Commit-Position: refs/heads/master@{#26218}
2015-01-22 10:57:42 +00:00
svenpanne
8fb593047a Removed bogus threading test to make TSAN happy.
TSAN hits an internal assertion on a self-join, and the test is not
really that useful, so let's just remove it.

BUG=https://code.google.com/p/thread-sanitizer/issues/detail?id=88
LOG=n

Review URL: https://codereview.chromium.org/824243007

Cr-Commit-Position: refs/heads/master@{#26217}
2015-01-22 10:23:58 +00:00
bmeurer
7619374979 Revert of Steps towards unification of number bitset and range types. (patchset #4 id:60001 of https://codereview.chromium.org/837723006/)
Reason for revert:
Breaks test-types/Maybe, i.e.

out/Release/cctest --random-seed=-707413401 test-types/Maybe

started failing afterwards

Original issue's description:
> Steps towards unification of number bitset and range types.
>
> - New invariant on union types: if the union has a range then the number
>   bits in the bitset must be cleared.
>
> - Various tweaks in intersection and union to satisfy the invariant.
>
> - Exposed and used representation bits in range types (and the Limits
>   helper class).
>
> - Implemented Glb for ranges so that the Is predicate handles
>   ranges correctly.
>
> - Change typer weakening so that it does not rely on GetRange.
>   However, the code still seems to be a bit fragile.
>
> - Removed the Smi types from the type system core, instead introduced
>   Signed31, Unsigned30 and created constructors for Small(Un)Signed
>   that point to the right type for the architecture.
>
> - Punched a hole in the config to be able to get to the isolate so
>   that it is possible to allocate heap numbers for newly created
>   ranges.
>
> Patch by jarin@chromium.prg, original review here:
> https://codereview.chromium.org/795713003/
>
> TBR=jarin@chromium.org
> BUG=
>
> Committed: https://crrev.com/2764fd8d1a266a9136c987c2483492113b0c8d80
> Cr-Commit-Position: refs/heads/master@{#26197}

TBR=jkummerow@chromium.org,rossberg@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

Review URL: https://codereview.chromium.org/868583002

Cr-Commit-Position: refs/heads/master@{#26207}
2015-01-22 05:33:39 +00:00
rossberg
2764fd8d1a Steps towards unification of number bitset and range types.
- New invariant on union types: if the union has a range then the number
  bits in the bitset must be cleared.

- Various tweaks in intersection and union to satisfy the invariant.

- Exposed and used representation bits in range types (and the Limits
  helper class).

- Implemented Glb for ranges so that the Is predicate handles
  ranges correctly.

- Change typer weakening so that it does not rely on GetRange.
  However, the code still seems to be a bit fragile.

- Removed the Smi types from the type system core, instead introduced
  Signed31, Unsigned30 and created constructors for Small(Un)Signed
  that point to the right type for the architecture.

- Punched a hole in the config to be able to get to the isolate so
  that it is possible to allocate heap numbers for newly created
  ranges.

Patch by jarin@chromium.prg, original review here:
https://codereview.chromium.org/795713003/

TBR=jarin@chromium.org
BUG=

Review URL: https://codereview.chromium.org/837723006

Cr-Commit-Position: refs/heads/master@{#26197}
2015-01-21 15:29:22 +00:00
bmeurer
4b31a97da3 Remove deprecated v8::base::OS::nan_value().
Use std::numeric_limits<double>::quiet_NaN() and
std::numeric_limits<float>::quiet_NaN() instead.

Review URL: https://codereview.chromium.org/864803002

Cr-Commit-Position: refs/heads/master@{#26195}
2015-01-21 14:38:58 +00:00
titzer
3442a5f9e0 [turbofan] First version of loop peeling.
BUG=

Review URL: https://codereview.chromium.org/816053002

Cr-Commit-Position: refs/heads/master@{#26149}
2015-01-20 09:45:17 +00:00
Ben L. Titzer
396381f944 [turbofan] Rename IrOpcode predicate IsLeafOpcode to IsConstantOpcode.
R=mstarzinger@chromium.org
BUG=

Review URL: https://codereview.chromium.org/863513002

Cr-Commit-Position: refs/heads/master@{#26141}
2015-01-19 15:35:16 +00:00
bmeurer
f578d35ba8 [turbofan] Make Factory::NewNumber() always return the minus_zero_value.
TEST=unittests

Review URL: https://codereview.chromium.org/857783002

Cr-Commit-Position: refs/heads/master@{#26124}
2015-01-19 08:07:37 +00:00
jarin
2e4e43a2dc [turbofan] Add frame state to the PlainPrimitiveToNumber unit test.
R=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/792043007

Cr-Commit-Position: refs/heads/master@{#26113}
2015-01-16 22:21:22 +00:00
mstarzinger
9fbe872137 Enable test coverage for --turbo-deoptimization mode.
R=jarin@chromium.org

Review URL: https://codereview.chromium.org/845193004

Cr-Commit-Position: refs/heads/master@{#26102}
2015-01-16 12:53:30 +00:00
bmeurer
835cc463a8 [turbofan] Initial attempt to cleanup Node and related classes.
- Make Node::Inputs and Node::Uses mostly STL compliant.
- Get rid of some pre-C++11 crappiness.
- Start moving unit tests from cctest to unittests.
- TrimInputCount() now tries to reserve inputs slots for
  later appending.
- Fix numerous style guide violations.

TEST=cctest,unittests
R=dcarney@chromium.org

Review URL: https://codereview.chromium.org/851263002

Cr-Commit-Position: refs/heads/master@{#26098}
2015-01-16 11:04:22 +00:00
Sven Panne
e4c5b84652 Contribution of PowerPC port (continuation of 422063005)
Contribution of PowerPC port (continuation of 422063005). The inital patch
covers the core changes to the common files.  Subsequent patches will cover
changes to common files to support AIX and to update the ppc directories so
they are current with the changes in the rest of the project.

This is based off of the GitHub repository
https://github.com/andrewlow/v8ppc

BUG=
R=svenpanne@chromium.org, danno@chromium.org, sevnpanne@chromium.org

Review URL: https://codereview.chromium.org/817143002

Cr-Commit-Position: refs/heads/master@{#26091}
2015-01-16 07:42:15 +00:00
bmeurer
a9d0d23405 Revert of [turbofan] Make Factory::NewNumber() always return the minus_zero_value. (patchset #1 id:1 of https://codereview.chromium.org/838263006/)
Reason for revert:
Breaks the tree

Original issue's description:
> [turbofan] Make Factory::NewNumber() always return the minus_zero_value.
>
> TEST=unittests
> R=mstarzinger@chromium.org, dcarney@chromium.org
>
> Committed: https://crrev.com/55b3e268b2895e2c09230d39669a75b6ab4e7e4d
> Cr-Commit-Position: refs/heads/master@{#26080}

TBR=dcarney@chromium.org,mstarzinger@chromium.org
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/853683009

Cr-Commit-Position: refs/heads/master@{#26081}
2015-01-15 15:29:42 +00:00
Benedikt Meurer
55b3e268b2 [turbofan] Make Factory::NewNumber() always return the minus_zero_value.
TEST=unittests
R=mstarzinger@chromium.org, dcarney@chromium.org

Review URL: https://codereview.chromium.org/838263006

Cr-Commit-Position: refs/heads/master@{#26080}
2015-01-15 15:10:05 +00:00
bmeurer
dd6ce12645 [turbofan] Turn IrOpcode::IsXXX() into range checks.
TEST=unittests
R=dcarney@chromium.org

Review URL: https://codereview.chromium.org/807573004

Cr-Commit-Position: refs/heads/master@{#26079}
2015-01-15 15:07:39 +00:00
bmeurer
4914716387 Revert of [turbofan] Use PlainPrimitiveToNumber whenever possible. (patchset #1 id:1 of https://codereview.chromium.org/852763002/)
Reason for revert:
Tanks performance of SQLite and towers.c.

Original issue's description:
> [turbofan] Use PlainPrimitiveToNumber whenever possible.
>
> TEST=cctest,unittests
> R=jarin@chromium.org
>
> Committed: https://crrev.com/1a5db24e6bf831e61e3f4aa0c252f77e48c3689c
> Cr-Commit-Position: refs/heads/master@{#26071}

TBR=jarin@chromium.org,dcarney@chromium.org
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/852153003

Cr-Commit-Position: refs/heads/master@{#26078}
2015-01-15 13:26:55 +00:00
bmeurer
1a5db24e6b [turbofan] Use PlainPrimitiveToNumber whenever possible.
TEST=cctest,unittests
R=jarin@chromium.org

Review URL: https://codereview.chromium.org/852763002

Cr-Commit-Position: refs/heads/master@{#26071}
2015-01-15 09:49:23 +00:00
dcarney
e6552d4917 Reland "[turbofan] simplify gap ordering"
BUG=

Review URL: https://codereview.chromium.org/854703002

Cr-Commit-Position: refs/heads/master@{#26069}
2015-01-15 09:06:05 +00:00
dcarney
a7e3c71b23 add register allocator regression test
BUG=

Review URL: https://codereview.chromium.org/852633002

Cr-Commit-Position: refs/heads/master@{#26068}
2015-01-15 08:56:10 +00:00
baptiste.afsa
51f3c66b64 [turbofan] Allow 0.0 as immediate for floating-point comparison on arm/arm64.
R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/850073002

Cr-Commit-Position: refs/heads/master@{#26066}
2015-01-15 06:31:07 +00:00
bmeurer
70b32e4b8a [turbofan] Fix truncation/representation sloppiness wrt. bool/bit.
TEST=cctest,mjsunit,unittests
BUG=v8:3812
LOG=y

Review URL: https://codereview.chromium.org/850013003

Cr-Commit-Position: refs/heads/master@{#26051}
2015-01-14 12:06:56 +00:00
bmeurer
214387fce1 Revert of [turbofan] Improve typed lowering of JSBitwiseAnd. (patchset #1 id:1 of https://codereview.chromium.org/811653004/)
Reason for revert:
Breaks SQLite

Original issue's description:
> [turbofan] Improve typed lowering of JSBitwiseAnd.
>
> TEST=unittests
> R=jarin@chromium.org
>
> Committed: https://crrev.com/284e1108182995abe85f580bc813d26491642b8c
> Cr-Commit-Position: refs/heads/master@{#26046}

TBR=jarin@chromium.org
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/795833006

Cr-Commit-Position: refs/heads/master@{#26048}
2015-01-14 09:07:07 +00:00
Benedikt Meurer
284e110818 [turbofan] Improve typed lowering of JSBitwiseAnd.
TEST=unittests
R=jarin@chromium.org

Review URL: https://codereview.chromium.org/811653004

Cr-Commit-Position: refs/heads/master@{#26046}
2015-01-14 07:40:32 +00:00
balazs.kilvady
3da5a729e8 MIPS: [turbofan] Improve code generation for unordered comparisons.
Port c24220c0c1

TEST=cctest,unittests
BUG=

Review URL: https://codereview.chromium.org/850733004

Cr-Commit-Position: refs/heads/master@{#26045}
2015-01-13 20:28:13 +00:00
bmeurer
1fa21bfd39 [turbofan] Reduce Word32And masking with shifted inputs.
TEST=unittests
R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/847113002

Cr-Commit-Position: refs/heads/master@{#26040}
2015-01-13 13:02:40 +00:00
bmeurer
9f292086f9 [turbofan] Add PlainPrimitiveToNumber simplified operator.
TEST=unittests

Review URL: https://codereview.chromium.org/845333002

Cr-Commit-Position: refs/heads/master@{#26038}
2015-01-13 11:02:57 +00:00
bmeurer
c24220c0c1 [turbofan] Improve code generation for unordered comparisons.
TEST=cctest,unittests

Review URL: https://codereview.chromium.org/850653002

Cr-Commit-Position: refs/heads/master@{#26034}
2015-01-13 08:42:02 +00:00
bmeurer
0e8a6d4ec8 [turbofan] Canonicalize x - K to x + -K.
TEST=unittests
R=dcarney@chromium.org

Review URL: https://codereview.chromium.org/846913002

Cr-Commit-Position: refs/heads/master@{#26027}
2015-01-12 15:02:06 +00:00
bmeurer
b6c7e11c10 [turbofan] Fix typo in IrOpcode::Mnemonic.
TEST=unittests
R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/843043002

Cr-Commit-Position: refs/heads/master@{#26014}
2015-01-09 14:20:03 +00:00
bmeurer
5157472539 [turbofan] Cleanup duplicated/unused code in InstructionSelector.
- Use C++11 range based for loops.
- Remove duplicated virtual register set in unittests.
- Don't expose implementation details of InstructionSelector.

TEST=unittests
R=dcarney@chromium.org

Review URL: https://codereview.chromium.org/837423002

Cr-Commit-Position: refs/heads/master@{#25997}
2015-01-08 14:13:33 +00:00
bmeurer
fec1bba852 [turbofan] Correctify representation changes to bit.
TEST=cctest/test-representation-change,unittests,mjsunit/compiler/regress-bit-number-constant
R=jarin@chromium.org

Review URL: https://codereview.chromium.org/840953003

Cr-Commit-Position: refs/heads/master@{#25987}
2015-01-08 09:48:41 +00:00
bmeurer
e53845d41c [turbofan] Cleanup Graph and related classes.
- Move NodeMarker to its own file, and introduce a non
  templatized base class.
- Cleanup the include hell.
- Sanitize the Node construction methods now that we
  got rid of that GenericNode/GenericGraph stuff.
- Protect against NodeId overflow in Graph.
- Various minor cleanups.

TEST=cctest,mjsunit,unittests

Review URL: https://codereview.chromium.org/838783002

Cr-Commit-Position: refs/heads/master@{#25977}
2015-01-07 14:42:49 +00:00
bmeurer
ec35c52e54 [turbofan] Generalize constant propagation.
Also support additional number types (singleton ranges, NaN and minus
zero) for constant propagation in typed lowering.

TEST=unittests

Review URL: https://codereview.chromium.org/829303002

Cr-Commit-Position: refs/heads/master@{#25963}
2015-01-07 08:24:38 +00:00
Benedikt Meurer
9def087efc [turbofan] Correctify JSToBoolean lowering.
Introduce a new AnyToBoolean simplified operator to handle the later
lowering of boolean conversions. Previously we tried to hack that with
the generic JSToBoolean, having its context set to zero, but that lead
to various problems/bugs and did not handle all cases.

TEST=cctest,unittests
R=jarin@chromium.org

Review URL: https://codereview.chromium.org/800833003

Cr-Commit-Position: refs/heads/master@{#25958}
2015-01-05 13:44:31 +00:00
bmeurer
c329a49d69 [turbofan] Fix incorrect minus zero handling in the unit tests.
TEST=unittests
R=jarin@chromium.org

Review URL: https://codereview.chromium.org/831203003

Cr-Commit-Position: refs/heads/master@{#25956}
2015-01-05 12:29:27 +00:00
bmeurer
643ed5b8be [turbofan] Fix missing MachineOperator unittest.
The machine-operator-unittest.cc file was missing from unittests.gyp.
Fixed the compiler errors and added it back.

TBR=machenbach@chromium.org

Review URL: https://codereview.chromium.org/824243003

Cr-Commit-Position: refs/heads/master@{#25948}
2015-01-02 07:44:52 +00:00
bmeurer
eeec886e5f [turbofan] Deinlinify OperatorProperties implementation.
TEST=cctest,unittests
R=jochen@chromium.org

Review URL: https://codereview.chromium.org/821913002

Cr-Commit-Position: refs/heads/master@{#25935}
2014-12-23 12:50:51 +00:00
bmeurer
00013a5692 [turbofan] Minor cleanup to reduce code duplication.
TEST=unittests
R=jochen@chromium.org

Review URL: https://codereview.chromium.org/819103002

Cr-Commit-Position: refs/heads/master@{#25927}
2014-12-22 14:37:22 +00:00
Benedikt Meurer
1ec1f5957f [turbofan] Cleanup use of virtual, OVERRIDE, FINAL.
Following the Google/Chromium coding style wrt. virtual, OVERRIDE and
FINAL specifications.

TEST=unittests
R=jochen@chromium.org

Review URL: https://codereview.chromium.org/816453005

Cr-Commit-Position: refs/heads/master@{#25924}
2014-12-22 13:48:10 +00:00
Benedikt Meurer
ee98a1d760 [turbofan] Introduce CommonOperatorReducer.
The CommonOperatorReducer currently takes care of redundant Phis,
EffectPhis and Selects. This functionality overlaps with ControlReducer,
but is required to make certain optimizations effective, since the
ControlReducer only runs really early and really late in the pipeline
and therefore other reducers aren't reapplied properly after redundant
phi/select elimination.

TEST=unittests
R=hpayer@chromium.org

Review URL: https://codereview.chromium.org/817243003

Cr-Commit-Position: refs/heads/master@{#25922}
2014-12-22 13:06:43 +00:00
machenbach
7d478d9621 Revert of Remove obsolete V8_INFINITY macro. (patchset #3 id:40001 of https://codereview.chromium.org/798413003/)
Reason for revert:
Speculative revert. This seems to block the current roll: https://codereview.chromium.org/819653003/

I retried several times, also with a new roll. The error is internal - but that doesn't make much of a difference.

Original issue's description:
> Remove obsolete V8_INFINITY macro.
>
> Use std::numeric_limits consistently.
>
> R=svenpanne@chromium.org
>
> Committed: https://crrev.com/31c66e2d53569c4e229d55483d28208491e73612
> Cr-Commit-Position: refs/heads/master@{#25897}

TBR=svenpanne@chromium.org,bmeurer@chromium.org
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/813813003

Cr-Commit-Position: refs/heads/master@{#25912}
2014-12-20 13:17:35 +00:00
bmeurer
31c66e2d53 Remove obsolete V8_INFINITY macro.
Use std::numeric_limits consistently.

R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/798413003

Cr-Commit-Position: refs/heads/master@{#25897}
2014-12-19 07:18:00 +00:00
machenbach
1f44e7267e Revert of [turbofan] simplify gap ordering (patchset #2 id:20001 of https://codereview.chromium.org/810013002/)
Reason for revert:
Revert for breaking emscripten bullet with turbofan on android arm64.

Original issue's description:
> [turbofan] simplify gap ordering
>
> BUG=
>
> Committed: https://crrev.com/70b5eb47b39acbf31746f4a116a9b3ce2730218a
> Cr-Commit-Position: refs/heads/master@{#25865}

TBR=bmeurer@chromium.org,dcarney@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=

Review URL: https://codereview.chromium.org/815743002

Cr-Commit-Position: refs/heads/master@{#25888}
2014-12-18 15:49:58 +00:00
machenbach
70eb456e73 Revert of [turbofan] remove control field from instruction (patchset #1 id:1 of https://codereview.chromium.org/810023002/)
Reason for revert:
Needed to revert 70b5eb47b3

Original issue's description:
> [turbofan] remove control field from instruction
>
> R=titzer@chromium.org
> BUG=
>
> Committed: https://crrev.com/7b9cb2eb3764d0c807c669e397fc3b84fbefb175
> Cr-Commit-Position: refs/heads/master@{#25866}

TBR=titzer@chromium.org,dcarney@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=

Review URL: https://codereview.chromium.org/814043002

Cr-Commit-Position: refs/heads/master@{#25884}
2014-12-18 14:42:16 +00:00
Benedikt Meurer
0925be14a2 [turbofan] Further reduction of Word32And with Int32Add.
- (y * (K << L) + x) & (-1 << L) => (x & (-1 << L)) + y * (K << L)
- (x + y * (K << L)) & (-1 << L) => (x & (-1 << L)) + y * (K << L)

TEST=unittests
R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/811293002

Cr-Commit-Position: refs/heads/master@{#25875}
2014-12-18 08:42:57 +00:00
dcarney
44e2dd535e [turbofan] move assembly order to InstructionBlock
R=titzer@chromium.org

BUG=

Review URL: https://codereview.chromium.org/805263003

Cr-Commit-Position: refs/heads/master@{#25867}
2014-12-17 15:10:03 +00:00
dcarney
7b9cb2eb37 [turbofan] remove control field from instruction
R=titzer@chromium.org
BUG=

Review URL: https://codereview.chromium.org/810023002

Cr-Commit-Position: refs/heads/master@{#25866}
2014-12-17 14:10:46 +00:00
dcarney
70b5eb47b3 [turbofan] simplify gap ordering
BUG=

Review URL: https://codereview.chromium.org/810013002

Cr-Commit-Position: refs/heads/master@{#25865}
2014-12-17 13:37:56 +00:00
dcarney
84345afbfb [turbofan] use START and END gap positions for constraints
R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/798363007

Cr-Commit-Position: refs/heads/master@{#25864}
2014-12-17 12:13:58 +00:00
Benedikt Meurer
a7d8724188 [turbofan] Improve reduction of Word32And and Int32Add.
TEST=unittests
R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/816433002

Cr-Commit-Position: refs/heads/master@{#25863}
2014-12-17 11:34:39 +00:00
bmeurer
5a8be47d21 Revert of [turbofan] Correctify TruncateFloat64ToInt32 reduction in MachineOperatorReducer. (patchset #1 id:1 of https://codereview.chromium.org/801263002/)
Reason for revert:
Can cause reduce cycles, needs more investigation

Original issue's description:
> [turbofan] Correctify TruncateFloat64ToInt32 reduction in MachineOperatorReducer.
>
> TEST=unittests
> R=svenpanne@chromium.org
>
> Committed: 6e7ceee4d0

TBR=svenpanne@chromium.org
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/794473003

Cr-Commit-Position: refs/heads/master@{#25859}
2014-12-17 09:51:17 +00:00
Benedikt Meurer
2b4eb88cdd [turbofan] Cache conversions inserted during typed lowering.
This greatly reduces the number of nodes in the graph (by more than 20x in
some extreme cases) for the Emscripten python interpreter main function.

BUG=v8:3763
LOG=y
TEST=cctest,mjsunit,unittests
R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/802353003

Cr-Commit-Position: refs/heads/master@{#25840}
2014-12-16 12:59:16 +00:00
Benedikt Meurer
54a31b628d [base] Add iterator_range helper class.
TEST=unittests
R=titzer@chromium.org

Review URL: https://codereview.chromium.org/810683003

Cr-Commit-Position: refs/heads/master@{#25834}
2014-12-16 07:32:03 +00:00
Benedikt Meurer
283175d984 [turbofan] Relax effects and context for JSToNumber(x:plain-primitive).
Relanded with fix for always returning Change for PlainPrimitive even
if there was no change. The performance regression on primes.js and
corrections.js is due to unlucky loop header alignment; will be addressed
separately.

TEST=unittests
R=svenpanne@chromium.org

Committed: 75484e8d16

Review URL: https://codereview.chromium.org/799413002

Cr-Commit-Position: refs/heads/master@{#25832}
2014-12-16 05:39:46 +00:00
bmeurer
2c30ab6616 Revert of [turbofan] Relax effects and context for JSToNumber(x:plain-primitive). (patchset #1 id:1 of https://codereview.chromium.org/799413002/)
Reason for revert:
Performance regressions on primes and corrections benchmarks.

Original issue's description:
> [turbofan] Relax effects and context for JSToNumber(x:plain-primitive).
>
> TEST=unittests
> R=svenpanne@chromium.org
>
> Committed: 75484e8d16

TBR=svenpanne@chromium.org
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/806103002

Cr-Commit-Position: refs/heads/master@{#25831}
2014-12-16 04:45:09 +00:00
Benedikt Meurer
75484e8d16 [turbofan] Relax effects and context for JSToNumber(x:plain-primitive).
TEST=unittests
R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/799413002

Cr-Commit-Position: refs/heads/master@{#25818}
2014-12-15 13:42:54 +00:00
Benedikt Meurer
6e7ceee4d0 [turbofan] Correctify TruncateFloat64ToInt32 reduction in MachineOperatorReducer.
TEST=unittests
R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/801263002

Cr-Commit-Position: refs/heads/master@{#25812}
2014-12-15 07:46:21 +00:00
danno
10b38df268 [turbofan]: Fix x64 regression during ia32 lea port
Review URL: https://codereview.chromium.org/795353008

Cr-Commit-Position: refs/heads/master@{#25807}
2014-12-12 18:17:01 +00:00