Commit 15ba84db authored by ggaren@apple.com's avatar ggaren@apple.com
Browse files

Removed some incorrect code that was dead.

Reviewed by Oliver Hunt.

clearSingleTransition() wasn't resetting m_data. Luckily,
no one cares, because its caller was unused. Removed both.

* runtime/Structure.cpp:
* runtime/StructureTransitionTable.h:
(JSC::StructureTransitionTable::~StructureTransitionTable):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@92810 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 963ff3b0
2011-08-10 Geoffrey Garen <ggaren@apple.com>
Removed some incorrect code that was dead.
Reviewed by Oliver Hunt.
clearSingleTransition() wasn't resetting m_data. Luckily,
no one cares, because its caller was unused. Removed both.
* runtime/Structure.cpp:
* runtime/StructureTransitionTable.h:
(JSC::StructureTransitionTable::~StructureTransitionTable):
2011-08-10 Filip Pizlo <fpizlo@apple.com>
 
REGRESSION(r92670-r92744): WebKit crashes when opening Gmail
......
......@@ -83,29 +83,6 @@ inline Structure* StructureTransitionTable::get(StringImpl* rep, unsigned attrib
return map()->get(make_pair(rep, attributes));
}
inline void StructureTransitionTable::remove(Structure* structure)
{
if (isUsingSingleSlot()) {
// If more than one transition had been added, then we wouldn't be in
// single slot mode (even despecifying a from a specific value triggers
// map mode).
// As such, the passed structure *must* be the existing transition.
ASSERT(singleTransition() == structure);
clearSingleTransition();
} else {
// Check whether a mapping exists for structure's key, and whether the
// entry is structure (the latter check may fail if we initially had a
// transition with a specific value, and this has been despecified).
// Newer versions of the STL have an std::make_pair function that takes rvalue references.
// When either of the parameters are bitfields, the C++ compiler will try to bind them as lvalues, which is invalid. To work around this, use unary "+" to make the parameter an rvalue.
// See https://bugs.webkit.org/show_bug.cgi?id=59261 for more details
TransitionMap::iterator entry = map()->find(make_pair(structure->m_nameInPrevious, +structure->m_attributesInPrevious));
if (entry != map()->end() && structure == entry.get().second)
map()->remove(entry);
}
}
inline void StructureTransitionTable::add(JSGlobalData& globalData, Structure* structure)
{
if (isUsingSingleSlot()) {
......
......@@ -93,14 +93,18 @@ public:
~StructureTransitionTable()
{
if (!isUsingSingleSlot())
if (!isUsingSingleSlot()) {
delete map();
else
clearSingleTransition();
return;
}
HandleSlot slot = this->slot();
if (!slot)
return;
HandleHeap::heapFor(slot)->deallocate(slot);
}
inline void add(JSGlobalData&, Structure*);
inline void remove(Structure*);
inline bool contains(StringImpl* rep, unsigned attributes) const;
inline Structure* get(StringImpl* rep, unsigned attributes) const;
......@@ -145,13 +149,6 @@ private:
return 0;
}
void clearSingleTransition()
{
ASSERT(isUsingSingleSlot());
if (HandleSlot slot = this->slot())
HandleHeap::heapFor(slot)->deallocate(slot);
}
void setSingleTransition(JSGlobalData& globalData, Structure* structure)
{
ASSERT(isUsingSingleSlot());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment