Windows opt build warning fixes. No bug, r=njn on the jsopcode code removal, r=lumpy on the rest
authorJeff Walden <jwalden@mit.edu>
Tue, 02 Oct 2012 09:32:29 -0700
changeset 109019 6b900e03eb58a0c9b26d889dfd6692f436ee2e59
parent 109018 02f0c3cf55754a5ed530e42fbfbe98c1ef5b3bb4
child 109020 c0ef7fe877d2b76c482fa838b281570357aa5b2c
push id82
push usershu@rfrn.org
push dateFri, 05 Oct 2012 13:20:22 +0000
reviewersnjn, lumpy
milestone18.0a1
Windows opt build warning fixes. No bug, r=njn on the jsopcode code removal, r=lumpy on the rest
js/src/ion/CodeGenerator.cpp
js/src/ion/IonBuilder.cpp
js/src/ion/Lowering.cpp
js/src/ion/Snapshots.cpp
js/src/ion/x86/Assembler-x86.h
js/src/ion/x86/MacroAssembler-x86.cpp
js/src/ion/x86/Trampoline-x86.cpp
js/src/jsopcode.cpp
js/src/jsreflect.cpp
js/src/jsworkers.h
js/src/methodjit/MonoIC.cpp
--- a/js/src/ion/CodeGenerator.cpp
+++ b/js/src/ion/CodeGenerator.cpp
@@ -3985,17 +3985,17 @@ CodeGenerator::visitGetDOMProperty(LGetD
     const Register PrivateReg = ToRegister(ins->getPrivReg());
     const Register ValueReg = ToRegister(ins->getValueReg());
 
     DebugOnly<uint32> initialStack = masm.framePushed();
 
     masm.checkStackAlignment();
 
     /* Make Space for the outparam */
-    masm.adjustStack((int)-sizeof(Value));
+    masm.adjustStack(-int32_t(sizeof(Value)));
     masm.movePtr(StackPointer, ValueReg);
 
     masm.Push(ObjectReg);
 
     // GetReservedSlot(obj, DOM_PROTO_INSTANCE_CLASS_SLOT).toPrivate()
     masm.loadPrivate(Address(ObjectReg, JSObject::getFixedSlotOffset(0)), PrivateReg);
 
     // Rooting will happen at GC time.
--- a/js/src/ion/IonBuilder.cpp
+++ b/js/src/ion/IonBuilder.cpp
@@ -740,17 +740,17 @@ IonBuilder::snoopControlFlow(JSOp op)
     return ControlStatus_None;
 }
 
 void
 IonBuilder::markPhiBytecodeUses(jsbytecode *pc)
 {
     unsigned nuses = analyze::GetUseCount(script_, pc - script_->code);
     for (unsigned i = 0; i < nuses; i++) {
-        MDefinition *def = current->peek(-(i + 1));
+        MDefinition *def = current->peek(-int32_t(i + 1));
         if (def->isPassArg())
             def = def->toPassArg()->getArgument();
         if (def->isPhi())
             def->toPhi()->setHasBytecodeUses();
     }
 }
 
 bool
--- a/js/src/ion/Lowering.cpp
+++ b/js/src/ion/Lowering.cpp
@@ -50,17 +50,17 @@ LIRGenerator::visitParameter(MParameter 
 
 bool
 LIRGenerator::visitCallee(MCallee *callee)
 {
     LCallee *ins = new LCallee;
     if (!define(ins, callee, LDefinition::PRESET))
         return false;
 
-    ins->getDef(0)->setOutput(LArgument(-sizeof(IonJSFrameLayout)
+    ins->getDef(0)->setOutput(LArgument(-int32_t(sizeof(IonJSFrameLayout))
                                         + IonJSFrameLayout::offsetOfCalleeToken()));
 
     return true;
 }
 
 bool
 LIRGenerator::visitGoto(MGoto *ins)
 {
--- a/js/src/ion/Snapshots.cpp
+++ b/js/src/ion/Snapshots.cpp
@@ -13,16 +13,18 @@
 #include "SnapshotReader.h"
 #include "SnapshotWriter.h"
 
 #ifdef TRACK_SNAPSHOTS
 #include "MIR.h"
 #include "LIR.h"
 #endif
 
+#include "jsscriptinlines.h"
+
 using namespace js;
 using namespace js::ion;
 
 // Snapshot header:
 //
 //   [vwu] bits (n-31]: frame count
 //         bits [0,n):  bailout kind (n = BAILOUT_KIND_BITS)
 //
--- a/js/src/ion/x86/Assembler-x86.h
+++ b/js/src/ion/x86/Assembler-x86.h
@@ -8,16 +8,18 @@
 #ifndef jsion_cpu_x86_assembler_h__
 #define jsion_cpu_x86_assembler_h__
 
 #include "ion/shared/Assembler-shared.h"
 #include "assembler/assembler/X86Assembler.h"
 #include "ion/CompactBuffer.h"
 #include "ion/IonCode.h"
 
+#include "jsscriptinlines.h"
+
 namespace js {
 namespace ion {
 
 static const Register eax = { JSC::X86Registers::eax };
 static const Register ecx = { JSC::X86Registers::ecx };
 static const Register edx = { JSC::X86Registers::edx };
 static const Register ebx = { JSC::X86Registers::ebx };
 static const Register esp = { JSC::X86Registers::esp };
--- a/js/src/ion/x86/MacroAssembler-x86.cpp
+++ b/js/src/ion/x86/MacroAssembler-x86.cpp
@@ -4,16 +4,18 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "MacroAssembler-x86.h"
 #include "ion/MoveEmitter.h"
 #include "ion/IonFrames.h"
 
+#include "jsscriptinlines.h"
+
 using namespace js;
 using namespace js::ion;
 
 void
 MacroAssemblerX86::setupABICall(uint32 args)
 {
     JS_ASSERT(!inCall_);
     inCall_ = true;
--- a/js/src/ion/x86/Trampoline-x86.cpp
+++ b/js/src/ion/x86/Trampoline-x86.cpp
@@ -9,16 +9,18 @@
 #include "assembler/assembler/MacroAssembler.h"
 #include "ion/IonCompartment.h"
 #include "ion/IonLinker.h"
 #include "ion/IonFrames.h"
 #include "ion/IonSpewer.h"
 #include "ion/Bailouts.h"
 #include "ion/VMFunctions.h"
 
+#include "jsscriptinlines.h"
+
 using namespace js;
 using namespace js::ion;
 
 enum EnterJitEbpArgumentOffset {
     ARG_JITCODE     = 2 * sizeof(void *),
     ARG_ARGC        = 3 * sizeof(void *),
     ARG_ARGV        = 4 * sizeof(void *),
     ARG_STACKFRAME  = 5 * sizeof(void *),
@@ -287,17 +289,17 @@ IonCompartment::generateArgumentsRectifi
 
     // Remove the rectifier frame.
     masm.pop(ebx);            // ebx <- descriptor with FrameType.
     masm.shrl(Imm32(FRAMESIZE_SHIFT), ebx); // ebx <- descriptor.
     masm.pop(edi);            // Discard calleeToken.
     masm.pop(edi);            // Discard number of actual arguments.
 
     // Discard pushed arguments, but not the pushed frame pointer.
-    BaseIndex unwind = BaseIndex(esp, ebx, TimesOne, -sizeof(void*));
+    BaseIndex unwind = BaseIndex(esp, ebx, TimesOne, -int32_t(sizeof(void*)));
     masm.lea(Operand(unwind), esp);
 
     masm.pop(FramePointer);
     masm.ret();
 
     Linker linker(masm);
     return linker.newCode(cx);
 }
--- a/js/src/jsopcode.cpp
+++ b/js/src/jsopcode.cpp
@@ -5635,30 +5635,19 @@ js_DecompileFunction(JSPrinter *jp)
         jsbytecode *defbegin = NULL;
         int32_t deflen = 0;
         uint16_t defstart = 0;
         unsigned nformal = fun->nargs - fun->hasRest();
 
         if (fun->hasDefaults()) {
             // Since bug 781422, this code is completely wrong. If you ever have
             // the unenviable task of reenabling the decompiler, you'll have to
-            // completely rewrite defaults decompiling.
+            // completely rewrite defaults decompiling.  The previous code for
+            // this is available in version control, if you need inspiration.
             MOZ_CRASH();
-
-            jsbytecode *defpc;
-            LOCAL_ASSERT_RV(defpc < endpc, JS_FALSE);
-            defpc += GetBytecodeLength(defpc);
-            LOCAL_ASSERT_RV(*defpc == JSOP_TABLESWITCH, JS_FALSE);
-            defbegin = defpc;
-            deflen = GET_JUMP_OFFSET(defpc);
-            defpc += JUMP_OFFSET_LEN;
-            defstart = GET_JUMP_OFFSET(defpc);
-            defpc += JUMP_OFFSET_LEN;
-            defpc += JUMP_OFFSET_LEN; // Skip high
-            deftable = defpc;
         }
 
         for (unsigned i = 0; i < fun->nargs; i++) {
             if (i > 0)
                 js_puts(jp, ", ");
 
             bool isRest = fun->hasRest() && i == unsigned(fun->nargs) - 1;
             if (isRest)
--- a/js/src/jsreflect.cpp
+++ b/js/src/jsreflect.cpp
@@ -140,19 +140,21 @@ class NodeBuilder
     RootedValue srcval;                /* source filename JS value or null      */
     Value       callbacks[AST_LIMIT];  /* user-specified callbacks              */
     AutoValueArray callbacksRoots;     /* for rooting |callbacks|               */
     RootedValue userv;                 /* user-specified builder object or null */
     RootedValue undefinedVal;          /* a rooted undefined val, used by opt() */
 
   public:
     NodeBuilder(JSContext *c, bool l, char const *s)
-        : cx(c), saveLoc(l), src(s), srcval(c), callbacks(),
+        : cx(c), saveLoc(l), src(s), srcval(c),
           callbacksRoots(c, callbacks, AST_LIMIT), userv(c), undefinedVal(c, UndefinedValue())
-    { }
+    {
+        MakeRangeGCSafe(callbacks, mozilla::ArrayLength(callbacks));
+    }
 
     bool init(HandleObject userobj = NullPtr()) {
         if (src) {
             if (!atomValue(src, &srcval))
                 return false;
         } else {
             srcval.setNull();
         }
--- a/js/src/jsworkers.h
+++ b/js/src/jsworkers.h
@@ -23,18 +23,19 @@ namespace ion {
 }
 
 #if defined(JS_THREADSAFE) && defined(JS_ION)
 # define JS_PARALLEL_COMPILATION
 
 struct WorkerThread;
 
 /* Per-runtime state for off thread work items. */
-struct WorkerThreadState
+class WorkerThreadState
 {
+  public:
     /* Available threads. */
     WorkerThread *threads;
     size_t numThreads;
 
     enum CondVar {
         MAIN,
         WORKER
     };
--- a/js/src/methodjit/MonoIC.cpp
+++ b/js/src/methodjit/MonoIC.cpp
@@ -683,20 +683,20 @@ class CallCompiler : public BaseCompiler
         size_t spOffset = sizeof(StackFrame) +
                           ic.frameSize.staticLocalSlots() * sizeof(Value);
         masm.addPtr(Imm32(spOffset), JSFrameReg, t0);
 
         /* Copy all remaining arguments. */
         for (size_t i = 0; i < argc + 1; i++) {
             /* Copy the argument onto the native stack. */
 #ifdef JS_NUNBOX32
-            masm.push(Address(t0, -((i + 1) * sizeof(Value)) + 4));
-            masm.push(Address(t0, -((i + 1) * sizeof(Value))));
+            masm.push(Address(t0, -int32_t((i + 1) * sizeof(Value)) + 4));
+            masm.push(Address(t0, -int32_t((i + 1) * sizeof(Value))));
 #elif defined JS_PUNBOX64
-            masm.push(Address(t0, -((i + 1) * sizeof(Value))));
+            masm.push(Address(t0, -int32_t((i + 1) * sizeof(Value))));
 #endif
         }
 
         /* Push argc and calleeToken. */
         masm.push(Imm32(argc));
         masm.push(funObjReg);
 
         /* Make and push a frame descriptor. */