Chromium Code Reviews| Index: src/code-stubs.cc |
| diff --git a/src/code-stubs.cc b/src/code-stubs.cc |
| index 3a4243dc5b853a8ade75d315d346634fe4af9dab..50db51ea458d11e0b72b0a5d8d14ec6d18ac8c63 100644 |
| --- a/src/code-stubs.cc |
| +++ b/src/code-stubs.cc |
| @@ -407,6 +407,46 @@ void ICCompareStub::Generate(MacroAssembler* masm) { |
| } |
| +CompareNilICStub::Types CompareNilICStub::GetPatchedICFlags( |
| + Code::ExtraICState extra_ic_state, |
| + Handle<Object> object, |
| + bool* already_monomorphic) { |
| + Types types = TypesField::decode(extra_ic_state); |
| + NilValue nil = NilValueField::decode(extra_ic_state); |
| + EqualityKind kind = EqualityKindField::decode(extra_ic_state); |
| + ASSERT(types != CompareNilICStub::kFullCompare); |
| + *already_monomorphic = |
| + (types & CompareNilICStub::kCompareAgainstMonomorphicMap) != 0; |
| + if (kind == kStrictEquality) { |
| + if (nil == kNullValue) { |
| + return CompareNilICStub::kCompareAgainstNull; |
| + } else { |
| + return CompareNilICStub::kCompareAgainstUndefined; |
| + } |
| + } else { |
| + if (object->IsNull()) { |
| + types = static_cast<CompareNilICStub::Types>( |
| + types | CompareNilICStub::kCompareAgainstNull); |
| + } else if (object->IsUndefined()) { |
| + types = static_cast<CompareNilICStub::Types>( |
| + types | CompareNilICStub::kCompareAgainstUndefined); |
| + } else { |
| + if (object->IsUndetectableObject() || !object->IsHeapObject()) { |
|
mvstanton
2013/04/23 09:27:30
Could you combine the if with the else above
danno
2013/04/23 16:14:47
Done.
|
| + types = CompareNilICStub::kFullCompare; |
| + } else { |
| + if ((types & CompareNilICStub::kCompareAgainstMonomorphicMap) != 0) { |
|
mvstanton
2013/04/23 09:27:30
And again here.
danno
2013/04/23 16:14:47
Done.
|
| + types = CompareNilICStub::kFullCompare; |
| + } else { |
| + types = static_cast<CompareNilICStub::Types>( |
| + types | CompareNilICStub::kCompareAgainstMonomorphicMap); |
| + } |
| + } |
| + } |
| + } |
| + return types; |
| +} |
| + |
| + |
| void InstanceofStub::PrintName(StringStream* stream) { |
| const char* args = ""; |
| if (HasArgsInRegisters()) { |