Disabled building AMD64 JIT in shell until regressions are tracked down. Fixed some compiling errors while I'm poking around here (bug 453674).
authorDavid Anderson <danderson@mozilla.com>
Thu, 04 Sep 2008 10:58:35 -0700
changeset 19040 ee704fbeb74f37bdc58bbf67943f93aad28449c2
parent 19039 ccb011438e5c2c5dc2a1d2ca5866b3a7ac8574d1
child 19041 f2f390ccae76657e5ecbdc9cb55db74e829616dc
push id1930
push usermrbkap@mozilla.com
push dateWed, 10 Sep 2008 06:40:47 +0000
treeherderautoland@ee61af1469cd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs453674
milestone1.9.1b1pre
Disabled building AMD64 JIT in shell until regressions are tracked down. Fixed some compiling errors while I'm poking around here (bug 453674).
js/src/config/Linux_All.mk
js/src/jstracer.cpp
--- a/js/src/config/Linux_All.mk
+++ b/js/src/config/Linux_All.mk
@@ -68,20 +68,20 @@ GCC_LIST:=$(sort 2.91.66 $(GCC_VERSION) 
 
 ifeq (2.91.66, $(firstword $(GCC_LIST)))
 CFLAGS+= -DGCC_OPT_BUG
 endif # gcc 2.91.66
 endif # gcc
 endif # 86
 endif # !x86_64
 
-ifeq ($(CPU_ARCH),x86_64)
-OS_CFLAGS += -DAVMPLUS_AMD64 -DAVMPLUS_64BIT -DAVMPLUS_LINUX
-NANOJIT_ARCH = i386
-endif
+#ifeq ($(CPU_ARCH),x86_64)
+#OS_CFLAGS += -DAVMPLUS_AMD64 -DAVMPLUS_64BIT -DAVMPLUS_LINUX
+#NANOJIT_ARCH = i386
+#endif
 
 ifeq ($(CPU_ARCH),arm)
 OS_CFLAGS += -DAVMPLUS_ARM -DAVMPLUS_LINUX
 NANOJIT_ARCH = ARM
 endif
 
 GFX_ARCH = x
 
--- a/js/src/jstracer.cpp
+++ b/js/src/jstracer.cpp
@@ -115,17 +115,19 @@ using namespace nanojit;
 
 static GC gc = GC();
 static avmplus::AvmCore s_core = avmplus::AvmCore();
 static avmplus::AvmCore* core = &s_core;
 
 /* We really need a better way to configure the JIT. Shaver, where is my fancy JIT object? */
 static bool nesting_enabled = true;
 static bool oracle_enabled = true;
+#if defined(NANOJIT_IA32)
 static bool did_we_check_sse2 = false;
+#endif
 
 #if defined(DEBUG) || defined(INCLUDE_VERBOSE_OUTPUT)
 static bool verbose_debug = getenv("TRACEMONKEY") && strstr(getenv("TRACEMONKEY"), "verbose");
 #define debug_only_v(x) if (verbose_debug) { x; }
 #else
 #define debug_only_v(x)
 #endif
 
@@ -2269,17 +2271,17 @@ js_ExecuteTree(JSContext* cx, Fragment**
     state.cx = cx;
 #ifdef DEBUG
     state.nestedExit = NULL;
 #endif    
     union { NIns *code; GuardRecord* (FASTCALL *func)(InterpState*, Fragment*); } u;
     u.code = f->code();
 
 #ifdef DEBUG
-#if defined(NANOJIT_IA32)
+#if defined(NANOJIT_IA32) || (defined(NANOJIT_AMD64) && defined(__GNUC__))
     uint64 start = rdtsc();
 #endif
 #endif
 
     /*
      * We may be called from js_MonitorLoopEdge while not recording, or while
      * recording. Rather than over-generalize by using a counter instead of a
      * flag, we simply sample and update tm->onTrace if necessary.
@@ -2354,20 +2356,20 @@ js_ExecuteTree(JSContext* cx, Fragment**
 
     /* If we are not exiting from an inlined frame the state->sp is spbase, otherwise spbase
        is whatever slots frames around us consume. */
     fp->regs->pc = (jsbytecode*)lr->from->root->ip + e->ip_adj;
     fp->regs->sp = StackBase(fp) + (e->sp_adj / sizeof(double)) - calldepth_slots;
     JS_ASSERT(fp->slots + fp->script->nfixed +
               js_ReconstructStackDepth(cx, fp->script, fp->regs->pc) == fp->regs->sp);
 
-#if defined(DEBUG) && defined(NANOJIT_IA32)
+#if defined(DEBUG) && (defined(NANOJIT_IA32) || (defined(NANOJIT_AMD64) && defined(__GNUC__)))
     uint64 cycles = rdtsc() - start;
-#else
-    debug_only_v(uint64 cycles = 0;)
+#elif defined(DEBUG)
+    uint64 cycles = 0;
 #endif
 
     debug_only_v(printf("leaving trace at %s:%u@%u, op=%s, lr=%p, exitType=%d, sp=%d, ip=%p, "
                         "cycles=%llu\n",
                         fp->script->filename, js_PCToLineNumber(cx, fp->script, fp->regs->pc),
                         fp->regs->pc - fp->script->code,
                         js_CodeName[*fp->regs->pc],
                         lr,
@@ -3561,17 +3563,17 @@ TraceRecorder::guardDenseArrayIndex(JSOb
     guard(true, lir->ins2i(LIR_ge, idx_ins, 0), MISMATCH_EXIT);
 
     // guard(index < length)
     guard(true, lir->ins2(LIR_lt, idx_ins, length_ins), MISMATCH_EXIT);
 
     // guard(index < capacity)
     guard(false, lir->ins_eq0(dslots_ins), MISMATCH_EXIT);
     guard(true,
-          lir->ins2(LIR_lt, idx_ins, lir->insLoad(LIR_ldp, dslots_ins, 0 - sizeof(jsval))),
+          lir->ins2(LIR_lt, idx_ins, lir->insLoad(LIR_ldp, dslots_ins, 0 - (int)sizeof(jsval))),
           MISMATCH_EXIT);
     return true;
 }
 
 void
 TraceRecorder::clearFrameSlotsFromCache()
 {
     /* Clear out all slots of this frame in the nativeFrameTracker. Different locations on the