js/src/jit/mips/Bailouts-mips.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit/mips/Bailouts-mips.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,77 @@
     1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
     1.5 + * vim: set ts=8 sts=4 et sw=4 tw=99:
     1.6 + * This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#ifndef jit_mips_Bailouts_mips_h
    1.11 +#define jit_mips_Bailouts_mips_h
    1.12 +
    1.13 +#include "jit/Bailouts.h"
    1.14 +#include "jit/JitCompartment.h"
    1.15 +
    1.16 +namespace js {
    1.17 +namespace jit {
    1.18 +
    1.19 +class BailoutStack
    1.20 +{
    1.21 +    uintptr_t frameClassId_;
    1.22 +    // This is pushed in the bailout handler.  Both entry points into the
    1.23 +    // handler inserts their own value int lr, which is then placed onto the
    1.24 +    // stack along with frameClassId_ above.  This should be migrated to ip.
    1.25 +  public:
    1.26 +    union {
    1.27 +        uintptr_t frameSize_;
    1.28 +        uintptr_t tableOffset_;
    1.29 +    };
    1.30 +
    1.31 +  protected:
    1.32 +    mozilla::Array<double, FloatRegisters::Total> fpregs_;
    1.33 +    mozilla::Array<uintptr_t, Registers::Total> regs_;
    1.34 +
    1.35 +    uintptr_t snapshotOffset_;
    1.36 +    uintptr_t padding_;
    1.37 +
    1.38 +  public:
    1.39 +    FrameSizeClass frameClass() const {
    1.40 +        return FrameSizeClass::FromClass(frameClassId_);
    1.41 +    }
    1.42 +    uintptr_t tableOffset() const {
    1.43 +        MOZ_ASSERT(frameClass() != FrameSizeClass::None());
    1.44 +        return tableOffset_;
    1.45 +    }
    1.46 +    uint32_t frameSize() const {
    1.47 +        if (frameClass() == FrameSizeClass::None())
    1.48 +            return frameSize_;
    1.49 +        return frameClass().frameSize();
    1.50 +    }
    1.51 +    MachineState machine() {
    1.52 +        return MachineState::FromBailout(regs_, fpregs_);
    1.53 +    }
    1.54 +    SnapshotOffset snapshotOffset() const {
    1.55 +        MOZ_ASSERT(frameClass() == FrameSizeClass::None());
    1.56 +        return snapshotOffset_;
    1.57 +    }
    1.58 +    uint8_t *parentStackPointer() const {
    1.59 +        if (frameClass() == FrameSizeClass::None())
    1.60 +            return (uint8_t *)this + sizeof(BailoutStack);
    1.61 +        return (uint8_t *)this + offsetof(BailoutStack, snapshotOffset_);
    1.62 +    }
    1.63 +    static size_t offsetOfFrameClass() {
    1.64 +        return offsetof(BailoutStack, frameClassId_);
    1.65 +    }
    1.66 +    static size_t offsetOfFrameSize() {
    1.67 +        return offsetof(BailoutStack, frameSize_);
    1.68 +    }
    1.69 +    static size_t offsetOfFpRegs() {
    1.70 +        return offsetof(BailoutStack, fpregs_);
    1.71 +    }
    1.72 +    static size_t offsetOfRegs() {
    1.73 +        return offsetof(BailoutStack, regs_);
    1.74 +    }
    1.75 +};
    1.76 +
    1.77 +} // namespace jit
    1.78 +} // namespace js
    1.79 +
    1.80 +#endif /* jit_mips_Bailouts_mips_h */

mercurial