js/src/jit/IonFrames-inl.h

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     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_IonFrames_inl_h
     8 #define jit_IonFrames_inl_h
    10 #ifdef JS_ION
    12 #include "jit/IonFrames.h"
    14 #include "jit/JitFrameIterator.h"
    15 #include "jit/LIR.h"
    16 #include "vm/ForkJoin.h"
    18 #include "jit/JitFrameIterator-inl.h"
    20 namespace js {
    21 namespace jit {
    23 inline void
    24 SafepointIndex::resolve()
    25 {
    26     JS_ASSERT(!resolved);
    27     safepointOffset_ = safepoint_->offset();
    28 #ifdef DEBUG
    29     resolved = true;
    30 #endif
    31 }
    33 inline uint8_t *
    34 JitFrameIterator::returnAddress() const
    35 {
    36     IonCommonFrameLayout *current = (IonCommonFrameLayout *) current_;
    37     return current->returnAddress();
    38 }
    40 inline size_t
    41 JitFrameIterator::prevFrameLocalSize() const
    42 {
    43     IonCommonFrameLayout *current = (IonCommonFrameLayout *) current_;
    44     return current->prevFrameLocalSize();
    45 }
    47 inline FrameType
    48 JitFrameIterator::prevType() const
    49 {
    50     IonCommonFrameLayout *current = (IonCommonFrameLayout *) current_;
    51     return current->prevType();
    52 }
    54 inline bool
    55 JitFrameIterator::isFakeExitFrame() const
    56 {
    57     bool res = (prevType() == JitFrame_Unwound_Rectifier ||
    58                 prevType() == JitFrame_Unwound_IonJS ||
    59                 prevType() == JitFrame_Unwound_BaselineStub ||
    60                 (prevType() == JitFrame_Entry && type() == JitFrame_Exit));
    61     JS_ASSERT_IF(res, type() == JitFrame_Exit || type() == JitFrame_BaselineJS);
    62     return res;
    63 }
    65 inline IonExitFrameLayout *
    66 JitFrameIterator::exitFrame() const
    67 {
    68     JS_ASSERT(type() == JitFrame_Exit);
    69     JS_ASSERT(!isFakeExitFrame());
    70     return (IonExitFrameLayout *) fp();
    71 }
    73 inline BaselineFrame *
    74 GetTopBaselineFrame(JSContext *cx)
    75 {
    76     JitFrameIterator iter(cx);
    77     JS_ASSERT(iter.type() == JitFrame_Exit);
    78     ++iter;
    79     if (iter.isBaselineStub())
    80         ++iter;
    81     JS_ASSERT(iter.isBaselineJS());
    82     return iter.baselineFrame();
    83 }
    85 inline JSScript *
    86 GetTopIonJSScript(JSContext *cx, void **returnAddrOut = nullptr)
    87 {
    88     return GetTopIonJSScript(cx->mainThread().ionTop, returnAddrOut, SequentialExecution);
    89 }
    91 inline JSScript *
    92 GetTopIonJSScript(ForkJoinContext *cx, void **returnAddrOut = nullptr)
    93 {
    94     return GetTopIonJSScript(cx->perThreadData->ionTop, returnAddrOut, ParallelExecution);
    95 }
    97 } // namespace jit
    98 } // namespace js
   100 #endif // JS_ION
   102 #endif /* jit_IonFrames_inl_h */

mercurial