Changeset 86657 in webkit


Ignore:
Timestamp:
May 16, 2011 11:12:46 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-05-16 Sheriff Bot <webkit.review.bot@gmail.com>

Unreviewed, rolling out r86653.
http://trac.webkit.org/changeset/86653
https://bugs.webkit.org/show_bug.cgi?id=60944

"Caused regressions on Windows, OSX and EFL" (Requested by
yutak on #webkit).

  • DerivedSources.make:
  • DerivedSources.pro:
  • GNUmakefile.am:
  • GNUmakefile.list.am:
  • JavaScriptCore.exp:
  • JavaScriptCore.gypi:
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  • create_hash_table:
  • heap/Heap.cpp: (JSC::TypeCounter::operator()):
  • interpreter/CallFrame.h: (JSC::ExecState::arrayTable): (JSC::ExecState::numberTable):
  • runtime/ArrayConstructor.cpp: (JSC::ArrayConstructor::ArrayConstructor):
  • runtime/ArrayConstructor.h:
  • runtime/ArrayPrototype.cpp: (JSC::ArrayPrototype::getOwnPropertySlot): (JSC::ArrayPrototype::getOwnPropertyDescriptor):
  • runtime/ArrayPrototype.h:
  • runtime/BooleanPrototype.cpp: (JSC::BooleanPrototype::BooleanPrototype):
  • runtime/BooleanPrototype.h:
  • runtime/DateConstructor.cpp: (JSC::DateConstructor::DateConstructor):
  • runtime/DateConstructor.h:
  • runtime/ErrorPrototype.cpp: (JSC::ErrorPrototype::ErrorPrototype):
  • runtime/ErrorPrototype.h:
  • runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::~JSGlobalData):
  • runtime/JSGlobalData.h:
  • runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::reset):
  • runtime/JSGlobalObject.h: (JSC::JSGlobalObject::addStaticGlobals): (JSC::JSGlobalObject::getOwnPropertySlot): (JSC::JSGlobalObject::getOwnPropertyDescriptor):
  • runtime/JSGlobalObjectFunctions.cpp: (JSC::globalFuncJSCPrint):
  • runtime/JSGlobalObjectFunctions.h:
  • runtime/MathObject.cpp:
  • runtime/NumberConstructor.cpp: (JSC::NumberConstructor::getOwnPropertySlot): (JSC::NumberConstructor::getOwnPropertyDescriptor):
  • runtime/NumberPrototype.cpp: (JSC::NumberPrototype::NumberPrototype):
  • runtime/NumberPrototype.h:
  • runtime/ObjectPrototype.cpp: (JSC::ObjectPrototype::ObjectPrototype): (JSC::ObjectPrototype::put): (JSC::ObjectPrototype::getOwnPropertySlot):
  • runtime/ObjectPrototype.h:
  • runtime/RegExpPrototype.cpp: (JSC::RegExpPrototype::RegExpPrototype):
  • runtime/RegExpPrototype.h:
  • runtime/StringConstructor.cpp: (JSC::StringConstructor::StringConstructor):
  • runtime/StringConstructor.h:
