Index: src/crankshaft/x64/lithium-codegen-x64.cc |
diff --git a/src/crankshaft/x64/lithium-codegen-x64.cc b/src/crankshaft/x64/lithium-codegen-x64.cc |
index 52cf25175fe3ff44ceb77524371468999655bdea..60d00927d093f438b55adb3be48ff60379d8c2ca 100644 |
--- a/src/crankshaft/x64/lithium-codegen-x64.cc |
+++ b/src/crankshaft/x64/lithium-codegen-x64.cc |
@@ -1993,17 +1993,16 @@ void LCodeGen::DoBranch(LBranch* instr) { |
__ cmpp(FieldOperand(reg, String::kLengthOffset), Immediate(0)); |
EmitBranch(instr, not_equal); |
} else { |
- ToBooleanICStub::Types expected = |
- instr->hydrogen()->expected_input_types(); |
+ ToBooleanHints expected = instr->hydrogen()->expected_input_types(); |
// Avoid deopts in the case where we've never executed this path before. |
- if (expected.IsEmpty()) expected = ToBooleanICStub::Types::Generic(); |
+ if (expected == ToBooleanHint::kNone) expected = ToBooleanHint::kAny; |
- if (expected.Contains(ToBooleanICStub::UNDEFINED)) { |
+ if (expected & ToBooleanHint::kUndefined) { |
// undefined -> false. |
__ CompareRoot(reg, Heap::kUndefinedValueRootIndex); |
__ j(equal, instr->FalseLabel(chunk_)); |
} |
- if (expected.Contains(ToBooleanICStub::BOOLEAN)) { |
+ if (expected & ToBooleanHint::kBoolean) { |
// true -> true. |
__ CompareRoot(reg, Heap::kTrueValueRootIndex); |
__ j(equal, instr->TrueLabel(chunk_)); |
@@ -2011,28 +2010,28 @@ void LCodeGen::DoBranch(LBranch* instr) { |
__ CompareRoot(reg, Heap::kFalseValueRootIndex); |
__ j(equal, instr->FalseLabel(chunk_)); |
} |
- if (expected.Contains(ToBooleanICStub::NULL_TYPE)) { |
+ if (expected & ToBooleanHint::kNull) { |
// 'null' -> false. |
__ CompareRoot(reg, Heap::kNullValueRootIndex); |
__ j(equal, instr->FalseLabel(chunk_)); |
} |
- if (expected.Contains(ToBooleanICStub::SMI)) { |
+ if (expected & ToBooleanHint::kSmallInteger) { |
// Smis: 0 -> false, all other -> true. |
__ Cmp(reg, Smi::kZero); |
__ j(equal, instr->FalseLabel(chunk_)); |
__ JumpIfSmi(reg, instr->TrueLabel(chunk_)); |
- } else if (expected.NeedsMap()) { |
+ } else if (expected & ToBooleanHint::kNeedsMap) { |
// If we need a map later and have a Smi -> deopt. |
__ testb(reg, Immediate(kSmiTagMask)); |
DeoptimizeIf(zero, instr, DeoptimizeReason::kSmi); |
} |
const Register map = kScratchRegister; |
- if (expected.NeedsMap()) { |
+ if (expected & ToBooleanHint::kNeedsMap) { |
__ movp(map, FieldOperand(reg, HeapObject::kMapOffset)); |
- if (expected.CanBeUndetectable()) { |
+ if (expected & ToBooleanHint::kCanBeUndetectable) { |
// Undetectable -> false. |
__ testb(FieldOperand(map, Map::kBitFieldOffset), |
Immediate(1 << Map::kIsUndetectable)); |
@@ -2040,13 +2039,13 @@ void LCodeGen::DoBranch(LBranch* instr) { |
} |
} |
- if (expected.Contains(ToBooleanICStub::SPEC_OBJECT)) { |
+ if (expected & ToBooleanHint::kReceiver) { |
// spec object -> true. |
__ CmpInstanceType(map, FIRST_JS_RECEIVER_TYPE); |
__ j(above_equal, instr->TrueLabel(chunk_)); |
} |
- if (expected.Contains(ToBooleanICStub::STRING)) { |
+ if (expected & ToBooleanHint::kString) { |
// String value -> false iff empty. |
Label not_string; |
__ CmpInstanceType(map, FIRST_NONSTRING_TYPE); |
@@ -2057,19 +2056,19 @@ void LCodeGen::DoBranch(LBranch* instr) { |
__ bind(¬_string); |
} |
- if (expected.Contains(ToBooleanICStub::SYMBOL)) { |
+ if (expected & ToBooleanHint::kSymbol) { |
// Symbol value -> true. |
__ CmpInstanceType(map, SYMBOL_TYPE); |
__ j(equal, instr->TrueLabel(chunk_)); |
} |
- if (expected.Contains(ToBooleanICStub::SIMD_VALUE)) { |
+ if (expected & ToBooleanHint::kSimdValue) { |
// SIMD value -> true. |
__ CmpInstanceType(map, SIMD128_VALUE_TYPE); |
__ j(equal, instr->TrueLabel(chunk_)); |
} |
- if (expected.Contains(ToBooleanICStub::HEAP_NUMBER)) { |
+ if (expected & ToBooleanHint::kHeapNumber) { |
// heap number -> false iff +0, -0, or NaN. |
Label not_heap_number; |
__ CompareRoot(map, Heap::kHeapNumberMapRootIndex); |
@@ -2082,7 +2081,7 @@ void LCodeGen::DoBranch(LBranch* instr) { |
__ bind(¬_heap_number); |
} |
- if (!expected.IsGeneric()) { |
+ if (expected != ToBooleanHint::kAny) { |
// We've seen something for the first time -> deopt. |
// This can only happen if we are not generic already. |
DeoptimizeIf(no_condition, instr, DeoptimizeReason::kUnexpectedObject); |