Bug 969375 - Enable IonMonkey on MIPS. r=jandem,glandium
authorBranislav Rankov <branislav.rankov@imgtec.com>
Tue, 26 Aug 2014 17:11:54 +0200
changeset 201870 9287adaf50e322b2577dbb43e34a9d97906d9cb9
parent 201869 5c977e86af7b0ad722b08be748c7ec9ffefb6958
child 201871 d7b776d3b254f453bbf6207b262e3c1a5810b367
push id48284
push userbranislav.rankov@rt-rk.com
push dateWed, 27 Aug 2014 12:37:49 +0000
treeherdermozilla-inbound@9287adaf50e3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem, glandium
bugs969375
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 969375 - Enable IonMonkey on MIPS. r=jandem,glandium
js/src/configure.in
js/src/moz.build
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -207,16 +207,19 @@ if test -n "$gonkdir" ; then
 
     case "$target_cpu" in
     arm)
         ARCH_DIR=arch-arm
         ;;
     i?86)
         ARCH_DIR=arch-x86
         ;;
+    mips*)
+        ARCH_DIR=arch-mips
+        ;;
     esac
 
     CPPFLAGS="-DANDROID -isystem $gonkdir/bionic/libc/$ARCH_DIR/include -isystem $gonkdir/bionic/libc/include/ -isystem $gonkdir/bionic/libc/kernel/common -isystem $gonkdir/bionic/libc/kernel/$ARCH_DIR -isystem $gonkdir/bionic/libm/include -I$gonkdir/frameworks/base/native/include -I$gonkdir/system/core/include -isystem $gonkdir/bionic $CPPFLAGS -I$gonkdir/external/valgrind/fxos-include"
     CFLAGS="-mandroid -fno-short-enums -fno-exceptions $CFLAGS"
     CXXFLAGS="-mandroid -fno-short-enums -fno-exceptions -Wno-psabi $CXXFLAGS $STLPORT_CPPFLAGS"
     LIBS="$LIBS $STLPORT_LIBS"
 
     dnl Add -llog by default, since we use it all over the place.
@@ -2024,16 +2027,17 @@ powerpc64-*)
     AC_DEFINE(JS_CPU_PPC64)
     AC_DEFINE(JS_PUNBOX64)
     ;;
 powerpc-*)
     AC_DEFINE(JS_CPU_PPC)
     AC_DEFINE(JS_NUNBOX32)
     ;;
 mips*-*)
+    ENABLE_ION=1
     AC_DEFINE(JS_CPU_MIPS)
     AC_DEFINE(JS_NUNBOX32)
     ;;
 esac
 
 MOZ_ARG_DISABLE_BOOL(ion,
 [  --disable-ion      Disable use of the IonMonkey JIT],
   ENABLE_ION= )
@@ -3174,40 +3178,60 @@ dnl ====================================
 dnl = Use ARM JIT code simulator. Requires an x86 build.
 dnl ========================================================
 dnl Also define JS_CODEGEN_ARM in this case. If the simulator is not used,
 dnl JS_CODEGEN_foo is defined if JS_CPU_foo is defined.
 MOZ_ARG_ENABLE_BOOL(arm-simulator,
 [  --enable-arm-simulator Enable ARM simulator for JIT code],
     JS_ARM_SIMULATOR=1,
     JS_ARM_SIMULATOR= )
+MOZ_ARG_ENABLE_BOOL(mips-simulator,
+[  --enable-mips-simulator Enable MIPS simulator for JIT code],
+    JS_MIPS_SIMULATOR=1,
+    JS_MIPS_SIMULATOR= )
+
+if test -n "$JS_ARM_SIMULATOR" && test -n "$JS_MIPS_SIMULATOR"; then
+    AC_MSG_ERROR([Flags --enable-arm-simulator and --enable-mips-simulator cannot be used together.])
+fi
 
 if test -z "$ENABLE_ION"; then
     AC_DEFINE(JS_CODEGEN_NONE)
     JS_CODEGEN_NONE=1
 elif test -n "$JS_ARM_SIMULATOR"; then
     if test "$CPU_ARCH" != "x86"; then
         AC_MSG_ERROR([The ARM simulator only works on x86.])
     fi
     AC_DEFINE(JS_ARM_SIMULATOR)
     AC_DEFINE(JS_CODEGEN_ARM)
     JS_CODEGEN_ARM=1
+elif test -n "$JS_MIPS_SIMULATOR"; then
+    if test "$CPU_ARCH" != "x86"; then
+        AC_MSG_ERROR([The MIPS simulator only works on x86.])
+    fi
+    AC_DEFINE(JS_MIPS_SIMULATOR)
+    AC_DEFINE(JS_CODEGEN_MIPS)
+    JS_CODEGEN_MIPS=1
 elif test "$CPU_ARCH" = "x86"; then
     AC_DEFINE(JS_CODEGEN_X86)
     JS_CODEGEN_X86=1
 elif test "$CPU_ARCH" = "x86_64"; then
     AC_DEFINE(JS_CODEGEN_X64)
     JS_CODEGEN_X64=1
 elif test "$CPU_ARCH" = "arm"; then
     AC_DEFINE(JS_CODEGEN_ARM)
     JS_CODEGEN_ARM=1
+elif test "$CPU_ARCH" = "mips"; then
+    AC_DEFINE(JS_CODEGEN_MIPS)
+    JS_CODEGEN_MIPS=1
 fi
 
 AC_SUBST(JS_ARM_SIMULATOR)
+AC_SUBST(JS_MIPS_SIMULATOR)
 AC_SUBST(JS_CODEGEN_ARM)
+AC_SUBST(JS_CODEGEN_MIPS)
 AC_SUBST(JS_CODEGEN_X86)
 AC_SUBST(JS_CODEGEN_X64)
 AC_SUBST(JS_CODEGEN_NONE)
 
 dnl ========================================================
 dnl jprof
 dnl ========================================================
 MOZ_ARG_ENABLE_BOOL(jprof,
--- a/js/src/moz.build
+++ b/js/src/moz.build
@@ -359,16 +359,33 @@ elif CONFIG['JS_CODEGEN_ARM']:
         'jit/arm/MacroAssembler-arm.cpp',
         'jit/arm/MoveEmitter-arm.cpp',
         'jit/arm/Trampoline-arm.cpp',
     ]
     if CONFIG['JS_ARM_SIMULATOR']:
         UNIFIED_SOURCES += [
             'jit/arm/Simulator-arm.cpp'
         ]
+elif CONFIG['JS_CODEGEN_MIPS']:
+    UNIFIED_SOURCES += [
+        'jit/mips/Architecture-mips.cpp',
+        'jit/mips/Assembler-mips.cpp',
+        'jit/mips/Bailouts-mips.cpp',
+        'jit/mips/BaselineCompiler-mips.cpp',
+        'jit/mips/BaselineIC-mips.cpp',
+        'jit/mips/CodeGenerator-mips.cpp',
+        'jit/mips/Lowering-mips.cpp',
+        'jit/mips/MacroAssembler-mips.cpp',
+        'jit/mips/MoveEmitter-mips.cpp',
+        'jit/mips/Trampoline-mips.cpp',
+    ]
+    if CONFIG['JS_MIPS_SIMULATOR']:
+        UNIFIED_SOURCES += [
+            'jit/mips/Simulator-mips.cpp'
+        ]
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     SOURCES += [
         'jit/ExecutableAllocatorWin.cpp',
     ]
     # _CRT_RAND_S must be #defined before #including stdlib.h to get rand_s()
     DEFINES['_CRT_RAND_S'] = True
 else: