| 1 | /* |
| 2 | * Copyright (C) 1999-2002 Harri Porten ([email protected]) |
| 3 | * Copyright (C) 2001 Peter Kelly ([email protected]) |
| 4 | * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 5 | * Copyright (C) 2007 Cameron Zwarich ([email protected]) |
| 6 | * Copyright (C) 2007 Maks Orlovich |
| 7 | * |
| 8 | * This library is free software; you can redistribute it and/or |
| 9 | * modify it under the terms of the GNU Library General Public |
| 10 | * License as published by the Free Software Foundation; either |
| 11 | * version 2 of the License, or (at your option) any later version. |
| 12 | * |
| 13 | * This library is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 16 | * Library General Public License for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU Library General Public License |
| 19 | * along with this library; see the file COPYING.LIB. If not, write to |
| 20 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 21 | * Boston, MA 02110-1301, USA. |
| 22 | * |
| 23 | */ |
| 24 | |
| 25 | #include "config.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/config.h`/ |
| 26 | #include "JSFunction.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSFunction.h`/ |
| 27 | |
| 28 | #include "CodeBlock.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/CodeBlock.h`/ |
| 29 | #include "CommonIdentifiers.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/CommonIdentifiers.h`/ |
| 30 | #include "CallFrame.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/CallFrame.h`/ |
| 31 | #include "FunctionPrototype.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/FunctionPrototype.h`/ |
| 32 | #include "JSGlobalObject.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalObject.h`/ |
| 33 | #include "Interpreter.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.h`/ |
| 34 | #include "ObjectPrototype.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/ObjectPrototype.h`/ |
| 35 | #include "Parser.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/parser/Parser.h`/ |
| 36 | #include "PropertyNameArray.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/PropertyNameArray.h`/ |
| 37 | #include "ScopeChainMark.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/ScopeChainMark.h`/ |
| 38 | |
| 39 | using namespace WTFcxx . . $ `<built-in>:467:9`!; |
| 40 | using namespace Unicode; |
| 41 | |
| 42 | namespace JSCcxx . . $ `<built-in>:463:9`! { |
| 43 | |
| 44 | ASSERT_CLASS_FITS_IN_CELLcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.h:42:9`!(JSFunction); |
| 45 | |
| 46 | const ClassInfocxx . . $ QTJSC/ClassInfo# JSFunctioncxx . . $ QTJSC/JSFunction#::infocxx . . $ QTJSC/JSFunction#info. = { "Function", &InternalFunctioncxx . . $ QTJSC/InternalFunction#::infocxx . . $ QTJSC/InternalFunction#info., 0, 0 }; |
| 47 | |
| 48 | bool JSFunctioncxx . . $ QTJSC/JSFunction#::isHostFunctionNonInlinecxx . . $ QTJSC/JSFunction#isHostFunctionNonInline(50ce9a9e25b4a850).() const |
| 49 | { |
| 50 | return isHostFunctioncxx . . $ QTJSC/JSFunction#isHostFunction(50ce9a9e25b4a850).(); |
| 51 | } |
| 52 | |
| 53 | JSFunctioncxx . . $ QTJSC/JSFunction#::JSFunctioncxx . . $ QTJSC/JSFunction#JSFunction(9678d77265d996b).(NonNullPassRefPtrcxx . . $ NonNullPassRefPtr#<Structurecxx . . $ QTJSC/Structure#> structure) |
| 54 | : Basecxx . . $ QTJSC/JSFunction#Base#(structure) |
| 55 | , m_executable(adoptRef(new VPtrHackExecutable())) |
| 56 | { |
| 57 | } |
| 58 | |
| 59 | JSFunctioncxx . . $ QTJSC/JSFunction#::JSFunctioncxx . . $ QTJSC/JSFunction#JSFunction(d0bee40614c306f0).(ExecStatecxx . . $ QTJSC/ExecState#* exec, NonNullPassRefPtrcxx . . $ NonNullPassRefPtr#<Structurecxx . . $ QTJSC/Structure#> structure, int length, const Identifiercxx . . $ QTJSC/Identifier#& name, NativeFunctioncxx . . $ QTJSC/NativeFunction# func) |
| 60 | : Basecxx . . $ QTJSC/JSFunction#Base#(&exec->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).(), structure, name) |
| 61 | #if ENABLEcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h:57:9`!(JIT) |
| 62 | , m_executable(adoptRef(new NativeExecutable(exec))) |
| 63 | #endif |
| 64 | { |
| 65 | #if ENABLEcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h:57:9`!(JIT) |
| 66 | setNativeFunctioncxx . . $ QTJSC/JSFunction#setNativeFunction(10fcf79cb215d05).(func); |
| 67 | putDirectcxx . . $ QTJSC/JSObject#putDirect(ced585bb6c91af73).(exec->propertyNamescxx . . $ QTJSC/ExecState#propertyNames(16296db726e31f87).().length, jsNumbercxx . . $ QTJSC/jsNumber(1201607e1a2ad33d).(exec, length), DontDeletecxx . . $ QTJSC/DontDelete. | ReadOnlycxx . . $ QTJSC/ReadOnly. | DontEnumcxx . . $ QTJSC/DontEnum.); |
| 68 | #else |
| 69 | UNUSED_PARAM(length); |
| 70 | UNUSED_PARAM(func); |
| 71 | ASSERT_NOT_REACHED(); |
| 72 | #endif |
| 73 | } |
| 74 | |
| 75 | JSFunctioncxx . . $ QTJSC/JSFunction#::JSFunctioncxx . . $ QTJSC/JSFunction#JSFunction(8f64747d1ea3da42).(ExecStatecxx . . $ QTJSC/ExecState#* exec, NonNullPassRefPtrcxx . . $ NonNullPassRefPtr#<FunctionExecutablecxx . . $ QTJSC/FunctionExecutable#> executable, ScopeChainNodecxx . . $ QTJSC/ScopeChainNode#* scopeChainNode) |
| 76 | : Basecxx . . $ QTJSC/JSFunction#Base#(&exec->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).(), exec->lexicalGlobalObjectcxx . . $ QTJSC/ExecState#lexicalGlobalObject(3d50c730b5e26899).()->functionStructurecxx . . $ QTJSC/JSGlobalObject#functionStructure(a25848528202c7a).(), executable->name()) |
| 77 | , m_executable(executable) |
| 78 | { |
| 79 | setScopeChaincxx . . $ QTJSC/JSFunction#setScopeChain(fdc7869371484d42).(scopeChainNode); |
| 80 | } |
| 81 | |
| 82 | JSFunctioncxx . . $ QTJSC/JSFunction#::~cxx . . $ QTJSC/JSFunction#`~JSFunction`(49f6e7a06ebc5aa8).JSFunctioncxx . . $ QTJSC/JSFunction#() |
| 83 | { |
| 84 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(vptr() == JSGlobalData::jsFunctionVPtr); |
| 85 | |
| 86 | // JIT code for other functions may have had calls linked directly to the code for this function; these links |
| 87 | // are based on a check for the this pointer value for this JSFunction - which will no longer be valid once |
| 88 | // this memory is freed and may be reused (potentially for another, different JSFunction). |
| 89 | if (!isHostFunctioncxx . . $ QTJSC/JSFunction#isHostFunction(50ce9a9e25b4a850).()) { |
| 90 | #if ENABLEcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h:57:9`!(JIT_OPTIMIZE_CALL) |
| 91 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(m_executable); |
| 92 | if (jsExecutablecxx . . $ QTJSC/JSFunction#jsExecutable(41a6d61c9ef790ed).()->isGeneratedcxx . . $ QTJSC/FunctionExecutable#isGenerated(50ce9a9e25b4a850).()) |
| 93 | jsExecutablecxx . . $ QTJSC/JSFunction#jsExecutable(41a6d61c9ef790ed).()->generatedBytecodecxx . . $ QTJSC/FunctionExecutable#generatedBytecode(bed47da3f3a565bc).().unlinkCallerscxx . . $ QTJSC/CodeBlock#unlinkCallers(49f6e7a06ebc5aa8).(); |
| 94 | #endif |
| 95 | scopeChaincxx . . $ QTJSC/JSFunction#scopeChain(b239d380c31bc982).().~ScopeChaincxx . . $ QTJSC/ScopeChain#(); // FIXME: Don't we need to do this in the interpreter too? |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | void JSFunctioncxx . . $ QTJSC/JSFunction#::markChildrencxx . . $ QTJSC/JSFunction#markChildren(bd9cae851d80a865).(MarkStackcxx . . $ QTJSC/MarkStack#& markStack) |
| 100 | { |
| 101 | Basecxx . . $ QTJSC/JSFunction#Base#::markChildrencxx . . $ QTJSC/JSObject#markChildren(bd9cae851d80a865).(markStack); |
| 102 | if (!isHostFunctioncxx . . $ QTJSC/JSFunction#isHostFunction(50ce9a9e25b4a850).()) { |
| 103 | jsExecutablecxx . . $ QTJSC/JSFunction#jsExecutable(41a6d61c9ef790ed).()->markAggregatecxx . . $ QTJSC/FunctionExecutable#markAggregate(bd9cae851d80a865).(markStack); |
| 104 | scopeChaincxx . . $ QTJSC/JSFunction#scopeChain(b239d380c31bc982).().markAggregatecxx . . $ QTJSC/ScopeChain#markAggregate(25892ea107a060b1).(markStack); |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | CallTypecxx . . $ QTJSC/CallType# JSFunctioncxx . . $ QTJSC/JSFunction#::getCallDatacxx . . $ QTJSC/JSFunction#getCallData(9482040cf952d29d).(CallDatacxx . . $ QTJSC/CallData#& callData) |
| 109 | { |
| 110 | if (isHostFunctioncxx . . $ QTJSC/JSFunction#isHostFunction(50ce9a9e25b4a850).()) { |
| 111 | callData.nativecxx . . $ QTJSC/CallData#native..functioncxx . . $ QTJSC/CallData#$anonymous_type_0#function. =cxx . . $ QTJSC/NativeFuncWrapper#`operator=`(d9f3a0596fbce81c). nativeFunctioncxx . . $ QTJSC/JSFunction#nativeFunction(9571a288bde0ae2f).(); |
| 112 | return CallTypeHostcxx . . $ QTJSC/CallTypeHost.; |
| 113 | } |
| 114 | callData.jscxx . . $ QTJSC/CallData#js..functionExecutablecxx . . $ QTJSC/CallData#$anonymous_type_1#functionExecutable. = jsExecutablecxx . . $ QTJSC/JSFunction#jsExecutable(41a6d61c9ef790ed).(); |
| 115 | callData.jscxx . . $ QTJSC/CallData#js..scopeChaincxx . . $ QTJSC/CallData#$anonymous_type_1#scopeChain. = scopeChaincxx . . $ QTJSC/JSFunction#scopeChain(b239d380c31bc982).().nodecxx . . $ QTJSC/ScopeChain#node(7483ce9f56294eec).(); |
| 116 | return CallTypeJScxx . . $ QTJSC/CallTypeJS.; |
| 117 | } |
| 118 | |
| 119 | JSValuecxx . . $ QTJSC/JSValue# JSFunctioncxx . . $ QTJSC/JSFunction#::callcxx . . $ QTJSC/JSFunction#call(a346bc844d0fe1c2).(ExecStatecxx . . $ QTJSC/ExecState#* exec, JSValuecxx . . $ QTJSC/JSValue# thisValue, const ArgListcxx . . $ QTJSC/ArgList#& args) |
| 120 | { |
| 121 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(!isHostFunction()); |
| 122 | return exec->interpretercxx . . $ QTJSC/ExecState#interpreter(6574b75232d5177f).()->executecxx . . $ QTJSC/Interpreter#execute(a0a052767767bb53).(jsExecutablecxx . . $ QTJSC/JSFunction#jsExecutable(41a6d61c9ef790ed).(), exec, this, thisValue.toThisObjectcxx . . $ QTJSC/JSValue#toThisObject(8709ed4849a165ab).(exec), args, scopeChaincxx . . $ QTJSC/JSFunction#scopeChain(b239d380c31bc982).().nodecxx . . $ QTJSC/ScopeChain#node(7483ce9f56294eec).(), exec->exceptionSlotcxx . . $ QTJSC/ExecState#exceptionSlot(6880e523701d9eaa).()); |
| 123 | } |
| 124 | |
| 125 | JSValuecxx . . $ QTJSC/JSValue# JSFunctioncxx . . $ QTJSC/JSFunction#::argumentsGettercxx . . $ QTJSC/JSFunction#argumentsGetter(2d50ae1b8ebdc06b).(ExecStatecxx . . $ QTJSC/ExecState#* exec, const Identifiercxx . . $ QTJSC/Identifier#&, const PropertySlotcxx . . $ QTJSC/PropertySlot#& slot) |
| 126 | { |
| 127 | JSFunctioncxx . . $ QTJSC/JSFunction#* thisObj = asFunctioncxx . . $ QTJSC/asFunction(deffc94ad83de35f).(slot.slotBasecxx . . $ QTJSC/PropertySlot#slotBase(888c053acf364da1).()); |
| 128 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(!thisObj->isHostFunction()); |
| 129 | return exec->interpretercxx . . $ QTJSC/ExecState#interpreter(6574b75232d5177f).()->retrieveArgumentscxx . . $ QTJSC/Interpreter#retrieveArguments(3f9d942197bdd3cc).(exec, thisObj); |
| 130 | } |
| 131 | |
| 132 | JSValuecxx . . $ QTJSC/JSValue# JSFunctioncxx . . $ QTJSC/JSFunction#::callerGettercxx . . $ QTJSC/JSFunction#callerGetter(2d50ae1b8ebdc06b).(ExecStatecxx . . $ QTJSC/ExecState#* exec, const Identifiercxx . . $ QTJSC/Identifier#&, const PropertySlotcxx . . $ QTJSC/PropertySlot#& slot) |
| 133 | { |
| 134 | JSFunctioncxx . . $ QTJSC/JSFunction#* thisObj = asFunctioncxx . . $ QTJSC/asFunction(deffc94ad83de35f).(slot.slotBasecxx . . $ QTJSC/PropertySlot#slotBase(888c053acf364da1).()); |
| 135 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(!thisObj->isHostFunction()); |
| 136 | return exec->interpretercxx . . $ QTJSC/ExecState#interpreter(6574b75232d5177f).()->retrieveCallercxx . . $ QTJSC/Interpreter#retrieveCaller(ba763e7f33a9c8e7).(exec, thisObj); |
| 137 | } |
| 138 | |
| 139 | JSValuecxx . . $ QTJSC/JSValue# JSFunctioncxx . . $ QTJSC/JSFunction#::lengthGettercxx . . $ QTJSC/JSFunction#lengthGetter(2d50ae1b8ebdc06b).(ExecStatecxx . . $ QTJSC/ExecState#* exec, const Identifiercxx . . $ QTJSC/Identifier#&, const PropertySlotcxx . . $ QTJSC/PropertySlot#& slot) |
| 140 | { |
| 141 | JSFunctioncxx . . $ QTJSC/JSFunction#* thisObj = asFunctioncxx . . $ QTJSC/asFunction(deffc94ad83de35f).(slot.slotBasecxx . . $ QTJSC/PropertySlot#slotBase(888c053acf364da1).()); |
| 142 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(!thisObj->isHostFunction()); |
| 143 | return jsNumbercxx . . $ QTJSC/jsNumber(bdb4a03c934d5200).(exec, thisObj->jsExecutablecxx . . $ QTJSC/JSFunction#jsExecutable(41a6d61c9ef790ed).()->parameterCountcxx . . $ QTJSC/FunctionExecutable#parameterCount(fe4d2d262d4164a8).()); |
| 144 | } |
| 145 | |
| 146 | bool JSFunctioncxx . . $ QTJSC/JSFunction#::getOwnPropertySlotcxx . . $ QTJSC/JSFunction#getOwnPropertySlot(6f4ef3dbfe7d5ab9).(ExecStatecxx . . $ QTJSC/ExecState#* exec, const Identifiercxx . . $ QTJSC/Identifier#& propertyName, PropertySlotcxx . . $ QTJSC/PropertySlot#& slot) |
| 147 | { |
| 148 | if (isHostFunctioncxx . . $ QTJSC/JSFunction#isHostFunction(50ce9a9e25b4a850).()) |
| 149 | return Basecxx . . $ QTJSC/JSFunction#Base#::getOwnPropertySlotcxx . . $ QTJSC/JSFunction#getOwnPropertySlot(6f4ef3dbfe7d5ab9).(exec, propertyName, slot); |
| 150 | |
| 151 | if (propertyName ==cxx . . $ QTJSC/`operator==`(8208a731c2dadbc2). exec->propertyNamescxx . . $ QTJSC/ExecState#propertyNames(16296db726e31f87).().prototype) { |
| 152 | JSValuecxx . . $ QTJSC/JSValue#* location = getDirectLocationcxx . . $ QTJSC/JSObject#getDirectLocation(d045793fede5b5cb).(propertyName); |
| 153 | |
| 154 | if (!location) { |
| 155 | JSObjectcxx . . $ QTJSC/JSObject#* prototype = new (exec) JSObject(scopeChain().globalObject()->emptyObjectStructure()); |
| 156 | prototype->putDirectcxx . . $ QTJSC/JSObject#putDirect(ced585bb6c91af73).(exec->propertyNamescxx . . $ QTJSC/ExecState#propertyNames(16296db726e31f87).().constructor, this, DontEnumcxx . . $ QTJSC/DontEnum.); |
| 157 | putDirectcxx . . $ QTJSC/JSObject#putDirect(ced585bb6c91af73).(exec->propertyNamescxx . . $ QTJSC/ExecState#propertyNames(16296db726e31f87).().prototype, prototype, DontDeletecxx . . $ QTJSC/DontDelete.); |
| 158 | location = getDirectLocationcxx . . $ QTJSC/JSObject#getDirectLocation(d045793fede5b5cb).(propertyName); |
| 159 | } |
| 160 | |
| 161 | slot.setValueSlotcxx . . $ QTJSC/PropertySlot#setValueSlot(1b789a609c0b4a9).(this, location, offsetForLocationcxx . . $ QTJSC/JSObject#offsetForLocation(3c2f1ef63f003ac6).(location)); |
| 162 | } |
| 163 | |
| 164 | if (propertyName ==cxx . . $ QTJSC/`operator==`(8208a731c2dadbc2). exec->propertyNamescxx . . $ QTJSC/ExecState#propertyNames(16296db726e31f87).().arguments) { |
| 165 | slot.setCustomcxx . . $ QTJSC/PropertySlot#setCustom(201c6ee79e352ec7).(this, argumentsGettercxx . . $ QTJSC/JSFunction#argumentsGetter(2d50ae1b8ebdc06b).); |
| 166 | return true; |
| 167 | } |
| 168 | |
| 169 | if (propertyName ==cxx . . $ QTJSC/`operator==`(8208a731c2dadbc2). exec->propertyNamescxx . . $ QTJSC/ExecState#propertyNames(16296db726e31f87).().length) { |
| 170 | slot.setCustomcxx . . $ QTJSC/PropertySlot#setCustom(201c6ee79e352ec7).(this, lengthGettercxx . . $ QTJSC/JSFunction#lengthGetter(2d50ae1b8ebdc06b).); |
| 171 | return true; |
| 172 | } |
| 173 | |
| 174 | if (propertyName ==cxx . . $ QTJSC/`operator==`(8208a731c2dadbc2). exec->propertyNamescxx . . $ QTJSC/ExecState#propertyNames(16296db726e31f87).().caller) { |
| 175 | slot.setCustomcxx . . $ QTJSC/PropertySlot#setCustom(201c6ee79e352ec7).(this, callerGettercxx . . $ QTJSC/JSFunction#callerGetter(2d50ae1b8ebdc06b).); |
| 176 | return true; |
| 177 | } |
| 178 | |
| 179 | return Basecxx . . $ QTJSC/JSFunction#Base#::getOwnPropertySlotcxx . . $ QTJSC/JSFunction#getOwnPropertySlot(6f4ef3dbfe7d5ab9).(exec, propertyName, slot); |
| 180 | } |
| 181 | |
| 182 | bool JSFunctioncxx . . $ QTJSC/JSFunction#::getOwnPropertyDescriptorcxx . . $ QTJSC/JSFunction#getOwnPropertyDescriptor(dce4ef7012294c32).(ExecStatecxx . . $ QTJSC/ExecState#* exec, const Identifiercxx . . $ QTJSC/Identifier#& propertyName, PropertyDescriptorcxx . . $ QTJSC/PropertyDescriptor#& descriptor) |
| 183 | { |
| 184 | if (isHostFunctioncxx . . $ QTJSC/JSFunction#isHostFunction(50ce9a9e25b4a850).()) |
| 185 | return Basecxx . . $ QTJSC/JSFunction#Base#::getOwnPropertyDescriptorcxx . . $ QTJSC/JSObject#getOwnPropertyDescriptor(dce4ef7012294c32).(exec, propertyName, descriptor); |
| 186 | |
| 187 | if (propertyName ==cxx . . $ QTJSC/`operator==`(8208a731c2dadbc2). exec->propertyNamescxx . . $ QTJSC/ExecState#propertyNames(16296db726e31f87).().prototype) { |
| 188 | PropertySlotcxx . . $ QTJSC/PropertySlot# slotcxx . . $ QTJSC/PropertySlot#PropertySlot(49f6e7a06ebc5aa8).; |
| 189 | getOwnPropertySlotcxx . . $ QTJSC/JSFunction#getOwnPropertySlot(6f4ef3dbfe7d5ab9).(exec, propertyName, slot); |
| 190 | return Basecxx . . $ QTJSC/JSFunction#Base#::getOwnPropertyDescriptorcxx . . $ QTJSC/JSObject#getOwnPropertyDescriptor(dce4ef7012294c32).(exec, propertyName, descriptor); |
| 191 | } |
| 192 | |
| 193 | if (propertyName ==cxx . . $ QTJSC/`operator==`(8208a731c2dadbc2). exec->propertyNamescxx . . $ QTJSC/ExecState#propertyNames(16296db726e31f87).().arguments) { |
| 194 | descriptor.setDescriptorcxx . . $ QTJSC/PropertyDescriptor#setDescriptor(48358939f851dacc).(exec->interpretercxx . . $ QTJSC/ExecState#interpreter(6574b75232d5177f).()->retrieveArgumentscxx . . $ QTJSC/Interpreter#retrieveArguments(3f9d942197bdd3cc).(exec, this), ReadOnlycxx . . $ QTJSC/ReadOnly. | DontEnumcxx . . $ QTJSC/DontEnum. | DontDeletecxx . . $ QTJSC/DontDelete.); |
| 195 | return true; |
| 196 | } |
| 197 | |
| 198 | if (propertyName ==cxx . . $ QTJSC/`operator==`(8208a731c2dadbc2). exec->propertyNamescxx . . $ QTJSC/ExecState#propertyNames(16296db726e31f87).().length) { |
| 199 | descriptor.setDescriptorcxx . . $ QTJSC/PropertyDescriptor#setDescriptor(48358939f851dacc).(jsNumbercxx . . $ QTJSC/jsNumber(bdb4a03c934d5200).(exec, jsExecutablecxx . . $ QTJSC/JSFunction#jsExecutable(41a6d61c9ef790ed).()->parameterCountcxx . . $ QTJSC/FunctionExecutable#parameterCount(fe4d2d262d4164a8).()), ReadOnlycxx . . $ QTJSC/ReadOnly. | DontEnumcxx . . $ QTJSC/DontEnum. | DontDeletecxx . . $ QTJSC/DontDelete.); |
| 200 | return true; |
| 201 | } |
| 202 | |
| 203 | if (propertyName ==cxx . . $ QTJSC/`operator==`(8208a731c2dadbc2). exec->propertyNamescxx . . $ QTJSC/ExecState#propertyNames(16296db726e31f87).().caller) { |
| 204 | descriptor.setDescriptorcxx . . $ QTJSC/PropertyDescriptor#setDescriptor(48358939f851dacc).(exec->interpretercxx . . $ QTJSC/ExecState#interpreter(6574b75232d5177f).()->retrieveCallercxx . . $ QTJSC/Interpreter#retrieveCaller(ba763e7f33a9c8e7).(exec, this), ReadOnlycxx . . $ QTJSC/ReadOnly. | DontEnumcxx . . $ QTJSC/DontEnum. | DontDeletecxx . . $ QTJSC/DontDelete.); |
| 205 | return true; |
| 206 | } |
| 207 | |
| 208 | return Basecxx . . $ QTJSC/JSFunction#Base#::getOwnPropertyDescriptorcxx . . $ QTJSC/JSObject#getOwnPropertyDescriptor(dce4ef7012294c32).(exec, propertyName, descriptor); |
| 209 | } |
| 210 | |
| 211 | void JSFunctioncxx . . $ QTJSC/JSFunction#::getOwnPropertyNamescxx . . $ QTJSC/JSFunction#getOwnPropertyNames(2f9e3f18de200b4e).(ExecStatecxx . . $ QTJSC/ExecState#* exec, PropertyNameArraycxx . . $ QTJSC/PropertyNameArray#& propertyNames, EnumerationModecxx . . $ QTJSC/EnumerationMode# mode) |
| 212 | { |
| 213 | if (!isHostFunctioncxx . . $ QTJSC/JSFunction#isHostFunction(50ce9a9e25b4a850).() && (mode == IncludeDontEnumPropertiescxx . . $ QTJSC/IncludeDontEnumProperties.)) { |
| 214 | propertyNames.addcxx . . $ QTJSC/PropertyNameArray#add(d7ed36c5537ed570).(exec->propertyNamescxx . . $ QTJSC/ExecState#propertyNames(16296db726e31f87).().arguments); |
| 215 | propertyNames.addcxx . . $ QTJSC/PropertyNameArray#add(d7ed36c5537ed570).(exec->propertyNamescxx . . $ QTJSC/ExecState#propertyNames(16296db726e31f87).().callee); |
| 216 | propertyNames.addcxx . . $ QTJSC/PropertyNameArray#add(d7ed36c5537ed570).(exec->propertyNamescxx . . $ QTJSC/ExecState#propertyNames(16296db726e31f87).().caller); |
| 217 | propertyNames.addcxx . . $ QTJSC/PropertyNameArray#add(d7ed36c5537ed570).(exec->propertyNamescxx . . $ QTJSC/ExecState#propertyNames(16296db726e31f87).().length); |
| 218 | } |
| 219 | Basecxx . . $ QTJSC/JSFunction#Base#::getOwnPropertyNamescxx . . $ QTJSC/JSObject#getOwnPropertyNames(2f9e3f18de200b4e).(exec, propertyNames, mode); |
| 220 | } |
| 221 | |
| 222 | void JSFunctioncxx . . $ QTJSC/JSFunction#::putcxx . . $ QTJSC/JSFunction#put(dfb3133dafbe9ff4).(ExecStatecxx . . $ QTJSC/ExecState#* exec, const Identifiercxx . . $ QTJSC/Identifier#& propertyName, JSValuecxx . . $ QTJSC/JSValue# value, PutPropertySlotcxx . . $ QTJSC/PutPropertySlot#& slot) |
| 223 | { |
| 224 | if (isHostFunctioncxx . . $ QTJSC/JSFunction#isHostFunction(50ce9a9e25b4a850).()) { |
| 225 | Basecxx . . $ QTJSC/JSFunction#Base#::putcxx . . $ QTJSC/JSFunction#put(dfb3133dafbe9ff4).(exec, propertyName, value, slot); |
| 226 | return; |
| 227 | } |
| 228 | if (propertyName ==cxx . . $ QTJSC/`operator==`(8208a731c2dadbc2). exec->propertyNamescxx . . $ QTJSC/ExecState#propertyNames(16296db726e31f87).().arguments || propertyName ==cxx . . $ QTJSC/`operator==`(8208a731c2dadbc2). exec->propertyNamescxx . . $ QTJSC/ExecState#propertyNames(16296db726e31f87).().length) |
| 229 | return; |
| 230 | Basecxx . . $ QTJSC/JSFunction#Base#::putcxx . . $ QTJSC/JSFunction#put(dfb3133dafbe9ff4).(exec, propertyName, value, slot); |
| 231 | } |
| 232 | |
| 233 | bool JSFunctioncxx . . $ QTJSC/JSFunction#::deletePropertycxx . . $ QTJSC/JSFunction#deleteProperty(13154ef9bddc9416).(ExecStatecxx . . $ QTJSC/ExecState#* exec, const Identifiercxx . . $ QTJSC/Identifier#& propertyName) |
| 234 | { |
| 235 | if (isHostFunctioncxx . . $ QTJSC/JSFunction#isHostFunction(50ce9a9e25b4a850).()) |
| 236 | return Basecxx . . $ QTJSC/JSFunction#Base#::deletePropertycxx . . $ QTJSC/JSFunction#deleteProperty(13154ef9bddc9416).(exec, propertyName); |
| 237 | if (propertyName ==cxx . . $ QTJSC/`operator==`(8208a731c2dadbc2). exec->propertyNamescxx . . $ QTJSC/ExecState#propertyNames(16296db726e31f87).().arguments || propertyName ==cxx . . $ QTJSC/`operator==`(8208a731c2dadbc2). exec->propertyNamescxx . . $ QTJSC/ExecState#propertyNames(16296db726e31f87).().length) |
| 238 | return false; |
| 239 | return Basecxx . . $ QTJSC/JSFunction#Base#::deletePropertycxx . . $ QTJSC/JSFunction#deleteProperty(13154ef9bddc9416).(exec, propertyName); |
| 240 | } |
| 241 | |
| 242 | // ECMA 13.2.2 [[Construct]] |
| 243 | ConstructTypecxx . . $ QTJSC/ConstructType# JSFunctioncxx . . $ QTJSC/JSFunction#::getConstructDatacxx . . $ QTJSC/JSFunction#getConstructData(80014d68d6143eea).(ConstructDatacxx . . $ QTJSC/ConstructData#& constructData) |
| 244 | { |
| 245 | if (isHostFunctioncxx . . $ QTJSC/JSFunction#isHostFunction(50ce9a9e25b4a850).()) |
| 246 | return ConstructTypeNonecxx . . $ QTJSC/ConstructTypeNone.; |
| 247 | constructData.jscxx . . $ QTJSC/ConstructData#js..functionExecutablecxx . . $ QTJSC/ConstructData#$anonymous_type_1#functionExecutable. = jsExecutablecxx . . $ QTJSC/JSFunction#jsExecutable(41a6d61c9ef790ed).(); |
| 248 | constructData.jscxx . . $ QTJSC/ConstructData#js..scopeChaincxx . . $ QTJSC/ConstructData#$anonymous_type_1#scopeChain. = scopeChaincxx . . $ QTJSC/JSFunction#scopeChain(b239d380c31bc982).().nodecxx . . $ QTJSC/ScopeChain#node(7483ce9f56294eec).(); |
| 249 | return ConstructTypeJScxx . . $ QTJSC/ConstructTypeJS.; |
| 250 | } |
| 251 | |
| 252 | JSObjectcxx . . $ QTJSC/JSObject#* JSFunctioncxx . . $ QTJSC/JSFunction#::constructcxx . . $ QTJSC/JSFunction#construct(ec25cef8276945af).(ExecStatecxx . . $ QTJSC/ExecState#* exec, const ArgListcxx . . $ QTJSC/ArgList#& args) |
| 253 | { |
| 254 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(!isHostFunction()); |
| 255 | Structurecxx . . $ QTJSC/Structure#* structure; |
| 256 | JSValuecxx . . $ QTJSC/JSValue# prototype = getcxx . . $ QTJSC/JSObject#get(2d9c2221088d2593).(exec, exec->propertyNamescxx . . $ QTJSC/ExecState#propertyNames(16296db726e31f87).().prototype); |
| 257 | if (prototype.isObjectcxx . . $ QTJSC/JSValue#isObject(50ce9a9e25b4a850).()) |
| 258 | structure = asObjectcxx . . $ QTJSC/asObject(107e81180f8dd622).(prototype)->inheritorIDcxx . . $ QTJSC/JSObject#inheritorID(4f089b87575e542).(); |
| 259 | else |
| 260 | structure = exec->lexicalGlobalObjectcxx . . $ QTJSC/ExecState#lexicalGlobalObject(3d50c730b5e26899).()->emptyObjectStructurecxx . . $ QTJSC/JSGlobalObject#emptyObjectStructure(a25848528202c7a).(); |
| 261 | JSObjectcxx . . $ QTJSC/JSObject#* thisObj = new (exec) JSObject(structure); |
| 262 | |
| 263 | JSValuecxx . . $ QTJSC/JSValue# result = exec->interpretercxx . . $ QTJSC/ExecState#interpreter(6574b75232d5177f).()->executecxx . . $ QTJSC/Interpreter#execute(a0a052767767bb53).(jsExecutablecxx . . $ QTJSC/JSFunction#jsExecutable(41a6d61c9ef790ed).(), exec, this, thisObj, args, scopeChaincxx . . $ QTJSC/JSFunction#scopeChain(b239d380c31bc982).().nodecxx . . $ QTJSC/ScopeChain#node(7483ce9f56294eec).(), exec->exceptionSlotcxx . . $ QTJSC/ExecState#exceptionSlot(6880e523701d9eaa).()); |
| 264 | if (exec->hadExceptioncxx . . $ QTJSC/ExecState#hadException(50ce9a9e25b4a850).() || !result.isObjectcxx . . $ QTJSC/JSValue#isObject(50ce9a9e25b4a850).()) |
| 265 | return thisObj; |
| 266 | return asObjectcxx . . $ QTJSC/asObject(107e81180f8dd622).(result); |
| 267 | } |
| 268 | |
| 269 | } // namespace JSC |