v8/test/unittests
Pierre Langlois 7ac10da795 [turbofan] Lower NumberConstant nodes to IntPtrConstant.
If a NumberConstant can be represented as a Smi, then lower it to a
IntPtrConstant node during simplified lowering. Thanks to this, all backends can
match Smi values that can also be encoded as immediates in the instruction
selector. Additionally, we can apply the same lowering to the CodeAssembler for
the snapshot.

As a result, we can remove `mov` instructions generated because Int32Matcher and
Int64Matcher didn't not recognize Smis:

For 32-bit target, it's common for Smis also be immediates: "if (a < 100) {}"
~~~
mov r1, #200 -> cmp r0, #200
cmp r0, r1   -> blt <>
blt <>       ->
~~~

On Arm64 particularly, we lose opportunites to use `cbz`: "if (a == 0) {}"
~~~
movz x0, #0x0 -> cbz x1 <>
cmp x1, x0    ->
b.eq <>       ->
~~~

Overall, we do not see an impact on benchmarks such as webtooling. However, we
do see noteworthy code size reduction, from 0.5% to 1.5%.

Bug: 
Change-Id: I7fbb718ad51b9036c3514fa31c1326bdd6f2b0e6
Reviewed-on: https://chromium-review.googlesource.com/848814
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Pierre Langlois <pierre.langlois@arm.com>
Cr-Commit-Position: refs/heads/master@{#50569}
2018-01-15 10:46:01 +00:00
..
api Enable clang's -Wunreachable-code warning. 2017-12-04 13:09:25 +00:00
asmjs Normalize casing of hexadecimal digits 2017-12-02 01:24:40 +00:00
base [Memory] Create memory management API in v8::internal. 2017-12-15 18:49:47 +00:00
compiler [turbofan] Lower NumberConstant nodes to IntPtrConstant. 2018-01-15 10:46:01 +00:00
compiler-dispatcher [test] Add TaskRunners to the platform in the compiler dispatcher tests 2017-11-20 15:54:11 +00:00
heap [Memory] Create memory management API in v8::internal. 2017-12-15 18:49:47 +00:00
interpreter [ignition] Change RestoreGeneratorRegisters to ResumeGenerator 2018-01-11 11:25:04 +00:00
libplatform Reland "[platform] Implement TaskRunners in the DefaultPlatform" 2017-11-15 12:35:54 +00:00
parser Normalize casing of hexadecimal digits 2017-12-02 01:24:40 +00:00
wasm [wasm] Move (almost all) constants to wasm-constants.h 2018-01-11 12:25:54 +00:00
zone [heap] Simplify and linearly scale ResourceConstraints::ConfigureDefaults. 2017-05-23 17:00:57 +00:00
allocation-unittest.cc [Memory] Add PageAllocator concept to v8::Platform. 2017-12-21 19:46:23 +00:00
bigint-unittest.cc Normalize casing of hexadecimal digits 2017-12-02 01:24:40 +00:00
BUILD.gn [turbofan] Lower NumberConstant nodes to IntPtrConstant. 2018-01-15 10:46:01 +00:00
cancelable-tasks-unittest.cc Make CancelableTask ids unique 2017-08-02 16:10:42 +00:00
char-predicates-unittest.cc Use ICU for ID_START, ID_CONTINUE and WhiteSpace check 2017-06-14 20:32:49 +00:00
code-stub-assembler-unittest.cc Remove ComputeFlags, simply pass in Code::Kind instead of Code::Flags 2017-09-29 15:37:27 +00:00
code-stub-assembler-unittest.h [csa] Add constant folding more universally to CodeAssembler operators 2017-09-12 10:03:10 +00:00
counters-unittest.cc [runtime] Make access to FLAG_runtime_stats atomic. 2017-12-19 19:01:50 +00:00
DEPS Move unit tests to test/unittests. 2014-10-01 08:34:25 +00:00
detachable-vector-unittest.cc [cleanup] Replace List with std::vector in api. 2017-09-28 09:32:18 +00:00
eh-frame-iterator-unittest.cc Normalize casing of hexadecimal digits 2017-12-02 01:24:40 +00:00
eh-frame-writer-unittest.cc Normalize casing of hexadecimal digits 2017-12-02 01:24:40 +00:00
locked-queue-unittest.cc Add lock-based unbounded queue 2015-11-18 10:54:13 +00:00
object-unittest.cc Leave spaces between instance types. 2017-12-20 07:34:39 +00:00
register-configuration-unittest.cc [Turbofan] Add concept of FP register aliasing on ARM 32. 2016-10-26 16:04:33 +00:00
run-all-unittests.cc [cleanup] use unique_ptr for the DefaultPlatform 2017-11-14 09:57:18 +00:00
source-position-table-unittest.cc Decouple SourcePositionTableBuilder from Zone 2017-11-21 12:56:13 +00:00
test-helpers.cc [unittests] Add TestWithIsolate::RunJS helper method 2017-11-13 14:27:51 +00:00
test-helpers.h [unittests] Add TestWithIsolate::RunJS helper method 2017-11-13 14:27:51 +00:00
test-utils.cc [RCS] Add explicit tests for function callbacks 2017-11-14 09:48:08 +00:00
test-utils.h [RCS] Add explicit tests for function callbacks 2017-11-14 09:48:08 +00:00
testcfg.py [test] Implement variant generators as processors 2018-01-12 10:39:20 +00:00
unicode-unittest.cc Implement DFA Unicode Decoder 2017-12-11 21:36:13 +00:00
unittests.gyp [turbofan] Lower NumberConstant nodes to IntPtrConstant. 2018-01-15 10:46:01 +00:00
unittests.isolate [test] Move GoogleTestSuite to a separate testcfg. 2017-12-11 20:57:07 +00:00
unittests.status Enable RCS unittests again 2017-11-10 09:40:23 +00:00
utils-unittest.cc Reland "MIPS[64] Implementation of MSA instructions on builtin simulator" 2017-11-28 13:43:23 +00:00
value-serializer-unittest.cc Enable clang's -Wunreachable-code warning. 2017-12-04 13:09:25 +00:00