Fix InlineCacheState for ToBoolean and CompareIC

BUG=
R=verwaest@chromium.org

Review URL: https://codereview.chromium.org/16613003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15003 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
olivf@chromium.org 2013-06-07 13:11:17 +00:00
parent b29a78fb02
commit 9595a691b0
2 changed files with 30 additions and 0 deletions

View File

@ -305,6 +305,27 @@ void BinaryOpStub::GenerateStringStub(MacroAssembler* masm) {
} }
InlineCacheState ICCompareStub::GetICState() {
CompareIC::State state = Max(left_, right_);
switch (state) {
case CompareIC::UNINITIALIZED:
return ::v8::internal::UNINITIALIZED;
case CompareIC::SMI:
case CompareIC::NUMBER:
case CompareIC::INTERNALIZED_STRING:
case CompareIC::STRING:
case CompareIC::UNIQUE_NAME:
case CompareIC::OBJECT:
case CompareIC::KNOWN_OBJECT:
return MONOMORPHIC;
case CompareIC::GENERIC:
return ::v8::internal::GENERIC;
}
UNREACHABLE();
return ::v8::internal::UNINITIALIZED;
}
void ICCompareStub::AddToSpecialCache(Handle<Code> new_object) { void ICCompareStub::AddToSpecialCache(Handle<Code> new_object) {
ASSERT(*known_map_ != NULL); ASSERT(*known_map_ != NULL);
Isolate* isolate = new_object->GetIsolate(); Isolate* isolate = new_object->GetIsolate();

View File

@ -1080,6 +1080,8 @@ class ICCompareStub: public PlatformCodeStub {
return static_cast<CompareIC::State>(HandlerStateField::decode(minor_key)); return static_cast<CompareIC::State>(HandlerStateField::decode(minor_key));
} }
virtual InlineCacheState GetICState();
private: private:
class OpField: public BitField<int, 0, 3> { }; class OpField: public BitField<int, 0, 3> { };
class LeftStateField: public BitField<int, 3, 4> { }; class LeftStateField: public BitField<int, 3, 4> { };
@ -2027,6 +2029,13 @@ class ToBooleanStub: public HydrogenCodeStub {
return types_.ToIntegral(); return types_.ToIntegral();
} }
virtual InlineCacheState GetICState() {
if (types_.IsEmpty()) {
return ::v8::internal::UNINITIALIZED;
} else {
return MONOMORPHIC;
}
}
private: private:
Major MajorKey() { return ToBoolean; } Major MajorKey() { return ToBoolean; }