[JAEGER] x64 tracejit integration. b=585174, r=dvander.
authorSean Stangl <sstangl@mozilla.com>
Tue, 10 Aug 2010 15:28:11 -0700
changeset 53372 fc549b24a1af3f63e70ed1108dbc29a4a734aa89
parent 53371 134c55bb21f6b10e129f07d5af126e79eed7331e
child 53373 dd17dd68ecf4a8423bbe45c1d727d4a81833b7aa
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)
reviewersdvander
bugs585174
milestone2.0b4pre
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
[JAEGER] x64 tracejit integration. b=585174, r=dvander. Trips asserts in nanojit when running trace-tests.
js/src/configure.in
js/src/methodjit/MethodJIT.cpp
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -2577,17 +2577,17 @@ i?86-*)
     NANOJIT_ARCH=i386
     ENABLE_METHODJIT=1
     ENABLE_MONOIC=1
     ENABLE_POLYIC=1
     AC_DEFINE(JS_CPU_X86)
     AC_DEFINE(JS_NUNBOX32)
     ;;
 x86_64*-*)
-dnl    ENABLE_TRACEJIT=1
+    ENABLE_TRACEJIT=1
     NANOJIT_ARCH=X64
     ENABLE_METHODJIT=1
     ENABLE_MONOIC=1
     ENABLE_POLYIC=1
     AC_DEFINE(JS_CPU_X64)
     AC_DEFINE(JS_PUNBOX64)
     ;;
 arm*-*)
--- a/js/src/methodjit/MethodJIT.cpp
+++ b/js/src/methodjit/MethodJIT.cpp
@@ -197,23 +197,38 @@ SYMBOL_STRING(JaegerThrowpoline) ":"    
     "popq %r14"                             "\n"
     "popq %r13"                             "\n"
     "popq %r12"                             "\n"
     "popq %rbp"                             "\n"
     "xorq %rax,%rax"                        "\n"
     "ret"                                   "\n"
 );
 
+JS_STATIC_ASSERT(offsetof(JSStackFrame, rval) == 0x40);
+JS_STATIC_ASSERT(offsetof(JSStackFrame, ncode) == 0x60);
+JS_STATIC_ASSERT(offsetof(VMFrame, fp) == 0x40);
+
+JS_STATIC_ASSERT(JSVAL_TAG_MASK == 0xFFFF800000000000LL);
+JS_STATIC_ASSERT(JSVAL_PAYLOAD_MASK == 0x00007FFFFFFFFFFFLL);
+
 asm volatile (
 ".text\n"
 ".globl " SYMBOL_STRING(JaegerFromTracer)   "\n"
 SYMBOL_STRING(JaegerFromTracer) ":"         "\n"
-    /* Restore fp reg. */
-    "movq 0x40(%rsp), %rbx"                 "\n"
-    "jmp *%rax"                             "\n"
+    "movq 0x40(%rbx), %rcx"                 "\n" /* fp->rval type (as value) */
+    "movq $0xFFFF800000000000, %r11"         "\n" /* load type mask (JSVAL_TAG_MASK) */
+    "andq %r11, %rcx"                       "\n" /* extract type */
+
+    "movq 0x40(%rbx), %rdx"                 "\n" /* fp->rval type */
+    "movq $0x00007FFFFFFFFFFF, %r11"        "\n" /* load payload mask (JSVAL_PAYLOAD_MASK) */
+    "andq %r11, %rdx"                       "\n" /* extract payload */
+
+    "movq 0x60(%rbx), %rax"                 "\n" /* fp->ncode */
+    "movq 0x40(%rsp), %rbx"                 "\n" /* f.fp */
+    "ret"                                   "\n"
 );
 
 # elif defined(JS_CPU_X86)
 
 /*
  *    *** DANGER ***
  * If these assertions break, update the constants below. The throwpoline
  * should have the offset of savedEBX plus 4, because it needs to clean