Bug 1149510 - Initialize the MachineState with safe-bad pointers. r=jandem, a=lizzard
authorNicolas B. Pierron <nicolas.b.pierron@mozilla.com>
Thu, 02 Apr 2015 23:26:54 +0200
changeset 267056 a5578b2096e47710def4c46fdab638c1603ffb48
parent 267055 8c4d11ea4b58681399ae8657ff94b4baef77409c
child 267057 692922cc239c15a6cb944f03892efb8fe0242ba8
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem, lizzard
bugs1149510
milestone39.0a2
Bug 1149510 - Initialize the MachineState with safe-bad pointers. r=jandem, a=lizzard
js/src/jit/Registers.h
--- a/js/src/jit/Registers.h
+++ b/js/src/jit/Registers.h
@@ -110,16 +110,23 @@ class RegisterDump
 
 // Information needed to recover machine register state.
 class MachineState
 {
     mozilla::Array<Registers::RegisterContent*, Registers::Total> regs_;
     mozilla::Array<FloatRegisters::RegisterContent*, FloatRegisters::Total> fpregs_;
 
   public:
+    MachineState() {
+        for (unsigned i = 0; i < Registers::Total; i++)
+            regs_[i] = reinterpret_cast<Registers::RegisterContent*>(i + 0x100);
+        for (unsigned i = 0; i < FloatRegisters::Total; i++)
+            fpregs_[i] = reinterpret_cast<FloatRegisters::RegisterContent*>(i + 0x200);
+    }
+
     static MachineState FromBailout(RegisterDump::GPRArray& regs, RegisterDump::FPUArray& fpregs);
 
     void setRegisterLocation(Register reg, uintptr_t* up) {
         regs_[reg.code()] = (Registers::RegisterContent*) up;
     }
     void setRegisterLocation(FloatRegister reg, float* fp) {
         MOZ_ASSERT(reg.isSingle());
         fpregs_[reg.code()] = (FloatRegisters::RegisterContent*) fp;