Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(383)

Unified Diff: src/ic.cc

Issue 14862009: Encapsulating Type information in the CompareICStub (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ic.h ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
}
« no previous file with comments | « src/ic.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698