Bug 739512: Patch 11: change JSScript::useCount to uint32_t. r=dvander.
authorNicholas Nethercote <nnethercote@mozilla.com>
Wed, 11 Apr 2012 16:37:57 -0700
changeset 93316 390dc1d722ab55ddc633cef232822a7f156778ac
parent 93315 86d28b6fa4fc7c4d153cc4bd22362970b9e4e059
child 93317 d4796c874d6ac25c7d55b0d862baf3b79f926032
push id9068
push usernnethercote@mozilla.com
push dateSun, 06 May 2012 23:16:24 +0000
treeherdermozilla-inbound@390dc1d722ab [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdvander
bugs739512
milestone15.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 739512: Patch 11: change JSScript::useCount to uint32_t. r=dvander.
js/src/jsscript.h
js/src/methodjit/Compiler.cpp
--- a/js/src/jsscript.h
+++ b/js/src/jsscript.h
@@ -458,32 +458,33 @@ struct JSScript : public js::gc::Cell
 #ifdef JS_METHODJIT
     JITScriptHandle jitHandleNormal; // extra JIT info for normal scripts
     JITScriptHandle jitHandleCtor;   // extra JIT info for constructors
 #endif
 
   private:
     js::HeapPtrFunction function_;
 
-    size_t          useCount;   /* Number of times the script has been called
-                                 * or has had backedges taken. Reset if the
-                                 * script's JIT code is forcibly discarded. */
-
     // 32-bit fields.
 
   public:
     uint32_t        length;     /* length of code vector */
 
     uint32_t        lineno;     /* base line number of script */
 
     uint32_t        mainOffset; /* offset of main entry point from code, after
                                    predef'ing prolog */
 
     uint32_t        natoms;     /* length of atoms array */
 
+  private:
+    uint32_t        useCount;   /* Number of times the script has been called
+                                 * or has had backedges taken. Reset if the
+                                 * script's JIT code is forcibly discarded. */
+
 #ifdef DEBUG
     // Unique identifier within the compartment for this script, used for
     // printing analysis information.
     uint32_t        id_;
   private:
     uint32_t        idpad;
 #endif
 
@@ -696,19 +697,19 @@ struct JSScript : public js::gc::Cell
     }
 
     static void ReleaseCode(js::FreeOp *fop, JITScriptHandle *jith);
 
     // These methods are implemented in MethodJIT.h.
     inline void **nativeMap(bool constructing);
     inline void *nativeCodeForPC(bool constructing, jsbytecode *pc);
 
-    size_t getUseCount() const  { return useCount; }
-    size_t incUseCount() { return ++useCount; }
-    size_t *addressOfUseCount() { return &useCount; }
+    uint32_t getUseCount() const  { return useCount; }
+    uint32_t incUseCount() { return ++useCount; }
+    uint32_t *addressOfUseCount() { return &useCount; }
     void resetUseCount() { useCount = 0; }
 
     /*
      * Size of the JITScript and all sections.  If |mallocSizeOf| is NULL, the
      * size is computed analytically.  (This method is implemented in
      * MethodJIT.cpp.)
      */
     size_t sizeOfJitScripts(JSMallocSizeOfFun mallocSizeOf);
--- a/js/src/methodjit/Compiler.cpp
+++ b/js/src/methodjit/Compiler.cpp
@@ -3885,17 +3885,17 @@ mjit::Compiler::interruptCheckHelper()
 void
 mjit::Compiler::recompileCheckHelper()
 {
     if (inlining() || debugMode() || !globalObj ||
         !analysis->hasFunctionCalls() || !cx->typeInferenceEnabled()) {
         return;
     }
 
-    size_t *addr = script->addressOfUseCount();
+    uint32_t *addr = script->addressOfUseCount();
     masm.add32(Imm32(1), AbsoluteAddress(addr));
 #if defined(JS_CPU_X86) || defined(JS_CPU_ARM)
     Jump jump = masm.branch32(Assembler::GreaterThanOrEqual, AbsoluteAddress(addr),
                               Imm32(USES_BEFORE_INLINING));
 #else
     /* Handle processors that can't load from absolute addresses. */
     RegisterID reg = frame.allocReg();
     masm.move(ImmPtr(addr), reg);