Chromium Code Reviews| Index: src/hydrogen.cc |
| diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
| index f50a2d5796c3880b0a3a0fc3d4b4d3e327d690da..3af9bbce7cc58d9fe1cd7147af330ad771dfe44c 100644 |
| --- a/src/hydrogen.cc |
| +++ b/src/hydrogen.cc |
| @@ -1807,27 +1807,27 @@ void HGraphBuilder::BuildCompareNil( |
| HIfContinuation* continuation) { |
| IfBuilder if_nil(this, position); |
| bool needs_or = false; |
| - if ((types & CompareNilICStub::kCompareAgainstNull) != 0) { |
| + if (types.Contains(CompareNilICStub::NULL_TYPE)) { |
| if (needs_or) if_nil.Or(); |
| if_nil.If<HCompareObjectEqAndBranch>(value, graph()->GetConstantNull()); |
| needs_or = true; |
| } |
| - if ((types & CompareNilICStub::kCompareAgainstUndefined) != 0) { |
| + if (types.Contains(CompareNilICStub::UNDEFINED)) { |
| if (needs_or) if_nil.Or(); |
| if_nil.If<HCompareObjectEqAndBranch>(value, |
| graph()->GetConstantUndefined()); |
| needs_or = true; |
| } |
| // Handle either undetectable or monomorphic, not both. |
| - ASSERT(((types & CompareNilICStub::kCompareAgainstUndetectable) == 0) || |
| - ((types & CompareNilICStub::kCompareAgainstMonomorphicMap) == 0)); |
| - if ((types & CompareNilICStub::kCompareAgainstUndetectable) != 0) { |
| + ASSERT(!types.Contains(CompareNilICStub::UNDETECTABLE) || |
| + !types.Contains(CompareNilICStub::MONOMORPHIC_MAP)); |
| + if (types.Contains(CompareNilICStub::UNDETECTABLE)) { |
| if (needs_or) if_nil.Or(); |
| if_nil.If<HIsUndetectableAndBranch>(value); |
| } else { |
| if_nil.Then(); |
| if_nil.Else(); |
| - if ((types & CompareNilICStub::kCompareAgainstMonomorphicMap) != 0) { |
| + if (types.Contains(CompareNilICStub::MONOMORPHIC_MAP)) { |
| BuildCheckNonSmi(value); |
| // For ICs, the map checked below is a sentinel map that gets replaced by |
| // the monomorphic map when the code is used as a template to generate a |
| @@ -10685,14 +10685,15 @@ void HOptimizedGraphBuilder::HandleLiteralCompareNil(CompareOperation* expr, |
| CompareNilICStub::Types types; |
| if (kind == kStrictEquality) { |
| if (nil == kNullValue) { |
|
Sven Panne
2013/05/13 14:24:50
Using a ternary ?: is clearer here.
oliv
2013/05/13 18:03:58
ok
|
| - types = CompareNilICStub::kCompareAgainstNull; |
| + types.Add(CompareNilICStub::NULL_TYPE); |
| } else { |
| - types = CompareNilICStub::kCompareAgainstUndefined; |
| + types.Add(CompareNilICStub::UNDEFINED); |
| } |
| } else { |
| - types = static_cast<CompareNilICStub::Types>( |
| - oracle()->CompareNilTypes(id)); |
| - if (types == 0) types = CompareNilICStub::kFullCompare; |
| + types = CompareNilICStub::Types(oracle()->CompareNilTypes(id)); |
| + if (types.IsEmpty()) { |
| + types.BeFullCompare(); |
| + } |
| } |
| Handle<Map> map_handle(oracle()->CompareNilMonomorphicReceiverType(id)); |
| BuildCompareNil(value, kind, types, map_handle, |