some ARM stuff
authorshaver@mozilla.org
Fri, 11 Jul 2008 01:27:06 -0400
changeset 17615 fc5ccedb84e5126cdfd22f469acc5ecccbafa3f7
parent 17614 cb2d64b052c048add8f0c4ad633bd08dc6830725
child 17616 4471d7a2aa883957ad8b7dc78c7610ac46694b06
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone1.9.1a1pre
some ARM stuff
js/src/config.mk
js/src/config/Linux_All.mk
js/src/jstracer.cpp
--- a/js/src/config.mk
+++ b/js/src/config.mk
@@ -123,17 +123,17 @@ endif
 ifdef BUILD_OPT
 ifdef USE_MSVC
 OPTIMIZER  = -O2 -GL
 INTERP_OPTIMIZER = -O2 -GL
 BUILTINS_OPTIMIZER = -O2 -GL
 LDFLAGS    += -LTCG
 else
 OPTIMIZER  = -Os -fno-exceptions -fno-rtti
-BUILTINS_OPTIMIZER = -O9 -fstrict-aliasing -momit-leaf-frame-pointer
+BUILTINS_OPTIMIZER = -O9 -fstrict-aliasing
 INTERP_OPTIMIZER = -O3 -fstrict-aliasing -fno-exceptions -fno-rtti
 endif
 DEFINES    += -UDEBUG -DNDEBUG -UDEBUG_$(USER)
 OBJDIR_TAG = _OPT
 else
 ifdef USE_MSVC
 OPTIMIZER  = -Zi
 INTERP_OPTIMIZER = -Zi
--- a/js/src/config/Linux_All.mk
+++ b/js/src/config/Linux_All.mk
@@ -63,19 +63,24 @@ NANOJIT_ARCH = i386
 ifeq (gcc, $(CC))
 # if using gcc on x86, check version for opt bug 
 # (http://bugzilla.mozilla.org/show_bug.cgi?id=24892)
 GCC_VERSION := $(shell gcc -v 2>&1 | grep version | awk '{ print $$3 }')
 GCC_LIST:=$(sort 2.91.66 $(GCC_VERSION) )
 
 ifeq (2.91.66, $(firstword $(GCC_LIST)))
 CFLAGS+= -DGCC_OPT_BUG
-endif
-endif
-endif
+endif # gcc 2.91.66
+endif # gcc
+endif # 86
+endif # !x86_64
+
+ifeq ($(CPU_ARCH),arm)
+OS_CFLAGS += -DAVMPLUS_ARM -DAVMPLUS_LINUX
+NANOJIT_ARCH = Thumb
 endif
 
 GFX_ARCH = x
 
 OS_LIBS = -lm -lc
 
 ASFLAGS += -x assembler-with-cpp
 
--- a/js/src/jstracer.cpp
+++ b/js/src/jstracer.cpp
@@ -49,17 +49,17 @@
 #include "jsprf.h"
 #include "jsinterp.h"
 #include "jsscope.h"
 
 #include "jsautooplen.h"
 
 #ifdef _MSC_VER
 #include <malloc.h>
-  __inline void * alloca(size_t size) { return _alloca(size); }
+#define alloca _alloca
 #endif
 
 using namespace avmplus;
 using namespace nanojit;
 
 static GC gc = GC();
 static avmplus::AvmCore* core = new (&gc) avmplus::AvmCore();
 
@@ -1081,22 +1081,22 @@ js_LoopEdge(JSContext* cx)
     double* entry_sp = &native[fi->nativeStackBase/sizeof(double) +
                                (cx->fp->regs->sp - cx->fp->spbase - 1)];
     InterpState state;
     state.ip = cx->fp->regs->pc;
     state.sp = (void*)entry_sp;
     state.cx = cx;
     union { NIns *code; GuardRecord* (FASTCALL *func)(InterpState*, Fragment*); } u;
     u.code = f->code();
-#ifdef DEBUG
+#if defined(DEBUG) && defined(AVMPLUS_IA32)
     printf("entering trace, pc=%p, sp=%p\n", state.ip, state.sp);
     uint64 start = rdtsc();
 #endif
     GuardRecord* lr = u.func(&state, NULL);
-#ifdef DEBUG
+#if defined(DEBUG) && defined(AVMPLUS_IA32)
     printf("leaving trace, pc=%p, sp=%p, cycles=%llu\n", state.ip, state.sp,
             (rdtsc() - start));
 #endif
     cx->fp->regs->sp += (((double*)state.sp - entry_sp));
     cx->fp->regs->pc = (jsbytecode*)state.ip;
     box(cx, cx->fp, cx->fp, lr->exit->typeMap, native);
 #ifdef DEBUG
     JS_ASSERT(*(uint64*)&native[fi->maxNativeFrameSlots] == 0xdeadbeefdeadbeefLL);