Sat, 03 Jan 2015 20:18:00 +0100
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.
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_Safepoints_h |
michael@0 | 8 | #define jit_Safepoints_h |
michael@0 | 9 | |
michael@0 | 10 | #include "jit/CompactBuffer.h" |
michael@0 | 11 | #include "jit/shared/Assembler-shared.h" |
michael@0 | 12 | |
michael@0 | 13 | namespace js { |
michael@0 | 14 | namespace jit { |
michael@0 | 15 | |
michael@0 | 16 | class BitSet; |
michael@0 | 17 | struct SafepointNunboxEntry; |
michael@0 | 18 | class LAllocation; |
michael@0 | 19 | class LSafepoint; |
michael@0 | 20 | |
michael@0 | 21 | static const uint32_t INVALID_SAFEPOINT_OFFSET = uint32_t(-1); |
michael@0 | 22 | |
michael@0 | 23 | class SafepointWriter |
michael@0 | 24 | { |
michael@0 | 25 | CompactBufferWriter stream_; |
michael@0 | 26 | BitSet *frameSlots_; |
michael@0 | 27 | |
michael@0 | 28 | public: |
michael@0 | 29 | bool init(TempAllocator &alloc, uint32_t slotCount); |
michael@0 | 30 | |
michael@0 | 31 | private: |
michael@0 | 32 | // A safepoint entry is written in the order these functions appear. |
michael@0 | 33 | uint32_t startEntry(); |
michael@0 | 34 | |
michael@0 | 35 | void writeOsiCallPointOffset(uint32_t osiPointOffset); |
michael@0 | 36 | void writeGcRegs(LSafepoint *safepoint); |
michael@0 | 37 | void writeGcSlots(LSafepoint *safepoint); |
michael@0 | 38 | void writeValueSlots(LSafepoint *safepoint); |
michael@0 | 39 | |
michael@0 | 40 | void writeSlotsOrElementsSlots(LSafepoint *safepoint); |
michael@0 | 41 | |
michael@0 | 42 | #ifdef JS_NUNBOX32 |
michael@0 | 43 | void writeNunboxParts(LSafepoint *safepoint); |
michael@0 | 44 | #endif |
michael@0 | 45 | |
michael@0 | 46 | void endEntry(); |
michael@0 | 47 | |
michael@0 | 48 | public: |
michael@0 | 49 | void encode(LSafepoint *safepoint); |
michael@0 | 50 | |
michael@0 | 51 | size_t size() const { |
michael@0 | 52 | return stream_.length(); |
michael@0 | 53 | } |
michael@0 | 54 | const uint8_t *buffer() const { |
michael@0 | 55 | return stream_.buffer(); |
michael@0 | 56 | } |
michael@0 | 57 | }; |
michael@0 | 58 | |
michael@0 | 59 | class SafepointReader |
michael@0 | 60 | { |
michael@0 | 61 | CompactBufferReader stream_; |
michael@0 | 62 | uint32_t frameSlots_; |
michael@0 | 63 | uint32_t currentSlotChunk_; |
michael@0 | 64 | uint32_t nextSlotChunkNumber_; |
michael@0 | 65 | uint32_t osiCallPointOffset_; |
michael@0 | 66 | GeneralRegisterSet gcSpills_; |
michael@0 | 67 | GeneralRegisterSet valueSpills_; |
michael@0 | 68 | GeneralRegisterSet slotsOrElementsSpills_; |
michael@0 | 69 | GeneralRegisterSet allGprSpills_; |
michael@0 | 70 | FloatRegisterSet allFloatSpills_; |
michael@0 | 71 | uint32_t nunboxSlotsRemaining_; |
michael@0 | 72 | uint32_t slotsOrElementsSlotsRemaining_; |
michael@0 | 73 | |
michael@0 | 74 | private: |
michael@0 | 75 | void advanceFromGcRegs(); |
michael@0 | 76 | void advanceFromGcSlots(); |
michael@0 | 77 | void advanceFromValueSlots(); |
michael@0 | 78 | void advanceFromNunboxSlots(); |
michael@0 | 79 | bool getSlotFromBitmap(uint32_t *slot); |
michael@0 | 80 | |
michael@0 | 81 | public: |
michael@0 | 82 | SafepointReader(IonScript *script, const SafepointIndex *si); |
michael@0 | 83 | |
michael@0 | 84 | static CodeLocationLabel InvalidationPatchPoint(IonScript *script, const SafepointIndex *si); |
michael@0 | 85 | |
michael@0 | 86 | uint32_t osiCallPointOffset() const { |
michael@0 | 87 | return osiCallPointOffset_; |
michael@0 | 88 | } |
michael@0 | 89 | GeneralRegisterSet gcSpills() const { |
michael@0 | 90 | return gcSpills_; |
michael@0 | 91 | } |
michael@0 | 92 | GeneralRegisterSet slotsOrElementsSpills() const { |
michael@0 | 93 | return slotsOrElementsSpills_; |
michael@0 | 94 | } |
michael@0 | 95 | GeneralRegisterSet valueSpills() const { |
michael@0 | 96 | return valueSpills_; |
michael@0 | 97 | } |
michael@0 | 98 | GeneralRegisterSet allGprSpills() const { |
michael@0 | 99 | return allGprSpills_; |
michael@0 | 100 | } |
michael@0 | 101 | FloatRegisterSet allFloatSpills() const { |
michael@0 | 102 | return allFloatSpills_; |
michael@0 | 103 | } |
michael@0 | 104 | uint32_t osiReturnPointOffset() const; |
michael@0 | 105 | |
michael@0 | 106 | // Returns true if a slot was read, false if there are no more slots. |
michael@0 | 107 | bool getGcSlot(uint32_t *slot); |
michael@0 | 108 | |
michael@0 | 109 | // Returns true if a slot was read, false if there are no more value slots. |
michael@0 | 110 | bool getValueSlot(uint32_t *slot); |
michael@0 | 111 | |
michael@0 | 112 | // Returns true if a nunbox slot was read, false if there are no more |
michael@0 | 113 | // nunbox slots. |
michael@0 | 114 | bool getNunboxSlot(LAllocation *type, LAllocation *payload); |
michael@0 | 115 | |
michael@0 | 116 | // Returns true if a slot was read, false if there are no more slots. |
michael@0 | 117 | bool getSlotsOrElementsSlot(uint32_t *slot); |
michael@0 | 118 | }; |
michael@0 | 119 | |
michael@0 | 120 | } // namespace jit |
michael@0 | 121 | } // namespace js |
michael@0 | 122 | |
michael@0 | 123 | #endif /* jit_Safepoints_h */ |