StructureStubInfo.cpp [plain text]
#include "config.h"
#include "StructureStubInfo.h"
#include "JSObject.h"
#include "PolymorphicGetByIdList.h"
#include "PolymorphicPutByIdList.h"
namespace JSC {
#if ENABLE(JIT)
void StructureStubInfo::deref()
{
switch (accessType) {
case access_get_by_id_list: {
delete u.getByIdList.list;
return;
}
case access_put_by_id_list:
delete u.putByIdList.list;
return;
case access_in_list: {
PolymorphicAccessStructureList* polymorphicStructures = u.inList.structureList;
delete polymorphicStructures;
return;
}
case access_get_by_id_self:
case access_put_by_id_transition_normal:
case access_put_by_id_transition_direct:
case access_put_by_id_replace:
case access_unset:
return;
default:
RELEASE_ASSERT_NOT_REACHED();
}
}
bool StructureStubInfo::visitWeakReferences(RepatchBuffer& repatchBuffer)
{
switch (accessType) {
case access_get_by_id_self:
if (!Heap::isMarked(u.getByIdSelf.baseObjectStructure.get()))
return false;
break;
case access_get_by_id_list: {
if (!u.getByIdList.list->visitWeak(repatchBuffer))
return false;
break;
}
case access_put_by_id_transition_normal:
case access_put_by_id_transition_direct:
if (!Heap::isMarked(u.putByIdTransition.previousStructure.get())
|| !Heap::isMarked(u.putByIdTransition.structure.get())
|| !Heap::isMarked(u.putByIdTransition.chain.get()))
return false;
break;
case access_put_by_id_replace:
if (!Heap::isMarked(u.putByIdReplace.baseObjectStructure.get()))
return false;
break;
case access_put_by_id_list:
if (!u.putByIdList.list->visitWeak(repatchBuffer))
return false;
break;
case access_in_list: {
PolymorphicAccessStructureList* polymorphicStructures = u.inList.structureList;
if (!polymorphicStructures->visitWeak(u.inList.listSize))
return false;
break;
}
default:
break;
}
return true;
}
#endif
}