| 1 | /* |
| 2 | * Copyright (C) 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 Lesser 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 | * Lesser General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU Lesser General Public |
| 15 | * License along with this library; if not, write to the Free Software |
| 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 17 | * |
| 18 | */ |
| 19 | |
| 20 | #include "config.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/config.h`/ |
| 21 | #include "Lookup.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Lookup.h`/ |
| 22 | |
| 23 | #include "JSFunction.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSFunction.h`/ |
| 24 | #include "PrototypeFunction.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/PrototypeFunction.h`/ |
| 25 | |
| 26 | namespace JSCcxx . . $ `<built-in>:463:9`! { |
| 27 | |
| 28 | void HashTablecxx . . $ QTJSC/HashTable#::createTablecxx . . $ QTJSC/HashTable#createTable(cacade0566098a58).(JSGlobalDatacxx . . $ QTJSC/JSGlobalData#* globalData) const |
| 29 | { |
| 30 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(!table); |
| 31 | int linkIndex = compactHashSizeMaskcxx . . $ QTJSC/HashTable#compactHashSizeMask. + 1; |
| 32 | HashEntrycxx . . $ QTJSC/HashEntry#* entries = new HashEntrycxx . . $ QTJSC/HashEntry#[compactSizecxx . . $ QTJSC/HashTable#compactSize.]; |
| 33 | for (int i = 0; i < compactSizecxx . . $ QTJSC/HashTable#compactSize.; ++i) |
| 34 | entries[i].setKeycxx . . $ QTJSC/HashEntry#setKey(f38096febece923b).(0); |
| 35 | for (int i = 0; valuescxx . . $ QTJSC/HashTable#values.[i].keycxx . . $ QTJSC/HashTableValue#key.; ++i) { |
| 36 | UStringcxx . . $ QTJSC/UString#::Repcxx . . $ QTJSC/UString#Rep#* identifier = Identifiercxx . . $ QTJSC/Identifier#::addcxx . . $ QTJSC/Identifier#add(b2bc4d53e7e7851c).(globalData, valuescxx . . $ QTJSC/HashTable#values.[i].keycxx . . $ QTJSC/HashTableValue#key.).releaseRef(); |
| 37 | int hashIndex = identifier->existingHashcxx . . $ QTJSC/UStringImpl#existingHash(ddd8539a2fcdd4ce).() & compactHashSizeMaskcxx . . $ QTJSC/HashTable#compactHashSizeMask.; |
| 38 | HashEntrycxx . . $ QTJSC/HashEntry#* entry = &entries[hashIndex]; |
| 39 | |
| 40 | if (entry->keycxx . . $ QTJSC/HashEntry#key(eff8ac5d0836371c).()) { |
| 41 | while (entry->nextcxx . . $ QTJSC/HashEntry#next(f830c77705987d82).()) { |
| 42 | entry = entry->nextcxx . . $ QTJSC/HashEntry#next(f830c77705987d82).(); |
| 43 | } |
| 44 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(linkIndex < compactSize); |
| 45 | entry->setNextcxx . . $ QTJSC/HashEntry#setNext(cfc321a836b2656e).(&entries[linkIndex++]); |
| 46 | entry = entry->nextcxx . . $ QTJSC/HashEntry#next(f830c77705987d82).(); |
| 47 | } |
| 48 | |
| 49 | entry->initializecxx . . $ QTJSC/HashEntry#initialize(f5bf2deaa008411d).(identifier, valuescxx . . $ QTJSC/HashTable#values.[i].attributescxx . . $ QTJSC/HashTableValue#attributes., valuescxx . . $ QTJSC/HashTable#values.[i].value1cxx . . $ QTJSC/HashTableValue#value1., valuescxx . . $ QTJSC/HashTable#values.[i].value2cxx . . $ QTJSC/HashTableValue#value2.); |
| 50 | } |
| 51 | tablecxx . . $ QTJSC/HashTable#table. = entries; |
| 52 | } |
| 53 | |
| 54 | void HashTablecxx . . $ QTJSC/HashTable#::deleteTablecxx . . $ QTJSC/HashTable#deleteTable(83f5f38750778ac8).() const |
| 55 | { |
| 56 | if (tablecxx . . $ QTJSC/HashTable#table.) { |
| 57 | int max = compactSizecxx . . $ QTJSC/HashTable#compactSize.; |
| 58 | for (int i = 0; i != max; ++i) { |
| 59 | if (UStringcxx . . $ QTJSC/UString#::Repcxx . . $ QTJSC/UString#Rep#* key = tablecxx . . $ QTJSC/HashTable#table.[i].keycxx . . $ QTJSC/HashEntry#key(eff8ac5d0836371c).()) |
| 60 | key->derefcxx . . $ QTJSC/UStringImpl#deref(49f6e7a06ebc5aa8).(); |
| 61 | } |
| 62 | delete [] tablecxx . . $ QTJSC/HashTable#table.; |
| 63 | tablecxx . . $ QTJSC/HashTable#table. = 0; |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | void setUpStaticFunctionSlotcxx . . $ QTJSC/setUpStaticFunctionSlot(62de5135612538c0).(ExecStatecxx . . $ QTJSC/ExecState#* exec, const HashEntrycxx . . $ QTJSC/HashEntry#* entry, JSObjectcxx . . $ QTJSC/JSObject#* thisObj, const Identifiercxx . . $ QTJSC/Identifier#& propertyName, PropertySlotcxx . . $ QTJSC/PropertySlot#& slot) |
| 68 | { |
| 69 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(entry->attributes() & Function); |
| 70 | JSValuecxx . . $ QTJSC/JSValue#* location = thisObj->getDirectLocationcxx . . $ QTJSC/JSObject#getDirectLocation(d045793fede5b5cb).(propertyName); |
| 71 | |
| 72 | if (!location) { |
| 73 | InternalFunctioncxx . . $ QTJSC/InternalFunction#* function = new (exec) NativeFunctionWrapper(exec, exec->lexicalGlobalObject()->prototypeFunctionStructure(), entry->functionLength(), propertyName, entry->function()); |
| 74 | |
| 75 | thisObj->putDirectFunctioncxx . . $ QTJSC/JSObject#putDirectFunction(c24ce1583bb64360).(propertyName, function, entry->attributescxx . . $ QTJSC/HashEntry#attributes(bd807b21b9713a30).()); |
| 76 | location = thisObj->getDirectLocationcxx . . $ QTJSC/JSObject#getDirectLocation(d045793fede5b5cb).(propertyName); |
| 77 | } |
| 78 | |
| 79 | slot.setValueSlotcxx . . $ QTJSC/PropertySlot#setValueSlot(1b789a609c0b4a9).(thisObj, location, thisObj->offsetForLocationcxx . . $ QTJSC/JSObject#offsetForLocation(3c2f1ef63f003ac6).(location)); |
| 80 | } |
| 81 | |
| 82 | } // namespace JSC |