v8/test/unittests/compiler
Benedikt Meurer f19c4a594f [turbofan] ReceiverOrNullOrUndefined feedback for JSEqual.
This changes the ReceiverOrOddball feedback on JSStrictEqual to
ReceiverOrNullOrUndefined feedback, which can also safely be
consumed by JSEqual (we cannot generally accept any oddball here
since booleans trigger implicit conversions, unfortunately).
Thus we replace the previously introduced CheckReceiverOrOddball
with CheckReceiverOrNullOrUndefined, and drop CheckOddball, since
we will no longer collect Oddball feedback separately.

TurboFan will then turn a JSEqual[ReceiverOrNullOrUndefined] into
a sequence like this:

```
left = CheckReceiverOrNullOrUndefined(left);
right = CheckReceiverOrNullOrUndefined(right);
result = if ObjectIsUndetectable(left) then
           ObjectIsUndetectable(right)
         else
           ReferenceEqual(left, right);
```

This significantly improves the peak performance of abstract equality
with Receiver, Null or Undefined inputs. On the test case outlined in
http://crbug.com/v8/8356 we go from

  naive: 2946 ms.
  tenary: 2134 ms.

to

  naive: 2230 ms.
  tenary: 2250 ms.

which corresponds to a 25% improvement on the abstract equality case.
For regular code this will probably yield more performance, since we
get rid of the JSEqual operator, which might have arbitrary side
effects and thus blocks all kinds of TurboFan optimizations. The
JSStrictEqual case is slightly slower now, since it has to rule out
booleans as well (even though that's not strictly necessary, but
consistency is key here).

This way developers can safely use `a == b` instead of doing a dance
like `a == null ? b == null : a === b` (which is what dart2js does
right now) when both `a` and `b` are known to be Receiver, Null or
Undefined. The abstract equality is not only faster to parse than
the tenary, but also generates a shorter bytecode sequence. In the
test case referenced in http://crbug.com/v8/8356 the bytecode for
`naive` is

```
StackCheck
Ldar a1
TestEqual a0, [0]
JumpIfFalse [5]
LdaSmi [1]
Return
LdaSmi [2]
Return
```

which is 14 bytes, whereas the `tenary` function generates

```
StackCheck
Ldar a0
TestUndetectable
JumpIfFalse [7]
Ldar a1
TestUndetectable
Jump [7]
Ldar a1
TestEqualStrict a0, [0]
JumpIfToBooleanFalse [5]
LdaSmi [1]
Return
LdaSmi [2]
Return
```

which is 24 bytes. So the `naive` version is 40% smaller and requires
fewer bytecode dispatches.

