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

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
     2  * vim: set ts=8 sts=4 et sw=4 tw=99:
     3  * This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 #ifndef jit_mips_Bailouts_mips_h
     8 #define jit_mips_Bailouts_mips_h
    10 #include "jit/Bailouts.h"
    11 #include "jit/JitCompartment.h"
    13 namespace js {
    14 namespace jit {
    16 class BailoutStack
    17 {
    18     uintptr_t frameClassId_;
    19     // This is pushed in the bailout handler.  Both entry points into the
    20     // handler inserts their own value int lr, which is then placed onto the
    21     // stack along with frameClassId_ above.  This should be migrated to ip.
    22   public:
    23     union {
    24         uintptr_t frameSize_;
    25         uintptr_t tableOffset_;
    26     };
    28   protected:
    29     mozilla::Array<double, FloatRegisters::Total> fpregs_;
    30     mozilla::Array<uintptr_t, Registers::Total> regs_;
    32     uintptr_t snapshotOffset_;
    33     uintptr_t padding_;
    35   public:
    36     FrameSizeClass frameClass() const {
    37         return FrameSizeClass::FromClass(frameClassId_);
    38     }
    39     uintptr_t tableOffset() const {
    40         MOZ_ASSERT(frameClass() != FrameSizeClass::None());
    41         return tableOffset_;
    42     }
    43     uint32_t frameSize() const {
    44         if (frameClass() == FrameSizeClass::None())
    45             return frameSize_;
    46         return frameClass().frameSize();
    47     }
    48     MachineState machine() {
    49         return MachineState::FromBailout(regs_, fpregs_);
    50     }
    51     SnapshotOffset snapshotOffset() const {
    52         MOZ_ASSERT(frameClass() == FrameSizeClass::None());
    53         return snapshotOffset_;
    54     }
    55     uint8_t *parentStackPointer() const {
    56         if (frameClass() == FrameSizeClass::None())
    57             return (uint8_t *)this + sizeof(BailoutStack);
    58         return (uint8_t *)this + offsetof(BailoutStack, snapshotOffset_);
    59     }
    60     static size_t offsetOfFrameClass() {
    61         return offsetof(BailoutStack, frameClassId_);
    62     }
    63     static size_t offsetOfFrameSize() {
    64         return offsetof(BailoutStack, frameSize_);
    65     }
    66     static size_t offsetOfFpRegs() {
    67         return offsetof(BailoutStack, fpregs_);
    68     }
    69     static size_t offsetOfRegs() {
    70         return offsetof(BailoutStack, regs_);
    71     }
    72 };
    74 } // namespace jit
    75 } // namespace js
    77 #endif /* jit_mips_Bailouts_mips_h */

mercurial