/*
- * Copyright (C) 2012 Apple Inc. All rights reserved.
+ * Copyright (C) 2012, 2014 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
namespace JSC {
-PutByIdAccess PutByIdAccess::fromStructureStubInfo(
- StructureStubInfo& stubInfo,
- MacroAssemblerCodePtr initialSlowPath)
+PutByIdAccess PutByIdAccess::fromStructureStubInfo(StructureStubInfo& stubInfo)
{
+ MacroAssemblerCodePtr initialSlowPath =
+ stubInfo.callReturnLocation.labelAtOffset(stubInfo.patch.deltaCallToSlowCase);
+
PutByIdAccess result;
switch (stubInfo.accessType) {
return result;
}
-bool PutByIdAccess::visitWeak() const
+bool PutByIdAccess::visitWeak(RepatchBuffer& repatchBuffer) const
{
switch (m_type) {
case Replace:
if (!Heap::isMarked(m_chain.get()))
return false;
break;
+ case Setter:
+ case CustomSetter:
+ if (!Heap::isMarked(m_oldStructure.get()))
+ return false;
+ if (m_chain && !Heap::isMarked(m_chain.get()))
+ return false;
+ break;
default:
RELEASE_ASSERT_NOT_REACHED();
return false;
}
+ if (!m_stubRoutine->visitWeak(repatchBuffer))
+ return false;
return true;
}
PolymorphicPutByIdList::PolymorphicPutByIdList(
- PutKind putKind,
- StructureStubInfo& stubInfo,
- MacroAssemblerCodePtr initialSlowPath)
+ PutKind putKind, StructureStubInfo& stubInfo)
: m_kind(putKind)
{
- m_list.append(PutByIdAccess::fromStructureStubInfo(stubInfo, initialSlowPath));
+ if (stubInfo.accessType != access_unset)
+ m_list.append(PutByIdAccess::fromStructureStubInfo(stubInfo));
}
PolymorphicPutByIdList* PolymorphicPutByIdList::from(
- PutKind putKind,
- StructureStubInfo& stubInfo,
- MacroAssemblerCodePtr initialSlowPath)
+ PutKind putKind, StructureStubInfo& stubInfo)
{
if (stubInfo.accessType == access_put_by_id_list)
return stubInfo.u.putByIdList.list;
ASSERT(stubInfo.accessType == access_put_by_id_replace
- || stubInfo.accessType == access_put_by_id_transition_normal
- || stubInfo.accessType == access_put_by_id_transition_direct);
+ || stubInfo.accessType == access_put_by_id_transition_normal
+ || stubInfo.accessType == access_put_by_id_transition_direct
+ || stubInfo.accessType == access_unset);
PolymorphicPutByIdList* result =
- new PolymorphicPutByIdList(putKind, stubInfo, initialSlowPath);
+ new PolymorphicPutByIdList(putKind, stubInfo);
stubInfo.initPutByIdList(result);
m_list.last() = putByIdAccess;
}
-bool PolymorphicPutByIdList::visitWeak() const
+bool PolymorphicPutByIdList::visitWeak(RepatchBuffer& repatchBuffer) const
{
for (unsigned i = 0; i < size(); ++i) {
- if (!at(i).visitWeak())
+ if (!at(i).visitWeak(repatchBuffer))
return false;
}
return true;