Bug: chromium:898455, v8:8356
Change-Id: If3961b2518b4438700706b3bd6071d546305e233
Reviewed-on: https://chromium-review.googlesource.com/c/1297315
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56948}
2018-10-24 13:45:22 +00:00
..
arm [CSA] Replace Word32Not with Word32BitwiseNot 2018-08-13 15:23:35 +00:00
arm64 Revert "Add Windows ARM64 ABI support to V8" 2018-10-23 17:32:43 +00:00
ia32 Fix stack check pattern matching for CSA code 2018-06-14 15:21:53 +00:00
mips MIPS: Disable Word32SarWithWord32Shl on MIPSr1 2018-08-07 09:27:17 +00:00
mips64 Update MIPS file ownership to @wavecomp.com e-mail addresses 2018-07-26 16:28:10 +00:00
ppc PPC/s390: [iwyu] Remove illegal inline include from "macro-assembler.h" 2017-09-14 12:23:51 +00:00
regalloc Reland "Introduce StdoutStream which prints to Android log or stdout" 2018-06-14 13:29:01 +00:00
s390 PPC/s390: [iwyu] Remove illegal inline include from "macro-assembler.h" 2017-09-14 12:23:51 +00:00
x64 [turbofan][x64] Match memory operand comparisons with zero. 2018-10-16 09:29:25 +00:00
branch-elimination-unittest.cc Revert "[TurboFan] Diagnostic code to track down bug in representation selection" 2017-11-14 09:26:51 +00:00
bytecode-analysis-unittest.cc [cleanup] Refactor compiler to use default members. 2018-09-17 12:12:21 +00:00
checkpoint-elimination-unittest.cc [cleanup] Refactor compiler to use default members. 2018-09-17 12:12:21 +00:00
code-assembler-unittest.cc [builtins] Fix Array.p.join overflow detection 2018-10-18 12:59:48 +00:00
code-assembler-unittest.h [cleanup] Refactor compiler to use default members. 2018-09-17 12:12:21 +00:00
common-operator-reducer-unittest.cc [cleanup] Refactor compiler to use default members. 2018-09-17 12:12:21 +00:00
common-operator-unittest.cc [cleanup] Refactor compiler to use default members. 2018-09-17 12:12:21 +00:00
compiler-test-utils.h [turbofan] Drop V8_TURBOFAN_BACKEND and V8_TURBOFAN_TARGET defines. 2015-08-10 07:17:34 +00:00
constant-folding-reducer-unittest.cc [turbofan] Rename "js_heap_broker" to "broker". 2018-10-15 08:17:17 +00:00
control-equivalence-unittest.cc Reland "Introduce StdoutStream which prints to Android log or stdout" 2018-06-14 13:29:01 +00:00
control-flow-optimizer-unittest.cc [cleanup] Refactor compiler to use default members. 2018-09-17 12:12:21 +00:00
dead-code-elimination-unittest.cc [cleanup] Refactor compiler to use default members. 2018-09-17 12:12:21 +00:00
diamond-unittest.cc [cleanup] [compiler] Fix (D)CHECK macros 2017-09-25 10:21:34 +00:00
effect-control-linearizer-unittest.cc [turbolizer] Show for each node from which node it was created from 2018-05-18 14:57:46 +00:00
graph-reducer-unittest.cc [cleanup] Replace 0 and NULL with nullptr for compiler files. 2018-09-14 16:20:29 +00:00
graph-reducer-unittest.h [turbofan] Add AdvancedReducer::ReplaceWithValue() method and convert JSInlining to an AdvancedReducer. 2015-05-12 12:41:36 +00:00
graph-trimmer-unittest.cc [turbofan] Proper dead code elimination as regular reducer. 2015-06-19 12:07:26 +00:00
graph-unittest.cc [turbofan] Rename "js_heap_broker" to "broker". 2018-10-15 08:17:17 +00:00
graph-unittest.h [turbofan] Rename "js_heap_broker" to "broker". 2018-10-15 08:17:17 +00:00
instruction-selector-unittest.cc [wasm] Reflect unavailability of root register in linkage 2018-10-02 16:31:48 +00:00
instruction-selector-unittest.h Reland "[arm64] Use root register for addressing external references." 2018-07-05 12:39:16 +00:00
instruction-sequence-unittest.cc [turbofan] Change handling of empty basic blocks 2018-06-12 15:10:26 +00:00
instruction-sequence-unittest.h MIPS: Reland of Fix bad RegisterConfiguration usage in InstructionSequence unit tests 2016-12-23 10:51:08 +00:00
instruction-unittest.cc [cleanup] Refactor compiler to use default members. 2018-09-17 12:12:21 +00:00
int64-lowering-unittest.cc [turbofan] Further optimize DataView accesses. 2018-08-14 09:20:47 +00:00
js-call-reducer-unittest.cc [turbofan] Brokerize parts of JSCallReducer. 2018-10-22 14:41:46 +00:00
js-create-lowering-unittest.cc [turbofan] Rename "js_heap_broker" to "broker". 2018-10-15 08:17:17 +00:00
js-intrinsic-lowering-unittest.cc [cleanup] Refactor compiler to use default members. 2018-09-17 12:12:21 +00:00
js-native-context-specialization-unittest.cc [turbofan] Rename "js_heap_broker" to "broker". 2018-10-15 08:17:17 +00:00
js-operator-unittest.cc [TurboFan] Model TypeOf as a simplified operator 2017-10-16 19:15:00 +00:00
js-typed-lowering-unittest.cc [turbofan] Rename "js_heap_broker" to "broker". 2018-10-15 08:17:17 +00:00
linkage-tail-call-unittest.cc Reland "[arm64] Preparation for padding of arguments" 2017-12-20 13:50:36 +00:00
live-range-builder.h [turbofan] Make MachineType a pair of enums. 2015-12-10 09:03:53 +00:00
load-elimination-unittest.cc [cleanup] Refactor compiler to use default members. 2018-09-17 12:12:21 +00:00
loop-peeling-unittest.cc [cleanup] Refactor compiler to use default members. 2018-09-17 12:12:21 +00:00
machine-operator-reducer-unittest.cc [cleanup] Refactor compiler to use default members. 2018-09-17 12:12:21 +00:00
machine-operator-unittest.cc [cleanup] Remove more OpParameter 2018-03-21 17:02:39 +00:00
node-cache-unittest.cc [cleanup] Replace 0 and NULL with nullptr for compiler files. 2018-09-14 16:20:29 +00:00
node-matchers-unittest.cc [cleanup] Refactor compiler to use default members. 2018-09-17 12:12:21 +00:00
node-properties-unittest.cc [jumbo] add unittests jumbo support 2017-09-28 22:19:40 +00:00
node-test-utils.cc [assembler] Move ConstantPools out of src/assembler.h 2018-10-19 11:38:39 +00:00
node-test-utils.h [builtins] Fix Array.p.join overflow detection 2018-10-18 12:59:48 +00:00
node-unittest.cc [jumbo] fix another set of unittest compilation errors 2017-10-19 09:15:44 +00:00
opcodes-unittest.cc [unittests] Reduce compilation overhead of opcodes-unittest.cc. 2016-09-13 05:16:18 +00:00
persistent-unittest.cc [turbofan] PersistentMap: Allow hash values larger than 32bit and some cleanup 2018-01-18 13:58:15 +00:00
redundancy-elimination-unittest.cc [turbofan] ReceiverOrNullOrUndefined feedback for JSEqual. 2018-10-24 13:45:22 +00:00
schedule-unittest.cc [jumbo] fix android/windows kDummyOperator collision 2017-10-20 12:43:57 +00:00
scheduler-rpo-unittest.cc [cleanup] Refactor compiler to use default members. 2018-09-17 12:12:21 +00:00
scheduler-unittest.cc Reland "Introduce StdoutStream which prints to Android log or stdout" 2018-06-14 13:29:01 +00:00
simplified-lowering-unittest.cc [turbofan] Rename "js_heap_broker" to "broker". 2018-10-15 08:17:17 +00:00
simplified-operator-reducer-unittest.cc [turbofan] Rename "js_heap_broker" to "broker". 2018-10-15 08:17:17 +00:00
simplified-operator-unittest.cc [jumbo] fix another set of unittest compilation errors 2017-10-19 09:15:44 +00:00
state-values-utils-unittest.cc Enable clang's -Wunreachable-code warning. 2017-12-04 13:09:25 +00:00
typed-optimization-unittest.cc [turbofan] Rename "js_heap_broker" to "broker". 2018-10-15 08:17:17 +00:00
typer-unittest.cc [turbofan] Rename "js_heap_broker" to "broker". 2018-10-15 08:17:17 +00:00
value-numbering-reducer-unittest.cc [jumbo] fix another set of unittest compilation errors 2017-10-19 09:15:44 +00:00
zone-stats-unittest.cc Named all zones in the project 2016-10-17 12:12:42 +00:00