Location:
trunk/Source/JavaScriptCore
Files:
37 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r86653 r86657  
     12011-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
    1712011-05-16  Geoffrey Garen  <ggaren@apple.com>
    272
  • trunk/Source/JavaScriptCore/DerivedSources.make

    r86653 r86657  
    3636.PHONY : all
    3737all : \
    38     ArrayConstructor.lut.h \
    3938    ArrayPrototype.lut.h \
    40     BooleanPrototype.lut.h \
    41     DateConstructor.lut.h \
    4239    DatePrototype.lut.h \
    43     ErrorPrototype.lut.h \
    4440    HeaderDetection.h \
    4541    JSONObject.lut.h \
    4642    JavaScriptCore.JSVALUE32_64.exp \
    4743    JavaScriptCore.JSVALUE64.exp \
    48     JSGlobalObject.lut.h \
    4944    Lexer.lut.h \
    5045    MathObject.lut.h \
    5146    NumberConstructor.lut.h \
    52     NumberPrototype.lut.h \
    5347    ObjectConstructor.lut.h \
    54     ObjectPrototype.lut.h \
    5548    RegExpConstructor.lut.h \
    56     RegExpPrototype.lut.h \
    5749    RegExpJitTables.h \
    5850    RegExpObject.lut.h \
    59     StringConstructor.lut.h \
    6051    StringPrototype.lut.h \
    6152    docs/bytecode.html \
  • trunk/Source/JavaScriptCore/DerivedSources.pro

    r86653 r86657  
    1515
    1616LUT_FILES += \
    17     runtime/ArrayConstructor.cpp \
    1817    runtime/ArrayPrototype.cpp \
    19     runtime/BooleanPrototype.cpp \
    20     runtime/DateConstructor.cpp \
    2118    runtime/DatePrototype.cpp \
    22     runtime/ErrorPrototype.cpp \
    23     runtime/JSGlobalObject.cpp \
    2419    runtime/JSONObject.cpp \
    2520    runtime/MathObject.cpp \
    2621    runtime/NumberConstructor.cpp \
    27     runtime/NumberPrototype.cpp \
    2822    runtime/ObjectConstructor.cpp \
    29     runtime/ObjectPrototype.cpp \
    3023    runtime/RegExpConstructor.cpp \
    3124    runtime/RegExpObject.cpp \
    32     runtime/RegExpPrototype.cpp \
    33     runtime/StringConstructor.cpp \
    34     runtime/StringPrototype.cpp \
     25    runtime/StringPrototype.cpp
    3526
    3627KEYWORDLUT_FILES += \
  • trunk/Source/JavaScriptCore/GNUmakefile.am

    r86653 r86657  
    146146# FIXME: Should this list be generated from javascriptcore_built_nosources?
    147147CLEANFILES += \
    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 \
    168156        Programs/jsc \
    169157        Programs/jsc-@WEBKITGTK_API_MAJOR_VERSION@ \
  • trunk/Source/JavaScriptCore/GNUmakefile.list.am

    r86653 r86657  
    1414        Source/JavaScriptCore/Lexer.lut.h \
    1515        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
    3425
    3526javascriptcore_sources += \
  • trunk/Source/JavaScriptCore/JavaScriptCore.exp

    r86653 r86657  
    160160__ZN3JSC14JSGlobalObject12defineSetterEPNS_9ExecStateERKNS_10IdentifierEPNS_8JSObjectEj
    161161__ZN3JSC14JSGlobalObject13visitChildrenERNS_9MarkStackE
    162 __ZN3JSC14JSGlobalObject16addStaticGlobalsEPNS0_18GlobalPropertyInfoEi
    163162__ZN3JSC14JSGlobalObject17putWithAttributesEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueEj
    164 __ZN3JSC14JSGlobalObject18getOwnPropertySlotEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE
    165 __ZN3JSC14JSGlobalObject24getOwnPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
    166163__ZN3JSC14JSGlobalObject3putEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE 
    167164__ZN3JSC14JSGlobalObject4initEPNS_8JSObjectE
    168 __ZN3JSC14JSGlobalObject6s_infoE
    169165__ZN3JSC14JSGlobalObjectD2Ev
    170166__ZN3JSC14JSGlobalObjectnwEmPNS_12JSGlobalDataE
     
    222218__ZN3JSC25evaluateInGlobalCallFrameERKNS_7UStringERNS_7JSValueEPNS_14JSGlobalObjectE
    223219__ZN3JSC35createInterruptedExecutionExceptionEPNS_12JSGlobalDataE
     220__ZN3JSC41constructFunctionSkippingEvalEnabledCheckEPNS_9ExecStateEPNS_14JSGlobalObjectERKNS_7ArgListERKNS_10IdentifierERKNS_7UStringEi
    224221__ZN3JSC3NaNE
    225 __ZN3JSC41constructFunctionSkippingEvalEnabledCheckEPNS_9ExecStateEPNS_14JSGlobalObjectERKNS_7ArgListERKNS_10IdentifierERKNS_7UStringEi
    226222__ZN3JSC4Heap16activityCallbackEv
    227223__ZN3JSC4Heap16allocateSlowCaseEm
     
    380376__ZN3WTF11OSAllocator18releaseDecommittedEPvm
    381377__ZN3WTF11commentAtomE
     378__ZN3WTF11emptyStringEv
    382379__ZN3WTF11currentTimeEv
    383380__ZN3WTF11dtoaRoundDPEPcdiRbRiRj
    384381__ZN3WTF11dtoaRoundSFEPcdiRbRiRj
    385 __ZN3WTF11emptyStringEv
    386382__ZN3WTF11fastReallocEPvm
    387383__ZN3WTF12AtomicString11addSlowCaseEPNS_10StringImplE
  • trunk/Source/JavaScriptCore/JavaScriptCore.gypi

    r86653 r86657  
    693693        ],
    694694        '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',
    695699            '<(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',
    706700            '<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/MathObject.lut.h',
    707701            '<(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',
    709707            '<(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',
    716708        ],
    717709        'minidom_files': [
  • trunk/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def

    r86653 r86657  
    5757    ?addPropertyWithoutTransition@Structure@JSC@@QAEIAAVJSGlobalData@2@ABVIdentifier@2@IPAVJSCell@2@@Z
    5858    ?addSlowCase@Identifier@JSC@@CA?AV?$PassRefPtr@VStringImpl@WTF@@@WTF@@PAVExecState@2@PAVStringImpl@4@@Z
    59     ?addStaticGlobals@JSGlobalObject@JSC@@IAEXPAUGlobalPropertyInfo@12@H@Z
    6059    ?allocate@Heap@JSC@@QAEPAXI@Z
    6160    ?allocateFromSizeClass@MarkedSpace@JSC@@AAEPAXAAUSizeClass@12@@Z
     
    184183    ?getJSNumber@JSCell@JSC@@UAE?AVJSValue@2@XZ
    185184    ?getObject@JSCell@JSC@@QAEPAVJSObject@2@XZ
    186     ?getOwnPropertyDescriptor@JSGlobalObject@JSC@@UAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z
    187185    ?getOwnPropertyDescriptor@JSObject@JSC@@UAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z
    188186    ?getOwnPropertyDescriptor@JSString@JSC@@EAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z
     
    194192    ?getOwnPropertySlot@JSCell@JSC@@EAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertySlot@2@@Z
    195193    ?getOwnPropertySlot@JSCell@JSC@@EAE_NPAVExecState@2@IAAVPropertySlot@2@@Z
    196     ?getOwnPropertySlot@JSGlobalObject@JSC@@UAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertySlot@2@@Z
    197194    ?getOwnPropertySlot@JSObject@JSC@@UAE_NPAVExecState@2@IAAVPropertySlot@2@@Z
    198195    ?getOwnPropertySlot@JSString@JSC@@EAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertySlot@2@@Z
     
    244241    ?lookupGetter@JSObject@JSC@@UAE?AVJSValue@2@PAVExecState@2@ABVIdentifier@2@@Z
    245242    ?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
    246247    ?materializePropertyMap@Structure@JSC@@AAEXAAVJSGlobalData@2@@Z
    247248    ?monthFromDayInYear@WTF@@YAHH_N@Z
     
    297298    ?retrieveCaller@Interpreter@JSC@@QBE?AVJSValue@2@PAVExecState@2@PAVJSFunction@2@@Z
    298299    ?retrieveLastCaller@Interpreter@JSC@@QBEXPAVExecState@2@AAH1AAVUString@2@AAVJSValue@2@@Z
    299     ?s_info@JSGlobalObject@JSC@@2UClassInfo@2@B
    300300    ?setAccessorDescriptor@PropertyDescriptor@JSC@@QAEXVJSValue@2@0I@Z
    301301    ?setConfigurable@PropertyDescriptor@JSC@@QAEX_N@Z
     
    370370    ?unwrappedObject@JSObject@JSC@@UAEPAV12@XZ
    371371    ?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
    376372    ?vtableAnchor@InternalFunction@JSC@@EAEXXZ
    377373    ?wait@ThreadCondition@WTF@@QAEXAAVMutex@2@@Z
  • trunk/Source/JavaScriptCore/create_hash_table

    r86653 r86657  
    285285            $thunkGenerator = "powThunkGenerator";
    286286        }
    287         if ($key eq "fromCharCode") {
    288             $thunkGenerator = "fromCharCodeThunkGenerator";
    289         }
    290287        print "   { \"$key\", $attrs[$i], (intptr_t)" . $castStr . "($firstValue), (intptr_t)$secondValue THUNK_GENERATOR($thunkGenerator) },\n";
    291288        $i++;
  • trunk/Source/JavaScriptCore/heap/Heap.cpp

    r86653 r86657  
    11/*
    2  *  Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011 Apple Inc. All rights reserved.
     2 *  Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
    33 *  Copyright (C) 2007 Eric Seidel <eric@webkit.org>
    44 *
     
    314314    const char* typeName(JSCell*);
    315315    OwnPtr<TypeCountSet> m_typeCountSet;
    316     HashSet<JSCell*> m_cells;
    317316};
    318317
     
    341340inline void TypeCounter::operator()(JSCell* cell)
    342341{
    343     if (!m_cells.add(cell).second)
    344         return;
    345342    m_typeCountSet->add(typeName(cell));
    346343}
  • trunk/Source/JavaScriptCore/interpreter/CallFrame.h

    r86653 r86657  
    22 *  Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
    33 *  Copyright (C) 2001 Peter Kelly (pmk@post.com)
    4  *  Copyright (C) 2003, 2007, 2008, 2011 Apple Inc. All rights reserved.
     4 *  Copyright (C) 2003, 2007, 2008 Apple Inc. All rights reserved.
    55 *
    66 *  This library is free software; you can redistribute it and/or
     
    7676        void dumpCaller();
    7777#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; }
    8179        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; }
    8580        static const HashTable* jsonTable(CallFrame* callFrame) { return callFrame->globalData().jsonTable; }
    8681        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; }
    8983        static const HashTable* objectConstructorTable(CallFrame* callFrame) { return callFrame->globalData().objectConstructorTable; }
    90         static const HashTable* objectPrototypeTable(CallFrame* callFrame) { return callFrame->globalData().objectPrototypeTable; }
    9184        static const HashTable* regExpTable(CallFrame* callFrame) { return callFrame->globalData().regExpTable; }
    9285        static const HashTable* regExpConstructorTable(CallFrame* callFrame) { return callFrame->globalData().regExpConstructorTable; }
    93         static const HashTable* regExpPrototypeTable(CallFrame* callFrame) { return callFrame->globalData().regExpPrototypeTable; }
    9486        static const HashTable* stringTable(CallFrame* callFrame) { return callFrame->globalData().stringTable; }
    95         static const HashTable* stringConstructorTable(CallFrame* callFrame) { return callFrame->globalData().stringConstructorTable; }
    9687
    9788        static CallFrame* create(Register* callFrameBase) { return static_cast<CallFrame*>(callFrameBase); }
  • trunk/Source/JavaScriptCore/runtime/ArrayConstructor.cpp

    r86653 r86657  
    11/*
    22 *  Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
    3  *  Copyright (C) 2003, 2007, 2008, 2011 Apple Inc. All rights reserved.
     3 *  Copyright (C) 2003, 2007, 2008 Apple Inc. All rights reserved.
    44 *  Copyright (C) 2003 Peter Kelly (pmk@post.com)
    55 *  Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
     
    3434namespace JSC {
    3535
     36ASSERT_CLASS_FITS_IN_CELL(ArrayConstructor);
     37   
    3638static EncodedJSValue JSC_HOST_CALL arrayConstructorIsArray(ExecState*);
    3739
    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)
     40ArrayConstructor::ArrayConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ArrayPrototype* arrayPrototype, Structure* functionStructure)
    5541    : InternalFunction(&exec->globalData(), globalObject, structure, Identifier(exec, arrayPrototype->classInfo()->className))
    5642{
     43    // ECMA 15.4.3.1 Array.prototype
    5744    putDirectWithoutTransition(exec->globalData(), exec->propertyNames().prototype, arrayPrototype, DontEnum | DontDelete | ReadOnly);
     45
     46    // no. of arguments for constructor
    5847    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);
    5951}
    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 ---------------------------
    7252
    7353static inline JSObject* constructArrayWithSizeQuirk(ExecState* exec, const ArgList& args)
     
    9373}
    9474
     75// ECMA 15.4.2
    9576ConstructType ArrayConstructor::getConstructData(ConstructData& constructData)
    9677{
     
    10586}
    10687
     88// ECMA 15.6.1
    10789CallType ArrayConstructor::getCallData(CallData& callData)
    10890{
  • trunk/Source/JavaScriptCore/runtime/ArrayConstructor.h

    r86653 r86657  
    11/*
    22 *  Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
    3  *  Copyright (C) 2007, 2008, 2011 Apple Inc. All rights reserved.
     3 *  Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
    44 *
    55 *  This library is free software; you can redistribute it and/or
     
    3030    class ArrayConstructor : public InternalFunction {
    3131    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*);
    4733
    4834        virtual ConstructType getConstructData(ConstructData&);
  • trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp

    r86653 r86657  
    8686// ------------------------------ ArrayPrototype ----------------------------
    8787
    88 const ClassInfo ArrayPrototype::s_info = {"Array", &JSArray::s_info, 0, ExecState::arrayPrototypeTable};
     88const ClassInfo ArrayPrototype::s_info = {"Array", &JSArray::s_info, 0, ExecState::arrayTable};
    8989
    9090/* Source for ArrayPrototype.lut.h
    91 @begin arrayPrototypeTable 16
     91@begin arrayTable 16
    9292  toString       arrayProtoFuncToString       DontEnum|Function 0
    9393  toLocaleString arrayProtoFuncToLocaleString DontEnum|Function 0
     
    124124bool ArrayPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
    125125{
    126     return getStaticFunctionSlot<JSArray>(exec, ExecState::arrayPrototypeTable(exec), this, propertyName, slot);
     126    return getStaticFunctionSlot<JSArray>(exec, ExecState::arrayTable(exec), this, propertyName, slot);
    127127}
    128128
    129129bool ArrayPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    130130{
    131     return getStaticFunctionDescriptor<JSArray>(exec, ExecState::arrayPrototypeTable(exec), this, propertyName, descriptor);
     131    return getStaticFunctionDescriptor<JSArray>(exec, ExecState::arrayTable(exec), this, propertyName, descriptor);
    132132}
    133133
  • trunk/Source/JavaScriptCore/runtime/ArrayPrototype.h

    r86653 r86657  
    11/*
    22 *  Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
    3  *  Copyright (C) 2007, 2011 Apple Inc. All rights reserved.
     3 *  Copyright (C) 2007 Apple Inc. All rights reserved.
    44 *
    55 *  This library is free software; you can redistribute it and/or
  • trunk/Source/JavaScriptCore/runtime/BooleanPrototype.cpp

    r86653 r86657  
    11/*
    22 *  Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
    3  *  Copyright (C) 2003, 2008, 2011 Apple Inc. All rights reserved.
     3 *  Copyright (C) 2003, 2008 Apple Inc. All rights reserved.
    44 *
    55 *  This library is free software; you can redistribute it and/or
     
    3030namespace JSC {
    3131
     32ASSERT_CLASS_FITS_IN_CELL(BooleanPrototype);
     33
     34// Functions
    3235static EncodedJSValue JSC_HOST_CALL booleanProtoFuncToString(ExecState*);
    3336static EncodedJSValue JSC_HOST_CALL booleanProtoFuncValueOf(ExecState*);
    3437
    35 }
     38// ECMA 15.6.4
    3639
    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)
     40BooleanPrototype::BooleanPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, Structure* functionStructure)
    5341    : BooleanObject(exec->globalData(), structure)
    5442{
    5543    setInternalValue(exec->globalData(), jsBoolean(false));
    5644
    57     ASSERT(inherits(&s_info));
    58     putAnonymousValue(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);
    5947}
    6048
    61 bool BooleanPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
    62 {
    63     return getStaticFunctionSlot<BooleanObject>(exec, ExecState::booleanPrototypeTable(exec), this, propertyName, slot);
    64 }
    6549
    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 --------------------------
    7051
    71 // ------------------------------ Functions ---------------------------
     52// ECMA 15.6.4.2 + 15.6.4.3
    7253
    7354EncodedJSValue JSC_HOST_CALL booleanProtoFuncToString(ExecState* exec)
  • trunk/Source/JavaScriptCore/runtime/BooleanPrototype.h

    r86653 r86657  
    11/*
    22 *  Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
    3  *  Copyright (C) 2008, 2011 Apple Inc. All rights reserved.
     3 *  Copyright (C) 2008 Apple Inc. All rights reserved.
    44 *
    55 *  This library is free software; you can redistribute it and/or
     
    2828    class BooleanPrototype : public BooleanObject {
    2929    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);
    4631    };
    4732
  • trunk/Source/JavaScriptCore/runtime/DateConstructor.cpp

    r86653 r86657  
    11/*
    22 *  Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
    3  *  Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserved.
     3 *  Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
    44 *
    55 *  This library is free software; you can redistribute it and/or
     
    5252namespace JSC {
    5353
     54ASSERT_CLASS_FITS_IN_CELL(DateConstructor);
     55
    5456static EncodedJSValue JSC_HOST_CALL dateParse(ExecState*);
    5557static EncodedJSValue JSC_HOST_CALL dateNow(ExecState*);
    5658static EncodedJSValue JSC_HOST_CALL dateUTC(ExecState*);
    5759
    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)
     60DateConstructor::DateConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, Structure* functionStructure, DatePrototype* datePrototype)
    7761    : InternalFunction(&exec->globalData(), globalObject, structure, Identifier(exec, datePrototype->classInfo()->className))
    7862{
    7963    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
    8069    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);
    9170}
    9271
  • trunk/Source/JavaScriptCore/runtime/DateConstructor.h

    r86653 r86657  
    11/*
    22 *  Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
    3  *  Copyright (C) 2008, 2011 Apple Inc. All rights reserved.
     3 *  Copyright (C) 2008 Apple Inc. All rights reserved.
    44 *
    55 *  This library is free software; you can redistribute it and/or
     
    3030    class DateConstructor : public InternalFunction {
    3131    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*);
    4333
    4434    private:
    4535        virtual ConstructType getConstructData(ConstructData&);
    4636        virtual CallType getCallData(CallData&);
    47 
    48         virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
    49         virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
    5037    };
    5138
  • trunk/Source/JavaScriptCore/runtime/ErrorPrototype.cpp

    r86653 r86657  
    3535static EncodedJSValue JSC_HOST_CALL errorProtoFuncToString(ExecState*);
    3636
    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
     38ErrorPrototype::ErrorPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, Structure* functionStructure)
    5439    : ErrorInstance(&exec->globalData(), structure)
    5540{
     41    // The constructor will be added later in ErrorConstructor's constructor
     42
    5643    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);
    6045}
    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 ---------------------------
    7346
    7447EncodedJSValue JSC_HOST_CALL errorProtoFuncToString(ExecState* exec)
  • trunk/Source/JavaScriptCore/runtime/ErrorPrototype.h

    r86653 r86657  
    3030    class ErrorPrototype : public ErrorInstance {
    3131    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);
    4833    };
    4934
  • trunk/Source/JavaScriptCore/runtime/JSGlobalData.cpp

    r86653 r86657  
    11/*
    2  * Copyright (C) 2008, 2011 Apple Inc. All rights reserved.
     2 * Copyright (C) 2008 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    9393namespace JSC {
    9494
    95 extern JSC_CONST_HASHTABLE HashTable arrayConstructorTable;
    96 extern JSC_CONST_HASHTABLE HashTable arrayPrototypeTable;
    97 extern JSC_CONST_HASHTABLE HashTable booleanPrototypeTable;
     95extern JSC_CONST_HASHTABLE HashTable arrayTable;
    9896extern JSC_CONST_HASHTABLE HashTable jsonTable;
    9997extern 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;
    10398extern JSC_CONST_HASHTABLE HashTable mathTable;
    104 extern JSC_CONST_HASHTABLE HashTable numberConstructorTable;
    105 extern JSC_CONST_HASHTABLE HashTable numberPrototypeTable;
     99extern JSC_CONST_HASHTABLE HashTable numberTable;
    106100extern JSC_CONST_HASHTABLE HashTable objectConstructorTable;
    107 extern JSC_CONST_HASHTABLE HashTable objectPrototypeTable;
    108101extern JSC_CONST_HASHTABLE HashTable regExpTable;
    109102extern JSC_CONST_HASHTABLE HashTable regExpConstructorTable;
    110 extern JSC_CONST_HASHTABLE HashTable regExpPrototypeTable;
    111103extern JSC_CONST_HASHTABLE HashTable stringTable;
    112 extern JSC_CONST_HASHTABLE HashTable stringConstructorTable;
    113104
    114105void* JSGlobalData::jsArrayVPtr;
     
    156147    : globalDataType(globalDataType)
    157148    , 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))
    161150    , dateTable(fastNew<HashTable>(JSC::dateTable))
    162     , dateConstructorTable(fastNew<HashTable>(JSC::dateConstructorTable))
    163     , errorPrototypeTable(fastNew<HashTable>(JSC::errorPrototypeTable))
    164     , globalObjectTable(fastNew<HashTable>(JSC::globalObjectTable))
    165151    , jsonTable(fastNew<HashTable>(JSC::jsonTable))
    166152    , mathTable(fastNew<HashTable>(JSC::mathTable))
    167     , numberConstructorTable(fastNew<HashTable>(JSC::numberConstructorTable))
    168     , numberPrototypeTable(fastNew<HashTable>(JSC::numberPrototypeTable))
     153    , numberTable(fastNew<HashTable>(JSC::numberTable))
    169154    , objectConstructorTable(fastNew<HashTable>(JSC::objectConstructorTable))
    170     , objectPrototypeTable(fastNew<HashTable>(JSC::objectPrototypeTable))
    171155    , regExpTable(fastNew<HashTable>(JSC::regExpTable))
    172156    , regExpConstructorTable(fastNew<HashTable>(JSC::regExpConstructorTable))
    173     , regExpPrototypeTable(fastNew<HashTable>(JSC::regExpPrototypeTable))
    174157    , stringTable(fastNew<HashTable>(JSC::stringTable))
    175     , stringConstructorTable(fastNew<HashTable>(JSC::stringConstructorTable))
    176158    , identifierTable(globalDataType == Default ? wtfThreadData().currentIdentifierTable() : createIdentifierTable())
    177159    , propertyNames(new CommonIdentifiers(this))
     
    294276#endif
    295277
    296     arrayPrototypeTable->deleteTable();
    297     arrayConstructorTable->deleteTable();
    298     booleanPrototypeTable->deleteTable();
     278    arrayTable->deleteTable();
    299279    dateTable->deleteTable();
    300     dateConstructorTable->deleteTable();
    301     errorPrototypeTable->deleteTable();
    302     globalObjectTable->deleteTable();
    303280    jsonTable->deleteTable();
    304281    mathTable->deleteTable();
    305     numberConstructorTable->deleteTable();
    306     numberPrototypeTable->deleteTable();
     282    numberTable->deleteTable();
    307283    objectConstructorTable->deleteTable();
    308     objectPrototypeTable->deleteTable();
    309284    regExpTable->deleteTable();
    310285    regExpConstructorTable->deleteTable();
    311     regExpPrototypeTable->deleteTable();
    312286    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));
    318289    fastDelete(const_cast<HashTable*>(dateTable));
    319     fastDelete(const_cast<HashTable*>(dateConstructorTable));
    320     fastDelete(const_cast<HashTable*>(errorPrototypeTable));
    321     fastDelete(const_cast<HashTable*>(globalObjectTable));
    322290    fastDelete(const_cast<HashTable*>(jsonTable));
    323291    fastDelete(const_cast<HashTable*>(mathTable));
    324     fastDelete(const_cast<HashTable*>(numberConstructorTable));
    325     fastDelete(const_cast<HashTable*>(numberPrototypeTable));
     292    fastDelete(const_cast<HashTable*>(numberTable));
    326293    fastDelete(const_cast<HashTable*>(objectConstructorTable));
    327     fastDelete(const_cast<HashTable*>(objectPrototypeTable));
    328294    fastDelete(const_cast<HashTable*>(regExpTable));
    329295    fastDelete(const_cast<HashTable*>(regExpConstructorTable));
    330     fastDelete(const_cast<HashTable*>(regExpPrototypeTable));
    331296    fastDelete(const_cast<HashTable*>(stringTable));
    332     fastDelete(const_cast<HashTable*>(stringConstructorTable));
    333297
    334298    delete parser;
  • trunk/Source/JavaScriptCore/runtime/JSGlobalData.h

    r86653 r86657  
    137137        ClientData* clientData;
    138138
    139         const HashTable* arrayConstructorTable;
    140         const HashTable* arrayPrototypeTable;
    141         const HashTable* booleanPrototypeTable;
     139        const HashTable* arrayTable;
    142140        const HashTable* dateTable;
    143         const HashTable* dateConstructorTable;
    144         const HashTable* errorPrototypeTable;
    145         const HashTable* globalObjectTable;
    146141        const HashTable* jsonTable;
    147142        const HashTable* mathTable;
    148         const HashTable* numberConstructorTable;
    149         const HashTable* numberPrototypeTable;
     143        const HashTable* numberTable;
    150144        const HashTable* objectConstructorTable;
    151         const HashTable* objectPrototypeTable;
    152145        const HashTable* regExpTable;
    153146        const HashTable* regExpConstructorTable;
    154         const HashTable* regExpPrototypeTable;
    155147        const HashTable* stringTable;
    156         const HashTable* stringConstructorTable;
    157148       
    158149        Strong<Structure> structureStructure;
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp

    r86653 r86657  
    5252#include "JSONObject.h"
    5353#include "Interpreter.h"
    54 #include "Lookup.h"
    5554#include "MathObject.h"
    5655#include "NativeErrorConstructor.h"
     
    7069#include "Debugger.h"
    7170
    72 #include "JSGlobalObject.lut.h"
    73 
    7471namespace JSC {
    75 
    76 const ClassInfo JSGlobalObject::s_info = { "GlobalObject", &NumberObject::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 */
    9272
    9373ASSERT_CLASS_FITS_IN_CELL(JSGlobalObject);
     
    187167{
    188168    ExecState* exec = JSGlobalObject::globalExec();
     169
     170    // Prototypes
    189171
    190172    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.
     
    196178    m_callFunction.set(exec->globalData(), this, callFunction);
    197179    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()));
    199181    m_functionPrototype->structure()->setPrototypeWithoutTransition(exec->globalData(), m_objectPrototype.get());
    200182
     
    214196    m_stringObjectStructure.set(exec->globalData(), this, StringObject::createStructure(exec->globalData(), m_stringPrototype.get()));
    215197
    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()));
    217199    m_booleanObjectStructure.set(exec->globalData(), this, BooleanObject::createStructure(exec->globalData(), m_booleanPrototype.get()));
    218200
    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()));
    220202    m_numberObjectStructure.set(exec->globalData(), this, NumberObject::createStructure(exec->globalData(), m_numberPrototype.get()));
    221203
     
    223205    m_dateStructure.set(exec->globalData(), this, DateInstance::createStructure(exec->globalData(), m_datePrototype.get()));
    224206
    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()));
    226208    m_regExpStructure.set(exec->globalData(), this, RegExpObject::createStructure(exec->globalData(), m_regExpPrototype.get()));
    227209
    228210    m_methodCallDummy.set(exec->globalData(), this, constructEmptyObject(exec));
    229211
    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());
    231213    m_errorStructure.set(exec->globalData(), this, ErrorInstance::createStructure(exec->globalData(), errorPrototype));
    232214
     
    235217    JSCell* objectConstructor = new (exec) ObjectConstructor(exec, this, ObjectConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), m_objectPrototype.get());
    236218    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());
    239221    JSCell* booleanConstructor = new (exec) BooleanConstructor(exec, this, BooleanConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), m_booleanPrototype.get());
    240222    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());
    242224
    243225    m_regExpConstructor.set(exec->globalData(), this, new (exec) RegExpConstructor(exec, this, RegExpConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), m_regExpPrototype.get()));
     
    263245    m_regExpPrototype->putDirectFunctionWithoutTransition(exec->globalData(), exec->propertyNames().constructor, m_regExpConstructor.get(), DontEnum);
    264246    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.
    265251
    266252    putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, "Object"), objectConstructor, DontEnum);
     
    280266    putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, "URIError"), m_URIErrorConstructor.get(), DontEnum);
    281267
    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.
    285269    GlobalPropertyInfo staticGlobals[] = {
    286270        GlobalPropertyInfo(Identifier(exec, "Math"), new (exec) MathObject(exec, this, MathObject::createStructure(exec->globalData(), m_objectPrototype.get())), DontEnum | DontDelete),
     
    290274        GlobalPropertyInfo(Identifier(exec, "JSON"), new (exec) JSONObject(this, JSONObject::createStructure(exec->globalData(), m_objectPrototype.get())), DontEnum | DontDelete)
    291275    };
     276
    292277    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
    293296
    294297    resetPrototype(exec->globalData(), prototype);
     
    442445}
    443446
    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 
    480447void JSGlobalObject::WeakMapsFinalizer::finalize(Handle<Unknown> handle, void*)
    481448{
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h

    r86653 r86657  
    149149        }
    150150
    151         static const ClassInfo s_info;
    152 
    153151    protected:
    154152        JSGlobalObject(JSGlobalData& globalData, Structure* structure, JSObject* thisValue)
     
    320318    }
    321319
     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
    322356    inline bool JSGlobalObject::hasOwnPropertyForWrite(ExecState* exec, const Identifier& propertyName)
    323357    {
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp

    r86653 r86657  
    588588}
    589589
     590#ifndef NDEBUG
     591EncodedJSValue 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
    590599} // namespace JSC
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.h

    r86653 r86657  
    4848    EncodedJSValue JSC_HOST_CALL globalFuncEscape(ExecState*);
    4949    EncodedJSValue JSC_HOST_CALL globalFuncUnescape(ExecState*);
     50#ifndef NDEBUG
     51    EncodedJSValue JSC_HOST_CALL globalFuncJSCPrint(ExecState*);
     52#endif
    5053
    5154    static const double mantissaOverflowLowerBound = 9007199254740992.0;
  • trunk/Source/JavaScriptCore/runtime/MathObject.cpp

    r86653 r86657  
    5959
    6060namespace JSC {
     61
     62// ------------------------------ MathObject --------------------------------
    6163
    6264const ClassInfo MathObject::s_info = { "Math", &JSObjectWithGlobalObject::s_info, 0, ExecState::mathTable };
     
    100102}
    101103
     104// ECMA 15.8
     105
    102106bool MathObject::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
    103107{
  • trunk/Source/JavaScriptCore/runtime/NumberConstructor.cpp

    r86653 r86657  
    11/*
    22 *  Copyright (C) 1999-2000,2003 Harri Porten (porten@kde.org)
    3  *  Copyright (C) 2007, 2008, 2011 Apple Inc. All rights reserved.
     3 *  Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
    44 *
    55 *  This library is free software; you can redistribute it and/or
     
    4343namespace JSC {
    4444
    45 const ClassInfo NumberConstructor::s_info = { "Function", &InternalFunction::s_info, 0, ExecState::numberConstructorTable };
     45const ClassInfo NumberConstructor::s_info = { "Function", &InternalFunction::s_info, 0, ExecState::numberTable };
    4646
    4747/* Source for NumberConstructor.lut.h
    48 @begin numberConstructorTable
     48@begin numberTable
    4949   NaN                   numberConstructorNaNValue       DontEnum|DontDelete|ReadOnly
    5050   NEGATIVE_INFINITY     numberConstructorNegInfinity    DontEnum|DontDelete|ReadOnly
     
    6969bool NumberConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
    7070{
    71     return getStaticValueSlot<NumberConstructor, InternalFunction>(exec, ExecState::numberConstructorTable(exec), this, propertyName, slot);
     71    return getStaticValueSlot<NumberConstructor, InternalFunction>(exec, ExecState::numberTable(exec), this, propertyName, slot);
    7272}
    7373
    7474bool NumberConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
    7575{
    76     return getStaticValueDescriptor<NumberConstructor, InternalFunction>(exec, ExecState::numberConstructorTable(exec), this, propertyName, descriptor);
     76    return getStaticValueDescriptor<NumberConstructor, InternalFunction>(exec, ExecState::numberTable(exec), this, propertyName, descriptor);
    7777}
    7878
  • trunk/Source/JavaScriptCore/runtime/NumberPrototype.cpp

    r86653 r86657  
    11/*
    22 *  Copyright (C) 1999-2000,2003 Harri Porten (porten@kde.org)
    3  *  Copyright (C) 2007, 2008, 2011 Apple Inc. All rights reserved.
     3 *  Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
    44 *
    55 *  This library is free software; you can redistribute it and/or
     
    3535namespace JSC {
    3636
     37ASSERT_CLASS_FITS_IN_CELL(NumberPrototype);
     38
    3739static EncodedJSValue JSC_HOST_CALL numberProtoFuncToString(ExecState*);
    3840static EncodedJSValue JSC_HOST_CALL numberProtoFuncToLocaleString(ExecState*);
     
    4244static EncodedJSValue JSC_HOST_CALL numberProtoFuncToPrecision(ExecState*);
    4345
    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
     48NumberPrototype::NumberPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, Structure* functionStructure)
    6649    : NumberObject(exec->globalData(), structure)
    6750{
    6851    setInternalValue(exec->globalData(), jsNumber(0));
    6952
    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);
    8261}
    8362
    8463// ------------------------------ Functions ---------------------------
     64
     65// ECMA 15.7.4.2 - 15.7.4.7
    8566
    8667static ALWAYS_INLINE bool toThisNumber(JSValue thisValue, double &x)
  • trunk/Source/JavaScriptCore/runtime/NumberPrototype.h

    r86653 r86657  
    11/*
    22 *  Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
    3  *  Copyright (C) 2008, 2011 Apple Inc. All rights reserved.
     3 *  Copyright (C) 2008 Apple Inc. All rights reserved.
    44 *
    55 *  This library is free software; you can redistribute it and/or
     
    2828    class NumberPrototype : public NumberObject {
    2929    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);
    4631    };
    4732
  • trunk/Source/JavaScriptCore/runtime/ObjectPrototype.cpp

    r86653 r86657  
    11/*
    22 *  Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
    3  *  Copyright (C) 2008, 2011 Apple Inc. All rights reserved.
     3 *  Copyright (C) 2008 Apple Inc. All rights reserved.
    44 *
    55 *  This library is free software; you can redistribute it and/or
     
    2929namespace JSC {
    3030
     31ASSERT_CLASS_FITS_IN_CELL(ObjectPrototype);
     32
    3133static EncodedJSValue JSC_HOST_CALL objectProtoFuncValueOf(ExecState*);
    3234static EncodedJSValue JSC_HOST_CALL objectProtoFuncHasOwnProperty(ExecState*);
     
    3941static EncodedJSValue JSC_HOST_CALL objectProtoFuncToLocaleString(ExecState*);
    4042
    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)
     43ObjectPrototype::ObjectPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* stucture, Structure* functionStructure)
    6744    : JSNonFinalObject(exec->globalData(), stucture)
    6845    , m_hasNoPropertiesWithUInt32Names(true)
    6946{
    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);
    7259}
    7360
    7461void ObjectPrototype::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
    7562{
    76     JSNonFinalObject::put(exec, propertyName, value, slot);
     63    JSObject::put(exec, propertyName, value, slot);
    7764
    7865    if (m_hasNoPropertiesWithUInt32Names) {
     
    8774    if (m_hasNoPropertiesWithUInt32Names)
    8875        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);
    10077}
    10178
    10279// ------------------------------ Functions --------------------------------
     80
     81// ECMA 15.2.4.2, 15.2.4.4, 15.2.4.5, 15.2.4.7
    10382
    10483EncodedJSValue JSC_HOST_CALL objectProtoFuncValueOf(ExecState* exec)
  • trunk/Source/JavaScriptCore/runtime/ObjectPrototype.h

    r86653 r86657  
    11/*
    22 *  Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
    3  *  Copyright (C) 2008, 2011 Apple Inc. All rights reserved.
     3 *  Copyright (C) 2008 Apple Inc. All rights reserved.
    44 *
    55 *  This library is free software; you can redistribute it and/or
     
    2828    class ObjectPrototype : public JSNonFinalObject {
    2929    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);
    4231
    4332    private:
    4433        virtual void put(ExecState*, const Identifier&, JSValue, PutPropertySlot&);
    45         virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
    4634        virtual bool getOwnPropertySlot(ExecState*, unsigned propertyName, PropertySlot&);
    47         virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
    4835
    4936        bool m_hasNoPropertiesWithUInt32Names;
  • trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp

    r86653 r86657  
    3939namespace JSC {
    4040
     41ASSERT_CLASS_FITS_IN_CELL(RegExpPrototype);
     42
    4143static EncodedJSValue JSC_HOST_CALL regExpProtoFuncTest(ExecState*);
    4244static EncodedJSValue JSC_HOST_CALL regExpProtoFuncExec(ExecState*);
     
    4446static EncodedJSValue JSC_HOST_CALL regExpProtoFuncToString(ExecState*);
    4547
    46 }
     48// ECMA 15.10.5
    4749
    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)
     50RegExpPrototype::RegExpPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, Structure* functionStructure)
    6651    : RegExpObject(globalObject, structure, RegExp::create(&exec->globalData(), "", NoFlags))
    6752{
    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);
    7857}
    7958
  • trunk/Source/JavaScriptCore/runtime/RegExpPrototype.h

    r86653 r86657  
    2929    class RegExpPrototype : public RegExpObject {
    3030    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);
    4532    };
    4633
  • trunk/Source/JavaScriptCore/runtime/StringConstructor.cpp

    r86653 r86657  
    3030namespace JSC {
    3131
    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 
    6932static NEVER_INLINE JSValue stringFromCharCodeSlowCase(ExecState* exec)
    7033{
     
    8447}
    8548
     49ASSERT_CLASS_FITS_IN_CELL(StringConstructor);
     50
     51StringConstructor::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
    8668static EncodedJSValue JSC_HOST_CALL constructWithStringConstructor(ExecState* exec)
    8769{
     
    9880}
    9981
     82// ECMA 15.5.1
    10083static EncodedJSValue JSC_HOST_CALL callStringConstructor(ExecState* exec)
    10184{
  • trunk/Source/JavaScriptCore/runtime/StringConstructor.h

    r86653 r86657  
    3030    class StringConstructor : public InternalFunction {
    3131    public:
    32         StringConstructor(ExecState*, JSGlobalObject*, Structure*, StringPrototype*);
     32        StringConstructor(ExecState*, JSGlobalObject*, Structure*, Structure* functionStructure, StringPrototype*);
    3333
    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:
    4534        virtual ConstructType getConstructData(ConstructData&);
    4635        virtual CallType getCallData(CallData&);
    47 
    48         virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
    49         virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
    5036    };
    5137
Note: See TracChangeset for help on using the changeset viewer.