Bug 517345: fix jitstats architecture flags, r=gal

--HG--
extra : rebase_source : bea8fd342f3f57071150c64e689971f14ecaa55e
This commit is contained in:
David Mandelin 2009-09-18 14:27:07 -07:00
parent c421bb6e66
commit 7c2e702632
2 changed files with 41 additions and 27 deletions

View File

@ -1988,33 +1988,6 @@ TraceRecorder::TraceRecorder(JSContext* cx, VMSideExit* _anchor, Fragment* _frag
(void*)this->globalObj, OBJ_SHAPE(this->globalObj));
debug_only_printf(LC_TMTreeVis, "TREEVIS RECORD FRAG=%p ANCHOR=%p\n", (void*)fragment,
(void*)anchor);
/* Set up jitstats so that trace-test.js can determine which architecture
* we're running on. */
jitstats.archIsIA32 = 0;
jitstats.archIs64BIT = 0;
jitstats.archIsARM = 0;
jitstats.archIsSPARC = 0;
jitstats.archIsPPC = 0;
#if defined NANOJIT_IA32
jitstats.archIsIA32 = 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
#if defined NANOJIT_X64
jitstats.archIsAMD64 = 1;
#endif
#endif
lir = lir_buf_writer = new LirBufWriter(lirbuf);
@ -7028,6 +7001,33 @@ js_InitJIT(JSTraceMonitor *tm)
#if !defined XP_WIN
debug_only(memset(&jitstats, 0, sizeof(jitstats)));
#endif
#ifdef JS_JIT_SPEW
/* Architecture properties used by test cases. */
jitstats.archIsIA32 = 0;
jitstats.archIs64BIT = 0;
jitstats.archIsARM = 0;
jitstats.archIsSPARC = 0;
jitstats.archIsPPC = 0;
#if defined NANOJIT_IA32
jitstats.archIsIA32 = 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
#if defined NANOJIT_X64
jitstats.archIsAMD64 = 1;
#endif
#endif
}
void

View File

@ -0,0 +1,14 @@
// Make sure the arch flags are valid on startup, even if nothing has
// been traced yet. We don't know what arch the user is building on,
// but presumably we want at least 1 flag to be set on all supported
// platforms.
if (jitstats) {
assertEq(jitstats.archIsIA32 ||
jitstats.archIs64BIT ||
jitstats.archIsARM ||
jitstats.archIsSPARC ||
jitstats.archIsPPC ||
jitstats.archIsAMD64,
1);
}