js/src/jit/x64/Bailouts-x64.cpp

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.

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 #include "jit/Bailouts.h"
michael@0 8
michael@0 9 using namespace js;
michael@0 10 using namespace js::jit;
michael@0 11
michael@0 12 #if defined(_WIN32)
michael@0 13 # pragma pack(push, 1)
michael@0 14 #endif
michael@0 15
michael@0 16 namespace js {
michael@0 17 namespace jit {
michael@0 18
michael@0 19 class BailoutStack
michael@0 20 {
michael@0 21 mozilla::Array<double, FloatRegisters::Total> fpregs_;
michael@0 22 mozilla::Array<uintptr_t, Registers::Total> regs_;
michael@0 23 uintptr_t frameSize_;
michael@0 24 uintptr_t snapshotOffset_;
michael@0 25
michael@0 26 public:
michael@0 27 MachineState machineState() {
michael@0 28 return MachineState::FromBailout(regs_, fpregs_);
michael@0 29 }
michael@0 30 uint32_t snapshotOffset() const {
michael@0 31 return snapshotOffset_;
michael@0 32 }
michael@0 33 uint32_t frameSize() const {
michael@0 34 return frameSize_;
michael@0 35 }
michael@0 36 uint8_t *parentStackPointer() {
michael@0 37 return (uint8_t *)this + sizeof(BailoutStack);
michael@0 38 }
michael@0 39 };
michael@0 40
michael@0 41 } // namespace jit
michael@0 42 } // namespace js
michael@0 43
michael@0 44 #if defined(_WIN32)
michael@0 45 # pragma pack(pop)
michael@0 46 #endif
michael@0 47
michael@0 48 IonBailoutIterator::IonBailoutIterator(const JitActivationIterator &activations,
michael@0 49 BailoutStack *bailout)
michael@0 50 : JitFrameIterator(activations),
michael@0 51 machine_(bailout->machineState())
michael@0 52 {
michael@0 53 uint8_t *sp = bailout->parentStackPointer();
michael@0 54 uint8_t *fp = sp + bailout->frameSize();
michael@0 55
michael@0 56 current_ = fp;
michael@0 57 type_ = JitFrame_IonJS;
michael@0 58 topFrameSize_ = current_ - sp;
michael@0 59 topIonScript_ = script()->ionScript();
michael@0 60 snapshotOffset_ = bailout->snapshotOffset();
michael@0 61 }
michael@0 62
michael@0 63 IonBailoutIterator::IonBailoutIterator(const JitActivationIterator &activations,
michael@0 64 InvalidationBailoutStack *bailout)
michael@0 65 : JitFrameIterator(activations),
michael@0 66 machine_(bailout->machine())
michael@0 67 {
michael@0 68 returnAddressToFp_ = bailout->osiPointReturnAddress();
michael@0 69 topIonScript_ = bailout->ionScript();
michael@0 70 const OsiIndex *osiIndex = topIonScript_->getOsiIndex(returnAddressToFp_);
michael@0 71
michael@0 72 current_ = (uint8_t*) bailout->fp();
michael@0 73 type_ = JitFrame_IonJS;
michael@0 74 topFrameSize_ = current_ - bailout->sp();
michael@0 75 snapshotOffset_ = osiIndex->snapshotOffset();
michael@0 76 }

mercurial