Changeset 86727 in webkit
- Timestamp:
- May 17, 2011 7:39:00 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 47 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r86725 r86727 1 2011-05-17 Geoffrey Garen <ggaren@apple.com> 2 3 Reviewed by Gavin Barraclough. 4 5 Global object initialization is expensive 6 https://bugs.webkit.org/show_bug.cgi?id=60933 7 8 Added a few more expected failures, now that more code uses static hash 9 tables. 10 11 The fact that built-ins are not deletable, but should be, is covered by 12 https://bugs.webkit.org/show_bug.cgi?id=61014 13 14 * sputnik/Conformance/15_Native_Objects/15.6_Boolean/15.6.2/S15.6.2.1_A4-expected.txt: 15 * sputnik/Conformance/15_Native_Objects/15.6_Boolean/15.6.3/15.6.3.1_Boolean.prototype/S15.6.3.1_A1-expected.txt: 16 * sputnik/Conformance/15_Native_Objects/15.6_Boolean/15.6.4/S15.6.4_A1-expected.txt: 17 * sputnik/Conformance/15_Native_Objects/15.7_Number/15.7.2/S15.7.2.1_A4-expected.txt: 18 * sputnik/Conformance/15_Native_Objects/15.7_Number/15.7.3/15.7.3.1_Number.prototype/S15.7.3.1_A2_T1-expected.txt: 19 * sputnik/Conformance/15_Native_Objects/15.7_Number/15.7.4/S15.7.4_A1-expected.txt: 20 * sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.4/15.9.4.2_Date.parse/S15.9.4.2_A1_T2-expected.txt: 21 * sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.4/15.9.4.3_Date.UTC/S15.9.4.3_A1_T2-expected.txt: 22 1 23 2011-05-17 Cris Neckar <cdn@chromium.org> 2 24 -
trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.6_Boolean/15.6.2/S15.6.2.1_A4-expected.txt
r58534 r86727 1 1 S15.6.2.1_A4 2 2 3 PASS 3 FAIL SputnikError: #1: The [[Class]] property of the newly constructed object is set to "Boolean" 4 4 5 5 TEST COMPLETE -
trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.6_Boolean/15.6.3/15.6.3.1_Boolean.prototype/S15.6.3.1_A1-expected.txt
r58534 r86727 1 1 S15.6.3.1_A1 2 2 3 PASS 3 FAIL SputnikError: #3: The [[Class]] property of the Boolean prototype object is set to "Boolean" 4 4 5 5 TEST COMPLETE -
trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.6_Boolean/15.6.4/S15.6.4_A1-expected.txt
r58534 r86727 1 1 S15.6.4_A1 2 2 3 PASS 3 FAIL SputnikError: #3: The [[Class]] property of the Boolean prototype object is set to "Boolean" 4 4 5 5 TEST COMPLETE -
trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.7_Number/15.7.2/S15.7.2.1_A4-expected.txt
r58534 r86727 1 1 S15.7.2.1_A4 2 2 3 PASS 3 FAIL SputnikError: #1: The [[Class]] property of the newly constructed object is set to "Number" 4 4 5 5 TEST COMPLETE -
trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.7_Number/15.7.3/15.7.3.1_Number.prototype/S15.7.3.1_A2_T1-expected.txt
r58534 r86727 1 1 S15.7.3.1_A2_T1 2 2 3 PASS 3 FAIL SputnikError: #3: The [[Class]] property of the Number prototype object is set to "Number" 4 4 5 5 TEST COMPLETE -
trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.7_Number/15.7.4/S15.7.4_A1-expected.txt
r58534 r86727 1 1 S15.7.4_A1 2 2 3 PASS 3 FAIL SputnikError: #3: The [[Class]] property of the Number prototype object is set to "Number" 4 4 5 5 TEST COMPLETE -
trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.4/15.9.4.2_Date.parse/S15.9.4.2_A1_T2-expected.txt
r58534 r86727 1 1 S15.9.4.2_A1_T2 2 2 3 PASS 3 FAIL SputnikError: #2: The Date.parse property has not the attributes DontDelete 4 4 5 5 TEST COMPLETE -
trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.4/15.9.4.3_Date.UTC/S15.9.4.3_A1_T2-expected.txt
r58534 r86727 1 1 S15.9.4.3_A1_T2 2 2 3 PASS 3 FAIL SputnikError: #2: The Date.UTC property has not the attributes DontDelete 4 4 5 5 TEST COMPLETE -
trunk/Source/JavaScriptCore/CMakeLists.txt
r83792 r86727 177 177 178 178 SET(JavaScriptCore_LUT_FILES 179 runtime/ArrayConstructor.cpp 179 180 runtime/ArrayPrototype.cpp 181 runtime/BooleanPrototype.cpp 182 runtime/DateConstructor.cpp 180 183 runtime/DatePrototype.cpp 184 runtime/ErrorPrototype.cpp 185 runtime/JSGlobalObject.cpp 181 186 runtime/JSONObject.cpp 182 187 runtime/MathObject.cpp 183 188 runtime/NumberConstructor.cpp 189 runtime/NumberPrototype.cpp 184 190 runtime/ObjectConstructor.cpp 191 runtime/ObjectPrototype.cpp 185 192 runtime/RegExpConstructor.cpp 186 193 runtime/RegExpObject.cpp 194 runtime/RegExpPrototype.cpp 195 runtime/StringConstructor.cpp 187 196 runtime/StringPrototype.cpp 188 197 ) -
trunk/Source/JavaScriptCore/ChangeLog
r86712 r86727 1 2011-05-16 Geoffrey Garen <ggaren@apple.com> 2 3 Rolling back in r86653 with build fixed. 4 5 Reviewed by Gavin Barraclough and Oliver Hunt. 6 7 Global object initialization is expensive 8 https://bugs.webkit.org/show_bug.cgi?id=60933 9 10 Changed a bunch of globals to allocate their properties lazily, and changed 11 the global object to allocate a bunch of its globals lazily. 12 13 This reduces the footprint of a global object from 287 objects with 58 14 functions for 24K to 173 objects with 20 functions for 15K. 15 16 Large patch, but it's all mechanical. 17 18 * DerivedSources.make: 19 * JavaScriptCore.exp: Build! 20 21 * create_hash_table: Added a special case for fromCharCode, since it uses 22 a custom "thunk generator". 23 24 * heap/Heap.cpp: 25 (JSC::TypeCounter::operator()): Fixed a bug where the type counter would 26 overcount objects that were owned through more than one mechanism because 27 it was getting in the way of counting the results for this patch. 28 29 * interpreter/CallFrame.h: 30 (JSC::ExecState::arrayConstructorTable): 31 (JSC::ExecState::arrayPrototypeTable): 32 (JSC::ExecState::booleanPrototypeTable): 33 (JSC::ExecState::dateConstructorTable): 34 (JSC::ExecState::errorPrototypeTable): 35 (JSC::ExecState::globalObjectTable): 36 (JSC::ExecState::numberConstructorTable): 37 (JSC::ExecState::numberPrototypeTable): 38 (JSC::ExecState::objectPrototypeTable): 39 (JSC::ExecState::regExpPrototypeTable): 40 (JSC::ExecState::stringConstructorTable): Added new tables. 41 42 * runtime/ArrayConstructor.cpp: 43 (JSC::ArrayConstructor::ArrayConstructor): 44 (JSC::ArrayConstructor::getOwnPropertySlot): 45 (JSC::ArrayConstructor::getOwnPropertyDescriptor): 46 * runtime/ArrayConstructor.h: 47 (JSC::ArrayConstructor::createStructure): 48 * runtime/ArrayPrototype.cpp: 49 (JSC::ArrayPrototype::getOwnPropertySlot): 50 (JSC::ArrayPrototype::getOwnPropertyDescriptor): 51 * runtime/ArrayPrototype.h: 52 * runtime/BooleanPrototype.cpp: 53 (JSC::BooleanPrototype::BooleanPrototype): 54 (JSC::BooleanPrototype::getOwnPropertySlot): 55 (JSC::BooleanPrototype::getOwnPropertyDescriptor): 56 * runtime/BooleanPrototype.h: 57 (JSC::BooleanPrototype::createStructure): 58 * runtime/DateConstructor.cpp: 59 (JSC::DateConstructor::DateConstructor): 60 (JSC::DateConstructor::getOwnPropertySlot): 61 (JSC::DateConstructor::getOwnPropertyDescriptor): 62 * runtime/DateConstructor.h: 63 (JSC::DateConstructor::createStructure): 64 * runtime/ErrorPrototype.cpp: 65 (JSC::ErrorPrototype::ErrorPrototype): 66 (JSC::ErrorPrototype::getOwnPropertySlot): 67 (JSC::ErrorPrototype::getOwnPropertyDescriptor): 68 * runtime/ErrorPrototype.h: 69 (JSC::ErrorPrototype::createStructure): Standardized these objects 70 to use static tables for function properties. 71 72 * runtime/JSGlobalData.cpp: 73 (JSC::JSGlobalData::JSGlobalData): 74 (JSC::JSGlobalData::~JSGlobalData): 75 * runtime/JSGlobalData.h: Added new tables. 76 77 * runtime/JSGlobalObject.cpp: 78 (JSC::JSGlobalObject::reset): 79 (JSC::JSGlobalObject::addStaticGlobals): 80 (JSC::JSGlobalObject::getOwnPropertySlot): 81 (JSC::JSGlobalObject::getOwnPropertyDescriptor): 82 * runtime/JSGlobalObject.h: 83 * runtime/JSGlobalObjectFunctions.cpp: 84 * runtime/JSGlobalObjectFunctions.h: Changed JSGlobalObject to use a 85 static table for its global functions. This required uninlining some 86 things to avoid a circular header dependency. However, those things 87 probably shouldn't have been inlined in the first place. 88 89 Even more global object properties can be made lazy, but that requires 90 more in-depth changes. 91 92 * runtime/MathObject.cpp: 93 * runtime/NumberConstructor.cpp: 94 (JSC::NumberConstructor::getOwnPropertySlot): 95 (JSC::NumberConstructor::getOwnPropertyDescriptor): 96 * runtime/NumberPrototype.cpp: 97 (JSC::NumberPrototype::NumberPrototype): 98 (JSC::NumberPrototype::getOwnPropertySlot): 99 (JSC::NumberPrototype::getOwnPropertyDescriptor): 100 * runtime/NumberPrototype.h: 101 (JSC::NumberPrototype::createStructure): 102 * runtime/ObjectPrototype.cpp: 103 (JSC::ObjectPrototype::ObjectPrototype): 104 (JSC::ObjectPrototype::put): 105 (JSC::ObjectPrototype::getOwnPropertySlot): 106 (JSC::ObjectPrototype::getOwnPropertyDescriptor): 107 * runtime/ObjectPrototype.h: 108 (JSC::ObjectPrototype::createStructure): 109 * runtime/RegExpPrototype.cpp: 110 (JSC::RegExpPrototype::RegExpPrototype): 111 (JSC::RegExpPrototype::getOwnPropertySlot): 112 (JSC::RegExpPrototype::getOwnPropertyDescriptor): 113 * runtime/RegExpPrototype.h: 114 (JSC::RegExpPrototype::createStructure): 115 * runtime/StringConstructor.cpp: 116 (JSC::StringConstructor::StringConstructor): 117 (JSC::StringConstructor::getOwnPropertySlot): 118 (JSC::StringConstructor::getOwnPropertyDescriptor): 119 * runtime/StringConstructor.h: 120 (JSC::StringConstructor::createStructure): Standardized these objects 121 to use static tables for function properties. 122 1 123 2011-05-17 Sam Weinig <sam@webkit.org> 2 124 -
trunk/Source/JavaScriptCore/DerivedSources.make
r86657 r86727 36 36 .PHONY : all 37 37 all : \ 38 ArrayConstructor.lut.h \ 38 39 ArrayPrototype.lut.h \ 40 BooleanPrototype.lut.h \ 41 DateConstructor.lut.h \ 39 42 DatePrototype.lut.h \ 43 ErrorPrototype.lut.h \ 40 44 HeaderDetection.h \ 41 45 JSONObject.lut.h \ 42 46 JavaScriptCore.JSVALUE32_64.exp \ 43 47 JavaScriptCore.JSVALUE64.exp \ 48 JSGlobalObject.lut.h \ 44 49 Lexer.lut.h \ 45 50 MathObject.lut.h \ 46 51 NumberConstructor.lut.h \ 52 NumberPrototype.lut.h \ 47 53 ObjectConstructor.lut.h \ 54 ObjectPrototype.lut.h \ 48 55 RegExpConstructor.lut.h \ 56 RegExpPrototype.lut.h \ 49 57 RegExpJitTables.h \ 50 58 RegExpObject.lut.h \ 59 StringConstructor.lut.h \ 51 60 StringPrototype.lut.h \ 52 61 docs/bytecode.html \ -
trunk/Source/JavaScriptCore/DerivedSources.pro
r86657 r86727 15 15 16 16 LUT_FILES += \ 17 runtime/ArrayConstructor.cpp \ 17 18 runtime/ArrayPrototype.cpp \ 19 runtime/BooleanPrototype.cpp \ 20 runtime/DateConstructor.cpp \ 18 21 runtime/DatePrototype.cpp \ 22 runtime/ErrorPrototype.cpp \ 23 runtime/JSGlobalObject.cpp \ 19 24 runtime/JSONObject.cpp \ 20 25 runtime/MathObject.cpp \ 21 26 runtime/NumberConstructor.cpp \ 27 runtime/NumberPrototype.cpp \ 22 28 runtime/ObjectConstructor.cpp \ 29 runtime/ObjectPrototype.cpp \ 23 30 runtime/RegExpConstructor.cpp \ 24 31 runtime/RegExpObject.cpp \ 25 runtime/StringPrototype.cpp 32 runtime/RegExpPrototype.cpp \ 33 runtime/StringConstructor.cpp \ 34 runtime/StringPrototype.cpp \ 26 35 27 36 KEYWORDLUT_FILES += \ -
trunk/Source/JavaScriptCore/GNUmakefile.am
r86657 r86727 146 146 # FIXME: Should this list be generated from javascriptcore_built_nosources? 147 147 CLEANFILES += \ 148 Source/JavaScriptCore/runtime/ArrayPrototype.lut.h \ 149 Source/JavaScriptCore/runtime/DatePrototype.lut.h \ 150 Source/JavaScriptCore/runtime/JSONObject.lut.h \ 151 Source/JavaScriptCore/runtime/MathObject.lut.h \ 152 Source/JavaScriptCore/runtime/NumberConstructor.lut.h \ 153 Source/JavaScriptCore/runtime/RegExpConstructor.lut.h \ 154 Source/JavaScriptCore/runtime/RegExpObject.lut.h \ 155 Source/JavaScriptCore/runtime/StringPrototype.lut.h \ 148 Source/JavaScriptCore/Lexer.lut.h \ 149 Source/JavaScriptCore/RegExpJitTables.h \ 150 Source/JavaScriptCore/runtime/ArrayConstructor.lut.h \ 151 Source/JavaScriptCore/runtime/ArrayPrototype.lut.h \ 152 Source/JavaScriptCore/runtime/BooleanPrototype.lut.h \ 153 Source/JavaScriptCore/runtime/DateConstructor.lut.h \ 154 Source/JavaScriptCore/runtime/DatePrototype.lut.h \ 155 Source/JavaScriptCore/runtime/ErrorPrototype.lut.h \ 156 Source/JavaScriptCore/runtime/JSGlobalObject.lut.h \ 157 Source/JavaScriptCore/runtime/JSONObject.lut.h \ 158 Source/JavaScriptCore/runtime/MathObject.lut.h \ 159 Source/JavaScriptCore/runtime/NumberConstructor.lut.h \ 160 Source/JavaScriptCore/runtime/NumberPrototype.lut.h \ 161 Source/JavaScriptCore/runtime/ObjectConstructor.lut.h \ 162 Source/JavaScriptCore/runtime/ObjectPrototype.lut.h \ 163 Source/JavaScriptCore/runtime/RegExpConstructor.lut.h \ 164 Source/JavaScriptCore/runtime/RegExpObject.lut.h \ 165 Source/JavaScriptCore/runtime/RegExpPrototype.lut.h \ 166 Source/JavaScriptCore/runtime/StringConstructor.lut.h \ 167 Source/JavaScriptCore/runtime/StringPrototype.lut.h \ 156 168 Programs/jsc \ 157 169 Programs/jsc-@WEBKITGTK_API_MAJOR_VERSION@ \ -
trunk/Source/JavaScriptCore/GNUmakefile.list.am
r86657 r86727 14 14 Source/JavaScriptCore/Lexer.lut.h \ 15 15 Source/JavaScriptCore/RegExpJitTables.h \ 16 Source/JavaScriptCore/runtime/ArrayPrototype.lut.h \ 17 Source/JavaScriptCore/runtime/DatePrototype.lut.h \ 18 Source/JavaScriptCore/runtime/JSONObject.lut.h \ 19 Source/JavaScriptCore/runtime/MathObject.lut.h \ 20 Source/JavaScriptCore/runtime/NumberConstructor.lut.h \ 21 Source/JavaScriptCore/runtime/ObjectConstructor.lut.h \ 22 Source/JavaScriptCore/runtime/RegExpConstructor.lut.h \ 23 Source/JavaScriptCore/runtime/RegExpObject.lut.h \ 24 Source/JavaScriptCore/runtime/StringPrototype.lut.h 16 Source/JavaScriptCore/runtime/ArrayConstructor.lut.h \ 17 Source/JavaScriptCore/runtime/ArrayPrototype.lut.h \ 18 Source/JavaScriptCore/runtime/BooleanPrototype.lut.h \ 19 Source/JavaScriptCore/runtime/DateConstructor.lut.h \ 20 Source/JavaScriptCore/runtime/DatePrototype.lut.h \ 21 Source/JavaScriptCore/runtime/ErrorPrototype.lut.h \ 22 Source/JavaScriptCore/runtime/JSGlobalObject.lut.h \ 23 Source/JavaScriptCore/runtime/JSONObject.lut.h \ 24 Source/JavaScriptCore/runtime/MathObject.lut.h \ 25 Source/JavaScriptCore/runtime/NumberConstructor.lut.h \ 26 Source/JavaScriptCore/runtime/NumberPrototype.lut.h \ 27 Source/JavaScriptCore/runtime/ObjectConstructor.lut.h \ 28 Source/JavaScriptCore/runtime/ObjectPrototype.lut.h \ 29 Source/JavaScriptCore/runtime/RegExpConstructor.lut.h \ 30 Source/JavaScriptCore/runtime/RegExpObject.lut.h \ 31 Source/JavaScriptCore/runtime/RegExpPrototype.lut.h \ 32 Source/JavaScriptCore/runtime/StringConstructor.lut.h \ 33 Source/JavaScriptCore/runtime/StringPrototype.lut.h 25 34 26 35 javascriptcore_sources += \ -
trunk/Source/JavaScriptCore/JavaScriptCore.exp
r86657 r86727 160 160 __ZN3JSC14JSGlobalObject12defineSetterEPNS_9ExecStateERKNS_10IdentifierEPNS_8JSObjectEj 161 161 __ZN3JSC14JSGlobalObject13visitChildrenERNS_9MarkStackE 162 __ZN3JSC14JSGlobalObject16addStaticGlobalsEPNS0_18GlobalPropertyInfoEi 162 163 __ZN3JSC14JSGlobalObject17putWithAttributesEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueEj 164 __ZN3JSC14JSGlobalObject18getOwnPropertySlotEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE 165 __ZN3JSC14JSGlobalObject24getOwnPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE 163 166 __ZN3JSC14JSGlobalObject3putEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE 164 167 __ZN3JSC14JSGlobalObject4initEPNS_8JSObjectE 168 __ZN3JSC14JSGlobalObject6s_infoE 165 169 __ZN3JSC14JSGlobalObjectD2Ev 166 170 __ZN3JSC14JSGlobalObjectnwEmPNS_12JSGlobalDataE … … 218 222 __ZN3JSC25evaluateInGlobalCallFrameERKNS_7UStringERNS_7JSValueEPNS_14JSGlobalObjectE 219 223 __ZN3JSC35createInterruptedExecutionExceptionEPNS_12JSGlobalDataE 224 __ZN3JSC3NaNE 220 225 __ZN3JSC41constructFunctionSkippingEvalEnabledCheckEPNS_9ExecStateEPNS_14JSGlobalObjectERKNS_7ArgListERKNS_10IdentifierERKNS_7UStringEi 221 __ZN3JSC3NaNE222 226 __ZN3JSC4Heap16activityCallbackEv 223 227 __ZN3JSC4Heap16allocateSlowCaseEm … … 376 380 __ZN3WTF11OSAllocator18releaseDecommittedEPvm 377 381 __ZN3WTF11commentAtomE 378 __ZN3WTF11emptyStringEv379 382 __ZN3WTF11currentTimeEv 380 383 __ZN3WTF11dtoaRoundDPEPcdiRbRiRj 381 384 __ZN3WTF11dtoaRoundSFEPcdiRbRiRj 385 __ZN3WTF11emptyStringEv 382 386 __ZN3WTF11fastReallocEPvm 383 387 __ZN3WTF12AtomicString11addSlowCaseEPNS_10StringImplE -
trunk/Source/JavaScriptCore/JavaScriptCore.gypi
r86657 r86727 693 693 ], 694 694 'javascriptcore_derived_source_files': [ 695 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/Lexer.lut.h', 696 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/RegExpJitTables.h', 697 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/TracingDtrace.h', 698 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/ArrayConstructor.lut.h', 695 699 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/ArrayPrototype.lut.h', 700 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/BooleanPrototype.lut.h', 701 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/DateConstructor.lut.h', 696 702 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/DatePrototype.lut.h', 697 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/HeaderDetection.h', 703 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/ErrorPrototype.lut.h', 704 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/JSGlobalObject.lut.h', 698 705 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/JSONObject.lut.h', 699 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/Lexer.lut.h',700 706 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/MathObject.lut.h', 701 707 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/NumberConstructor.lut.h', 708 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/NumberPrototype.lut.h', 709 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/ObjectConstructor.lut.h', 710 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/ObjectPrototype.lut.h', 702 711 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/RegExpConstructor.lut.h', 703 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/RegExpJitTables.h',704 712 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/RegExpObject.lut.h', 713 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/RegExpPrototype.lut.h', 714 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/StringConstructor.lut.h', 705 715 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/StringPrototype.lut.h', 706 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/TracingDtrace.h',707 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/ObjectConstructor.lut.h',708 716 ], 709 717 'minidom_files': [ -
trunk/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
r86657 r86727 57 57 ?addPropertyWithoutTransition@Structure@JSC@@QAEIAAVJSGlobalData@2@ABVIdentifier@2@IPAVJSCell@2@@Z 58 58 ?addSlowCase@Identifier@JSC@@CA?AV?$PassRefPtr@VStringImpl@WTF@@@WTF@@PAVExecState@2@PAVStringImpl@4@@Z 59 ?addStaticGlobals@JSGlobalObject@JSC@@IAEXPAUGlobalPropertyInfo@12@H@Z 59 60 ?allocate@Heap@JSC@@QAEPAXI@Z 60 61 ?allocateFromSizeClass@MarkedSpace@JSC@@AAEPAXAAUSizeClass@12@@Z … … 183 184 ?getJSNumber@JSCell@JSC@@UAE?AVJSValue@2@XZ 184 185 ?getObject@JSCell@JSC@@QAEPAVJSObject@2@XZ 186 ?getOwnPropertyDescriptor@JSGlobalObject@JSC@@UAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z 185 187 ?getOwnPropertyDescriptor@JSObject@JSC@@UAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z 186 188 ?getOwnPropertyDescriptor@JSString@JSC@@EAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z … … 192 194 ?getOwnPropertySlot@JSCell@JSC@@EAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertySlot@2@@Z 193 195 ?getOwnPropertySlot@JSCell@JSC@@EAE_NPAVExecState@2@IAAVPropertySlot@2@@Z 196 ?getOwnPropertySlot@JSGlobalObject@JSC@@UAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertySlot@2@@Z 194 197 ?getOwnPropertySlot@JSObject@JSC@@UAE_NPAVExecState@2@IAAVPropertySlot@2@@Z 195 198 ?getOwnPropertySlot@JSString@JSC@@EAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertySlot@2@@Z … … 241 244 ?lookupGetter@JSObject@JSC@@UAE?AVJSValue@2@PAVExecState@2@ABVIdentifier@2@@Z 242 245 ?lookupSetter@JSObject@JSC@@UAE?AVJSValue@2@PAVExecState@2@ABVIdentifier@2@@Z 243 ?visitChildren@JSGlobalObject@JSC@@UAEXAAVMarkStack@2@@Z244 ?visitChildren@JSObject@JSC@@UAEXAAVMarkStack@2@@Z245 ?visitChildren@JSWrapperObject@JSC@@EAEXAAVMarkStack@2@@Z246 ?visitChildren@ScopeChainNode@JSC@@UAEXAAVMarkStack@2@@Z247 246 ?materializePropertyMap@Structure@JSC@@AAEXAAVJSGlobalData@2@@Z 248 247 ?monthFromDayInYear@WTF@@YAHH_N@Z … … 298 297 ?retrieveCaller@Interpreter@JSC@@QBE?AVJSValue@2@PAVExecState@2@PAVJSFunction@2@@Z 299 298 ?retrieveLastCaller@Interpreter@JSC@@QBEXPAVExecState@2@AAH1AAVUString@2@AAVJSValue@2@@Z 299 ?s_info@JSGlobalObject@JSC@@2UClassInfo@2@B 300 300 ?setAccessorDescriptor@PropertyDescriptor@JSC@@QAEXVJSValue@2@0I@Z 301 301 ?setConfigurable@PropertyDescriptor@JSC@@QAEX_N@Z … … 370 370 ?unwrappedObject@JSObject@JSC@@UAEPAV12@XZ 371 371 ?utf8@UString@JSC@@QBE?AVCString@WTF@@_N@Z 372 ?visitChildren@JSGlobalObject@JSC@@UAEXAAVMarkStack@2@@Z 373 ?visitChildren@JSObject@JSC@@UAEXAAVMarkStack@2@@Z 374 ?visitChildren@JSWrapperObject@JSC@@EAEXAAVMarkStack@2@@Z 375 ?visitChildren@ScopeChainNode@JSC@@UAEXAAVMarkStack@2@@Z 372 376 ?vtableAnchor@InternalFunction@JSC@@EAEXXZ 373 377 ?wait@ThreadCondition@WTF@@QAEXAAVMutex@2@@Z -
trunk/Source/JavaScriptCore/create_hash_table
r86657 r86727 285 285 $thunkGenerator = "powThunkGenerator"; 286 286 } 287 if ($key eq "fromCharCode") { 288 $thunkGenerator = "fromCharCodeThunkGenerator"; 289 } 287 290 print " { \"$key\", $attrs[$i], (intptr_t)" . $castStr . "($firstValue), (intptr_t)$secondValue THUNK_GENERATOR($thunkGenerator) },\n"; 288 291 $i++; -
trunk/Source/JavaScriptCore/heap/Heap.cpp
r86657 r86727 1 1 /* 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> 4 4 * … … 314 314 const char* typeName(JSCell*); 315 315 OwnPtr<TypeCountSet> m_typeCountSet; 316 HashSet<JSCell*> m_cells; 316 317 }; 317 318 … … 340 341 inline void TypeCounter::operator()(JSCell* cell) 341 342 { 343 if (!m_cells.add(cell).second) 344 return; 342 345 m_typeCountSet->add(typeName(cell)); 343 346 } -
trunk/Source/JavaScriptCore/interpreter/CallFrame.h
r86657 r86727 2 2 * Copyright (C) 1999-2001 Harri Porten (porten@kde.org) 3 3 * Copyright (C) 2001 Peter Kelly (pmk@post.com) 4 * Copyright (C) 2003, 2007, 2008 Apple Inc. All rights reserved.4 * Copyright (C) 2003, 2007, 2008, 2011 Apple Inc. All rights reserved. 5 5 * 6 6 * This library is free software; you can redistribute it and/or … … 76 76 void dumpCaller(); 77 77 #endif 78 static const HashTable* arrayTable(CallFrame* callFrame) { return callFrame->globalData().arrayTable; } 78 static const HashTable* arrayConstructorTable(CallFrame* callFrame) { return callFrame->globalData().arrayConstructorTable; } 79 static const HashTable* arrayPrototypeTable(CallFrame* callFrame) { return callFrame->globalData().arrayPrototypeTable; } 80 static const HashTable* booleanPrototypeTable(CallFrame* callFrame) { return callFrame->globalData().booleanPrototypeTable; } 79 81 static const HashTable* dateTable(CallFrame* callFrame) { return callFrame->globalData().dateTable; } 82 static const HashTable* dateConstructorTable(CallFrame* callFrame) { return callFrame->globalData().dateConstructorTable; } 83 static const HashTable* errorPrototypeTable(CallFrame* callFrame) { return callFrame->globalData().errorPrototypeTable; } 84 static const HashTable* globalObjectTable(CallFrame* callFrame) { return callFrame->globalData().globalObjectTable; } 80 85 static const HashTable* jsonTable(CallFrame* callFrame) { return callFrame->globalData().jsonTable; } 81 86 static const HashTable* mathTable(CallFrame* callFrame) { return callFrame->globalData().mathTable; } 82 static const HashTable* numberTable(CallFrame* callFrame) { return callFrame->globalData().numberTable; } 87 static const HashTable* numberConstructorTable(CallFrame* callFrame) { return callFrame->globalData().numberConstructorTable; } 88 static const HashTable* numberPrototypeTable(CallFrame* callFrame) { return callFrame->globalData().numberPrototypeTable; } 83 89 static const HashTable* objectConstructorTable(CallFrame* callFrame) { return callFrame->globalData().objectConstructorTable; } 90 static const HashTable* objectPrototypeTable(CallFrame* callFrame) { return callFrame->globalData().objectPrototypeTable; } 84 91 static const HashTable* regExpTable(CallFrame* callFrame) { return callFrame->globalData().regExpTable; } 85 92 static const HashTable* regExpConstructorTable(CallFrame* callFrame) { return callFrame->globalData().regExpConstructorTable; } 93 static const HashTable* regExpPrototypeTable(CallFrame* callFrame) { return callFrame->globalData().regExpPrototypeTable; } 86 94 static const HashTable* stringTable(CallFrame* callFrame) { return callFrame->globalData().stringTable; } 95 static const HashTable* stringConstructorTable(CallFrame* callFrame) { return callFrame->globalData().stringConstructorTable; } 87 96 88 97 static CallFrame* create(Register* callFrameBase) { return static_cast<CallFrame*>(callFrameBase); } -
trunk/Source/JavaScriptCore/runtime/ArrayConstructor.cpp
r86657 r86727 1 1 /* 2 2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) 3 * Copyright (C) 2003, 2007, 2008 Apple Inc. All rights reserved.3 * Copyright (C) 2003, 2007, 2008, 2011 Apple Inc. All rights reserved. 4 4 * Copyright (C) 2003 Peter Kelly (pmk@post.com) 5 5 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) … … 34 34 namespace JSC { 35 35 36 ASSERT_CLASS_FITS_IN_CELL(ArrayConstructor);37 38 36 static EncodedJSValue JSC_HOST_CALL arrayConstructorIsArray(ExecState*); 39 37 40 ArrayConstructor::ArrayConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ArrayPrototype* arrayPrototype, Structure* functionStructure) 38 } 39 40 #include "ArrayConstructor.lut.h" 41 42 namespace JSC { 43 44 const ClassInfo ArrayConstructor::s_info = { "Function", &InternalFunction::s_info, 0, ExecState::arrayConstructorTable }; 45 46 /* Source for ArrayConstructor.lut.h 47 @begin arrayConstructorTable 48 isArray arrayConstructorIsArray DontEnum|Function 1 49 @end 50 */ 51 52 ASSERT_CLASS_FITS_IN_CELL(ArrayConstructor); 53 54 ArrayConstructor::ArrayConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ArrayPrototype* arrayPrototype) 41 55 : InternalFunction(&exec->globalData(), globalObject, structure, Identifier(exec, arrayPrototype->classInfo()->className)) 42 56 { 43 // ECMA 15.4.3.1 Array.prototype44 57 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().prototype, arrayPrototype, DontEnum | DontDelete | ReadOnly); 58 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().length, jsNumber(1), ReadOnly | DontEnum | DontDelete); 59 } 45 60 46 // no. of arguments for constructor 47 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().length, jsNumber(1), ReadOnly | DontEnum | DontDelete); 61 bool ArrayConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot) 62 { 63 return getStaticFunctionSlot<InternalFunction>(exec, ExecState::arrayConstructorTable(exec), this, propertyName, slot); 64 } 48 65 49 // ES5 50 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, globalObject, functionStructure, 1, exec->propertyNames().isArray, arrayConstructorIsArray), DontEnum); 66 bool ArrayConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 67 { 68 return getStaticFunctionDescriptor<InternalFunction>(exec, ExecState::arrayConstructorTable(exec), this, propertyName, descriptor); 51 69 } 70 71 // ------------------------------ Functions --------------------------- 52 72 53 73 static inline JSObject* constructArrayWithSizeQuirk(ExecState* exec, const ArgList& args) … … 73 93 } 74 94 75 // ECMA 15.4.276 95 ConstructType ArrayConstructor::getConstructData(ConstructData& constructData) 77 96 { … … 86 105 } 87 106 88 // ECMA 15.6.189 107 CallType ArrayConstructor::getCallData(CallData& callData) 90 108 { -
trunk/Source/JavaScriptCore/runtime/ArrayConstructor.h
r86657 r86727 1 1 /* 2 2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) 3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.3 * Copyright (C) 2007, 2008, 2011 Apple Inc. All rights reserved. 4 4 * 5 5 * This library is free software; you can redistribute it and/or … … 30 30 class ArrayConstructor : public InternalFunction { 31 31 public: 32 ArrayConstructor(ExecState*, JSGlobalObject*, Structure*, ArrayPrototype*, Structure*); 32 ArrayConstructor(ExecState*, JSGlobalObject*, Structure*, ArrayPrototype*); 33 34 static const ClassInfo s_info; 35 36 static Structure* createStructure(JSGlobalData& globalData, JSValue prototype) 37 { 38 return Structure::create(globalData, prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info); 39 } 40 41 protected: 42 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags; 43 44 private: 45 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 46 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 33 47 34 48 virtual ConstructType getConstructData(ConstructData&); -
trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp
r86657 r86727 86 86 // ------------------------------ ArrayPrototype ---------------------------- 87 87 88 const ClassInfo ArrayPrototype::s_info = {"Array", &JSArray::s_info, 0, ExecState::array Table};88 const ClassInfo ArrayPrototype::s_info = {"Array", &JSArray::s_info, 0, ExecState::arrayPrototypeTable}; 89 89 90 90 /* Source for ArrayPrototype.lut.h 91 @begin array Table 1691 @begin arrayPrototypeTable 16 92 92 toString arrayProtoFuncToString DontEnum|Function 0 93 93 toLocaleString arrayProtoFuncToLocaleString DontEnum|Function 0 … … 124 124 bool ArrayPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 125 125 { 126 return getStaticFunctionSlot<JSArray>(exec, ExecState::array Table(exec), this, propertyName, slot);126 return getStaticFunctionSlot<JSArray>(exec, ExecState::arrayPrototypeTable(exec), this, propertyName, slot); 127 127 } 128 128 129 129 bool ArrayPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 130 130 { 131 return getStaticFunctionDescriptor<JSArray>(exec, ExecState::array Table(exec), this, propertyName, descriptor);131 return getStaticFunctionDescriptor<JSArray>(exec, ExecState::arrayPrototypeTable(exec), this, propertyName, descriptor); 132 132 } 133 133 -
trunk/Source/JavaScriptCore/runtime/ArrayPrototype.h
r86657 r86727 1 1 /* 2 2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) 3 * Copyright (C) 2007 Apple Inc. All rights reserved.3 * Copyright (C) 2007, 2011 Apple Inc. All rights reserved. 4 4 * 5 5 * This library is free software; you can redistribute it and/or -
trunk/Source/JavaScriptCore/runtime/BooleanPrototype.cpp
r86657 r86727 1 1 /* 2 2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) 3 * Copyright (C) 2003, 2008 Apple Inc. All rights reserved.3 * Copyright (C) 2003, 2008, 2011 Apple Inc. All rights reserved. 4 4 * 5 5 * This library is free software; you can redistribute it and/or … … 30 30 namespace JSC { 31 31 32 ASSERT_CLASS_FITS_IN_CELL(BooleanPrototype);33 34 // Functions35 32 static EncodedJSValue JSC_HOST_CALL booleanProtoFuncToString(ExecState*); 36 33 static EncodedJSValue JSC_HOST_CALL booleanProtoFuncValueOf(ExecState*); 37 34 38 // ECMA 15.6.4 35 } 39 36 40 BooleanPrototype::BooleanPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, Structure* functionStructure) 37 #include "BooleanPrototype.lut.h" 38 39 namespace JSC { 40 41 const ClassInfo BooleanPrototype::s_info = { "Boolean", &BooleanObject::s_info, 0, ExecState::booleanPrototypeTable }; 42 43 /* Source for BooleanPrototype.lut.h 44 @begin booleanPrototypeTable 45 toString booleanProtoFuncToString DontEnum|Function 0 46 valueOf booleanProtoFuncValueOf DontEnum|Function 0 47 @end 48 */ 49 50 ASSERT_CLASS_FITS_IN_CELL(BooleanPrototype); 51 52 BooleanPrototype::BooleanPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure) 41 53 : BooleanObject(exec->globalData(), structure) 42 54 { 43 55 setInternalValue(exec->globalData(), jsBoolean(false)); 44 56 45 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, globalObject, functionStructure, 0, exec->propertyNames().toString, booleanProtoFuncToString), DontEnum);46 put DirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, globalObject, functionStructure, 0, exec->propertyNames().valueOf, booleanProtoFuncValueOf), DontEnum);57 ASSERT(inherits(&s_info)); 58 putAnonymousValue(globalObject->globalData(), 0, globalObject); 47 59 } 48 60 61 bool BooleanPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot) 62 { 63 return getStaticFunctionSlot<BooleanObject>(exec, ExecState::booleanPrototypeTable(exec), this, propertyName, slot); 64 } 49 65 50 // ------------------------------ Functions -------------------------- 66 bool BooleanPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 67 { 68 return getStaticFunctionDescriptor<BooleanObject>(exec, ExecState::booleanPrototypeTable(exec), this, propertyName, descriptor); 69 } 51 70 52 // ECMA 15.6.4.2 + 15.6.4.371 // ------------------------------ Functions --------------------------- 53 72 54 73 EncodedJSValue JSC_HOST_CALL booleanProtoFuncToString(ExecState* exec) -
trunk/Source/JavaScriptCore/runtime/BooleanPrototype.h
r86657 r86727 1 1 /* 2 2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) 3 * Copyright (C) 2008 Apple Inc. All rights reserved.3 * Copyright (C) 2008, 2011 Apple Inc. All rights reserved. 4 4 * 5 5 * This library is free software; you can redistribute it and/or … … 28 28 class BooleanPrototype : public BooleanObject { 29 29 public: 30 BooleanPrototype(ExecState*, JSGlobalObject*, Structure*, Structure* functionStructure); 30 BooleanPrototype(ExecState*, JSGlobalObject*, Structure*); 31 32 static const ClassInfo s_info; 33 34 static Structure* createStructure(JSGlobalData& globalData, JSValue prototype) 35 { 36 return Structure::create(globalData, prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info); 37 } 38 39 protected: 40 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | BooleanObject::StructureFlags; 41 static const unsigned AnonymousSlotCount = BooleanObject::AnonymousSlotCount + 1; 42 43 private: 44 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 45 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 31 46 }; 32 47 -
trunk/Source/JavaScriptCore/runtime/DateConstructor.cpp
r86657 r86727 1 1 /* 2 2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. 4 4 * 5 5 * This library is free software; you can redistribute it and/or … … 52 52 namespace JSC { 53 53 54 ASSERT_CLASS_FITS_IN_CELL(DateConstructor);55 56 54 static EncodedJSValue JSC_HOST_CALL dateParse(ExecState*); 57 55 static EncodedJSValue JSC_HOST_CALL dateNow(ExecState*); 58 56 static EncodedJSValue JSC_HOST_CALL dateUTC(ExecState*); 59 57 60 DateConstructor::DateConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, Structure* functionStructure, DatePrototype* datePrototype) 58 } 59 60 #include "DateConstructor.lut.h" 61 62 namespace JSC { 63 64 const ClassInfo DateConstructor::s_info = { "Function", &InternalFunction::s_info, 0, ExecState::dateConstructorTable }; 65 66 /* Source for DateConstructor.lut.h 67 @begin dateConstructorTable 68 parse dateParse DontEnum|Function 1 69 UTC dateUTC DontEnum|Function 7 70 now dateNow DontEnum|Function 0 71 @end 72 */ 73 74 ASSERT_CLASS_FITS_IN_CELL(DateConstructor); 75 76 DateConstructor::DateConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, DatePrototype* datePrototype) 61 77 : InternalFunction(&exec->globalData(), globalObject, structure, Identifier(exec, datePrototype->classInfo()->className)) 62 78 { 63 79 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().prototype, datePrototype, DontEnum | DontDelete | ReadOnly); 64 65 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, globalObject, functionStructure, 1, exec->propertyNames().parse, dateParse), DontEnum);66 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, globalObject, functionStructure, 7, exec->propertyNames().UTC, dateUTC), DontEnum);67 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, globalObject, functionStructure, 0, exec->propertyNames().now, dateNow), DontEnum);68 69 80 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().length, jsNumber(7), ReadOnly | DontEnum | DontDelete); 81 } 82 83 bool DateConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot) 84 { 85 return getStaticFunctionSlot<InternalFunction>(exec, ExecState::dateConstructorTable(exec), this, propertyName, slot); 86 } 87 88 bool DateConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 89 { 90 return getStaticFunctionDescriptor<InternalFunction>(exec, ExecState::dateConstructorTable(exec), this, propertyName, descriptor); 70 91 } 71 92 -
trunk/Source/JavaScriptCore/runtime/DateConstructor.h
r86657 r86727 1 1 /* 2 2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) 3 * Copyright (C) 2008 Apple Inc. All rights reserved.3 * Copyright (C) 2008, 2011 Apple Inc. All rights reserved. 4 4 * 5 5 * This library is free software; you can redistribute it and/or … … 30 30 class DateConstructor : public InternalFunction { 31 31 public: 32 DateConstructor(ExecState*, JSGlobalObject*, Structure*, Structure* functionStructure, DatePrototype*); 32 DateConstructor(ExecState*, JSGlobalObject*, Structure*, DatePrototype*); 33 34 static const ClassInfo s_info; 35 36 static Structure* createStructure(JSGlobalData& globalData, JSValue prototype) 37 { 38 return Structure::create(globalData, prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info); 39 } 40 41 protected: 42 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags; 33 43 34 44 private: 35 45 virtual ConstructType getConstructData(ConstructData&); 36 46 virtual CallType getCallData(CallData&); 47 48 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 49 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 37 50 }; 38 51 -
trunk/Source/JavaScriptCore/runtime/ErrorPrototype.cpp
r86657 r86727 35 35 static EncodedJSValue JSC_HOST_CALL errorProtoFuncToString(ExecState*); 36 36 37 // ECMA 15.9.4 38 ErrorPrototype::ErrorPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, Structure* functionStructure) 37 } 38 39 #include "ErrorPrototype.lut.h" 40 41 namespace JSC { 42 43 const ClassInfo ErrorPrototype::s_info = { "Error", &ErrorInstance::s_info, 0, ExecState::errorPrototypeTable }; 44 45 /* Source for ErrorPrototype.lut.h 46 @begin errorPrototypeTable 47 toString errorProtoFuncToString DontEnum|Function 0 48 @end 49 */ 50 51 ASSERT_CLASS_FITS_IN_CELL(ErrorPrototype); 52 53 ErrorPrototype::ErrorPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure) 39 54 : ErrorInstance(&exec->globalData(), structure) 40 55 { 41 // The constructor will be added later in ErrorConstructor's constructor56 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().name, jsNontrivialString(exec, "Error"), DontEnum); 42 57 43 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().name, jsNontrivialString(exec, "Error"), DontEnum);44 put DirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, globalObject, functionStructure, 0, exec->propertyNames().toString, errorProtoFuncToString), DontEnum);58 ASSERT(inherits(&s_info)); 59 putAnonymousValue(globalObject->globalData(), 0, globalObject); 45 60 } 61 62 bool ErrorPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot) 63 { 64 return getStaticFunctionSlot<ErrorInstance>(exec, ExecState::errorPrototypeTable(exec), this, propertyName, slot); 65 } 66 67 bool ErrorPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 68 { 69 return getStaticFunctionDescriptor<ErrorInstance>(exec, ExecState::errorPrototypeTable(exec), this, propertyName, descriptor); 70 } 71 72 // ------------------------------ Functions --------------------------- 46 73 47 74 EncodedJSValue JSC_HOST_CALL errorProtoFuncToString(ExecState* exec) -
trunk/Source/JavaScriptCore/runtime/ErrorPrototype.h
r86657 r86727 30 30 class ErrorPrototype : public ErrorInstance { 31 31 public: 32 ErrorPrototype(ExecState*, JSGlobalObject*, Structure*, Structure* functionStructure); 32 ErrorPrototype(ExecState*, JSGlobalObject*, Structure*); 33 34 static const ClassInfo s_info; 35 36 static Structure* createStructure(JSGlobalData& globalData, JSValue prototype) 37 { 38 return Structure::create(globalData, prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info); 39 } 40 41 protected: 42 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ErrorInstance::StructureFlags; 43 static const unsigned AnonymousSlotCount = ErrorInstance::AnonymousSlotCount + 1; 44 45 private: 46 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 47 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 33 48 }; 34 49 -
trunk/Source/JavaScriptCore/runtime/JSGlobalData.cpp
r86657 r86727 1 1 /* 2 * Copyright (C) 2008 Apple Inc. All rights reserved.2 * Copyright (C) 2008, 2011 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 93 93 namespace JSC { 94 94 95 extern JSC_CONST_HASHTABLE HashTable arrayTable; 95 extern JSC_CONST_HASHTABLE HashTable arrayConstructorTable; 96 extern JSC_CONST_HASHTABLE HashTable arrayPrototypeTable; 97 extern JSC_CONST_HASHTABLE HashTable booleanPrototypeTable; 96 98 extern JSC_CONST_HASHTABLE HashTable jsonTable; 97 99 extern JSC_CONST_HASHTABLE HashTable dateTable; 100 extern JSC_CONST_HASHTABLE HashTable dateConstructorTable; 101 extern JSC_CONST_HASHTABLE HashTable errorPrototypeTable; 102 extern JSC_CONST_HASHTABLE HashTable globalObjectTable; 98 103 extern JSC_CONST_HASHTABLE HashTable mathTable; 99 extern JSC_CONST_HASHTABLE HashTable numberTable; 104 extern JSC_CONST_HASHTABLE HashTable numberConstructorTable; 105 extern JSC_CONST_HASHTABLE HashTable numberPrototypeTable; 100 106 extern JSC_CONST_HASHTABLE HashTable objectConstructorTable; 107 extern JSC_CONST_HASHTABLE HashTable objectPrototypeTable; 101 108 extern JSC_CONST_HASHTABLE HashTable regExpTable; 102 109 extern JSC_CONST_HASHTABLE HashTable regExpConstructorTable; 110 extern JSC_CONST_HASHTABLE HashTable regExpPrototypeTable; 103 111 extern JSC_CONST_HASHTABLE HashTable stringTable; 112 extern JSC_CONST_HASHTABLE HashTable stringConstructorTable; 104 113 105 114 void* JSGlobalData::jsArrayVPtr; … … 147 156 : globalDataType(globalDataType) 148 157 , clientData(0) 149 , arrayTable(fastNew<HashTable>(JSC::arrayTable)) 158 , arrayConstructorTable(fastNew<HashTable>(JSC::arrayConstructorTable)) 159 , arrayPrototypeTable(fastNew<HashTable>(JSC::arrayPrototypeTable)) 160 , booleanPrototypeTable(fastNew<HashTable>(JSC::booleanPrototypeTable)) 150 161 , dateTable(fastNew<HashTable>(JSC::dateTable)) 162 , dateConstructorTable(fastNew<HashTable>(JSC::dateConstructorTable)) 163 , errorPrototypeTable(fastNew<HashTable>(JSC::errorPrototypeTable)) 164 , globalObjectTable(fastNew<HashTable>(JSC::globalObjectTable)) 151 165 , jsonTable(fastNew<HashTable>(JSC::jsonTable)) 152 166 , mathTable(fastNew<HashTable>(JSC::mathTable)) 153 , numberTable(fastNew<HashTable>(JSC::numberTable)) 167 , numberConstructorTable(fastNew<HashTable>(JSC::numberConstructorTable)) 168 , numberPrototypeTable(fastNew<HashTable>(JSC::numberPrototypeTable)) 154 169 , objectConstructorTable(fastNew<HashTable>(JSC::objectConstructorTable)) 170 , objectPrototypeTable(fastNew<HashTable>(JSC::objectPrototypeTable)) 155 171 , regExpTable(fastNew<HashTable>(JSC::regExpTable)) 156 172 , regExpConstructorTable(fastNew<HashTable>(JSC::regExpConstructorTable)) 173 , regExpPrototypeTable(fastNew<HashTable>(JSC::regExpPrototypeTable)) 157 174 , stringTable(fastNew<HashTable>(JSC::stringTable)) 175 , stringConstructorTable(fastNew<HashTable>(JSC::stringConstructorTable)) 158 176 , identifierTable(globalDataType == Default ? wtfThreadData().currentIdentifierTable() : createIdentifierTable()) 159 177 , propertyNames(new CommonIdentifiers(this)) … … 276 294 #endif 277 295 278 arrayTable->deleteTable(); 296 arrayPrototypeTable->deleteTable(); 297 arrayConstructorTable->deleteTable(); 298 booleanPrototypeTable->deleteTable(); 279 299 dateTable->deleteTable(); 300 dateConstructorTable->deleteTable(); 301 errorPrototypeTable->deleteTable(); 302 globalObjectTable->deleteTable(); 280 303 jsonTable->deleteTable(); 281 304 mathTable->deleteTable(); 282 numberTable->deleteTable(); 305 numberConstructorTable->deleteTable(); 306 numberPrototypeTable->deleteTable(); 283 307 objectConstructorTable->deleteTable(); 308 objectPrototypeTable->deleteTable(); 284 309 regExpTable->deleteTable(); 285 310 regExpConstructorTable->deleteTable(); 311 regExpPrototypeTable->deleteTable(); 286 312 stringTable->deleteTable(); 287 288 fastDelete(const_cast<HashTable*>(arrayTable)); 313 stringConstructorTable->deleteTable(); 314 315 fastDelete(const_cast<HashTable*>(arrayConstructorTable)); 316 fastDelete(const_cast<HashTable*>(arrayPrototypeTable)); 317 fastDelete(const_cast<HashTable*>(booleanPrototypeTable)); 289 318 fastDelete(const_cast<HashTable*>(dateTable)); 319 fastDelete(const_cast<HashTable*>(dateConstructorTable)); 320 fastDelete(const_cast<HashTable*>(errorPrototypeTable)); 321 fastDelete(const_cast<HashTable*>(globalObjectTable)); 290 322 fastDelete(const_cast<HashTable*>(jsonTable)); 291 323 fastDelete(const_cast<HashTable*>(mathTable)); 292 fastDelete(const_cast<HashTable*>(numberTable)); 324 fastDelete(const_cast<HashTable*>(numberConstructorTable)); 325 fastDelete(const_cast<HashTable*>(numberPrototypeTable)); 293 326 fastDelete(const_cast<HashTable*>(objectConstructorTable)); 327 fastDelete(const_cast<HashTable*>(objectPrototypeTable)); 294 328 fastDelete(const_cast<HashTable*>(regExpTable)); 295 329 fastDelete(const_cast<HashTable*>(regExpConstructorTable)); 330 fastDelete(const_cast<HashTable*>(regExpPrototypeTable)); 296 331 fastDelete(const_cast<HashTable*>(stringTable)); 332 fastDelete(const_cast<HashTable*>(stringConstructorTable)); 297 333 298 334 delete parser; -
trunk/Source/JavaScriptCore/runtime/JSGlobalData.h
r86657 r86727 137 137 ClientData* clientData; 138 138 139 const HashTable* arrayTable; 139 const HashTable* arrayConstructorTable; 140 const HashTable* arrayPrototypeTable; 141 const HashTable* booleanPrototypeTable; 140 142 const HashTable* dateTable; 143 const HashTable* dateConstructorTable; 144 const HashTable* errorPrototypeTable; 145 const HashTable* globalObjectTable; 141 146 const HashTable* jsonTable; 142 147 const HashTable* mathTable; 143 const HashTable* numberTable; 148 const HashTable* numberConstructorTable; 149 const HashTable* numberPrototypeTable; 144 150 const HashTable* objectConstructorTable; 151 const HashTable* objectPrototypeTable; 145 152 const HashTable* regExpTable; 146 153 const HashTable* regExpConstructorTable; 154 const HashTable* regExpPrototypeTable; 147 155 const HashTable* stringTable; 156 const HashTable* stringConstructorTable; 148 157 149 158 Strong<Structure> structureStructure; -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
r86657 r86727 52 52 #include "JSONObject.h" 53 53 #include "Interpreter.h" 54 #include "Lookup.h" 54 55 #include "MathObject.h" 55 56 #include "NativeErrorConstructor.h" … … 69 70 #include "Debugger.h" 70 71 72 #include "JSGlobalObject.lut.h" 73 71 74 namespace JSC { 75 76 const ClassInfo JSGlobalObject::s_info = { "GlobalObject", &JSVariableObject::s_info, 0, ExecState::globalObjectTable }; 77 78 /* Source for JSGlobalObject.lut.h 79 @begin globalObjectTable 80 parseInt globalFuncParseInt DontEnum|Function 2 81 parseFloat globalFuncParseFloat DontEnum|Function 1 82 isNaN globalFuncIsNaN DontEnum|Function 1 83 isFinite globalFuncIsFinite DontEnum|Function 1 84 escape globalFuncEscape DontEnum|Function 1 85 unescape globalFuncUnescape DontEnum|Function 1 86 decodeURI globalFuncDecodeURI DontEnum|Function 1 87 decodeURIComponent globalFuncDecodeURIComponent DontEnum|Function 1 88 encodeURI globalFuncEncodeURI DontEnum|Function 1 89 encodeURIComponent globalFuncEncodeURIComponent DontEnum|Function 1 90 @end 91 */ 72 92 73 93 ASSERT_CLASS_FITS_IN_CELL(JSGlobalObject); … … 167 187 { 168 188 ExecState* exec = JSGlobalObject::globalExec(); 169 170 // Prototypes171 189 172 190 m_functionPrototype.set(exec->globalData(), this, new (exec) FunctionPrototype(exec, this, FunctionPrototype::createStructure(exec->globalData(), jsNull()))); // The real prototype will be set once ObjectPrototype is created. … … 178 196 m_callFunction.set(exec->globalData(), this, callFunction); 179 197 m_applyFunction.set(exec->globalData(), this, applyFunction); 180 m_objectPrototype.set(exec->globalData(), this, new (exec) ObjectPrototype(exec, this, ObjectPrototype::createStructure(exec->globalData(), jsNull()) , m_functionStructure.get()));198 m_objectPrototype.set(exec->globalData(), this, new (exec) ObjectPrototype(exec, this, ObjectPrototype::createStructure(exec->globalData(), jsNull()))); 181 199 m_functionPrototype->structure()->setPrototypeWithoutTransition(exec->globalData(), m_objectPrototype.get()); 182 200 … … 196 214 m_stringObjectStructure.set(exec->globalData(), this, StringObject::createStructure(exec->globalData(), m_stringPrototype.get())); 197 215 198 m_booleanPrototype.set(exec->globalData(), this, new (exec) BooleanPrototype(exec, this, BooleanPrototype::createStructure(exec->globalData(), m_objectPrototype.get()) , m_functionStructure.get()));216 m_booleanPrototype.set(exec->globalData(), this, new (exec) BooleanPrototype(exec, this, BooleanPrototype::createStructure(exec->globalData(), m_objectPrototype.get()))); 199 217 m_booleanObjectStructure.set(exec->globalData(), this, BooleanObject::createStructure(exec->globalData(), m_booleanPrototype.get())); 200 218 201 m_numberPrototype.set(exec->globalData(), this, new (exec) NumberPrototype(exec, this, NumberPrototype::createStructure(exec->globalData(), m_objectPrototype.get()) , m_functionStructure.get()));219 m_numberPrototype.set(exec->globalData(), this, new (exec) NumberPrototype(exec, this, NumberPrototype::createStructure(exec->globalData(), m_objectPrototype.get()))); 202 220 m_numberObjectStructure.set(exec->globalData(), this, NumberObject::createStructure(exec->globalData(), m_numberPrototype.get())); 203 221 … … 205 223 m_dateStructure.set(exec->globalData(), this, DateInstance::createStructure(exec->globalData(), m_datePrototype.get())); 206 224 207 m_regExpPrototype.set(exec->globalData(), this, new (exec) RegExpPrototype(exec, this, RegExpPrototype::createStructure(exec->globalData(), m_objectPrototype.get()) , m_functionStructure.get()));225 m_regExpPrototype.set(exec->globalData(), this, new (exec) RegExpPrototype(exec, this, RegExpPrototype::createStructure(exec->globalData(), m_objectPrototype.get()))); 208 226 m_regExpStructure.set(exec->globalData(), this, RegExpObject::createStructure(exec->globalData(), m_regExpPrototype.get())); 209 227 210 228 m_methodCallDummy.set(exec->globalData(), this, constructEmptyObject(exec)); 211 229 212 ErrorPrototype* errorPrototype = new (exec) ErrorPrototype(exec, this, ErrorPrototype::createStructure(exec->globalData(), m_objectPrototype.get()) , m_functionStructure.get());230 ErrorPrototype* errorPrototype = new (exec) ErrorPrototype(exec, this, ErrorPrototype::createStructure(exec->globalData(), m_objectPrototype.get())); 213 231 m_errorStructure.set(exec->globalData(), this, ErrorInstance::createStructure(exec->globalData(), errorPrototype)); 214 232 … … 217 235 JSCell* objectConstructor = new (exec) ObjectConstructor(exec, this, ObjectConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), m_objectPrototype.get()); 218 236 JSCell* functionConstructor = new (exec) FunctionConstructor(exec, this, FunctionConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), m_functionPrototype.get()); 219 JSCell* arrayConstructor = new (exec) ArrayConstructor(exec, this, ArrayConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), m_arrayPrototype.get() , m_functionStructure.get());220 JSCell* stringConstructor = new (exec) StringConstructor(exec, this, StringConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), m_ functionStructure.get(), m_stringPrototype.get());237 JSCell* arrayConstructor = new (exec) ArrayConstructor(exec, this, ArrayConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), m_arrayPrototype.get()); 238 JSCell* stringConstructor = new (exec) StringConstructor(exec, this, StringConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), m_stringPrototype.get()); 221 239 JSCell* booleanConstructor = new (exec) BooleanConstructor(exec, this, BooleanConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), m_booleanPrototype.get()); 222 240 JSCell* numberConstructor = new (exec) NumberConstructor(exec, this, NumberConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), m_numberPrototype.get()); 223 JSCell* dateConstructor = new (exec) DateConstructor(exec, this, DateConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), m_ functionStructure.get(), m_datePrototype.get());241 JSCell* dateConstructor = new (exec) DateConstructor(exec, this, DateConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), m_datePrototype.get()); 224 242 225 243 m_regExpConstructor.set(exec->globalData(), this, new (exec) RegExpConstructor(exec, this, RegExpConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), m_regExpPrototype.get())); … … 245 263 m_regExpPrototype->putDirectFunctionWithoutTransition(exec->globalData(), exec->propertyNames().constructor, m_regExpConstructor.get(), DontEnum); 246 264 errorPrototype->putDirectFunctionWithoutTransition(exec->globalData(), exec->propertyNames().constructor, m_errorConstructor.get(), DontEnum); 247 248 // Set global constructors249 250 // FIXME: These properties could be handled by a static hash table.251 265 252 266 putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, "Object"), objectConstructor, DontEnum); … … 266 280 putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, "URIError"), m_URIErrorConstructor.get(), DontEnum); 267 281 268 // Set global values. 282 m_evalFunction.set(exec->globalData(), this, new (exec) JSFunction(exec, this, m_functionStructure.get(), 1, exec->propertyNames().eval, globalFuncEval)); 283 putDirectFunctionWithoutTransition(exec, m_evalFunction.get(), DontEnum); 284 269 285 GlobalPropertyInfo staticGlobals[] = { 270 286 GlobalPropertyInfo(Identifier(exec, "Math"), new (exec) MathObject(exec, this, MathObject::createStructure(exec->globalData(), m_objectPrototype.get())), DontEnum | DontDelete), … … 274 290 GlobalPropertyInfo(Identifier(exec, "JSON"), new (exec) JSONObject(this, JSONObject::createStructure(exec->globalData(), m_objectPrototype.get())), DontEnum | DontDelete) 275 291 }; 276 277 292 addStaticGlobals(staticGlobals, WTF_ARRAY_LENGTH(staticGlobals)); 278 279 // Set global functions.280 281 m_evalFunction.set(exec->globalData(), this, new (exec) JSFunction(exec, this, m_functionStructure.get(), 1, exec->propertyNames().eval, globalFuncEval));282 putDirectFunctionWithoutTransition(exec, m_evalFunction.get(), DontEnum);283 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, this, m_functionStructure.get(), 2, Identifier(exec, "parseInt"), globalFuncParseInt), DontEnum);284 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, this, m_functionStructure.get(), 1, Identifier(exec, "parseFloat"), globalFuncParseFloat), DontEnum);285 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, this, m_functionStructure.get(), 1, Identifier(exec, "isNaN"), globalFuncIsNaN), DontEnum);286 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, this, m_functionStructure.get(), 1, Identifier(exec, "isFinite"), globalFuncIsFinite), DontEnum);287 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, this, m_functionStructure.get(), 1, Identifier(exec, "escape"), globalFuncEscape), DontEnum);288 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, this, m_functionStructure.get(), 1, Identifier(exec, "unescape"), globalFuncUnescape), DontEnum);289 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, this, m_functionStructure.get(), 1, Identifier(exec, "decodeURI"), globalFuncDecodeURI), DontEnum);290 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, this, m_functionStructure.get(), 1, Identifier(exec, "decodeURIComponent"), globalFuncDecodeURIComponent), DontEnum);291 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, this, m_functionStructure.get(), 1, Identifier(exec, "encodeURI"), globalFuncEncodeURI), DontEnum);292 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, this, m_functionStructure.get(), 1, Identifier(exec, "encodeURIComponent"), globalFuncEncodeURIComponent), DontEnum);293 #ifndef NDEBUG294 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, this, m_functionStructure.get(), 1, Identifier(exec, "jscprint"), globalFuncJSCPrint), DontEnum);295 #endif296 293 297 294 resetPrototype(exec->globalData(), prototype); … … 445 442 } 446 443 444 void JSGlobalObject::addStaticGlobals(GlobalPropertyInfo* globals, int count) 445 { 446 size_t oldSize = m_registerArraySize; 447 size_t newSize = oldSize + count; 448 OwnArrayPtr<WriteBarrier<Unknown> > registerArray = adoptArrayPtr(new WriteBarrier<Unknown>[newSize]); 449 if (m_registerArray) { 450 // memcpy is safe here as we're copying barriers we already own from the existing array 451 memcpy(registerArray.get() + count, m_registerArray.get(), oldSize * sizeof(Register)); 452 } 453 454 WriteBarrier<Unknown>* registers = registerArray.get() + newSize; 455 setRegisters(registers, registerArray.release(), newSize); 456 457 for (int i = 0, index = -static_cast<int>(oldSize) - 1; i < count; ++i, --index) { 458 GlobalPropertyInfo& global = globals[i]; 459 ASSERT(global.attributes & DontDelete); 460 SymbolTableEntry newEntry(index, global.attributes); 461 symbolTable().add(global.identifier.impl(), newEntry); 462 registerAt(index).set(globalData(), this, global.value); 463 } 464 } 465 466 bool JSGlobalObject::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 467 { 468 if (getStaticFunctionSlot<JSVariableObject>(exec, ExecState::globalObjectTable(exec), this, propertyName, slot)) 469 return true; 470 return symbolTableGet(propertyName, slot); 471 } 472 473 bool JSGlobalObject::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 474 { 475 if (getStaticFunctionDescriptor<JSVariableObject>(exec, ExecState::globalObjectTable(exec), this, propertyName, descriptor)) 476 return true; 477 return symbolTableGet(propertyName, descriptor); 478 } 479 447 480 void JSGlobalObject::WeakMapsFinalizer::finalize(Handle<Unknown> handle, void*) 448 481 { -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h
r86657 r86727 149 149 } 150 150 151 static JS_EXPORTDATA const ClassInfo s_info; 152 151 153 protected: 152 154 JSGlobalObject(JSGlobalData& globalData, Structure* structure, JSObject* thisValue) … … 318 320 } 319 321 320 inline void JSGlobalObject::addStaticGlobals(GlobalPropertyInfo* globals, int count)321 {322 size_t oldSize = m_registerArraySize;323 size_t newSize = oldSize + count;324 OwnArrayPtr<WriteBarrier<Unknown> > registerArray = adoptArrayPtr(new WriteBarrier<Unknown>[newSize]);325 if (m_registerArray) {326 // memcpy is safe here as we're copying barriers we already own from the existing array327 memcpy(registerArray.get() + count, m_registerArray.get(), oldSize * sizeof(Register));328 }329 330 WriteBarrier<Unknown>* registers = registerArray.get() + newSize;331 setRegisters(registers, registerArray.release(), newSize);332 333 for (int i = 0, index = -static_cast<int>(oldSize) - 1; i < count; ++i, --index) {334 GlobalPropertyInfo& global = globals[i];335 ASSERT(global.attributes & DontDelete);336 SymbolTableEntry newEntry(index, global.attributes);337 symbolTable().add(global.identifier.impl(), newEntry);338 registerAt(index).set(globalData(), this, global.value);339 }340 }341 342 inline bool JSGlobalObject::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)343 {344 if (JSVariableObject::getOwnPropertySlot(exec, propertyName, slot))345 return true;346 return symbolTableGet(propertyName, slot);347 }348 349 inline bool JSGlobalObject::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)350 {351 if (symbolTableGet(propertyName, descriptor))352 return true;353 return JSVariableObject::getOwnPropertyDescriptor(exec, propertyName, descriptor);354 }355 356 322 inline bool JSGlobalObject::hasOwnPropertyForWrite(ExecState* exec, const Identifier& propertyName) 357 323 { -
trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
r86657 r86727 588 588 } 589 589 590 #ifndef NDEBUG591 EncodedJSValue JSC_HOST_CALL globalFuncJSCPrint(ExecState* exec)592 {593 CString string = exec->argument(0).toString(exec).utf8();594 puts(string.data());595 return JSValue::encode(jsUndefined());596 }597 #endif598 599 590 } // namespace JSC -
trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.h
r86657 r86727 48 48 EncodedJSValue JSC_HOST_CALL globalFuncEscape(ExecState*); 49 49 EncodedJSValue JSC_HOST_CALL globalFuncUnescape(ExecState*); 50 #ifndef NDEBUG51 EncodedJSValue JSC_HOST_CALL globalFuncJSCPrint(ExecState*);52 #endif53 50 54 51 static const double mantissaOverflowLowerBound = 9007199254740992.0; -
trunk/Source/JavaScriptCore/runtime/MathObject.cpp
r86657 r86727 59 59 60 60 namespace JSC { 61 62 // ------------------------------ MathObject --------------------------------63 61 64 62 const ClassInfo MathObject::s_info = { "Math", &JSObjectWithGlobalObject::s_info, 0, ExecState::mathTable }; … … 102 100 } 103 101 104 // ECMA 15.8105 106 102 bool MathObject::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot) 107 103 { -
trunk/Source/JavaScriptCore/runtime/NumberConstructor.cpp
r86657 r86727 1 1 /* 2 2 * Copyright (C) 1999-2000,2003 Harri Porten (porten@kde.org) 3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.3 * Copyright (C) 2007, 2008, 2011 Apple Inc. All rights reserved. 4 4 * 5 5 * This library is free software; you can redistribute it and/or … … 43 43 namespace JSC { 44 44 45 const ClassInfo NumberConstructor::s_info = { "Function", &InternalFunction::s_info, 0, ExecState::number Table };45 const ClassInfo NumberConstructor::s_info = { "Function", &InternalFunction::s_info, 0, ExecState::numberConstructorTable }; 46 46 47 47 /* Source for NumberConstructor.lut.h 48 @begin number Table48 @begin numberConstructorTable 49 49 NaN numberConstructorNaNValue DontEnum|DontDelete|ReadOnly 50 50 NEGATIVE_INFINITY numberConstructorNegInfinity DontEnum|DontDelete|ReadOnly … … 69 69 bool NumberConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 70 70 { 71 return getStaticValueSlot<NumberConstructor, InternalFunction>(exec, ExecState::number Table(exec), this, propertyName, slot);71 return getStaticValueSlot<NumberConstructor, InternalFunction>(exec, ExecState::numberConstructorTable(exec), this, propertyName, slot); 72 72 } 73 73 74 74 bool NumberConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 75 75 { 76 return getStaticValueDescriptor<NumberConstructor, InternalFunction>(exec, ExecState::number Table(exec), this, propertyName, descriptor);76 return getStaticValueDescriptor<NumberConstructor, InternalFunction>(exec, ExecState::numberConstructorTable(exec), this, propertyName, descriptor); 77 77 } 78 78 -
trunk/Source/JavaScriptCore/runtime/NumberPrototype.cpp
r86657 r86727 1 1 /* 2 2 * Copyright (C) 1999-2000,2003 Harri Porten (porten@kde.org) 3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.3 * Copyright (C) 2007, 2008, 2011 Apple Inc. All rights reserved. 4 4 * 5 5 * This library is free software; you can redistribute it and/or … … 35 35 namespace JSC { 36 36 37 ASSERT_CLASS_FITS_IN_CELL(NumberPrototype);38 39 37 static EncodedJSValue JSC_HOST_CALL numberProtoFuncToString(ExecState*); 40 38 static EncodedJSValue JSC_HOST_CALL numberProtoFuncToLocaleString(ExecState*); … … 44 42 static EncodedJSValue JSC_HOST_CALL numberProtoFuncToPrecision(ExecState*); 45 43 46 // ECMA 15.7.4 47 48 NumberPrototype::NumberPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, Structure* functionStructure) 44 } 45 46 #include "NumberPrototype.lut.h" 47 48 namespace JSC { 49 50 const ClassInfo NumberPrototype::s_info = { "Number", &NumberObject::s_info, 0, ExecState::numberPrototypeTable }; 51 52 /* Source for NumberPrototype.lut.h 53 @begin numberPrototypeTable 54 toString numberProtoFuncToString DontEnum|Function 1 55 toLocaleString numberProtoFuncToLocaleString DontEnum|Function 0 56 valueOf numberProtoFuncValueOf DontEnum|Function 0 57 toFixed numberProtoFuncToFixed DontEnum|Function 1 58 toExponential numberProtoFuncToExponential DontEnum|Function 1 59 toPrecision numberProtoFuncToPrecision DontEnum|Function 1 60 @end 61 */ 62 63 ASSERT_CLASS_FITS_IN_CELL(NumberPrototype); 64 65 NumberPrototype::NumberPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure) 49 66 : NumberObject(exec->globalData(), structure) 50 67 { 51 68 setInternalValue(exec->globalData(), jsNumber(0)); 52 69 53 // The constructor will be added later, after NumberConstructor has been constructed 54 55 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, globalObject, functionStructure, 1, exec->propertyNames().toString, numberProtoFuncToString), DontEnum); 56 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, globalObject, functionStructure, 0, exec->propertyNames().toLocaleString, numberProtoFuncToLocaleString), DontEnum); 57 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, globalObject, functionStructure, 0, exec->propertyNames().valueOf, numberProtoFuncValueOf), DontEnum); 58 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, globalObject, functionStructure, 1, exec->propertyNames().toFixed, numberProtoFuncToFixed), DontEnum); 59 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, globalObject, functionStructure, 1, exec->propertyNames().toExponential, numberProtoFuncToExponential), DontEnum); 60 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, globalObject, functionStructure, 1, exec->propertyNames().toPrecision, numberProtoFuncToPrecision), DontEnum); 70 ASSERT(inherits(&s_info)); 71 putAnonymousValue(globalObject->globalData(), 0, globalObject); 72 } 73 74 bool NumberPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot) 75 { 76 return getStaticFunctionSlot<NumberObject>(exec, ExecState::numberPrototypeTable(exec), this, propertyName, slot); 77 } 78 79 bool NumberPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 80 { 81 return getStaticFunctionDescriptor<NumberObject>(exec, ExecState::numberPrototypeTable(exec), this, propertyName, descriptor); 61 82 } 62 83 63 84 // ------------------------------ Functions --------------------------- 64 65 // ECMA 15.7.4.2 - 15.7.4.766 85 67 86 static ALWAYS_INLINE bool toThisNumber(JSValue thisValue, double &x) -
trunk/Source/JavaScriptCore/runtime/NumberPrototype.h
r86657 r86727 1 1 /* 2 2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) 3 * Copyright (C) 2008 Apple Inc. All rights reserved.3 * Copyright (C) 2008, 2011 Apple Inc. All rights reserved. 4 4 * 5 5 * This library is free software; you can redistribute it and/or … … 28 28 class NumberPrototype : public NumberObject { 29 29 public: 30 NumberPrototype(ExecState*, JSGlobalObject*, Structure*, Structure* functionStructure); 30 NumberPrototype(ExecState*, JSGlobalObject*, Structure*); 31 32 static const ClassInfo s_info; 33 34 static Structure* createStructure(JSGlobalData& globalData, JSValue prototype) 35 { 36 return Structure::create(globalData, prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info); 37 } 38 39 protected: 40 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | NumberObject::StructureFlags; 41 static const unsigned AnonymousSlotCount = NumberObject::AnonymousSlotCount + 1; 42 43 private: 44 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 45 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 31 46 }; 32 47 -
trunk/Source/JavaScriptCore/runtime/ObjectPrototype.cpp
r86657 r86727 1 1 /* 2 2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) 3 * Copyright (C) 2008 Apple Inc. All rights reserved.3 * Copyright (C) 2008, 2011 Apple Inc. All rights reserved. 4 4 * 5 5 * This library is free software; you can redistribute it and/or … … 29 29 namespace JSC { 30 30 31 ASSERT_CLASS_FITS_IN_CELL(ObjectPrototype);32 33 31 static EncodedJSValue JSC_HOST_CALL objectProtoFuncValueOf(ExecState*); 34 32 static EncodedJSValue JSC_HOST_CALL objectProtoFuncHasOwnProperty(ExecState*); … … 41 39 static EncodedJSValue JSC_HOST_CALL objectProtoFuncToLocaleString(ExecState*); 42 40 43 ObjectPrototype::ObjectPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* stucture, Structure* functionStructure) 41 } 42 43 #include "ObjectPrototype.lut.h" 44 45 namespace JSC { 46 47 const ClassInfo ObjectPrototype::s_info = { "Object", &JSNonFinalObject::s_info, 0, ExecState::objectPrototypeTable }; 48 49 /* Source for ObjectPrototype.lut.h 50 @begin objectPrototypeTable 51 toString objectProtoFuncToString DontEnum|Function 0 52 toLocaleString objectProtoFuncToLocaleString DontEnum|Function 0 53 valueOf objectProtoFuncValueOf DontEnum|Function 0 54 hasOwnProperty objectProtoFuncHasOwnProperty DontEnum|Function 1 55 propertyIsEnumerable objectProtoFuncPropertyIsEnumerable DontEnum|Function 1 56 isPrototypeOf objectProtoFuncIsPrototypeOf DontEnum|Function 1 57 __defineGetter__ objectProtoFuncDefineGetter DontEnum|Function 2 58 __defineSetter__ objectProtoFuncDefineSetter DontEnum|Function 2 59 __lookupGetter__ objectProtoFuncLookupGetter DontEnum|Function 1 60 __lookupSetter__ objectProtoFuncLookupSetter DontEnum|Function 1 61 @end 62 */ 63 64 ASSERT_CLASS_FITS_IN_CELL(ObjectPrototype); 65 66 ObjectPrototype::ObjectPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* stucture) 44 67 : JSNonFinalObject(exec->globalData(), stucture) 45 68 , m_hasNoPropertiesWithUInt32Names(true) 46 69 { 47 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, globalObject, functionStructure, 0, exec->propertyNames().toString, objectProtoFuncToString), DontEnum); 48 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, globalObject, functionStructure, 0, exec->propertyNames().toLocaleString, objectProtoFuncToLocaleString), DontEnum); 49 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, globalObject, functionStructure, 0, exec->propertyNames().valueOf, objectProtoFuncValueOf), DontEnum); 50 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, globalObject, functionStructure, 1, exec->propertyNames().hasOwnProperty, objectProtoFuncHasOwnProperty), DontEnum); 51 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, globalObject, functionStructure, 1, exec->propertyNames().propertyIsEnumerable, objectProtoFuncPropertyIsEnumerable), DontEnum); 52 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, globalObject, functionStructure, 1, exec->propertyNames().isPrototypeOf, objectProtoFuncIsPrototypeOf), DontEnum); 53 54 // Mozilla extensions 55 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, globalObject, functionStructure, 2, exec->propertyNames().__defineGetter__, objectProtoFuncDefineGetter), DontEnum); 56 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, globalObject, functionStructure, 2, exec->propertyNames().__defineSetter__, objectProtoFuncDefineSetter), DontEnum); 57 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, globalObject, functionStructure, 1, exec->propertyNames().__lookupGetter__, objectProtoFuncLookupGetter), DontEnum); 58 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, globalObject, functionStructure, 1, exec->propertyNames().__lookupSetter__, objectProtoFuncLookupSetter), DontEnum); 70 ASSERT(inherits(&s_info)); 71 putAnonymousValue(globalObject->globalData(), 0, globalObject); 59 72 } 60 73 61 74 void ObjectPrototype::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) 62 75 { 63 JS Object::put(exec, propertyName, value, slot);76 JSNonFinalObject::put(exec, propertyName, value, slot); 64 77 65 78 if (m_hasNoPropertiesWithUInt32Names) { … … 74 87 if (m_hasNoPropertiesWithUInt32Names) 75 88 return false; 76 return JSObject::getOwnPropertySlot(exec, propertyName, slot); 89 return JSNonFinalObject::getOwnPropertySlot(exec, propertyName, slot); 90 } 91 92 bool ObjectPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot) 93 { 94 return getStaticFunctionSlot<JSNonFinalObject>(exec, ExecState::objectPrototypeTable(exec), this, propertyName, slot); 95 } 96 97 bool ObjectPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 98 { 99 return getStaticFunctionDescriptor<JSNonFinalObject>(exec, ExecState::objectPrototypeTable(exec), this, propertyName, descriptor); 77 100 } 78 101 79 102 // ------------------------------ Functions -------------------------------- 80 81 // ECMA 15.2.4.2, 15.2.4.4, 15.2.4.5, 15.2.4.782 103 83 104 EncodedJSValue JSC_HOST_CALL objectProtoFuncValueOf(ExecState* exec) -
trunk/Source/JavaScriptCore/runtime/ObjectPrototype.h
r86657 r86727 1 1 /* 2 2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) 3 * Copyright (C) 2008 Apple Inc. All rights reserved.3 * Copyright (C) 2008, 2011 Apple Inc. All rights reserved. 4 4 * 5 5 * This library is free software; you can redistribute it and/or … … 28 28 class ObjectPrototype : public JSNonFinalObject { 29 29 public: 30 ObjectPrototype(ExecState*, JSGlobalObject*, Structure*, Structure* functionStructure); 30 ObjectPrototype(ExecState*, JSGlobalObject*, Structure*); 31 32 static const ClassInfo s_info; 33 34 static Structure* createStructure(JSGlobalData& globalData, JSValue prototype) 35 { 36 return Structure::create(globalData, prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info); 37 } 38 39 protected: 40 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | JSNonFinalObject::StructureFlags; 41 static const unsigned AnonymousSlotCount = JSNonFinalObject::AnonymousSlotCount + 1; 31 42 32 43 private: 33 44 virtual void put(ExecState*, const Identifier&, JSValue, PutPropertySlot&); 45 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 34 46 virtual bool getOwnPropertySlot(ExecState*, unsigned propertyName, PropertySlot&); 47 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 35 48 36 49 bool m_hasNoPropertiesWithUInt32Names; -
trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp
r86657 r86727 39 39 namespace JSC { 40 40 41 ASSERT_CLASS_FITS_IN_CELL(RegExpPrototype);42 43 41 static EncodedJSValue JSC_HOST_CALL regExpProtoFuncTest(ExecState*); 44 42 static EncodedJSValue JSC_HOST_CALL regExpProtoFuncExec(ExecState*); … … 46 44 static EncodedJSValue JSC_HOST_CALL regExpProtoFuncToString(ExecState*); 47 45 48 // ECMA 15.10.5 46 } 49 47 50 RegExpPrototype::RegExpPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, Structure* functionStructure) 48 #include "RegExpPrototype.lut.h" 49 50 namespace JSC { 51 52 const ClassInfo RegExpPrototype::s_info = { "RegExp", &RegExpObject::s_info, 0, ExecState::regExpPrototypeTable }; 53 54 /* Source for RegExpPrototype.lut.h 55 @begin regExpPrototypeTable 56 compile regExpProtoFuncCompile DontEnum|Function 2 57 exec regExpProtoFuncExec DontEnum|Function 1 58 test regExpProtoFuncTest DontEnum|Function 1 59 toString regExpProtoFuncToString DontEnum|Function 0 60 @end 61 */ 62 63 ASSERT_CLASS_FITS_IN_CELL(RegExpPrototype); 64 65 RegExpPrototype::RegExpPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure) 51 66 : RegExpObject(globalObject, structure, RegExp::create(&exec->globalData(), "", NoFlags)) 52 67 { 53 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, globalObject, functionStructure, 2, exec->propertyNames().compile, regExpProtoFuncCompile), DontEnum); 54 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, globalObject, functionStructure, 1, exec->propertyNames().exec, regExpProtoFuncExec), DontEnum); 55 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, globalObject, functionStructure, 1, exec->propertyNames().test, regExpProtoFuncTest), DontEnum); 56 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, globalObject, functionStructure, 0, exec->propertyNames().toString, regExpProtoFuncToString), DontEnum); 68 } 69 70 bool RegExpPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot) 71 { 72 return getStaticFunctionSlot<RegExpObject>(exec, ExecState::regExpPrototypeTable(exec), this, propertyName, slot); 73 } 74 75 bool RegExpPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 76 { 77 return getStaticFunctionDescriptor<RegExpObject>(exec, ExecState::regExpPrototypeTable(exec), this, propertyName, descriptor); 57 78 } 58 79 -
trunk/Source/JavaScriptCore/runtime/RegExpPrototype.h
r86657 r86727 29 29 class RegExpPrototype : public RegExpObject { 30 30 public: 31 RegExpPrototype(ExecState*, JSGlobalObject*, Structure*, Structure* functionStructure); 31 RegExpPrototype(ExecState*, JSGlobalObject*, Structure*); 32 33 static const ClassInfo s_info; 34 35 static Structure* createStructure(JSGlobalData& globalData, JSValue prototype) 36 { 37 return Structure::create(globalData, prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info); 38 } 39 40 protected: 41 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | RegExpObject::StructureFlags; 42 43 private: 44 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 45 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 32 46 }; 33 47 -
trunk/Source/JavaScriptCore/runtime/StringConstructor.cpp
r86657 r86727 30 30 namespace JSC { 31 31 32 static EncodedJSValue JSC_HOST_CALL stringFromCharCode(ExecState*); 33 34 } 35 36 #include "StringConstructor.lut.h" 37 38 namespace JSC { 39 40 const ClassInfo StringConstructor::s_info = { "Function", &InternalFunction::s_info, 0, ExecState::stringConstructorTable }; 41 42 /* Source for StringConstructor.lut.h 43 @begin stringConstructorTable 44 fromCharCode stringFromCharCode DontEnum|Function 1 45 @end 46 */ 47 48 ASSERT_CLASS_FITS_IN_CELL(StringConstructor); 49 50 StringConstructor::StringConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, StringPrototype* stringPrototype) 51 : InternalFunction(&exec->globalData(), globalObject, structure, Identifier(exec, stringPrototype->classInfo()->className)) 52 { 53 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().prototype, stringPrototype, ReadOnly | DontEnum | DontDelete); 54 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().length, jsNumber(1), ReadOnly | DontEnum | DontDelete); 55 } 56 57 bool StringConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot) 58 { 59 return getStaticFunctionSlot<InternalFunction>(exec, ExecState::stringConstructorTable(exec), this, propertyName, slot); 60 } 61 62 bool StringConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 63 { 64 return getStaticFunctionDescriptor<InternalFunction>(exec, ExecState::stringConstructorTable(exec), this, propertyName, descriptor); 65 } 66 67 // ------------------------------ Functions -------------------------------- 68 32 69 static NEVER_INLINE JSValue stringFromCharCodeSlowCase(ExecState* exec) 33 70 { … … 47 84 } 48 85 49 ASSERT_CLASS_FITS_IN_CELL(StringConstructor);50 51 StringConstructor::StringConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, Structure* functionStructure, StringPrototype* stringPrototype)52 : InternalFunction(&exec->globalData(), globalObject, structure, Identifier(exec, stringPrototype->classInfo()->className))53 {54 // ECMA 15.5.3.1 String.prototype55 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().prototype, stringPrototype, ReadOnly | DontEnum | DontDelete);56 57 // ECMA 15.5.3.2 fromCharCode()58 #if ENABLE(JIT) && ENABLE(JIT_OPTIMIZE_NATIVE_CALL)59 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, globalObject, functionStructure, 1, exec->propertyNames().fromCharCode, exec->globalData().getHostFunction(stringFromCharCode, fromCharCodeThunkGenerator)), DontEnum);60 #else61 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, globalObject, functionStructure, 1, exec->propertyNames().fromCharCode, stringFromCharCode), DontEnum);62 #endif63 // no. of arguments for constructor64 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().length, jsNumber(1), ReadOnly | DontEnum | DontDelete);65 }66 67 // ECMA 15.5.268 86 static EncodedJSValue JSC_HOST_CALL constructWithStringConstructor(ExecState* exec) 69 87 { … … 80 98 } 81 99 82 // ECMA 15.5.183 100 static EncodedJSValue JSC_HOST_CALL callStringConstructor(ExecState* exec) 84 101 { -
trunk/Source/JavaScriptCore/runtime/StringConstructor.h
r86657 r86727 30 30 class StringConstructor : public InternalFunction { 31 31 public: 32 StringConstructor(ExecState*, JSGlobalObject*, Structure*, Str ucture* functionStructure, StringPrototype*);32 StringConstructor(ExecState*, JSGlobalObject*, Structure*, StringPrototype*); 33 33 34 static const ClassInfo s_info; 35 36 static Structure* createStructure(JSGlobalData& globalData, JSValue prototype) 37 { 38 return Structure::create(globalData, prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info); 39 } 40 41 protected: 42 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags; 43 44 private: 34 45 virtual ConstructType getConstructData(ConstructData&); 35 46 virtual CallType getCallData(CallData&); 47 48 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 49 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 36 50 }; 37 51
Note: See TracChangeset
for help on using the changeset viewer.