Kill alwaysLowMem

We're hitting the assert in some jobs (see task) and it's not
a measureable win.
Esse commit está contido em:
bsimmers
2013-04-30 13:04:08 -07:00
commit de Sara Golemon
commit 66f23c5c06
4 arquivos alterados com 3 adições e 29 exclusões
-2
Ver Arquivo
@@ -514,8 +514,6 @@ void PreClassRepoProxy::GetPreClassesStmt
ClassPtr Class::newClass(PreClass* preClass, Class* parent) {
unsigned classVecLen = (parent != nullptr) ? parent->m_classVecLen+1 : 1;
void* mem = Util::low_malloc(sizeForNClasses(classVecLen));
always_assert(IMPLIES(alwaysLowMem(), ptr_is_low_mem(mem)) &&
"All Classes must be allocated at 32-bit addresses");
try {
return ClassPtr(new (mem) Class(preClass, parent, classVecLen));
} catch (...) {
-12
Ver Arquivo
@@ -645,18 +645,6 @@ public:
Class(PreClass* preClass, Class* parent, unsigned classVecLen);
void atomicRelease();
static bool alwaysLowMem() {
// jemalloc 3.2.0 and later support allocating objects in low memory
// (addresses that fit in 32 bits), and we take advantage of this in
// translated code.
#if defined(JEMALLOC_VERSION) && \
((JEMALLOC_VERSION_MAJOR == 3 && JEMALLOC_VERSION_MINOR >= 2) || \
JEMALLOC_VERSION_MAJOR > 3)
return use_jemalloc && RuntimeOption::RepoAuthoritative;
#else
return false;
#endif
}
static size_t sizeForNClasses(unsigned nClasses) {
return offsetof(Class, m_classVec) + (sizeof(Class*) * nClasses);
}
+2 -10
Ver Arquivo
@@ -1578,11 +1578,7 @@ void CodeGenerator::cgExtendsClass(IRInstruction* inst) {
// Test if it is the exact same class. TODO(#2044801): we should be
// doing this control flow at the IR level.
if (!(testClass->attrs() & AttrAbstract)) {
if (Class::alwaysLowMem()) {
a. cmpl (r32(rTestClass), r32(rObjClass));
} else {
a. cmpq (rTestClass, rObjClass);
}
a. cmpq (rTestClass, rObjClass);
a. jne8 (notExact);
a. movb (1, rdst);
a. jmp8 (out);
@@ -1600,11 +1596,7 @@ asm_label(a, notExact);
a. jb8 (falseLabel);
// If it's a subclass, rTestClass must be at the appropriate index.
if (Class::alwaysLowMem()) {
a. cmpl (r32(rTestClass), rObjClass[vecOffset]);
} else {
a. cmpq (rTestClass, rObjClass[vecOffset]);
}
a. cmpq (rTestClass, rObjClass[vecOffset]);
a. sete (rdst);
a. jmp8 (out);
+1 -5
Ver Arquivo
@@ -10509,11 +10509,7 @@ TranslatorX64::emitInstanceCheck(const Tracelet& t,
// (meaning the class isn't defined yet) but that's ok: if it is null
// the cmp will always fail.
int offset = Class::classVecOff() + sizeof(Class*) * (parentVecLen-1);
if (Class::alwaysLowMem()) {
a.cmp_reg32_disp_reg64(r(cls), offset, r(inCls));
} else {
a.cmp_reg64_disp_reg64(r(cls), offset, r(inCls));
}
a.cmp_reg64_disp_reg64(r(cls), offset, r(inCls));
if (verifying) {
parentFailJe = a.code.frontier;
a.jne8(parentFailJe);