Relax the testTableSwitch2 test for non-x86 platforms which don't use ::tableswitch() in jstracer.cpp. (510193, r=jorendorff)

This commit is contained in:
Jacob Bramley 2009-08-13 14:53:03 +01:00
parent 25b9ed2a98
commit 967d281c76
3 changed files with 42 additions and 6 deletions

View File

@ -54,3 +54,9 @@ JITSTAT(returnLoopExits)
JITSTAT(mergedLoopExits)
JITSTAT(noCompatInnerTrees)
JITSTAT(blacklisted)
JITSTAT(archIsIA32)
JITSTAT(archIsAMD64)
JITSTAT(archIs64BIT)
JITSTAT(archIsARM)
JITSTAT(archIsSPARC)
JITSTAT(archIsPPC)

View File

@ -1704,6 +1704,34 @@ TraceRecorder::TraceRecorder(JSContext* cx, VMSideExit* _anchor, Fragment* _frag
debug_only_printf(LC_TMTracer, "globalObj=%p, shape=%d\n",
(void*)this->globalObj, OBJ_SHAPE(this->globalObj));
/* Set up jitstats so that trace-test.js can determine which architecture
* we're running on. */
jitstats.archIsIA32 = 0;
jitstats.archIsAMD64 = 0;
jitstats.archIs64BIT = 0;
jitstats.archIsARM = 0;
jitstats.archIsSPARC = 0;
jitstats.archIsPPC = 0;
#if defined NANOJIT_IA32
jitstats.archIsIA32 = 1;
#endif
#if defined NANOJIT_ARM64
jitstats.archIsAMD64 = 1;
#endif
#if defined NANOJIT_64BIT
jitstats.archIs64BIT = 1;
#endif
#if defined NANOJIT_ARM
jitstats.archIsARM = 1;
#endif
#if defined NANOJIT_SPARC
jitstats.archIsSPARC = 1;
#endif
#if defined NANOJIT_PPC
jitstats.archIsPPC = 1;
#endif
#endif
lir = lir_buf_writer = new (&gc) LirBufWriter(lirbuf);

View File

@ -4410,12 +4410,14 @@ function testTableSwitch2() {
}
assertEq(s, arr.join(""));
}
testTableSwitch2.jitstats = {
recorderStarted: 1,
sideExitIntoInterpreter: 4,
recorderAborted: 0,
traceCompleted: 3
};
if (jitstats.archIsIA32) {
testTableSwitch2.jitstats = {
recorderStarted: 1,
sideExitIntoInterpreter: 4,
recorderAborted: 0,
traceCompleted: 3
};
}
test(testTableSwitch2);
function testGeneratorDeepBail() {