Changeset 86657 in webkit
- Timestamp:
- May 16, 2011 11:12:46 PM (13 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 37 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r86653 r86657 1 2011-05-16 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r86653. 4 http://trac.webkit.org/changeset/86653 5 https://bugs.webkit.org/show_bug.cgi?id=60944 6 7 "Caused regressions on Windows, OSX and EFL" (Requested by 8 yutak on #webkit). 9 10 * DerivedSources.make: 11 * DerivedSources.pro: 12 * GNUmakefile.am: 13 * GNUmakefile.list.am: 14 * JavaScriptCore.exp: 15 * JavaScriptCore.gypi: 16 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 17 * create_hash_table: 18 * heap/Heap.cpp: 19 (JSC::TypeCounter::operator()): 20 * interpreter/CallFrame.h: 21 (JSC::ExecState::arrayTable): 22 (JSC::ExecState::numberTable): 23 * runtime/ArrayConstructor.cpp: 24 (JSC::ArrayConstructor::ArrayConstructor): 25 * runtime/ArrayConstructor.h: 26 * runtime/ArrayPrototype.cpp: 27 (JSC::ArrayPrototype::getOwnPropertySlot): 28 (JSC::ArrayPrototype::getOwnPropertyDescriptor): 29 * runtime/ArrayPrototype.h: 30 * runtime/BooleanPrototype.cpp: 31 (JSC::BooleanPrototype::BooleanPrototype): 32 * runtime/BooleanPrototype.h: 33 * runtime/DateConstructor.cpp: 34 (JSC::DateConstructor::DateConstructor): 35 * runtime/DateConstructor.h: 36 * runtime/ErrorPrototype.cpp: 37 (JSC::ErrorPrototype::ErrorPrototype): 38 * runtime/ErrorPrototype.h: 39 * runtime/JSGlobalData.cpp: 40 (JSC::JSGlobalData::JSGlobalData): 41 (JSC::JSGlobalData::~JSGlobalData): 42 * runtime/JSGlobalData.h: 43 * runtime/JSGlobalObject.cpp: 44 (JSC::JSGlobalObject::reset): 45 * runtime/JSGlobalObject.h: 46 (JSC::JSGlobalObject::addStaticGlobals): 47 (JSC::JSGlobalObject::getOwnPropertySlot): 48 (JSC::JSGlobalObject::getOwnPropertyDescriptor): 49 * runtime/JSGlobalObjectFunctions.cpp: 50 (JSC::globalFuncJSCPrint): 51 * runtime/JSGlobalObjectFunctions.h: 52 * runtime/MathObject.cpp: 53 * runtime/NumberConstructor.cpp: 54 (JSC::NumberConstructor::getOwnPropertySlot): 55 (JSC::NumberConstructor::getOwnPropertyDescriptor): 56 * runtime/NumberPrototype.cpp: 57 (JSC::NumberPrototype::NumberPrototype): 58 * runtime/NumberPrototype.h: 59 * runtime/ObjectPrototype.cpp: 60 (JSC::ObjectPrototype::ObjectPrototype): 61 (JSC::ObjectPrototype::put): 62 (JSC::ObjectPrototype::getOwnPropertySlot): 63 * runtime/ObjectPrototype.h: 64 * runtime/RegExpPrototype.cpp: 65 (JSC::RegExpPrototype::RegExpPrototype): 66 * runtime/RegExpPrototype.h: 67 * runtime/StringConstructor.cpp: 68 (JSC::StringConstructor::StringConstructor): 69 * runtime/StringConstructor.h: 70 1 71 2011-05-16 Geoffrey Garen <ggaren@apple.com> 2 72 -
trunk/Source/JavaScriptCore/DerivedSources.make
r86653 r86657 36 36 .PHONY : all 37 37 all : \ 38 ArrayConstructor.lut.h \39 38 ArrayPrototype.lut.h \ 40 BooleanPrototype.lut.h \41 DateConstructor.lut.h \42 39 DatePrototype.lut.h \ 43 ErrorPrototype.lut.h \44 40 HeaderDetection.h \ 45 41 JSONObject.lut.h \ 46 42 JavaScriptCore.JSVALUE32_64.exp \ 47 43 JavaScriptCore.JSVALUE64.exp \ 48 JSGlobalObject.lut.h \49 44 Lexer.lut.h \ 50 45 MathObject.lut.h \ 51 46 NumberConstructor.lut.h \ 52 NumberPrototype.lut.h \53 47 ObjectConstructor.lut.h \ 54 ObjectPrototype.lut.h \55 48 RegExpConstructor.lut.h \ 56 RegExpPrototype.lut.h \57 49 RegExpJitTables.h \ 58 50 RegExpObject.lut.h \ 59 StringConstructor.lut.h \60 51 StringPrototype.lut.h \ 61 52 docs/bytecode.html \ -
trunk/Source/JavaScriptCore/DerivedSources.pro
r86653 r86657 15 15 16 16 LUT_FILES += \ 17 runtime/ArrayConstructor.cpp \18 17 runtime/ArrayPrototype.cpp \ 19 runtime/BooleanPrototype.cpp \20 runtime/DateConstructor.cpp \21 18 runtime/DatePrototype.cpp \ 22 runtime/ErrorPrototype.cpp \23 runtime/JSGlobalObject.cpp \24 19 runtime/JSONObject.cpp \ 25 20 runtime/MathObject.cpp \ 26 21 runtime/NumberConstructor.cpp \ 27 runtime/NumberPrototype.cpp \28 22 runtime/ObjectConstructor.cpp \ 29 runtime/ObjectPrototype.cpp \30 23 runtime/RegExpConstructor.cpp \ 31 24 runtime/RegExpObject.cpp \ 32 runtime/RegExpPrototype.cpp \ 33 runtime/StringConstructor.cpp \ 34 runtime/StringPrototype.cpp \ 25 runtime/StringPrototype.cpp 35 26 36 27 KEYWORDLUT_FILES += \ -
trunk/Source/JavaScriptCore/GNUmakefile.am
r86653 r86657 146 146 # FIXME: Should this list be generated from javascriptcore_built_nosources? 147 147 CLEANFILES += \ 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 \ 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 \ 168 156 Programs/jsc \ 169 157 Programs/jsc-@WEBKITGTK_API_MAJOR_VERSION@ \ -
trunk/Source/JavaScriptCore/GNUmakefile.list.am
r86653 r86657 14 14 Source/JavaScriptCore/Lexer.lut.h \ 15 15 Source/JavaScriptCore/RegExpJitTables.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 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 34 25 35 26 javascriptcore_sources += \ -
trunk/Source/JavaScriptCore/JavaScriptCore.exp
r86653 r86657 160 160 __ZN3JSC14JSGlobalObject12defineSetterEPNS_9ExecStateERKNS_10IdentifierEPNS_8JSObjectEj 161 161 __ZN3JSC14JSGlobalObject13visitChildrenERNS_9MarkStackE 162 __ZN3JSC14JSGlobalObject16addStaticGlobalsEPNS0_18GlobalPropertyInfoEi163 162 __ZN3JSC14JSGlobalObject17putWithAttributesEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueEj 164 __ZN3JSC14JSGlobalObject18getOwnPropertySlotEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE165 __ZN3JSC14JSGlobalObject24getOwnPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE166 163 __ZN3JSC14JSGlobalObject3putEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE 167 164 __ZN3JSC14JSGlobalObject4initEPNS_8JSObjectE 168 __ZN3JSC14JSGlobalObject6s_infoE169 165 __ZN3JSC14JSGlobalObjectD2Ev 170 166 __ZN3JSC14JSGlobalObjectnwEmPNS_12JSGlobalDataE … … 222 218 __ZN3JSC25evaluateInGlobalCallFrameERKNS_7UStringERNS_7JSValueEPNS_14JSGlobalObjectE 223 219 __ZN3JSC35createInterruptedExecutionExceptionEPNS_12JSGlobalDataE 220 __ZN3JSC41constructFunctionSkippingEvalEnabledCheckEPNS_9ExecStateEPNS_14JSGlobalObjectERKNS_7ArgListERKNS_10IdentifierERKNS_7UStringEi 224 221 __ZN3JSC3NaNE 225 __ZN3JSC41constructFunctionSkippingEvalEnabledCheckEPNS_9ExecStateEPNS_14JSGlobalObjectERKNS_7ArgListERKNS_10IdentifierERKNS_7UStringEi226 222 __ZN3JSC4Heap16activityCallbackEv 227 223 __ZN3JSC4Heap16allocateSlowCaseEm … … 380 376 __ZN3WTF11OSAllocator18releaseDecommittedEPvm 381 377 __ZN3WTF11commentAtomE 378 __ZN3WTF11emptyStringEv 382 379 __ZN3WTF11currentTimeEv 383 380 __ZN3WTF11dtoaRoundDPEPcdiRbRiRj 384 381 __ZN3WTF11dtoaRoundSFEPcdiRbRiRj 385 __ZN3WTF11emptyStringEv386 382 __ZN3WTF11fastReallocEPvm 387 383 __ZN3WTF12AtomicString11addSlowCaseEPNS_10StringImplE -
trunk/Source/JavaScriptCore/JavaScriptCore.gypi
r86653 r86657 693 693 ], 694 694 'javascriptcore_derived_source_files': [ 695 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/ArrayPrototype.lut.h', 696 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/DatePrototype.lut.h', 697 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/HeaderDetection.h', 698 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/JSONObject.lut.h', 695 699 '<(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',699 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/ArrayPrototype.lut.h',700 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/BooleanPrototype.lut.h',701 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/DateConstructor.lut.h',702 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/DatePrototype.lut.h',703 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/ErrorPrototype.lut.h',704 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/JSGlobalObject.lut.h',705 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/JSONObject.lut.h',706 700 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/MathObject.lut.h', 707 701 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/NumberConstructor.lut.h', 708 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/NumberPrototype.lut.h', 702 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/RegExpConstructor.lut.h', 703 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/RegExpJitTables.h', 704 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/RegExpObject.lut.h', 705 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/StringPrototype.lut.h', 706 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/TracingDtrace.h', 709 707 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/ObjectConstructor.lut.h', 710 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/ObjectPrototype.lut.h',711 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/RegExpConstructor.lut.h',712 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/RegExpObject.lut.h',713 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/RegExpPrototype.lut.h',714 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/StringConstructor.lut.h',715 '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/StringPrototype.lut.h',716 708 ], 717 709 'minidom_files': [ -
trunk/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
r86653 r86657 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@Z60 59 ?allocate@Heap@JSC@@QAEPAXI@Z 61 60 ?allocateFromSizeClass@MarkedSpace@JSC@@AAEPAXAAUSizeClass@12@@Z … … 184 183 ?getJSNumber@JSCell@JSC@@UAE?AVJSValue@2@XZ 185 184 ?getObject@JSCell@JSC@@QAEPAVJSObject@2@XZ 186 ?getOwnPropertyDescriptor@JSGlobalObject@JSC@@UAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z187 185 ?getOwnPropertyDescriptor@JSObject@JSC@@UAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z 188 186 ?getOwnPropertyDescriptor@JSString@JSC@@EAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z … … 194 192 ?getOwnPropertySlot@JSCell@JSC@@EAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertySlot@2@@Z 195 193 ?getOwnPropertySlot@JSCell@JSC@@EAE_NPAVExecState@2@IAAVPropertySlot@2@@Z 196 ?getOwnPropertySlot@JSGlobalObject@JSC@@UAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertySlot@2@@Z197 194 ?getOwnPropertySlot@JSObject@JSC@@UAE_NPAVExecState@2@IAAVPropertySlot@2@@Z 198 195 ?getOwnPropertySlot@JSString@JSC@@EAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertySlot@2@@Z … … 244 241 ?lookupGetter@JSObject@JSC@@UAE?AVJSValue@2@PAVExecState@2@ABVIdentifier@2@@Z 245 242 ?lookupSetter@JSObject@JSC@@UAE?AVJSValue@2@PAVExecState@2@ABVIdentifier@2@@Z 243 ?visitChildren@JSGlobalObject@JSC@@UAEXAAVMarkStack@2@@Z 244 ?visitChildren@JSObject@JSC@@UAEXAAVMarkStack@2@@Z 245 ?visitChildren@JSWrapperObject@JSC@@EAEXAAVMarkStack@2@@Z 246 ?visitChildren@ScopeChainNode@JSC@@UAEXAAVMarkStack@2@@Z 246 247 ?materializePropertyMap@Structure@JSC@@AAEXAAVJSGlobalData@2@@Z 247 248 ?monthFromDayInYear@WTF@@YAHH_N@Z … … 297 298 ?retrieveCaller@Interpreter@JSC@@QBE?AVJSValue@2@PAVExecState@2@PAVJSFunction@2@@Z 298 299 ?retrieveLastCaller@Interpreter@JSC@@QBEXPAVExecState@2@AAH1AAVUString@2@AAVJSValue@2@@Z 299 ?s_info@JSGlobalObject@JSC@@2UClassInfo@2@B300 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@@Z373 ?visitChildren@JSObject@JSC@@UAEXAAVMarkStack@2@@Z374 ?visitChildren@JSWrapperObject@JSC@@EAEXAAVMarkStack@2@@Z375 ?visitChildren@ScopeChainNode@JSC@@UAEXAAVMarkStack@2@@Z376 372 ?vtableAnchor@InternalFunction@JSC@@EAEXXZ 377 373 ?wait@ThreadCondition@WTF@@QAEXAAVMutex@2@@Z -
trunk/Source/JavaScriptCore/create_hash_table
r86653 r86657 285 285 $thunkGenerator = "powThunkGenerator"; 286 286 } 287 if ($key eq "fromCharCode") {288 $thunkGenerator = "fromCharCodeThunkGenerator";289 }290 287 print " { \"$key\", $attrs[$i], (intptr_t)" . $castStr . "($firstValue), (intptr_t)$secondValue THUNK_GENERATOR($thunkGenerator) },\n"; 291 288 $i++; -
trunk/Source/JavaScriptCore/heap/Heap.cpp
r86653 r86657 1 1 /* 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 , 2011Apple Inc. All rights reserved.2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 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;317 316 }; 318 317 … … 341 340 inline void TypeCounter::operator()(JSCell* cell) 342 341 { 343 if (!m_cells.add(cell).second)344 return;345 342 m_typeCountSet->add(typeName(cell)); 346 343 } -
trunk/Source/JavaScriptCore/interpreter/CallFrame.h
r86653 r86657 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 , 2011Apple Inc. All rights reserved.4 * Copyright (C) 2003, 2007, 2008 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* 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; } 78 static const HashTable* arrayTable(CallFrame* callFrame) { return callFrame->globalData().arrayTable; } 81 79 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; }85 80 static const HashTable* jsonTable(CallFrame* callFrame) { return callFrame->globalData().jsonTable; } 86 81 static const HashTable* mathTable(CallFrame* callFrame) { return callFrame->globalData().mathTable; } 87 static const HashTable* numberConstructorTable(CallFrame* callFrame) { return callFrame->globalData().numberConstructorTable; } 88 static const HashTable* numberPrototypeTable(CallFrame* callFrame) { return callFrame->globalData().numberPrototypeTable; } 82 static const HashTable* numberTable(CallFrame* callFrame) { return callFrame->globalData().numberTable; } 89 83 static const HashTable* objectConstructorTable(CallFrame* callFrame) { return callFrame->globalData().objectConstructorTable; } 90 static const HashTable* objectPrototypeTable(CallFrame* callFrame) { return callFrame->globalData().objectPrototypeTable; }91 84 static const HashTable* regExpTable(CallFrame* callFrame) { return callFrame->globalData().regExpTable; } 92 85 static const HashTable* regExpConstructorTable(CallFrame* callFrame) { return callFrame->globalData().regExpConstructorTable; } 93 static const HashTable* regExpPrototypeTable(CallFrame* callFrame) { return callFrame->globalData().regExpPrototypeTable; }94 86 static const HashTable* stringTable(CallFrame* callFrame) { return callFrame->globalData().stringTable; } 95 static const HashTable* stringConstructorTable(CallFrame* callFrame) { return callFrame->globalData().stringConstructorTable; }96 87 97 88 static CallFrame* create(Register* callFrameBase) { return static_cast<CallFrame*>(callFrameBase); } -
trunk/Source/JavaScriptCore/runtime/ArrayConstructor.cpp
r86653 r86657 1 1 /* 2 2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) 3 * Copyright (C) 2003, 2007, 2008 , 2011Apple Inc. All rights reserved.3 * Copyright (C) 2003, 2007, 2008 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 36 38 static EncodedJSValue JSC_HOST_CALL arrayConstructorIsArray(ExecState*); 37 39 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) 40 ArrayConstructor::ArrayConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ArrayPrototype* arrayPrototype, Structure* functionStructure) 55 41 : InternalFunction(&exec->globalData(), globalObject, structure, Identifier(exec, arrayPrototype->classInfo()->className)) 56 42 { 43 // ECMA 15.4.3.1 Array.prototype 57 44 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().prototype, arrayPrototype, DontEnum | DontDelete | ReadOnly); 45 46 // no. of arguments for constructor 58 47 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().length, jsNumber(1), ReadOnly | DontEnum | DontDelete); 48 49 // ES5 50 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, globalObject, functionStructure, 1, exec->propertyNames().isArray, arrayConstructorIsArray), DontEnum); 59 51 } 60 61 bool ArrayConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot)62 {63 return getStaticFunctionSlot<InternalFunction>(exec, ExecState::arrayConstructorTable(exec), this, propertyName, slot);64 }65 66 bool ArrayConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)67 {68 return getStaticFunctionDescriptor<InternalFunction>(exec, ExecState::arrayConstructorTable(exec), this, propertyName, descriptor);69 }70 71 // ------------------------------ Functions ---------------------------72 52 73 53 static inline JSObject* constructArrayWithSizeQuirk(ExecState* exec, const ArgList& args) … … 93 73 } 94 74 75 // ECMA 15.4.2 95 76 ConstructType ArrayConstructor::getConstructData(ConstructData& constructData) 96 77 { … … 105 86 } 106 87 88 // ECMA 15.6.1 107 89 CallType ArrayConstructor::getCallData(CallData& callData) 108 90 { -
trunk/Source/JavaScriptCore/runtime/ArrayConstructor.h
r86653 r86657 1 1 /* 2 2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) 3 * Copyright (C) 2007, 2008 , 2011Apple Inc. All rights reserved.3 * Copyright (C) 2007, 2008 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*); 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&); 32 ArrayConstructor(ExecState*, JSGlobalObject*, Structure*, ArrayPrototype*, Structure*); 47 33 48 34 virtual ConstructType getConstructData(ConstructData&); -
trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp
r86653 r86657 86 86 // ------------------------------ ArrayPrototype ---------------------------- 87 87 88 const ClassInfo ArrayPrototype::s_info = {"Array", &JSArray::s_info, 0, ExecState::array PrototypeTable};88 const ClassInfo ArrayPrototype::s_info = {"Array", &JSArray::s_info, 0, ExecState::arrayTable}; 89 89 90 90 /* Source for ArrayPrototype.lut.h 91 @begin array PrototypeTable 1691 @begin arrayTable 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 PrototypeTable(exec), this, propertyName, slot);126 return getStaticFunctionSlot<JSArray>(exec, ExecState::arrayTable(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 PrototypeTable(exec), this, propertyName, descriptor);131 return getStaticFunctionDescriptor<JSArray>(exec, ExecState::arrayTable(exec), this, propertyName, descriptor); 132 132 } 133 133 -
trunk/Source/JavaScriptCore/runtime/ArrayPrototype.h
r86653 r86657 1 1 /* 2 2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) 3 * Copyright (C) 2007 , 2011Apple Inc. All rights reserved.3 * Copyright (C) 2007 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
r86653 r86657 1 1 /* 2 2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) 3 * Copyright (C) 2003, 2008 , 2011Apple Inc. All rights reserved.3 * Copyright (C) 2003, 2008 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 // Functions 32 35 static EncodedJSValue JSC_HOST_CALL booleanProtoFuncToString(ExecState*); 33 36 static EncodedJSValue JSC_HOST_CALL booleanProtoFuncValueOf(ExecState*); 34 37 35 } 38 // ECMA 15.6.4 36 39 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) 40 BooleanPrototype::BooleanPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, Structure* functionStructure) 53 41 : BooleanObject(exec->globalData(), structure) 54 42 { 55 43 setInternalValue(exec->globalData(), jsBoolean(false)); 56 44 57 ASSERT(inherits(&s_info));58 put AnonymousValue(globalObject->globalData(), 0, globalObject);45 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, globalObject, functionStructure, 0, exec->propertyNames().toString, booleanProtoFuncToString), DontEnum); 46 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, globalObject, functionStructure, 0, exec->propertyNames().valueOf, booleanProtoFuncValueOf), DontEnum); 59 47 } 60 48 61 bool BooleanPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot)62 {63 return getStaticFunctionSlot<BooleanObject>(exec, ExecState::booleanPrototypeTable(exec), this, propertyName, slot);64 }65 49 66 bool BooleanPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 67 { 68 return getStaticFunctionDescriptor<BooleanObject>(exec, ExecState::booleanPrototypeTable(exec), this, propertyName, descriptor); 69 } 50 // ------------------------------ Functions -------------------------- 70 51 71 // ------------------------------ Functions ---------------------------52 // ECMA 15.6.4.2 + 15.6.4.3 72 53 73 54 EncodedJSValue JSC_HOST_CALL booleanProtoFuncToString(ExecState* exec) -
trunk/Source/JavaScriptCore/runtime/BooleanPrototype.h
r86653 r86657 1 1 /* 2 2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) 3 * Copyright (C) 2008 , 2011Apple Inc. All rights reserved.3 * Copyright (C) 2008 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*); 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&); 30 BooleanPrototype(ExecState*, JSGlobalObject*, Structure*, Structure* functionStructure); 46 31 }; 47 32 -
trunk/Source/JavaScriptCore/runtime/DateConstructor.cpp
r86653 r86657 1 1 /* 2 2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 , 2011Apple Inc. All rights reserved.3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 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 54 56 static EncodedJSValue JSC_HOST_CALL dateParse(ExecState*); 55 57 static EncodedJSValue JSC_HOST_CALL dateNow(ExecState*); 56 58 static EncodedJSValue JSC_HOST_CALL dateUTC(ExecState*); 57 59 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) 60 DateConstructor::DateConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, Structure* functionStructure, DatePrototype* datePrototype) 77 61 : InternalFunction(&exec->globalData(), globalObject, structure, Identifier(exec, datePrototype->classInfo()->className)) 78 62 { 79 63 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 80 69 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);91 70 } 92 71 -
trunk/Source/JavaScriptCore/runtime/DateConstructor.h
r86653 r86657 1 1 /* 2 2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) 3 * Copyright (C) 2008 , 2011Apple Inc. All rights reserved.3 * Copyright (C) 2008 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*, 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; 32 DateConstructor(ExecState*, JSGlobalObject*, Structure*, Structure* functionStructure, DatePrototype*); 43 33 44 34 private: 45 35 virtual ConstructType getConstructData(ConstructData&); 46 36 virtual CallType getCallData(CallData&); 47 48 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);49 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);50 37 }; 51 38 -
trunk/Source/JavaScriptCore/runtime/ErrorPrototype.cpp
r86653 r86657 35 35 static EncodedJSValue JSC_HOST_CALL errorProtoFuncToString(ExecState*); 36 36 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) 37 // ECMA 15.9.4 38 ErrorPrototype::ErrorPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, Structure* functionStructure) 54 39 : ErrorInstance(&exec->globalData(), structure) 55 40 { 41 // The constructor will be added later in ErrorConstructor's constructor 42 56 43 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().name, jsNontrivialString(exec, "Error"), DontEnum); 57 58 ASSERT(inherits(&s_info)); 59 putAnonymousValue(globalObject->globalData(), 0, globalObject); 44 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, globalObject, functionStructure, 0, exec->propertyNames().toString, errorProtoFuncToString), DontEnum); 60 45 } 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 ---------------------------73 46 74 47 EncodedJSValue JSC_HOST_CALL errorProtoFuncToString(ExecState* exec) -
trunk/Source/JavaScriptCore/runtime/ErrorPrototype.h
r86653 r86657 30 30 class ErrorPrototype : public ErrorInstance { 31 31 public: 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&); 32 ErrorPrototype(ExecState*, JSGlobalObject*, Structure*, Structure* functionStructure); 48 33 }; 49 34 -
trunk/Source/JavaScriptCore/runtime/JSGlobalData.cpp
r86653 r86657 1 1 /* 2 * Copyright (C) 2008 , 2011Apple Inc. All rights reserved.2 * Copyright (C) 2008 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 arrayConstructorTable; 96 extern JSC_CONST_HASHTABLE HashTable arrayPrototypeTable; 97 extern JSC_CONST_HASHTABLE HashTable booleanPrototypeTable; 95 extern JSC_CONST_HASHTABLE HashTable arrayTable; 98 96 extern JSC_CONST_HASHTABLE HashTable jsonTable; 99 97 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;103 98 extern JSC_CONST_HASHTABLE HashTable mathTable; 104 extern JSC_CONST_HASHTABLE HashTable numberConstructorTable; 105 extern JSC_CONST_HASHTABLE HashTable numberPrototypeTable; 99 extern JSC_CONST_HASHTABLE HashTable numberTable; 106 100 extern JSC_CONST_HASHTABLE HashTable objectConstructorTable; 107 extern JSC_CONST_HASHTABLE HashTable objectPrototypeTable;108 101 extern JSC_CONST_HASHTABLE HashTable regExpTable; 109 102 extern JSC_CONST_HASHTABLE HashTable regExpConstructorTable; 110 extern JSC_CONST_HASHTABLE HashTable regExpPrototypeTable;111 103 extern JSC_CONST_HASHTABLE HashTable stringTable; 112 extern JSC_CONST_HASHTABLE HashTable stringConstructorTable;113 104 114 105 void* JSGlobalData::jsArrayVPtr; … … 156 147 : globalDataType(globalDataType) 157 148 , clientData(0) 158 , arrayConstructorTable(fastNew<HashTable>(JSC::arrayConstructorTable)) 159 , arrayPrototypeTable(fastNew<HashTable>(JSC::arrayPrototypeTable)) 160 , booleanPrototypeTable(fastNew<HashTable>(JSC::booleanPrototypeTable)) 149 , arrayTable(fastNew<HashTable>(JSC::arrayTable)) 161 150 , dateTable(fastNew<HashTable>(JSC::dateTable)) 162 , dateConstructorTable(fastNew<HashTable>(JSC::dateConstructorTable))163 , errorPrototypeTable(fastNew<HashTable>(JSC::errorPrototypeTable))164 , globalObjectTable(fastNew<HashTable>(JSC::globalObjectTable))165 151 , jsonTable(fastNew<HashTable>(JSC::jsonTable)) 166 152 , mathTable(fastNew<HashTable>(JSC::mathTable)) 167 , numberConstructorTable(fastNew<HashTable>(JSC::numberConstructorTable)) 168 , numberPrototypeTable(fastNew<HashTable>(JSC::numberPrototypeTable)) 153 , numberTable(fastNew<HashTable>(JSC::numberTable)) 169 154 , objectConstructorTable(fastNew<HashTable>(JSC::objectConstructorTable)) 170 , objectPrototypeTable(fastNew<HashTable>(JSC::objectPrototypeTable))171 155 , regExpTable(fastNew<HashTable>(JSC::regExpTable)) 172 156 , regExpConstructorTable(fastNew<HashTable>(JSC::regExpConstructorTable)) 173 , regExpPrototypeTable(fastNew<HashTable>(JSC::regExpPrototypeTable))174 157 , stringTable(fastNew<HashTable>(JSC::stringTable)) 175 , stringConstructorTable(fastNew<HashTable>(JSC::stringConstructorTable))176 158 , identifierTable(globalDataType == Default ? wtfThreadData().currentIdentifierTable() : createIdentifierTable()) 177 159 , propertyNames(new CommonIdentifiers(this)) … … 294 276 #endif 295 277 296 arrayPrototypeTable->deleteTable(); 297 arrayConstructorTable->deleteTable(); 298 booleanPrototypeTable->deleteTable(); 278 arrayTable->deleteTable(); 299 279 dateTable->deleteTable(); 300 dateConstructorTable->deleteTable();301 errorPrototypeTable->deleteTable();302 globalObjectTable->deleteTable();303 280 jsonTable->deleteTable(); 304 281 mathTable->deleteTable(); 305 numberConstructorTable->deleteTable(); 306 numberPrototypeTable->deleteTable(); 282 numberTable->deleteTable(); 307 283 objectConstructorTable->deleteTable(); 308 objectPrototypeTable->deleteTable();309 284 regExpTable->deleteTable(); 310 285 regExpConstructorTable->deleteTable(); 311 regExpPrototypeTable->deleteTable();312 286 stringTable->deleteTable(); 313 stringConstructorTable->deleteTable(); 314 315 fastDelete(const_cast<HashTable*>(arrayConstructorTable)); 316 fastDelete(const_cast<HashTable*>(arrayPrototypeTable)); 317 fastDelete(const_cast<HashTable*>(booleanPrototypeTable)); 287 288 fastDelete(const_cast<HashTable*>(arrayTable)); 318 289 fastDelete(const_cast<HashTable*>(dateTable)); 319 fastDelete(const_cast<HashTable*>(dateConstructorTable));320 fastDelete(const_cast<HashTable*>(errorPrototypeTable));321 fastDelete(const_cast<HashTable*>(globalObjectTable));322 290 fastDelete(const_cast<HashTable*>(jsonTable)); 323 291 fastDelete(const_cast<HashTable*>(mathTable)); 324 fastDelete(const_cast<HashTable*>(numberConstructorTable)); 325 fastDelete(const_cast<HashTable*>(numberPrototypeTable)); 292 fastDelete(const_cast<HashTable*>(numberTable)); 326 293 fastDelete(const_cast<HashTable*>(objectConstructorTable)); 327 fastDelete(const_cast<HashTable*>(objectPrototypeTable));328 294 fastDelete(const_cast<HashTable*>(regExpTable)); 329 295 fastDelete(const_cast<HashTable*>(regExpConstructorTable)); 330 fastDelete(const_cast<HashTable*>(regExpPrototypeTable));331 296 fastDelete(const_cast<HashTable*>(stringTable)); 332 fastDelete(const_cast<HashTable*>(stringConstructorTable));333 297 334 298 delete parser; -
trunk/Source/JavaScriptCore/runtime/JSGlobalData.h
r86653 r86657 137 137 ClientData* clientData; 138 138 139 const HashTable* arrayConstructorTable; 140 const HashTable* arrayPrototypeTable; 141 const HashTable* booleanPrototypeTable; 139 const HashTable* arrayTable; 142 140 const HashTable* dateTable; 143 const HashTable* dateConstructorTable;144 const HashTable* errorPrototypeTable;145 const HashTable* globalObjectTable;146 141 const HashTable* jsonTable; 147 142 const HashTable* mathTable; 148 const HashTable* numberConstructorTable; 149 const HashTable* numberPrototypeTable; 143 const HashTable* numberTable; 150 144 const HashTable* objectConstructorTable; 151 const HashTable* objectPrototypeTable;152 145 const HashTable* regExpTable; 153 146 const HashTable* regExpConstructorTable; 154 const HashTable* regExpPrototypeTable;155 147 const HashTable* stringTable; 156 const HashTable* stringConstructorTable;157 148 158 149 Strong<Structure> structureStructure; -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
r86653 r86657 52 52 #include "JSONObject.h" 53 53 #include "Interpreter.h" 54 #include "Lookup.h"55 54 #include "MathObject.h" 56 55 #include "NativeErrorConstructor.h" … … 70 69 #include "Debugger.h" 71 70 72 #include "JSGlobalObject.lut.h"73 74 71 namespace JSC { 75 76 const ClassInfo JSGlobalObject::s_info = { "GlobalObject", &NumberObject::s_info, 0, ExecState::globalObjectTable };77 78 /* Source for JSGlobalObject.lut.h79 @begin globalObjectTable80 parseInt globalFuncParseInt DontEnum|Function 281 parseFloat globalFuncParseFloat DontEnum|Function 182 isNaN globalFuncIsNaN DontEnum|Function 183 isFinite globalFuncIsFinite DontEnum|Function 184 escape globalFuncEscape DontEnum|Function 185 unescape globalFuncUnescape DontEnum|Function 186 decodeURI globalFuncDecodeURI DontEnum|Function 187 decodeURIComponent globalFuncDecodeURIComponent DontEnum|Function 188 encodeURI globalFuncEncodeURI DontEnum|Function 189 encodeURIComponent globalFuncEncodeURIComponent DontEnum|Function 190 @end91 */92 72 93 73 ASSERT_CLASS_FITS_IN_CELL(JSGlobalObject); … … 187 167 { 188 168 ExecState* exec = JSGlobalObject::globalExec(); 169 170 // Prototypes 189 171 190 172 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. … … 196 178 m_callFunction.set(exec->globalData(), this, callFunction); 197 179 m_applyFunction.set(exec->globalData(), this, applyFunction); 198 m_objectPrototype.set(exec->globalData(), this, new (exec) ObjectPrototype(exec, this, ObjectPrototype::createStructure(exec->globalData(), jsNull()) ));180 m_objectPrototype.set(exec->globalData(), this, new (exec) ObjectPrototype(exec, this, ObjectPrototype::createStructure(exec->globalData(), jsNull()), m_functionStructure.get())); 199 181 m_functionPrototype->structure()->setPrototypeWithoutTransition(exec->globalData(), m_objectPrototype.get()); 200 182 … … 214 196 m_stringObjectStructure.set(exec->globalData(), this, StringObject::createStructure(exec->globalData(), m_stringPrototype.get())); 215 197 216 m_booleanPrototype.set(exec->globalData(), this, new (exec) BooleanPrototype(exec, this, BooleanPrototype::createStructure(exec->globalData(), m_objectPrototype.get()) ));198 m_booleanPrototype.set(exec->globalData(), this, new (exec) BooleanPrototype(exec, this, BooleanPrototype::createStructure(exec->globalData(), m_objectPrototype.get()), m_functionStructure.get())); 217 199 m_booleanObjectStructure.set(exec->globalData(), this, BooleanObject::createStructure(exec->globalData(), m_booleanPrototype.get())); 218 200 219 m_numberPrototype.set(exec->globalData(), this, new (exec) NumberPrototype(exec, this, NumberPrototype::createStructure(exec->globalData(), m_objectPrototype.get()) ));201 m_numberPrototype.set(exec->globalData(), this, new (exec) NumberPrototype(exec, this, NumberPrototype::createStructure(exec->globalData(), m_objectPrototype.get()), m_functionStructure.get())); 220 202 m_numberObjectStructure.set(exec->globalData(), this, NumberObject::createStructure(exec->globalData(), m_numberPrototype.get())); 221 203 … … 223 205 m_dateStructure.set(exec->globalData(), this, DateInstance::createStructure(exec->globalData(), m_datePrototype.get())); 224 206 225 m_regExpPrototype.set(exec->globalData(), this, new (exec) RegExpPrototype(exec, this, RegExpPrototype::createStructure(exec->globalData(), m_objectPrototype.get()) ));207 m_regExpPrototype.set(exec->globalData(), this, new (exec) RegExpPrototype(exec, this, RegExpPrototype::createStructure(exec->globalData(), m_objectPrototype.get()), m_functionStructure.get())); 226 208 m_regExpStructure.set(exec->globalData(), this, RegExpObject::createStructure(exec->globalData(), m_regExpPrototype.get())); 227 209 228 210 m_methodCallDummy.set(exec->globalData(), this, constructEmptyObject(exec)); 229 211 230 ErrorPrototype* errorPrototype = new (exec) ErrorPrototype(exec, this, ErrorPrototype::createStructure(exec->globalData(), m_objectPrototype.get()) );212 ErrorPrototype* errorPrototype = new (exec) ErrorPrototype(exec, this, ErrorPrototype::createStructure(exec->globalData(), m_objectPrototype.get()), m_functionStructure.get()); 231 213 m_errorStructure.set(exec->globalData(), this, ErrorInstance::createStructure(exec->globalData(), errorPrototype)); 232 214 … … 235 217 JSCell* objectConstructor = new (exec) ObjectConstructor(exec, this, ObjectConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), m_objectPrototype.get()); 236 218 JSCell* functionConstructor = new (exec) FunctionConstructor(exec, this, FunctionConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), m_functionPrototype.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());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()); 239 221 JSCell* booleanConstructor = new (exec) BooleanConstructor(exec, this, BooleanConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), m_booleanPrototype.get()); 240 222 JSCell* numberConstructor = new (exec) NumberConstructor(exec, this, NumberConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), m_numberPrototype.get()); 241 JSCell* dateConstructor = new (exec) DateConstructor(exec, this, DateConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), m_ datePrototype.get());223 JSCell* dateConstructor = new (exec) DateConstructor(exec, this, DateConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), m_functionStructure.get(), m_datePrototype.get()); 242 224 243 225 m_regExpConstructor.set(exec->globalData(), this, new (exec) RegExpConstructor(exec, this, RegExpConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), m_regExpPrototype.get())); … … 263 245 m_regExpPrototype->putDirectFunctionWithoutTransition(exec->globalData(), exec->propertyNames().constructor, m_regExpConstructor.get(), DontEnum); 264 246 errorPrototype->putDirectFunctionWithoutTransition(exec->globalData(), exec->propertyNames().constructor, m_errorConstructor.get(), DontEnum); 247 248 // Set global constructors 249 250 // FIXME: These properties could be handled by a static hash table. 265 251 266 252 putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, "Object"), objectConstructor, DontEnum); … … 280 266 putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, "URIError"), m_URIErrorConstructor.get(), DontEnum); 281 267 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 268 // Set global values. 285 269 GlobalPropertyInfo staticGlobals[] = { 286 270 GlobalPropertyInfo(Identifier(exec, "Math"), new (exec) MathObject(exec, this, MathObject::createStructure(exec->globalData(), m_objectPrototype.get())), DontEnum | DontDelete), … … 290 274 GlobalPropertyInfo(Identifier(exec, "JSON"), new (exec) JSONObject(this, JSONObject::createStructure(exec->globalData(), m_objectPrototype.get())), DontEnum | DontDelete) 291 275 }; 276 292 277 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 NDEBUG 294 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, this, m_functionStructure.get(), 1, Identifier(exec, "jscprint"), globalFuncJSCPrint), DontEnum); 295 #endif 293 296 294 297 resetPrototype(exec->globalData(), prototype); … … 442 445 } 443 446 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 array451 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 480 447 void JSGlobalObject::WeakMapsFinalizer::finalize(Handle<Unknown> handle, void*) 481 448 { -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h
r86653 r86657 149 149 } 150 150 151 static const ClassInfo s_info;152 153 151 protected: 154 152 JSGlobalObject(JSGlobalData& globalData, Structure* structure, JSObject* thisValue) … … 320 318 } 321 319 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 array 327 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 322 356 inline bool JSGlobalObject::hasOwnPropertyForWrite(ExecState* exec, const Identifier& propertyName) 323 357 { -
trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
r86653 r86657 588 588 } 589 589 590 #ifndef NDEBUG 591 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 #endif 598 590 599 } // namespace JSC -
trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.h
r86653 r86657 48 48 EncodedJSValue JSC_HOST_CALL globalFuncEscape(ExecState*); 49 49 EncodedJSValue JSC_HOST_CALL globalFuncUnescape(ExecState*); 50 #ifndef NDEBUG 51 EncodedJSValue JSC_HOST_CALL globalFuncJSCPrint(ExecState*); 52 #endif 50 53 51 54 static const double mantissaOverflowLowerBound = 9007199254740992.0; -
trunk/Source/JavaScriptCore/runtime/MathObject.cpp
r86653 r86657 59 59 60 60 namespace JSC { 61 62 // ------------------------------ MathObject -------------------------------- 61 63 62 64 const ClassInfo MathObject::s_info = { "Math", &JSObjectWithGlobalObject::s_info, 0, ExecState::mathTable }; … … 100 102 } 101 103 104 // ECMA 15.8 105 102 106 bool MathObject::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot) 103 107 { -
trunk/Source/JavaScriptCore/runtime/NumberConstructor.cpp
r86653 r86657 1 1 /* 2 2 * Copyright (C) 1999-2000,2003 Harri Porten (porten@kde.org) 3 * Copyright (C) 2007, 2008 , 2011Apple Inc. All rights reserved.3 * Copyright (C) 2007, 2008 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 ConstructorTable };45 const ClassInfo NumberConstructor::s_info = { "Function", &InternalFunction::s_info, 0, ExecState::numberTable }; 46 46 47 47 /* Source for NumberConstructor.lut.h 48 @begin number ConstructorTable48 @begin numberTable 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 ConstructorTable(exec), this, propertyName, slot);71 return getStaticValueSlot<NumberConstructor, InternalFunction>(exec, ExecState::numberTable(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 ConstructorTable(exec), this, propertyName, descriptor);76 return getStaticValueDescriptor<NumberConstructor, InternalFunction>(exec, ExecState::numberTable(exec), this, propertyName, descriptor); 77 77 } 78 78 -
trunk/Source/JavaScriptCore/runtime/NumberPrototype.cpp
r86653 r86657 1 1 /* 2 2 * Copyright (C) 1999-2000,2003 Harri Porten (porten@kde.org) 3 * Copyright (C) 2007, 2008 , 2011Apple Inc. All rights reserved.3 * Copyright (C) 2007, 2008 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 37 39 static EncodedJSValue JSC_HOST_CALL numberProtoFuncToString(ExecState*); 38 40 static EncodedJSValue JSC_HOST_CALL numberProtoFuncToLocaleString(ExecState*); … … 42 44 static EncodedJSValue JSC_HOST_CALL numberProtoFuncToPrecision(ExecState*); 43 45 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) 46 // ECMA 15.7.4 47 48 NumberPrototype::NumberPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, Structure* functionStructure) 66 49 : NumberObject(exec->globalData(), structure) 67 50 { 68 51 setInternalValue(exec->globalData(), jsNumber(0)); 69 52 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); 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); 82 61 } 83 62 84 63 // ------------------------------ Functions --------------------------- 64 65 // ECMA 15.7.4.2 - 15.7.4.7 85 66 86 67 static ALWAYS_INLINE bool toThisNumber(JSValue thisValue, double &x) -
trunk/Source/JavaScriptCore/runtime/NumberPrototype.h
r86653 r86657 1 1 /* 2 2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) 3 * Copyright (C) 2008 , 2011Apple Inc. All rights reserved.3 * Copyright (C) 2008 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*); 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&); 30 NumberPrototype(ExecState*, JSGlobalObject*, Structure*, Structure* functionStructure); 46 31 }; 47 32 -
trunk/Source/JavaScriptCore/runtime/ObjectPrototype.cpp
r86653 r86657 1 1 /* 2 2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) 3 * Copyright (C) 2008 , 2011Apple Inc. All rights reserved.3 * Copyright (C) 2008 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 31 33 static EncodedJSValue JSC_HOST_CALL objectProtoFuncValueOf(ExecState*); 32 34 static EncodedJSValue JSC_HOST_CALL objectProtoFuncHasOwnProperty(ExecState*); … … 39 41 static EncodedJSValue JSC_HOST_CALL objectProtoFuncToLocaleString(ExecState*); 40 42 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) 43 ObjectPrototype::ObjectPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* stucture, Structure* functionStructure) 67 44 : JSNonFinalObject(exec->globalData(), stucture) 68 45 , m_hasNoPropertiesWithUInt32Names(true) 69 46 { 70 ASSERT(inherits(&s_info)); 71 putAnonymousValue(globalObject->globalData(), 0, globalObject); 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); 72 59 } 73 60 74 61 void ObjectPrototype::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) 75 62 { 76 JS NonFinalObject::put(exec, propertyName, value, slot);63 JSObject::put(exec, propertyName, value, slot); 77 64 78 65 if (m_hasNoPropertiesWithUInt32Names) { … … 87 74 if (m_hasNoPropertiesWithUInt32Names) 88 75 return false; 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); 76 return JSObject::getOwnPropertySlot(exec, propertyName, slot); 100 77 } 101 78 102 79 // ------------------------------ Functions -------------------------------- 80 81 // ECMA 15.2.4.2, 15.2.4.4, 15.2.4.5, 15.2.4.7 103 82 104 83 EncodedJSValue JSC_HOST_CALL objectProtoFuncValueOf(ExecState* exec) -
trunk/Source/JavaScriptCore/runtime/ObjectPrototype.h
r86653 r86657 1 1 /* 2 2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) 3 * Copyright (C) 2008 , 2011Apple Inc. All rights reserved.3 * Copyright (C) 2008 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*); 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; 30 ObjectPrototype(ExecState*, JSGlobalObject*, Structure*, Structure* functionStructure); 42 31 43 32 private: 44 33 virtual void put(ExecState*, const Identifier&, JSValue, PutPropertySlot&); 45 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);46 34 virtual bool getOwnPropertySlot(ExecState*, unsigned propertyName, PropertySlot&); 47 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);48 35 49 36 bool m_hasNoPropertiesWithUInt32Names; -
trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp
r86653 r86657 39 39 namespace JSC { 40 40 41 ASSERT_CLASS_FITS_IN_CELL(RegExpPrototype); 42 41 43 static EncodedJSValue JSC_HOST_CALL regExpProtoFuncTest(ExecState*); 42 44 static EncodedJSValue JSC_HOST_CALL regExpProtoFuncExec(ExecState*); … … 44 46 static EncodedJSValue JSC_HOST_CALL regExpProtoFuncToString(ExecState*); 45 47 46 } 48 // ECMA 15.10.5 47 49 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) 50 RegExpPrototype::RegExpPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, Structure* functionStructure) 66 51 : RegExpObject(globalObject, structure, RegExp::create(&exec->globalData(), "", NoFlags)) 67 52 { 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); 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); 78 57 } 79 58 -
trunk/Source/JavaScriptCore/runtime/RegExpPrototype.h
r86653 r86657 29 29 class RegExpPrototype : public RegExpObject { 30 30 public: 31 RegExpPrototype(ExecState*, JSGlobalObject*, Structure*); 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 | RegExpObject::StructureFlags; 41 42 private: 43 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 44 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 31 RegExpPrototype(ExecState*, JSGlobalObject*, Structure*, Structure* functionStructure); 45 32 }; 46 33 -
trunk/Source/JavaScriptCore/runtime/StringConstructor.cpp
r86653 r86657 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.h43 @begin stringConstructorTable44 fromCharCode stringFromCharCode DontEnum|Function 145 @end46 */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 69 32 static NEVER_INLINE JSValue stringFromCharCodeSlowCase(ExecState* exec) 70 33 { … … 84 47 } 85 48 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.prototype 55 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 #else 61 putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, globalObject, functionStructure, 1, exec->propertyNames().fromCharCode, stringFromCharCode), DontEnum); 62 #endif 63 // no. of arguments for constructor 64 putDirectWithoutTransition(exec->globalData(), exec->propertyNames().length, jsNumber(1), ReadOnly | DontEnum | DontDelete); 65 } 66 67 // ECMA 15.5.2 86 68 static EncodedJSValue JSC_HOST_CALL constructWithStringConstructor(ExecState* exec) 87 69 { … … 98 80 } 99 81 82 // ECMA 15.5.1 100 83 static EncodedJSValue JSC_HOST_CALL callStringConstructor(ExecState* exec) 101 84 { -
trunk/Source/JavaScriptCore/runtime/StringConstructor.h
r86653 r86657 30 30 class StringConstructor : public InternalFunction { 31 31 public: 32 StringConstructor(ExecState*, JSGlobalObject*, Structure*, Str ingPrototype*);32 StringConstructor(ExecState*, JSGlobalObject*, Structure*, Structure* functionStructure, 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:45 34 virtual ConstructType getConstructData(ConstructData&); 46 35 virtual CallType getCallData(CallData&); 47 48 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);49 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);50 36 }; 51 37
Note: See TracChangeset
for help on using the changeset viewer.