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