Index: src/ic.cc |
diff --git a/src/ic.cc b/src/ic.cc |
index 31845f21421373dc6e9d48e821a4891ec4b44137..2c498b032c2215cc76c7a78368e4bf61a2d3e63b 100644 |
--- a/src/ic.cc |
+++ b/src/ic.cc |
@@ -2881,25 +2881,17 @@ RUNTIME_FUNCTION(Code*, CompareIC_Miss) { |
} |
-Code* CompareNilIC::GetRawUninitialized(EqualityKind kind, |
- NilValue nil) { |
- CompareNilICStub stub(kind, nil); |
- Code* code = NULL; |
- CHECK(stub.FindCodeInCache(&code, Isolate::Current())); |
- return code; |
-} |
- |
- |
void CompareNilIC::Clear(Address address, Code* target) { |
if (target->ic_state() == UNINITIALIZED) return; |
Code::ExtraICState state = target->extended_extra_ic_state(); |
- EqualityKind kind = |
- CompareNilICStub::EqualityKindFromExtraICState(state); |
- NilValue nil = |
- CompareNilICStub::NilValueFromExtraICState(state); |
+ CompareNilICStub stub(state, CompareNilICStub::CODE_STUB_IS_MISS); |
+ stub.ClearTypes(); |
- SetTargetAtAddress(address, GetRawUninitialized(kind, nil)); |
+ Code* code = NULL; |
+ CHECK(stub.FindCodeInCache(&code, target->GetIsolate())); |
+ |
+ SetTargetAtAddress(address, code); |
} |
@@ -2923,28 +2915,24 @@ MaybeObject* CompareNilIC::DoCompareNilSlow(EqualityKind kind, |
MaybeObject* CompareNilIC::CompareNil(Handle<Object> object) { |
Code::ExtraICState extra_ic_state = target()->extended_extra_ic_state(); |
+ CompareNilICStub stub(extra_ic_state); |
+ |
// Extract the current supported types from the patched IC and calculate what |
// types must be supported as a result of the miss. |
- bool already_monomorphic; |
- CompareNilICStub::Types types = |
- CompareNilICStub::GetPatchedICFlags(extra_ic_state, |
- object, &already_monomorphic); |
+ bool already_monomorphic = stub.IsMonomorphic(); |
+ |
+ stub.Record(object); |
- EqualityKind kind = |
- CompareNilICStub::EqualityKindFromExtraICState(extra_ic_state); |
- NilValue nil = |
- CompareNilICStub::NilValueFromExtraICState(extra_ic_state); |
+ EqualityKind kind = stub.GetKind(); |
+ NilValue nil = stub.GetNilValue(); |
// Find or create the specialized stub to support the new set of types. |
- CompareNilICStub stub(kind, nil, types); |
Handle<Code> code; |
- if ((types & CompareNilICStub::kCompareAgainstMonomorphicMap) != 0) { |
+ if (stub.IsMonomorphic()) { |
Handle<Map> monomorphic_map(already_monomorphic |
? target()->FindFirstMap() |
: HeapObject::cast(*object)->map()); |
- code = isolate()->stub_cache()->ComputeCompareNil(monomorphic_map, |
- nil, |
- stub.GetTypes()); |
+ code = isolate()->stub_cache()->ComputeCompareNil(monomorphic_map, stub); |
} else { |
code = stub.GetCode(isolate()); |
} |