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:
parent
b29a78fb02
commit
9595a691b0
@ -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) {
|
||||
ASSERT(*known_map_ != NULL);
|
||||
Isolate* isolate = new_object->GetIsolate();
|
||||
|
@ -1080,6 +1080,8 @@ class ICCompareStub: public PlatformCodeStub {
|
||||
return static_cast<CompareIC::State>(HandlerStateField::decode(minor_key));
|
||||
}
|
||||
|
||||
virtual InlineCacheState GetICState();
|
||||
|
||||
private:
|
||||
class OpField: public BitField<int, 0, 3> { };
|
||||
class LeftStateField: public BitField<int, 3, 4> { };
|
||||
@ -2027,6 +2029,13 @@ class ToBooleanStub: public HydrogenCodeStub {
|
||||
return types_.ToIntegral();
|
||||
}
|
||||
|
||||
virtual InlineCacheState GetICState() {
|
||||
if (types_.IsEmpty()) {
|
||||
return ::v8::internal::UNINITIALIZED;
|
||||
} else {
|
||||
return MONOMORPHIC;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
Major MajorKey() { return ToBoolean; }
|
||||
|
Loading…
Reference in New Issue
Block a user