| 1 | /* |
| 2 | * Copyright (C) 2005, 2007, 2008 Apple Inc. All rights reserved. |
| 3 | * |
| 4 | * This library is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU Library General Public |
| 6 | * License as published by the Free Software Foundation; either |
| 7 | * version 2 of the License, or (at your option) any later version. |
| 8 | * |
| 9 | * This library is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 | * Library General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU Library General Public License |
| 15 | * along with this library; see the file COPYING.LIB. If not, write to |
| 16 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 17 | * Boston, MA 02110-1301, USA. |
| 18 | * |
| 19 | */ |
| 20 | |
| 21 | #ifndef PropertySlot_h |
| 22 | #define PropertySlot_hcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/runtime/PropertySlot.h:22:9`! |
| 23 | |
| 24 | #include "Identifier.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Identifier.h`/ |
| 25 | #include "JSValue.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSValue.h`/ |
| 26 | #include "Register.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Register.h`/ |
| 27 | #include <wtf/Assertions.h>cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h`/ |
| 28 | #include <wtf/NotFound.h>cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/wtf/NotFound.h`/ |
| 29 | |
| 30 | namespace JSCcxx . . $ QTJSC/ { |
| 31 | |
| 32 | class ExecStatecxx . . $ QTJSC/ExecState#; |
| 33 | class JSObjectcxx . . $ QTJSC/JSObject#; |
| 34 | |
| 35 | #define JSC_VALUE_SLOT_MARKERcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/runtime/PropertySlot.h:35:9`! 0 |
| 36 | #define JSC_REGISTER_SLOT_MARKERcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/runtime/PropertySlot.h:36:9`! reinterpret_cast<GetValueFunc>(1) |
| 37 | |
| 38 | class PropertySlotcxx . . $ QTJSC/PropertySlot# { |
| 39 | public: |
| 40 | PropertySlotcxx . . $ QTJSC/PropertySlot#PropertySlot(49f6e7a06ebc5aa8).() |
| 41 | { |
| 42 | clearBasecxx . . $ QTJSC/PropertySlot#clearBase(49f6e7a06ebc5aa8).(); |
| 43 | clearOffsetcxx . . $ QTJSC/PropertySlot#clearOffset(49f6e7a06ebc5aa8).(); |
| 44 | clearValuecxx . . $ QTJSC/PropertySlot#clearValue(49f6e7a06ebc5aa8).(); |
| 45 | } |
| 46 | |
| 47 | explicit PropertySlotcxx . . $ QTJSC/PropertySlot#PropertySlot(5c2ac18db087b3e6).(const JSValuecxx . . $ QTJSC/JSValue# base) |
| 48 | : m_slotBasecxx . . $ QTJSC/PropertySlot#m_slotBase.(base) |
| 49 | { |
| 50 | clearOffsetcxx . . $ QTJSC/PropertySlot#clearOffset(49f6e7a06ebc5aa8).(); |
| 51 | clearValuecxx . . $ QTJSC/PropertySlot#clearValue(49f6e7a06ebc5aa8).(); |
| 52 | } |
| 53 | |
| 54 | typedef JSValuecxx . . $ QTJSC/JSValue# (*GetValueFunccxx . . $ QTJSC/PropertySlot#GetValueFunc#)(ExecStatecxx . . $ QTJSC/ExecState#*, const Identifiercxx . . $ QTJSC/Identifier#&, const PropertySlotcxx . . $ QTJSC/PropertySlot#&); |
| 55 | |
| 56 | JSValuecxx . . $ QTJSC/JSValue# getValuecxx . . $ QTJSC/PropertySlot#getValue(ccadc8db5e9d2977).(ExecStatecxx . . $ QTJSC/ExecState#* exec, const Identifiercxx . . $ QTJSC/Identifier#& propertyName) const |
| 57 | { |
| 58 | if (m_getValuecxx . . $ QTJSC/PropertySlot#m_getValue. == JSC_VALUE_SLOT_MARKERcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/runtime/PropertySlot.h:35:9`!) |
| 59 | return *m_datacxx . . $ QTJSC/PropertySlot#m_data..valueSlotcxx . . $ QTJSC/PropertySlot#$anonymous_type_0#valueSlot.; |
| 60 | if (m_getValuecxx . . $ QTJSC/PropertySlot#m_getValue. == JSC_REGISTER_SLOT_MARKERcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/runtime/PropertySlot.h:36:9`!) |
| 61 | return (*m_datacxx . . $ QTJSC/PropertySlot#m_data..registerSlotcxx . . $ QTJSC/PropertySlot#$anonymous_type_0#registerSlot.).jsValuecxx . . $ QTJSC/Register#jsValue(888c053acf364da1).(); |
| 62 | return m_getValuecxx . . $ QTJSC/PropertySlot#m_getValue.(exec, propertyName, *this); |
| 63 | } |
| 64 | |
| 65 | JSValuecxx . . $ QTJSC/JSValue# getValuecxx . . $ QTJSC/PropertySlot#getValue(2d9c2221088d2593).(ExecStatecxx . . $ QTJSC/ExecState#* exec, unsigned propertyName) const |
| 66 | { |
| 67 | if (m_getValuecxx . . $ QTJSC/PropertySlot#m_getValue. == JSC_VALUE_SLOT_MARKERcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/runtime/PropertySlot.h:35:9`!) |
| 68 | return *m_datacxx . . $ QTJSC/PropertySlot#m_data..valueSlotcxx . . $ QTJSC/PropertySlot#$anonymous_type_0#valueSlot.; |
| 69 | if (m_getValuecxx . . $ QTJSC/PropertySlot#m_getValue. == JSC_REGISTER_SLOT_MARKERcxx . . $ QTJSC/PropertySlot#GetValueFunc#) |
| 70 | return (*m_datacxx . . $ QTJSC/PropertySlot#m_data..registerSlotcxx . . $ QTJSC/PropertySlot#$anonymous_type_0#registerSlot.).jsValuecxx . . $ QTJSC/Register#jsValue(888c053acf364da1).(); |
| 71 | return m_getValuecxx . . $ QTJSC/PropertySlot#m_getValue.(exec, Identifiercxx . . $ QTJSC/Identifier#::fromcxx . . $ QTJSC/Identifier#from(d1afedae20629715).(exec, propertyName), *this); |
| 72 | } |
| 73 | |
| 74 | bool isCacheablecxx . . $ QTJSC/PropertySlot#isCacheable(50ce9a9e25b4a850).() const { return m_offsetcxx . . $ QTJSC/PropertySlot#m_offset. != WTFcxx . . $ QTWTF/::notFoundcxx . . $ QTWTF/notFound.; } |
| 75 | size_t cachedOffsetcxx . . $ QTJSC/PropertySlot#cachedOffset(fe4d2d262d4164a8).() const |
| 76 | { |
| 77 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(isCacheable()); |
| 78 | return m_offsetcxx . . $ QTJSC/PropertySlot#m_offset.; |
| 79 | } |
| 80 | |
| 81 | void setValueSlotcxx . . $ QTJSC/PropertySlot#setValueSlot(1b789a609c0b4a9).(JSValuecxx . . $ QTJSC/JSValue#* valueSlot) |
| 82 | { |
| 83 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(valueSlot); |
| 84 | clearBasecxx . . $ QTJSC/PropertySlot#clearBase(49f6e7a06ebc5aa8).(); |
| 85 | clearOffsetcxx . . $ QTJSC/PropertySlot#clearOffset(49f6e7a06ebc5aa8).(); |
| 86 | m_getValuecxx . . $ QTJSC/PropertySlot#m_getValue. = JSC_VALUE_SLOT_MARKERcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/runtime/PropertySlot.h:35:9`!; |
| 87 | m_datacxx . . $ QTJSC/PropertySlot#m_data..valueSlotcxx . . $ QTJSC/PropertySlot#$anonymous_type_0#valueSlot. = valueSlot; |
| 88 | } |
| 89 | |
| 90 | void setValueSlotcxx . . $ QTJSC/PropertySlot#setValueSlot(a9b256ef6187ec1d).(JSValuecxx . . $ QTJSC/JSValue# slotBase, JSValuecxx . . $ QTJSC/JSValue#* valueSlot) |
| 91 | { |
| 92 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(valueSlot); |
| 93 | m_getValuecxx . . $ QTJSC/PropertySlot#m_getValue. = JSC_VALUE_SLOT_MARKERcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/runtime/PropertySlot.h:35:9`!; |
| 94 | m_slotBasecxx . . $ QTJSC/PropertySlot#m_slotBase. =cxx . . $ QTJSC/JSValue#`operator=`(af0e8a528f82a1b5). slotBase; |
| 95 | m_datacxx . . $ QTJSC/PropertySlot#m_data..valueSlotcxx . . $ QTJSC/PropertySlot#$anonymous_type_0#valueSlot. = valueSlot; |
| 96 | } |
| 97 | |
| 98 | void setValueSlotcxx . . $ QTJSC/PropertySlot#setValueSlot(63b98b35532c3673).(JSValuecxx . . $ QTJSC/JSValue# slotBase, JSValuecxx . . $ QTJSC/JSValue#* valueSlot, size_t offset) |
| 99 | { |
| 100 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(valueSlot); |
| 101 | m_getValuecxx . . $ QTJSC/PropertySlot#m_getValue. = JSC_VALUE_SLOT_MARKERcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/runtime/PropertySlot.h:35:9`!; |
| 102 | m_slotBasecxx . . $ QTJSC/PropertySlot#m_slotBase. =cxx . . $ QTJSC/JSValue#`operator=`(af0e8a528f82a1b5). slotBase; |
| 103 | m_datacxx . . $ QTJSC/PropertySlot#m_data..valueSlotcxx . . $ QTJSC/PropertySlot#$anonymous_type_0#valueSlot. = valueSlot; |
| 104 | m_offsetcxx . . $ QTJSC/PropertySlot#m_offset. = offset; |
| 105 | } |
| 106 | |
| 107 | void setValuecxx . . $ QTJSC/PropertySlot#setValue(5c2ac18db087b3e6).(JSValuecxx . . $ QTJSC/JSValue# value) |
| 108 | { |
| 109 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(value); |
| 110 | clearBasecxx . . $ QTJSC/PropertySlot#clearBase(49f6e7a06ebc5aa8).(); |
| 111 | clearOffsetcxx . . $ QTJSC/PropertySlot#clearOffset(49f6e7a06ebc5aa8).(); |
| 112 | m_getValuecxx . . $ QTJSC/PropertySlot#m_getValue. = JSC_VALUE_SLOT_MARKERcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/runtime/PropertySlot.h:35:9`!; |
| 113 | m_valuecxx . . $ QTJSC/PropertySlot#m_value. =cxx . . $ QTJSC/JSValue#`operator=`(af0e8a528f82a1b5). value; |
| 114 | m_datacxx . . $ QTJSC/PropertySlot#m_data..valueSlotcxx . . $ QTJSC/PropertySlot#$anonymous_type_0#valueSlot. = &m_valuecxx . . $ QTJSC/PropertySlot#m_value.; |
| 115 | } |
| 116 | |
| 117 | void setRegisterSlotcxx . . $ QTJSC/PropertySlot#setRegisterSlot(2654b274bd0f5c24).(Registercxx . . $ QTJSC/Register#* registerSlot) |
| 118 | { |
| 119 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(registerSlot); |
| 120 | clearBasecxx . . $ QTJSC/PropertySlot#clearBase(49f6e7a06ebc5aa8).(); |
| 121 | clearOffsetcxx . . $ QTJSC/PropertySlot#clearOffset(49f6e7a06ebc5aa8).(); |
| 122 | m_getValuecxx . . $ QTJSC/PropertySlot#m_getValue. = JSC_REGISTER_SLOT_MARKERcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/runtime/PropertySlot.h:36:9`!; |
| 123 | m_datacxx . . $ QTJSC/PropertySlot#m_data..registerSlotcxx . . $ QTJSC/PropertySlot#$anonymous_type_0#registerSlot. = registerSlot; |
| 124 | } |
| 125 | |
| 126 | void setCustomcxx . . $ QTJSC/PropertySlot#setCustom(201c6ee79e352ec7).(JSValuecxx . . $ QTJSC/JSValue# slotBase, GetValueFunccxx . . $ QTJSC/PropertySlot#GetValueFunc# getValue) |
| 127 | { |
| 128 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(slotBase); |
| 129 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(getValue); |
| 130 | m_getValuecxx . . $ QTJSC/PropertySlot#m_getValue. = getValue; |
| 131 | m_slotBasecxx . . $ QTJSC/PropertySlot#m_slotBase. =cxx . . $ QTJSC/JSValue#`operator=`(af0e8a528f82a1b5). slotBase; |
| 132 | } |
| 133 | |
| 134 | void setCustomIndexcxx . . $ QTJSC/PropertySlot#setCustomIndex(2e0c226ed7b7d53d).(JSValuecxx . . $ QTJSC/JSValue# slotBase, unsigned index, GetValueFunccxx . . $ QTJSC/PropertySlot#GetValueFunc# getValue) |
| 135 | { |
| 136 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(slotBase); |
| 137 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(getValue); |
| 138 | m_getValuecxx . . $ QTJSC/PropertySlot#m_getValue. = getValue; |
| 139 | m_slotBasecxx . . $ QTJSC/PropertySlot#m_slotBase. =cxx . . $ QTJSC/JSValue#`operator=`(af0e8a528f82a1b5). slotBase; |
| 140 | m_datacxx . . $ QTJSC/PropertySlot#m_data..indexcxx . . $ QTJSC/PropertySlot#$anonymous_type_0#index. = index; |
| 141 | } |
| 142 | |
| 143 | void setGetterSlotcxx . . $ QTJSC/PropertySlot#setGetterSlot(aa1c69ebc68b9201).(JSObjectcxx . . $ QTJSC/JSObject#* getterFunc) |
| 144 | { |
| 145 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(getterFunc); |
| 146 | m_getValuecxx . . $ QTJSC/PropertySlot#m_getValue. = functionGettercxx . . $ QTJSC/PropertySlot#functionGetter(2d50ae1b8ebdc06b).; |
| 147 | m_datacxx . . $ QTJSC/PropertySlot#m_data..getterFunccxx . . $ QTJSC/PropertySlot#$anonymous_type_0#getterFunc. = getterFunc; |
| 148 | } |
| 149 | |
| 150 | void setUndefinedcxx . . $ QTJSC/PropertySlot#setUndefined(49f6e7a06ebc5aa8).() |
| 151 | { |
| 152 | setValuecxx . . $ QTJSC/PropertySlot#setValue(5c2ac18db087b3e6).(jsUndefinedcxx . . $ QTJSC/jsUndefined(ad9afe69d7bf6378).()); |
| 153 | } |
| 154 | |
| 155 | JSValuecxx . . $ QTJSC/JSValue# slotBasecxx . . $ QTJSC/PropertySlot#slotBase(888c053acf364da1).() const |
| 156 | { |
| 157 | return m_slotBasecxx . . $ QTJSC/PropertySlot#m_slotBase.; |
| 158 | } |
| 159 | |
| 160 | void setBasecxx . . $ QTJSC/PropertySlot#setBase(5c2ac18db087b3e6).(JSValuecxx . . $ QTJSC/JSValue# base) |
| 161 | { |
| 162 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(m_slotBase); |
| 163 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(base); |
| 164 | m_slotBasecxx . . $ QTJSC/PropertySlot#m_slotBase. =cxx . . $ QTJSC/JSValue#`operator=`(af0e8a528f82a1b5). base; |
| 165 | } |
| 166 | |
| 167 | void clearBasecxx . . $ QTJSC/PropertySlot#clearBase(49f6e7a06ebc5aa8).() |
| 168 | { |
| 169 | #ifndef NDEBUGcxx . . $ `<built-in>:472:9`! |
| 170 | m_slotBase = JSValue(); |
| 171 | #endif |
| 172 | } |
| 173 | |
| 174 | void clearValuecxx . . $ QTJSC/PropertySlot#clearValue(49f6e7a06ebc5aa8).() |
| 175 | { |
| 176 | #ifndef NDEBUGcxx . . $ `<built-in>:472:9`! |
| 177 | m_value = JSValue(); |
| 178 | #endif |
| 179 | } |
| 180 | |
| 181 | void clearOffsetcxx . . $ QTJSC/PropertySlot#clearOffset(49f6e7a06ebc5aa8).() |
| 182 | { |
| 183 | // Clear offset even in release builds, in case this PropertySlot has been used before. |
| 184 | // (For other data members, we don't need to clear anything because reuse would meaningfully overwrite them.) |
| 185 | m_offsetcxx . . $ QTJSC/PropertySlot#m_offset. = WTFcxx . . $ QTWTF/::notFoundcxx . . $ QTWTF/notFound.; |
| 186 | } |
| 187 | |
| 188 | unsigned indexcxx . . $ QTJSC/PropertySlot#index(ddd8539a2fcdd4ce).() const { return m_datacxx . . $ QTJSC/PropertySlot#m_data..indexcxx . . $ QTJSC/PropertySlot#$anonymous_type_0#index.; } |
| 189 | |
| 190 | private: |
| 191 | static JSValuecxx . . $ QTJSC/JSValue# functionGettercxx . . $ QTJSC/PropertySlot#functionGetter(2d50ae1b8ebdc06b).(ExecStatecxx . . $ QTJSC/ExecState#*, const Identifiercxx . . $ QTJSC/Identifier#&, const PropertySlotcxx . . $ QTJSC/PropertySlot#&); |
| 192 | |
| 193 | GetValueFunccxx . . $ QTJSC/PropertySlot#GetValueFunc# m_getValuecxx . . $ QTJSC/PropertySlot#m_getValue.; |
| 194 | |
| 195 | JSValuecxx . . $ QTJSC/JSValue# m_slotBasecxx . . $ QTJSC/PropertySlot#m_slotBase.; |
| 196 | unioncxx . . $ QTJSC/PropertySlot#$anonymous_type_0# { |
| 197 | JSObjectcxx . . $ QTJSC/JSObject#* getterFunccxx . . $ QTJSC/PropertySlot#$anonymous_type_0#getterFunc.; |
| 198 | JSValuecxx . . $ QTJSC/JSValue#* valueSlotcxx . . $ QTJSC/PropertySlot#$anonymous_type_0#valueSlot.; |
| 199 | Registercxx . . $ QTJSC/Register#* registerSlotcxx . . $ QTJSC/PropertySlot#$anonymous_type_0#registerSlot.; |
| 200 | unsigned indexcxx . . $ QTJSC/PropertySlot#$anonymous_type_0#index.; |
| 201 | } m_datacxx . . $ QTJSC/PropertySlot#m_data.; |
| 202 | |
| 203 | JSValuecxx . . $ QTJSC/JSValue# m_valuecxx . . $ QTJSC/PropertySlot#m_value.; |
| 204 | |
| 205 | size_t m_offsetcxx . . $ QTJSC/PropertySlot#m_offset.; |
| 206 | }; |
| 207 | |
| 208 | } // namespace JSC |
| 209 | |
| 210 | #endif // PropertySlot_h |