| 1 | /* |
| 2 | * Copyright (C) 1999-2001 Harri Porten ([email protected]) |
| 3 | * Copyright (C) 2001 Peter Kelly ([email protected]) |
| 4 | * Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 5 | * |
| 6 | * This library is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU Library General Public |
| 8 | * License as published by the Free Software Foundation; either |
| 9 | * version 2 of the License, or (at your option) any later version. |
| 10 | * |
| 11 | * This library is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | * Library General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU Library General Public License |
| 17 | * along with this library; see the file COPYING.LIB. If not, write to |
| 18 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 19 | * Boston, MA 02110-1301, USA. |
| 20 | * |
| 21 | */ |
| 22 | |
| 23 | #ifndef JSCell_h |
| 24 | #define JSCell_hcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSCell.h:24:9`! |
| 25 | |
| 26 | #include "Collector.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.h`/ |
| 27 | #include "JSImmediate.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSImmediate.h`/ |
| 28 | #include "JSValue.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSValue.h`/ |
| 29 | #include "MarkStack.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/MarkStack.h`/ |
| 30 | #include "Structure.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Structure.h`/ |
| 31 | #include <wtf/Noncopyable.h>cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Noncopyable.h`/ |
| 32 | |
| 33 | namespace JSCcxx . . $ QTJSC/ { |
| 34 | |
| 35 | class JSCellcxx . . $ QTJSC/JSCell# : public NoncopyableCustomAllocatedcxx . . $ NoncopyableCustomAllocated# { |
| 36 | friend class GetterSettercxx . . $ QTJSC/GetterSetter#; |
| 37 | friend class Heap; |
| 38 | friend class JITcxx . . $ QTJSC/JIT#; |
| 39 | friend class JSNumberCellcxx . . $ QTJSC/JSNumberCell#; |
| 40 | friend class JSObjectcxx . . $ QTJSC/JSObject#; |
| 41 | friend class JSPropertyNameIteratorcxx . . $ QTJSC/JSPropertyNameIterator#; |
| 42 | friend class JSStringcxx . . $ QTJSC/JSString#; |
| 43 | friend class JSValuecxx . . $ QTJSC/JSValue#; |
| 44 | friend class JSAPIValueWrappercxx . . $ QTJSC/JSAPIValueWrapper#; |
| 45 | friend class JSZombiecxx . . $ QTJSC/JSZombie#; |
| 46 | friend class JSGlobalDatacxx . . $ QTJSC/JSGlobalData#; |
| 47 | |
| 48 | private: |
| 49 | explicit JSCellcxx . . $ QTJSC/JSCell#JSCell(32e4947f9059a24a).(Structurecxx . . $ QTJSC/Structure#*); |
| 50 | virtual ~cxx . . $ QTJSC/JSCell#`~JSCell`(49f6e7a06ebc5aa8).JSCellcxx . . $ QTJSC/JSCell#(); |
| 51 | |
| 52 | public: |
| 53 | static PassRefPtrcxx . . $ PassRefPtr#<Structurecxx . . $ QTJSC/Structure#> createDummyStructurecxx . . $ QTJSC/JSCell#createDummyStructure(7087cf4e3ae1ff05).() |
| 54 | { |
| 55 | return Structure::create(jsNullcxx . . $ QTJSC/jsNull(ad9afe69d7bf6378).(), TypeInfocxx . . $ QTJSC/TypeInfo#TypeInfo(85e540a0e5560fef).(UnspecifiedTypecxx . . $ QTJSC/UnspecifiedType.)); |
| 56 | } |
| 57 | |
| 58 | // Querying the type. |
| 59 | #if USEcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h:55:9`!(JSVALUE32) |
| 60 | bool isNumber() const; |
| 61 | #endif |
| 62 | bool isStringcxx . . $ QTJSC/JSCell#isString(50ce9a9e25b4a850).() const; |
| 63 | bool isObjectcxx . . $ QTJSC/JSCell#isObject(50ce9a9e25b4a850).() const; |
| 64 | virtual bool isGetterSettercxx . . $ QTJSC/JSCell#isGetterSetter(50ce9a9e25b4a850).() const; |
| 65 | bool inheritscxx . . $ QTJSC/JSCell#inherits(7eca403b06d48463).(const ClassInfocxx . . $ QTJSC/ClassInfo#*) const; |
| 66 | virtual bool isAPIValueWrappercxx . . $ QTJSC/JSCell#isAPIValueWrapper(50ce9a9e25b4a850).() const { return false; } |
| 67 | virtual bool isPropertyNameIteratorcxx . . $ QTJSC/JSCell#isPropertyNameIterator(50ce9a9e25b4a850).() const { return false; } |
| 68 | |
| 69 | Structurecxx . . $ QTJSC/Structure#* structurecxx . . $ QTJSC/JSCell#structure(a25848528202c7a).() const; |
| 70 | |
| 71 | // Extracting the value. |
| 72 | bool getStringcxx . . $ QTJSC/JSCell#getString(4ed3c128543e83ef).(ExecStatecxx . . $ QTJSC/ExecState#* exec, UStringcxx . . $ QTJSC/UString#&) const; |
| 73 | UStringcxx . . $ QTJSC/UString# getStringcxx . . $ QTJSC/JSCell#getString(9c94f5abb1995042).(ExecStatecxx . . $ QTJSC/ExecState#* exec) const; // null string if not a string |
| 74 | JSObjectcxx . . $ QTJSC/JSObject#* getObjectcxx . . $ QTJSC/JSCell#getObject(2eaa870b9a6c25e1).(); // NULL if not an object |
| 75 | const JSObjectcxx . . $ QTJSC/JSObject#* getObjectcxx . . $ QTJSC/JSCell#getObject(352b1c9b6b28f20d).() const; // NULL if not an object |
| 76 | |
| 77 | virtual CallTypecxx . . $ QTJSC/CallType# getCallDatacxx . . $ QTJSC/JSCell#getCallData(9482040cf952d29d).(CallDatacxx . . $ QTJSC/CallData#&); |
| 78 | virtual ConstructTypecxx . . $ QTJSC/ConstructType# getConstructDatacxx . . $ QTJSC/JSCell#getConstructData(80014d68d6143eea).(ConstructDatacxx . . $ QTJSC/ConstructData#&); |
| 79 | |
| 80 | // Extracting integer values. |
| 81 | // FIXME: remove these methods, can check isNumberCell in JSValue && then call asNumberCell::*. |
| 82 | virtual bool getUInt32cxx . . $ QTJSC/JSCell#getUInt32(186fade19594183d).(uint32_tcxx . . $ uint32_t#&) const; |
| 83 | |
| 84 | // Basic conversions. |
| 85 | virtual JSValuecxx . . $ QTJSC/JSValue# toPrimitivecxx . . $ QTJSC/JSCell#toPrimitive(9c1c7f5535dadf1e).(ExecStatecxx . . $ QTJSC/ExecState#*, PreferredPrimitiveTypecxx . . $ QTJSC/PreferredPrimitiveType#) const; |
| 86 | virtual bool getPrimitiveNumbercxx . . $ QTJSC/JSCell#getPrimitiveNumber(5ae801b0dd2b44e9).(ExecStatecxx . . $ QTJSC/ExecState#*, double& number, JSValuecxx . . $ QTJSC/JSValue#&); |
| 87 | virtual bool toBooleancxx . . $ QTJSC/JSCell#toBoolean(9608304f86fd7dc).(ExecStatecxx . . $ QTJSC/ExecState#*) const; |
| 88 | virtual double toNumbercxx . . $ QTJSC/JSCell#toNumber(1fd034e372fd1279).(ExecStatecxx . . $ QTJSC/ExecState#*) const; |
| 89 | virtual UStringcxx . . $ QTJSC/UString# toStringcxx . . $ QTJSC/JSCell#toString(9c94f5abb1995042).(ExecStatecxx . . $ QTJSC/ExecState#*) const; |
| 90 | virtual JSObjectcxx . . $ QTJSC/JSObject#* toObjectcxx . . $ QTJSC/JSCell#toObject(8709ed4849a165ab).(ExecStatecxx . . $ QTJSC/ExecState#*) const; |
| 91 | |
| 92 | // Garbage collection. |
| 93 | void* operatorcxx . . $ QTJSC/JSCell#`operator new`(110e84b3d131dcaa). new(size_t, ExecStatecxx . . $ QTJSC/ExecState#*); |
| 94 | void* operatorcxx . . $ QTJSC/JSCell#`operator new`(d67e494932e2c596). new(size_t, JSGlobalDatacxx . . $ QTJSC/JSGlobalData#*); |
| 95 | void* operatorcxx . . $ QTJSC/JSCell#`operator new`(7cf5f2fc6057a0cc). new(size_t, void* placementNewDestination) { return placementNewDestination; } |
| 96 | |
| 97 | virtual void markChildrencxx . . $ QTJSC/JSCell#markChildren(bd9cae851d80a865).(MarkStackcxx . . $ QTJSC/MarkStack#&); |
| 98 | #if ENABLEcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h:57:9`!(JSC_ZOMBIES) |
| 99 | virtual bool isZombie() const { return false; } |
| 100 | #endif |
| 101 | |
| 102 | // Object operations, with the toObject operation included. |
| 103 | virtual const ClassInfocxx . . $ QTJSC/ClassInfo#* classInfocxx . . $ QTJSC/JSCell#classInfo(f90fb4cda7a7c2e2).() const; |
| 104 | virtual void putcxx . . $ QTJSC/JSCell#put(dfb3133dafbe9ff4).(ExecStatecxx . . $ QTJSC/ExecState#*, const Identifiercxx . . $ QTJSC/Identifier#& propertyName, JSValuecxx . . $ QTJSC/JSValue#, PutPropertySlotcxx . . $ QTJSC/PutPropertySlot#&); |
| 105 | virtual void putcxx . . $ QTJSC/JSCell#put(b1b60585cf3bb95).(ExecStatecxx . . $ QTJSC/ExecState#*, unsigned propertyName, JSValuecxx . . $ QTJSC/JSValue#); |
| 106 | virtual bool deletePropertycxx . . $ QTJSC/JSCell#deleteProperty(13154ef9bddc9416).(ExecStatecxx . . $ QTJSC/ExecState#*, const Identifiercxx . . $ QTJSC/Identifier#& propertyName); |
| 107 | virtual bool deletePropertycxx . . $ QTJSC/JSCell#deleteProperty(2f8cbeb04562a47b).(ExecStatecxx . . $ QTJSC/ExecState#*, unsigned propertyName); |
| 108 | |
| 109 | virtual JSObjectcxx . . $ QTJSC/JSObject#* toThisObjectcxx . . $ QTJSC/JSCell#toThisObject(8709ed4849a165ab).(ExecStatecxx . . $ QTJSC/ExecState#*) const; |
| 110 | virtual UStringcxx . . $ QTJSC/UString# toThisStringcxx . . $ QTJSC/JSCell#toThisString(9c94f5abb1995042).(ExecStatecxx . . $ QTJSC/ExecState#*) const; |
| 111 | virtual JSStringcxx . . $ QTJSC/JSString#* toThisJSStringcxx . . $ QTJSC/JSCell#toThisJSString(193b2cc77222fd6b).(ExecStatecxx . . $ QTJSC/ExecState#*); |
| 112 | virtual JSValuecxx . . $ QTJSC/JSValue# getJSNumbercxx . . $ QTJSC/JSCell#getJSNumber(ad9afe69d7bf6378).(); |
| 113 | void* vptrcxx . . $ QTJSC/JSCell#vptr(50c7df7de5344ebb).() { return *reinterpret_cast<void**>(this); } |
| 114 | void setVPtrcxx . . $ QTJSC/JSCell#setVPtr(5d22bdacc48458e8).(void* vptr) { *reinterpret_cast<void**>(this) = vptr; } |
| 115 | |
| 116 | private: |
| 117 | // Base implementation; for non-object classes implements getPropertySlot. |
| 118 | bool fastGetOwnPropertySlotcxx . . $ QTJSC/JSCell#fastGetOwnPropertySlot(6f4ef3dbfe7d5ab9).(ExecStatecxx . . $ QTJSC/ExecState#*, const Identifiercxx . . $ QTJSC/Identifier#& propertyName, PropertySlotcxx . . $ QTJSC/PropertySlot#&); |
| 119 | virtual bool getOwnPropertySlotcxx . . $ QTJSC/JSCell#getOwnPropertySlot(6f4ef3dbfe7d5ab9).(ExecStatecxx . . $ QTJSC/ExecState#*, const Identifiercxx . . $ QTJSC/Identifier#& propertyName, PropertySlotcxx . . $ QTJSC/PropertySlot#&); |
| 120 | virtual bool getOwnPropertySlotcxx . . $ QTJSC/JSCell#getOwnPropertySlot(d57d1c8d4b24d235).(ExecStatecxx . . $ QTJSC/ExecState#*, unsigned propertyName, PropertySlotcxx . . $ QTJSC/PropertySlot#&); |
| 121 | |
| 122 | Structurecxx . . $ QTJSC/Structure#* m_structurecxx . . $ QTJSC/JSCell#m_structure.; |
| 123 | }; |
| 124 | |
| 125 | inline JSCellcxx . . $ QTJSC/JSCell#::JSCellcxx . . $ QTJSC/JSCell#JSCell(32e4947f9059a24a).(Structurecxx . . $ QTJSC/Structure#* structure) |
| 126 | : m_structurecxx . . $ QTJSC/JSCell#m_structure.(structure) |
| 127 | { |
| 128 | } |
| 129 | |
| 130 | inline JSCellcxx . . $ QTJSC/JSCell#::~cxx . . $ QTJSC/JSCell#`~JSCell`(49f6e7a06ebc5aa8).JSCellcxx . . $ QTJSC/JSCell#() |
| 131 | { |
| 132 | } |
| 133 | |
| 134 | #if USEcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h:55:9`!(JSVALUE32) |
| 135 | inline bool JSCell::isNumber() const |
| 136 | { |
| 137 | return m_structure->typeInfo().type() == NumberType; |
| 138 | } |
| 139 | #endif |
| 140 | |
| 141 | inline bool JSCellcxx . . $ QTJSC/JSCell#::isObjectcxx . . $ QTJSC/JSCell#isObject(50ce9a9e25b4a850).() const |
| 142 | { |
| 143 | return m_structurecxx . . $ QTJSC/JSCell#m_structure.->typeInfocxx . . $ QTJSC/Structure#typeInfo(2e356ef879c79f0c).().typecxx . . $ QTJSC/TypeInfo#type(81c355aa0b104834).() == ObjectTypecxx . . $ QTJSC/ObjectType.; |
| 144 | } |
| 145 | |
| 146 | inline bool JSCellcxx . . $ QTJSC/JSCell#::isStringcxx . . $ QTJSC/JSCell#isString(50ce9a9e25b4a850).() const |
| 147 | { |
| 148 | return m_structurecxx . . $ QTJSC/JSCell#m_structure.->typeInfocxx . . $ QTJSC/Structure#typeInfo(2e356ef879c79f0c).().typecxx . . $ QTJSC/TypeInfo#type(81c355aa0b104834).() == StringTypecxx . . $ QTJSC/StringType.; |
| 149 | } |
| 150 | |
| 151 | inline Structurecxx . . $ QTJSC/Structure#* JSCellcxx . . $ QTJSC/JSCell#::structurecxx . . $ QTJSC/JSCell#structure(a25848528202c7a).() const |
| 152 | { |
| 153 | return m_structurecxx . . $ QTJSC/JSCell#m_structure.; |
| 154 | } |
| 155 | |
| 156 | inline void JSCellcxx . . $ QTJSC/JSCell#::markChildrencxx . . $ QTJSC/JSCell#markChildren(bd9cae851d80a865).(MarkStackcxx . . $ QTJSC/MarkStack#&) |
| 157 | { |
| 158 | } |
| 159 | |
| 160 | inline void* JSCellcxx . . $ QTJSC/JSCell#::operatorcxx . . $ QTJSC/JSCell#`operator new`(d67e494932e2c596). new(size_t size, JSGlobalDatacxx . . $ QTJSC/JSGlobalData#* globalData) |
| 161 | { |
| 162 | return globalData->heap.allocate(size); |
| 163 | } |
| 164 | |
| 165 | inline void* JSCellcxx . . $ QTJSC/JSCell#::operatorcxx . . $ QTJSC/JSCell#`operator new`(110e84b3d131dcaa). new(size_t size, ExecStatecxx . . $ QTJSC/ExecState#* exec) |
| 166 | { |
| 167 | return exec->heapcxx . . $ QTJSC/ExecState#heap(56d7b0fd64ccd56f).()->allocatecxx . . $ QTJSC/Heap#allocate(bfcfa4d6b7f7ef64).(size); |
| 168 | } |
| 169 | |
| 170 | // --- JSValue inlines ---------------------------- |
| 171 | |
| 172 | inline bool JSValuecxx . . $ QTJSC/JSValue#::isStringcxx . . $ QTJSC/JSValue#isString(50ce9a9e25b4a850).() const |
| 173 | { |
| 174 | return isCellcxx . . $ QTJSC/JSValue#isCell(50ce9a9e25b4a850).() && asCellcxx . . $ QTJSC/JSValue#asCell(60510463d9a84528).()->isStringcxx . . $ QTJSC/JSCell#isString(50ce9a9e25b4a850).(); |
| 175 | } |
| 176 | |
| 177 | inline bool JSValuecxx . . $ QTJSC/JSValue#::isGetterSettercxx . . $ QTJSC/JSValue#isGetterSetter(50ce9a9e25b4a850).() const |
| 178 | { |
| 179 | return isCellcxx . . $ QTJSC/JSValue#isCell(50ce9a9e25b4a850).() && asCellcxx . . $ QTJSC/JSValue#asCell(60510463d9a84528).()->isGetterSettercxx . . $ QTJSC/JSCell#isGetterSetter(50ce9a9e25b4a850).(); |
| 180 | } |
| 181 | |
| 182 | inline bool JSValuecxx . . $ QTJSC/JSValue#::isObjectcxx . . $ QTJSC/JSValue#isObject(50ce9a9e25b4a850).() const |
| 183 | { |
| 184 | return isCellcxx . . $ QTJSC/JSValue#isCell(50ce9a9e25b4a850).() && asCellcxx . . $ QTJSC/JSValue#asCell(60510463d9a84528).()->isObjectcxx . . $ QTJSC/JSCell#isObject(50ce9a9e25b4a850).(); |
| 185 | } |
| 186 | |
| 187 | inline bool JSValuecxx . . $ QTJSC/JSValue#::getStringcxx . . $ QTJSC/JSValue#getString(4ed3c128543e83ef).(ExecStatecxx . . $ QTJSC/ExecState#* exec, UStringcxx . . $ QTJSC/UString#& s) const |
| 188 | { |
| 189 | return isCellcxx . . $ QTJSC/JSValue#isCell(50ce9a9e25b4a850).() && asCellcxx . . $ QTJSC/JSValue#asCell(60510463d9a84528).()->getStringcxx . . $ QTJSC/JSCell#getString(4ed3c128543e83ef).(exec, s); |
| 190 | } |
| 191 | |
| 192 | inline UStringcxx . . $ QTJSC/UString# JSValuecxx . . $ QTJSC/JSValue#::getStringcxx . . $ QTJSC/JSValue#getString(9c94f5abb1995042).(ExecStatecxx . . $ QTJSC/ExecState#* exec) const |
| 193 | { |
| 194 | return isCellcxx . . $ QTJSC/UString#UString(e6bad6cb9b63b14d).() ? asCellcxx . . $ QTJSC/UString#UString(e6bad6cb9b63b14d).()->getStringcxx . . $ QTJSC/JSCell#getString(9c94f5abb1995042).(exec) : UStringcxx . . $ QTJSC/UString#UString(e6bad6cb9b63b14d).(); |
| 195 | } |
| 196 | |
| 197 | inline JSObjectcxx . . $ QTJSC/JSObject#* JSValuecxx . . $ QTJSC/JSValue#::getObjectcxx . . $ QTJSC/JSValue#getObject(8ac23ea934d7a115).() const |
| 198 | { |
| 199 | return isCellcxx . . $ QTJSC/JSValue#isCell(50ce9a9e25b4a850).() ? asCellcxx . . $ QTJSC/JSValue#asCell(60510463d9a84528).()->getObjectcxx . . $ QTJSC/JSCell#getObject(2eaa870b9a6c25e1).() : 0; |
| 200 | } |
| 201 | |
| 202 | inline CallTypecxx . . $ QTJSC/CallType# JSValuecxx . . $ QTJSC/JSValue#::getCallDatacxx . . $ QTJSC/JSValue#getCallData(9482040cf952d29d).(CallDatacxx . . $ QTJSC/CallData#& callData) |
| 203 | { |
| 204 | return isCellcxx . . $ QTJSC/JSValue#isCell(50ce9a9e25b4a850).() ? asCellcxx . . $ QTJSC/JSValue#asCell(60510463d9a84528).()->getCallDatacxx . . $ QTJSC/JSCell#getCallData(9482040cf952d29d).(callData) : CallTypeNonecxx . . $ QTJSC/CallTypeNone.; |
| 205 | } |
| 206 | |
| 207 | inline ConstructTypecxx . . $ QTJSC/ConstructType# JSValuecxx . . $ QTJSC/JSValue#::getConstructDatacxx . . $ QTJSC/JSValue#getConstructData(80014d68d6143eea).(ConstructDatacxx . . $ QTJSC/ConstructData#& constructData) |
| 208 | { |
| 209 | return isCellcxx . . $ QTJSC/JSValue#isCell(50ce9a9e25b4a850).() ? asCellcxx . . $ QTJSC/JSValue#asCell(60510463d9a84528).()->getConstructDatacxx . . $ QTJSC/JSCell#getConstructData(80014d68d6143eea).(constructData) : ConstructTypeNonecxx . . $ QTJSC/ConstructTypeNone.; |
| 210 | } |
| 211 | |
| 212 | ALWAYS_INLINEcxx . . $ `../3rdparty/javascriptcore/JavaScriptCore/wtf/AlwaysInline.h:25:9`! bool JSValuecxx . . $ QTJSC/JSValue#::getUInt32cxx . . $ QTJSC/JSValue#getUInt32(186fade19594183d).(uint32_tcxx . . $ uint32_t#& v) const |
| 213 | { |
| 214 | if (isInt32cxx . . $ QTJSC/JSValue#isInt32(50ce9a9e25b4a850).()) { |
| 215 | int32_tcxx . . $ int32_t# i = asInt32cxx . . $ QTJSC/JSValue#asInt32(455f465bc33b4cdf).(); |
| 216 | v = static_cast<uint32_tcxx . . $ uint32_t#>(i); |
| 217 | return i >= 0; |
| 218 | } |
| 219 | if (isDoublecxx . . $ QTJSC/JSValue#isDouble(50ce9a9e25b4a850).()) { |
| 220 | double d = asDoublecxx . . $ QTJSC/JSValue#asDouble(21b6c25e127938e2).(); |
| 221 | v = static_cast<uint32_tcxx . . $ uint32_t#>(d); |
| 222 | return v == d; |
| 223 | } |
| 224 | return false; |
| 225 | } |
| 226 | |
| 227 | #if !USEcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h:55:9`!(JSVALUE32_64) |
| 228 | ALWAYS_INLINEcxx . . $ `../3rdparty/javascriptcore/JavaScriptCore/wtf/AlwaysInline.h:25:9`! JSCellcxx . . $ QTJSC/JSCell#* JSValuecxx . . $ QTJSC/JSValue#::asCellcxx . . $ QTJSC/JSValue#asCell(60510463d9a84528).() const |
| 229 | { |
| 230 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(isCell()); |
| 231 | return m_ptrcxx . . $ QTJSC/JSValue#m_ptr.; |
| 232 | } |
| 233 | #endif // !USE(JSVALUE32_64) |
| 234 | |
| 235 | inline JSValuecxx . . $ QTJSC/JSValue# JSValuecxx . . $ QTJSC/JSValue#::toPrimitivecxx . . $ QTJSC/JSValue#toPrimitive(9c1c7f5535dadf1e).(ExecStatecxx . . $ QTJSC/ExecState#* exec, PreferredPrimitiveTypecxx . . $ QTJSC/PreferredPrimitiveType# preferredType) const |
| 236 | { |
| 237 | return isCellcxx . . $ QTJSC/JSValue#isCell(50ce9a9e25b4a850).() ? asCellcxx . . $ QTJSC/JSValue#asCell(60510463d9a84528).()->toPrimitivecxx . . $ QTJSC/JSCell#toPrimitive(9c1c7f5535dadf1e).(exec, preferredType) : asValuecxx . . $ QTJSC/JSValue#asValue(2b3a0f51c71d9b1b).(); |
| 238 | } |
| 239 | |
| 240 | inline bool JSValuecxx . . $ QTJSC/JSValue#::getPrimitiveNumbercxx . . $ QTJSC/JSValue#getPrimitiveNumber(5ae801b0dd2b44e9).(ExecStatecxx . . $ QTJSC/ExecState#* exec, double& number, JSValuecxx . . $ QTJSC/JSValue#& value) |
| 241 | { |
| 242 | if (isInt32cxx . . $ QTJSC/JSValue#isInt32(50ce9a9e25b4a850).()) { |
| 243 | number = asInt32cxx . . $ QTJSC/JSValue#asInt32(455f465bc33b4cdf).(); |
| 244 | value =cxx . . $ QTJSC/JSValue#`operator=`(af0e8a528f82a1b5). *this; |
| 245 | return true; |
| 246 | } |
| 247 | if (isDoublecxx . . $ QTJSC/JSValue#isDouble(50ce9a9e25b4a850).()) { |
| 248 | number = asDoublecxx . . $ QTJSC/JSValue#asDouble(21b6c25e127938e2).(); |
| 249 | value =cxx . . $ QTJSC/JSValue#`operator=`(af0e8a528f82a1b5). *this; |
| 250 | return true; |
| 251 | } |
| 252 | if (isCellcxx . . $ QTJSC/JSValue#isCell(50ce9a9e25b4a850).()) |
| 253 | return asCellcxx . . $ QTJSC/JSValue#asCell(60510463d9a84528).()->getPrimitiveNumbercxx . . $ QTJSC/JSCell#getPrimitiveNumber(5ae801b0dd2b44e9).(exec, number, value); |
| 254 | if (isTruecxx . . $ QTJSC/JSValue#isTrue(50ce9a9e25b4a850).()) { |
| 255 | number = 1.0; |
| 256 | value =cxx . . $ QTJSC/JSValue#`operator=`(af0e8a528f82a1b5). *this; |
| 257 | return true; |
| 258 | } |
| 259 | if (isFalsecxx . . $ QTJSC/JSValue#isFalse(50ce9a9e25b4a850).() || isNullcxx . . $ QTJSC/JSValue#isNull(50ce9a9e25b4a850).()) { |
| 260 | number = 0.0; |
| 261 | value =cxx . . $ QTJSC/JSValue#`operator=`(af0e8a528f82a1b5). *this; |
| 262 | return true; |
| 263 | } |
| 264 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(isUndefined()); |
| 265 | number = nonInlineNaNcxx . . $ QTJSC/nonInlineNaN(31fa7155c10fdd13).(); |
| 266 | value =cxx . . $ QTJSC/JSValue#`operator=`(af0e8a528f82a1b5). *this; |
| 267 | return true; |
| 268 | } |
| 269 | |
| 270 | inline bool JSValuecxx . . $ QTJSC/JSValue#::toBooleancxx . . $ QTJSC/JSValue#toBoolean(9608304f86fd7dc).(ExecStatecxx . . $ QTJSC/ExecState#* exec) const |
| 271 | { |
| 272 | if (isInt32cxx . . $ QTJSC/JSValue#isInt32(50ce9a9e25b4a850).()) |
| 273 | return asInt32cxx . . $ QTJSC/JSValue#asInt32(455f465bc33b4cdf).() != 0; |
| 274 | if (isDoublecxx . . $ QTJSC/JSValue#isDouble(50ce9a9e25b4a850).()) |
| 275 | return asDoublecxx . . $ QTJSC/JSValue#asDouble(21b6c25e127938e2).() > 0.0 || asDoublecxx . . $ QTJSC/JSValue#asDouble(21b6c25e127938e2).() < 0.0; // false for NaN |
| 276 | if (isCellcxx . . $ QTJSC/JSValue#isCell(50ce9a9e25b4a850).()) |
| 277 | return asCellcxx . . $ QTJSC/JSValue#asCell(60510463d9a84528).()->toBooleancxx . . $ QTJSC/JSCell#toBoolean(9608304f86fd7dc).(exec); |
| 278 | return isTruecxx . . $ QTJSC/JSValue#isTrue(50ce9a9e25b4a850).(); // false, null, and undefined all convert to false. |
| 279 | } |
| 280 | |
| 281 | ALWAYS_INLINEcxx . . $ `../3rdparty/javascriptcore/JavaScriptCore/wtf/AlwaysInline.h:25:9`! double JSValuecxx . . $ QTJSC/JSValue#::toNumbercxx . . $ QTJSC/JSValue#toNumber(1fd034e372fd1279).(ExecStatecxx . . $ QTJSC/ExecState#* exec) const |
| 282 | { |
| 283 | if (isInt32cxx . . $ QTJSC/JSValue#isInt32(50ce9a9e25b4a850).()) |
| 284 | return asInt32cxx . . $ QTJSC/JSValue#asInt32(455f465bc33b4cdf).(); |
| 285 | if (isDoublecxx . . $ QTJSC/JSValue#isDouble(50ce9a9e25b4a850).()) |
| 286 | return asDoublecxx . . $ QTJSC/JSValue#asDouble(21b6c25e127938e2).(); |
| 287 | if (isCellcxx . . $ QTJSC/JSValue#isCell(50ce9a9e25b4a850).()) |
| 288 | return asCellcxx . . $ QTJSC/JSValue#asCell(60510463d9a84528).()->toNumbercxx . . $ QTJSC/JSCell#toNumber(1fd034e372fd1279).(exec); |
| 289 | if (isTruecxx . . $ QTJSC/JSValue#isTrue(50ce9a9e25b4a850).()) |
| 290 | return 1.0; |
| 291 | return isUndefinedcxx . . $ QTJSC/JSValue#isUndefined(50ce9a9e25b4a850).() ? nonInlineNaNcxx . . $ QTJSC/nonInlineNaN(31fa7155c10fdd13).() : 0; // null and false both convert to 0. |
| 292 | } |
| 293 | |
| 294 | inline bool JSValuecxx . . $ QTJSC/JSValue#::needsThisConversioncxx . . $ QTJSC/JSValue#needsThisConversion(50ce9a9e25b4a850).() const |
| 295 | { |
| 296 | if (UNLIKELYcxx . . $ `../3rdparty/javascriptcore/JavaScriptCore/wtf/AlwaysInline.h:45:9`!(!isCell())) |
| 297 | return true; |
| 298 | return asCellcxx . . $ QTJSC/JSValue#asCell(60510463d9a84528).()->structurecxx . . $ QTJSC/JSCell#structure(a25848528202c7a).()->typeInfocxx . . $ QTJSC/Structure#typeInfo(2e356ef879c79f0c).().needsThisConversioncxx . . $ QTJSC/TypeInfo#needsThisConversion(50ce9a9e25b4a850).(); |
| 299 | } |
| 300 | |
| 301 | inline UStringcxx . . $ QTJSC/UString# JSValuecxx . . $ QTJSC/JSValue#::toThisStringcxx . . $ QTJSC/JSValue#toThisString(9c94f5abb1995042).(ExecStatecxx . . $ QTJSC/ExecState#* exec) const |
| 302 | { |
| 303 | return isCellcxx . . $ QTJSC/UString#UString(e6bad6cb9b63b14d).() ? asCellcxx . . $ QTJSC/UString#UString(e6bad6cb9b63b14d).()->toThisStringcxx . . $ QTJSC/JSCell#toThisString(9c94f5abb1995042).(exec) : toStringcxx . . $ QTJSC/UString#UString(e6bad6cb9b63b14d).(exec); |
| 304 | } |
| 305 | |
| 306 | inline JSValuecxx . . $ QTJSC/JSValue# JSValuecxx . . $ QTJSC/JSValue#::getJSNumbercxx . . $ QTJSC/JSValue#getJSNumber(ad9afe69d7bf6378).() |
| 307 | { |
| 308 | if (isInt32cxx . . $ QTJSC/JSValue#isInt32(50ce9a9e25b4a850).() || isDoublecxx . . $ QTJSC/JSValue#isDouble(50ce9a9e25b4a850).()) |
| 309 | return *this; |
| 310 | if (isCellcxx . . $ QTJSC/JSValue#isCell(50ce9a9e25b4a850).()) |
| 311 | return asCellcxx . . $ QTJSC/JSValue#asCell(60510463d9a84528).()->getJSNumbercxx . . $ QTJSC/JSCell#getJSNumber(ad9afe69d7bf6378).(); |
| 312 | return JSValuecxx . . $ QTJSC/JSValue#JSValue(49f6e7a06ebc5aa8).(); |
| 313 | } |
| 314 | |
| 315 | inline JSObjectcxx . . $ QTJSC/JSObject#* JSValuecxx . . $ QTJSC/JSValue#::toObjectcxx . . $ QTJSC/JSValue#toObject(8709ed4849a165ab).(ExecStatecxx . . $ QTJSC/ExecState#* exec) const |
| 316 | { |
| 317 | return isCellcxx . . $ QTJSC/JSValue#isCell(50ce9a9e25b4a850).() ? asCellcxx . . $ QTJSC/JSValue#asCell(60510463d9a84528).()->toObjectcxx . . $ QTJSC/JSCell#toObject(8709ed4849a165ab).(exec) : toObjectSlowCasecxx . . $ QTJSC/JSValue#toObjectSlowCase(8709ed4849a165ab).(exec); |
| 318 | } |
| 319 | |
| 320 | inline JSObjectcxx . . $ QTJSC/JSObject#* JSValuecxx . . $ QTJSC/JSValue#::toThisObjectcxx . . $ QTJSC/JSValue#toThisObject(8709ed4849a165ab).(ExecStatecxx . . $ QTJSC/ExecState#* exec) const |
| 321 | { |
| 322 | return isCellcxx . . $ QTJSC/JSValue#isCell(50ce9a9e25b4a850).() ? asCellcxx . . $ QTJSC/JSValue#asCell(60510463d9a84528).()->toThisObjectcxx . . $ QTJSC/JSCell#toThisObject(8709ed4849a165ab).(exec) : toThisObjectSlowCasecxx . . $ QTJSC/JSValue#toThisObjectSlowCase(8709ed4849a165ab).(exec); |
| 323 | } |
| 324 | |
| 325 | ALWAYS_INLINEcxx . . $ `../3rdparty/javascriptcore/JavaScriptCore/wtf/AlwaysInline.h:25:9`! void MarkStackcxx . . $ QTJSC/MarkStack#::appendcxx . . $ QTJSC/MarkStack#append(c6d88d3bdacccd64).(JSCellcxx . . $ QTJSC/JSCell#* cell) |
| 326 | { |
| 327 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(!m_isCheckingForDefaultMarkViolation); |
| 328 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(cell); |
| 329 | if (Heapcxx . . $ QTJSC/Heap#::isCellMarkedcxx . . $ QTJSC/Heap#isCellMarked(991f49f25290885c).(cell)) |
| 330 | return; |
| 331 | Heapcxx . . $ QTJSC/Heap#::markCellcxx . . $ QTJSC/Heap#markCell(c6d88d3bdacccd64).(cell); |
| 332 | if (cell->structure()->typeInfo().type() >= CompoundType) |
| 333 | m_values.append(cell); |
| 334 | } |
| 335 | |
| 336 | ALWAYS_INLINEcxx . . $ `../3rdparty/javascriptcore/JavaScriptCore/wtf/AlwaysInline.h:25:9`! void MarkStackcxx . . $ QTJSC/MarkStack#::appendcxx . . $ QTJSC/MarkStack#append(5c2ac18db087b3e6).(JSValuecxx . . $ QTJSC/JSValue# value) |
| 337 | { |
| 338 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(value); |
| 339 | if (value.isCellcxx . . $ QTJSC/JSValue#isCell(50ce9a9e25b4a850).()) |
| 340 | appendcxx . . $ QTJSC/MarkStack#append(c6d88d3bdacccd64).(value.asCellcxx . . $ QTJSC/JSValue#asCell(60510463d9a84528).()); |
| 341 | } |
| 342 | |
| 343 | inline Heapcxx . . $ QTJSC/Heap#* Heapcxx . . $ QTJSC/Heap#::heapcxx . . $ QTJSC/Heap#heap(4163b73911f9bcad).(JSValuecxx . . $ QTJSC/JSValue# v) |
| 344 | { |
| 345 | if (!v.isCellcxx . . $ QTJSC/JSValue#isCell(50ce9a9e25b4a850).()) |
| 346 | return 0; |
| 347 | return heapcxx . . $ QTJSC/Heap#heap(eedc9d5ae2d54a92).(v.asCellcxx . . $ QTJSC/JSValue#asCell(60510463d9a84528).()); |
| 348 | } |
| 349 | |
| 350 | inline Heapcxx . . $ QTJSC/Heap#* Heapcxx . . $ QTJSC/Heap#::heapcxx . . $ QTJSC/Heap#heap(eedc9d5ae2d54a92).(JSCellcxx . . $ QTJSC/JSCell#* c) |
| 351 | { |
| 352 | return cellBlockcxx . . $ QTJSC/Heap#cellBlock(be718e8bf64b13d3).(c)->heapcxx . . $ QTJSC/CollectorBlock#heap.; |
| 353 | } |
| 354 | |
| 355 | #if ENABLEcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h:57:9`!(JSC_ZOMBIES) |
| 356 | inline bool JSValue::isZombie() const |
| 357 | { |
| 358 | return isCell() && asCell() && asCell()->isZombie(); |
| 359 | } |
| 360 | #endif |
| 361 | } // namespace JSC |
| 362 | |
| 363 | #endif // JSCell_h |