[turbofan] Optimize certain chains of Branch into a Switch.
authorbmeurer <bmeurer@chromium.org>
Tue, 17 Feb 2015 13:29:31 +0000 (05:29 -0800)
committerCommit bot <commit-bot@chromium.org>
Tue, 17 Feb 2015 13:29:46 +0000 (13:29 +0000)
commitacd9c46ca7a0ada723d717f2545fd484c824eaa2
tree7ab334543eab5261cad277cbc8344446e7ed1626
parent66ca91b9d28a45d666e56fc7e122976ab1c5a176
[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}
39 files changed:
BUILD.gn
src/compiler/arm/code-generator-arm.cc
src/compiler/arm/instruction-selector-arm.cc
src/compiler/arm64/code-generator-arm64.cc
src/compiler/arm64/instruction-selector-arm64.cc
src/compiler/code-generator.h
src/compiler/common-operator.cc
src/compiler/common-operator.h
src/compiler/control-flow-optimizer.cc [new file with mode: 0644]
src/compiler/control-flow-optimizer.h [new file with mode: 0644]
src/compiler/ia32/code-generator-ia32.cc
src/compiler/ia32/instruction-selector-ia32.cc
src/compiler/instruction-codes.h
src/compiler/instruction-selector.cc
src/compiler/instruction-selector.h
src/compiler/opcodes.h
src/compiler/operator-properties.cc
src/compiler/operator.cc
src/compiler/operator.h
src/compiler/pipeline.cc
src/compiler/raw-machine-assembler.cc
src/compiler/raw-machine-assembler.h
src/compiler/schedule.h
src/compiler/scheduler.cc
src/compiler/simplified-lowering.cc
src/compiler/verifier.cc
src/compiler/x64/code-generator-x64.cc
src/compiler/x64/instruction-selector-x64.cc
src/flag-definitions.h
test/cctest/compiler/test-run-machops.cc
test/mjsunit/asm/switch.js [new file with mode: 0644]
test/unittests/compiler/common-operator-unittest.cc
test/unittests/compiler/control-flow-optimizer-unittest.cc [new file with mode: 0644]
test/unittests/compiler/graph-unittest.h
test/unittests/compiler/node-test-utils.cc
test/unittests/compiler/node-test-utils.h
test/unittests/compiler/scheduler-unittest.cc
test/unittests/unittests.gyp
tools/gyp/v8.gyp