Commit 0dbc719b authored by ishell's avatar ishell Committed by Commit bot

[stubs] Fix performance regression on x64 caused by modified double hole check.

Compare the whole word on 64-bit architectures with the kHoleNanInt64 value
since comparing only upper part produces slightly worse code on x64.
Currently TurboFan is not able to fold (array + ((const1 + index*scale) + const))
into single addressing mode: (array + (const + index*scale)).

BUG=chromium:645414

Review-Url: https://codereview.chromium.org/2322283002
Cr-Commit-Position: refs/heads/master@{#39335}
parent fe0fad73
......@@ -1151,10 +1151,19 @@ Node* CodeStubAssembler::LoadDoubleWithHoleCheck(Node* base, Node* offset,
Label* if_hole,
MachineType machine_type) {
if (if_hole) {
Node* element_upper =
Load(MachineType::Uint32(), base,
IntPtrAdd(offset, IntPtrConstant(kIeeeDoubleExponentWordOffset)));
GotoIf(Word32Equal(element_upper, Int32Constant(kHoleNanUpper32)), if_hole);
// TODO(ishell): Compare only the upper part for the hole once the
// compiler is able to fold addition of already complex |offset| with
// |kIeeeDoubleExponentWordOffset| into one addressing mode.
if (Is64()) {
Node* element = Load(MachineType::Uint64(), base, offset);
GotoIf(Word64Equal(element, Int64Constant(kHoleNanInt64)), if_hole);
} else {
Node* element_upper = Load(
MachineType::Uint32(), base,
IntPtrAdd(offset, IntPtrConstant(kIeeeDoubleExponentWordOffset)));
GotoIf(Word32Equal(element_upper, Int32Constant(kHoleNanUpper32)),
if_hole);
}
}
if (machine_type.IsNone()) {
// This means the actual value is not needed.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment