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.

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

mercurial