Bug 1068953 - Disable coherency checks in JitCodeGlobalTable's SplayTree. (r=djvj)

This commit is contained in:
Shu-yu Guo 2014-09-23 15:43:27 -07:00
Родитель 3ba1b8c3a7
Коммит cc76f05d9c
2 изменённых файлов: 20 добавлений и 1 удалений

Просмотреть файл

@ -35,6 +35,10 @@ class SplayTree
LifoAlloc *alloc;
Node *root, *freeList;
#ifdef DEBUG
bool enableCheckCoherency;
#endif
SplayTree(const SplayTree &) MOZ_DELETE;
SplayTree &operator=(const SplayTree &) MOZ_DELETE;
@ -42,12 +46,21 @@ class SplayTree
explicit SplayTree(LifoAlloc *alloc = nullptr)
: alloc(alloc), root(nullptr), freeList(nullptr)
#ifdef DEBUG
, enableCheckCoherency(true)
#endif
{}
void setAllocator(LifoAlloc *alloc) {
this->alloc = alloc;
}
void disableCheckCoherency() {
#ifdef DEBUG
enableCheckCoherency = false;
#endif
}
bool empty() const {
return !root;
}
@ -253,6 +266,8 @@ class SplayTree
Node *checkCoherency(Node *node, Node *minimum)
{
#ifdef DEBUG
if (!enableCheckCoherency)
return nullptr;
if (!node) {
JS_ASSERT(!root);
return nullptr;

Просмотреть файл

@ -481,7 +481,11 @@ class JitcodeGlobalTable
EntryVector entries_;
public:
JitcodeGlobalTable() : treeAlloc_(LIFO_CHUNK_SIZE), tree_(&treeAlloc_), entries_() {}
JitcodeGlobalTable() : treeAlloc_(LIFO_CHUNK_SIZE), tree_(&treeAlloc_), entries_() {
// Always checking coherency in DEBUG builds may cause tests to time
// out under --baseline-eager or --ion-eager.
tree_.disableCheckCoherency();
}
~JitcodeGlobalTable() {}
bool empty() const {