| Index: src/code-stubs.cc
|
| diff --git a/src/code-stubs.cc b/src/code-stubs.cc
|
| index 6bda25d14cc37c310eccee3f0e971bd73d5fbc92..098ca9e3232f6b6d93cdfdbdb65a3a09f361fae2 100644
|
| --- a/src/code-stubs.cc
|
| +++ b/src/code-stubs.cc
|
| @@ -407,6 +407,52 @@ void ICCompareStub::Generate(MacroAssembler* masm) {
|
| }
|
|
|
|
|
| +CompareNilICStub::Types CompareNilICStub::GetPatchedICFlags(
|
| + Code* ic,
|
| + EqualityKind kind,
|
| + NilValue nil,
|
| + Handle<Object> object,
|
| + bool* already_monomorphic) {
|
| + Code::ExtraICState extra_state = ic->extra_ic_state();
|
| + CompareNilICStub::Types types =
|
| + CompareNilICStub::TypesFromExtraICState(extra_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()) {
|
| + types = CompareNilICStub::kFullCompare;
|
| + } else {
|
| + if ((types & CompareNilICStub::kCompareAgainstMonomorphicMap) != 0) {
|
| + ASSERT_EQ(Code::COMPARE_NIL_IC, ic->kind());
|
| + Map* monomorphic_map = ic->FindFirstMap();
|
| + if (monomorphic_map != Handle<HeapObject>::cast(object)->map()) {
|
| + types = CompareNilICStub::kFullCompare;
|
| + }
|
| + } else {
|
| + types = static_cast<CompareNilICStub::Types>(
|
| + types | CompareNilICStub::kCompareAgainstMonomorphicMap);
|
| + }
|
| + }
|
| + }
|
| + }
|
| + return types;
|
| +}
|
| +
|
| +
|
| void InstanceofStub::PrintName(StringStream* stream) {
|
| const char* args = "";
|
| if (HasArgsInRegisters()) {
|
|
|