Ignore:
Timestamp:
Jun 23, 2008, 10:23:17 PM (17 years ago)
Author:
Darin Adler
Message:

JavaScriptCore:

2008-06-23 Darin Adler <Darin Adler>

Reviewed by Geoff.

More preparation toward making functions work on primitive types without
creating wrapper objects. No speedup this time, but prepares for a future
speedup without slowing things down.

SunSpider reports no change.

  • Eliminated the implementsCall, callAsFunction and construct virtual functions from JSObject. Instead, the CallData and ConstructData for a native function includes a function pointer that the caller can use directly. Changed all call sites to use CallData and ConstructData.
  • Changed the "this" argument to native functions to be a JSValue rather than a JSObject. This prepares us for passing primitives into these functions. The conversion to an object now must be done inside the function. Critically, if it's a function that can be called on a DOM window object, then we have to be sure to call toThisObject on the argument before we use it for anything even if it's already an object.
  • Eliminated the practice of using constructor objects in the global object to make objects of the various basic types. Since these constructors can't be replaced by script, there's no reason to involve a constructor object at all. Added functions to do the construction directly.
  • Made some more class members private and protected, including virtual function overrides. This can catch code using unnecessarily slow virtual function code paths when the type of an object is known statically. If we later find a new reason use the members outside the class it's easy to make them public again.
  • Moved the declarations of the native implementations for functions out of header files. These can have internal linkage and be declared inside the source file.
  • Changed PrototypeFunction to take function pointers with the right arguments to be put directly into CallData. This eliminates the need to have a separate PrototypeReflexiveFunction, and reveals that the real purpose of that class included something else specific to eval -- storage of a cached global object. So renamed PrototypeReflexiveFunction to GlobalEvalFunction.
  • API/JSCallbackConstructor.cpp: (KJS::constructJSCallback): (KJS::JSCallbackConstructor::getConstructData):
  • API/JSCallbackConstructor.h:
  • API/JSCallbackFunction.cpp: (KJS::JSCallbackFunction::implementsHasInstance): (KJS::JSCallbackFunction::call): (KJS::JSCallbackFunction::getCallData):
  • API/JSCallbackFunction.h: (KJS::JSCallbackFunction::classInfo):
  • API/JSCallbackObject.h: (KJS::JSCallbackObject::classRef): (KJS::JSCallbackObject::classInfo):
  • API/JSCallbackObjectFunctions.h: (KJS::::getConstructData): (KJS::::construct): (KJS::::getCallData): (KJS::::call):
  • API/JSObjectRef.cpp: (JSObjectMakeFunction): (JSObjectIsFunction): (JSObjectCallAsFunction): (JSObjectCallAsConstructor):
  • JavaScriptCore.exp:
  • VM/Machine.cpp: (KJS::jsTypeStringForValue): (KJS::Machine::privateExecute):
  • kjs/ArrayPrototype.cpp: (KJS::arrayProtoFuncToString): (KJS::arrayProtoFuncToLocaleString): (KJS::arrayProtoFuncJoin): (KJS::arrayProtoFuncConcat): (KJS::arrayProtoFuncPop): (KJS::arrayProtoFuncPush): (KJS::arrayProtoFuncReverse): (KJS::arrayProtoFuncShift): (KJS::arrayProtoFuncSlice): (KJS::arrayProtoFuncSort): (KJS::arrayProtoFuncSplice): (KJS::arrayProtoFuncUnShift): (KJS::arrayProtoFuncFilter): (KJS::arrayProtoFuncMap): (KJS::arrayProtoFuncEvery): (KJS::arrayProtoFuncForEach): (KJS::arrayProtoFuncSome): (KJS::arrayProtoFuncIndexOf): (KJS::arrayProtoFuncLastIndexOf): (KJS::ArrayConstructor::ArrayConstructor): (KJS::constructArrayWithSizeQuirk): (KJS::constructWithArrayConstructor): (KJS::ArrayConstructor::getConstructData): (KJS::callArrayConstructor): (KJS::ArrayConstructor::getCallData):
  • kjs/ArrayPrototype.h:
  • kjs/BooleanObject.cpp: (KJS::booleanProtoFuncToString): (KJS::booleanProtoFuncValueOf): (KJS::constructBoolean): (KJS::constructWithBooleanConstructor): (KJS::BooleanConstructor::getConstructData): (KJS::callBooleanConstructor): (KJS::BooleanConstructor::getCallData): (KJS::constructBooleanFromImmediateBoolean):
  • kjs/BooleanObject.h:
  • kjs/CallData.h: (KJS::):
  • kjs/ConstructData.h: (KJS::):
  • kjs/FunctionPrototype.cpp: (KJS::callFunctionPrototype): (KJS::FunctionPrototype::getCallData): (KJS::functionProtoFuncToString): (KJS::functionProtoFuncApply): (KJS::functionProtoFuncCall): (KJS::constructWithFunctionConstructor): (KJS::FunctionConstructor::getConstructData): (KJS::callFunctionConstructor): (KJS::FunctionConstructor::getCallData): (KJS::constructFunction):
  • kjs/FunctionPrototype.h:
  • kjs/JSArray.cpp: (KJS::AVLTreeAbstractorForArrayCompare::compare_key_key): (KJS::JSArray::sort): (KJS::constructEmptyArray): (KJS::constructArray):
  • kjs/JSArray.h: (KJS::JSArray::classInfo):
  • kjs/JSFunction.cpp: (KJS::JSFunction::call): (KJS::globalFuncEval): (KJS::globalFuncParseInt): (KJS::globalFuncParseFloat): (KJS::globalFuncIsNaN): (KJS::globalFuncIsFinite): (KJS::globalFuncDecodeURI): (KJS::globalFuncDecodeURIComponent): (KJS::globalFuncEncodeURI): (KJS::globalFuncEncodeURIComponent): (KJS::globalFuncEscape): (KJS::globalFuncUnescape): (KJS::globalFuncKJSPrint): (KJS::PrototypeFunction::PrototypeFunction): (KJS::PrototypeFunction::getCallData): (KJS::GlobalEvalFunction::GlobalEvalFunction): (KJS::GlobalEvalFunction::mark):
  • kjs/JSFunction.h: (KJS::InternalFunction::classInfo): (KJS::InternalFunction::functionName): (KJS::JSFunction::classInfo): (KJS::GlobalEvalFunction::cachedGlobalObject):
  • kjs/JSGlobalObject.cpp: (KJS::JSGlobalObject::reset): (KJS::JSGlobalObject::mark):
  • kjs/JSGlobalObject.h: (KJS::JSGlobalObject::JSGlobalObject): (KJS::JSGlobalObject::evalFunction):
  • kjs/JSImmediate.cpp: (KJS::JSImmediate::toObject):
  • kjs/JSNotAnObject.cpp:
  • kjs/JSNotAnObject.h:
  • kjs/JSObject.cpp: (KJS::JSObject::put): (KJS::callDefaultValueFunction): (KJS::JSObject::defaultValue): (KJS::JSObject::lookupGetter): (KJS::JSObject::lookupSetter): (KJS::JSObject::hasInstance): (KJS::JSObject::fillGetterPropertySlot): (KJS::Error::create): (KJS::constructEmptyObject):
  • kjs/JSObject.h: (KJS::GetterSetter::GetterSetter): (KJS::GetterSetter::getter): (KJS::GetterSetter::setGetter): (KJS::GetterSetter::setter): (KJS::GetterSetter::setSetter):
  • kjs/JSValue.cpp: (KJS::JSCell::deleteProperty): (KJS::call): (KJS::construct):
  • kjs/JSValue.h:
  • kjs/MathObject.cpp: (KJS::mathProtoFuncAbs): (KJS::mathProtoFuncACos): (KJS::mathProtoFuncASin): (KJS::mathProtoFuncATan): (KJS::mathProtoFuncATan2): (KJS::mathProtoFuncCeil): (KJS::mathProtoFuncCos): (KJS::mathProtoFuncExp): (KJS::mathProtoFuncFloor): (KJS::mathProtoFuncLog): (KJS::mathProtoFuncMax): (KJS::mathProtoFuncMin): (KJS::mathProtoFuncPow): (KJS::mathProtoFuncRandom): (KJS::mathProtoFuncRound): (KJS::mathProtoFuncSin): (KJS::mathProtoFuncSqrt): (KJS::mathProtoFuncTan):
  • kjs/MathObject.h:
  • kjs/NumberObject.cpp: (KJS::numberProtoFuncToString): (KJS::numberProtoFuncToLocaleString): (KJS::numberProtoFuncValueOf): (KJS::numberProtoFuncToFixed): (KJS::numberProtoFuncToExponential): (KJS::numberProtoFuncToPrecision): (KJS::NumberConstructor::NumberConstructor): (KJS::constructWithNumberConstructor): (KJS::NumberConstructor::getConstructData): (KJS::callNumberConstructor): (KJS::NumberConstructor::getCallData): (KJS::constructNumber): (KJS::constructNumberFromImmediateNumber):
  • kjs/NumberObject.h: (KJS::NumberObject::classInfo): (KJS::NumberConstructor::classInfo):
  • kjs/PropertySlot.cpp: (KJS::PropertySlot::functionGetter):
  • kjs/RegExpObject.cpp: (KJS::regExpProtoFuncTest): (KJS::regExpProtoFuncExec): (KJS::regExpProtoFuncCompile): (KJS::regExpProtoFuncToString): (KJS::callRegExpObject): (KJS::RegExpObject::getCallData): (KJS::constructRegExp): (KJS::constructWithRegExpConstructor): (KJS::RegExpConstructor::getConstructData): (KJS::callRegExpConstructor): (KJS::RegExpConstructor::getCallData):
  • kjs/RegExpObject.h: (KJS::RegExpConstructor::classInfo):
  • kjs/Shell.cpp: (GlobalObject::GlobalObject): (functionPrint): (functionDebug): (functionGC): (functionVersion): (functionRun): (functionLoad): (functionReadline): (functionQuit):
  • kjs/date_object.cpp: (KJS::gmtoffset): (KJS::formatLocaleDate): (KJS::fillStructuresUsingDateArgs): (KJS::DateInstance::getTime): (KJS::DateInstance::getUTCTime): (KJS::DateConstructor::DateConstructor): (KJS::constructDate): (KJS::DateConstructor::getConstructData): (KJS::callDate): (KJS::DateConstructor::getCallData): (KJS::dateParse): (KJS::dateNow): (KJS::dateUTC): (KJS::dateProtoFuncToString): (KJS::dateProtoFuncToUTCString): (KJS::dateProtoFuncToDateString): (KJS::dateProtoFuncToTimeString): (KJS::dateProtoFuncToLocaleString): (KJS::dateProtoFuncToLocaleDateString): (KJS::dateProtoFuncToLocaleTimeString): (KJS::dateProtoFuncValueOf): (KJS::dateProtoFuncGetTime): (KJS::dateProtoFuncGetFullYear): (KJS::dateProtoFuncGetUTCFullYear): (KJS::dateProtoFuncToGMTString): (KJS::dateProtoFuncGetMonth): (KJS::dateProtoFuncGetUTCMonth): (KJS::dateProtoFuncGetDate): (KJS::dateProtoFuncGetUTCDate): (KJS::dateProtoFuncGetDay): (KJS::dateProtoFuncGetUTCDay): (KJS::dateProtoFuncGetHours): (KJS::dateProtoFuncGetUTCHours): (KJS::dateProtoFuncGetMinutes): (KJS::dateProtoFuncGetUTCMinutes): (KJS::dateProtoFuncGetSeconds): (KJS::dateProtoFuncGetUTCSeconds): (KJS::dateProtoFuncGetMilliSeconds): (KJS::dateProtoFuncGetUTCMilliseconds): (KJS::dateProtoFuncGetTimezoneOffset): (KJS::dateProtoFuncSetTime): (KJS::setNewValueFromTimeArgs): (KJS::setNewValueFromDateArgs): (KJS::dateProtoFuncSetMilliSeconds): (KJS::dateProtoFuncSetUTCMilliseconds): (KJS::dateProtoFuncSetSeconds): (KJS::dateProtoFuncSetUTCSeconds): (KJS::dateProtoFuncSetMinutes): (KJS::dateProtoFuncSetUTCMinutes): (KJS::dateProtoFuncSetHours): (KJS::dateProtoFuncSetUTCHours): (KJS::dateProtoFuncSetDate): (KJS::dateProtoFuncSetUTCDate): (KJS::dateProtoFuncSetMonth): (KJS::dateProtoFuncSetUTCMonth): (KJS::dateProtoFuncSetFullYear): (KJS::dateProtoFuncSetUTCFullYear): (KJS::dateProtoFuncSetYear): (KJS::dateProtoFuncGetYear):
  • kjs/date_object.h: (KJS::DateInstance::internalNumber): (KJS::DateInstance::classInfo):
  • kjs/error_object.cpp: (KJS::errorProtoFuncToString): (KJS::constructError): (KJS::constructWithErrorConstructor): (KJS::ErrorConstructor::getConstructData): (KJS::callErrorConstructor): (KJS::ErrorConstructor::getCallData): (KJS::NativeErrorConstructor::construct): (KJS::constructWithNativeErrorConstructor): (KJS::NativeErrorConstructor::getConstructData): (KJS::callNativeErrorConstructor): (KJS::NativeErrorConstructor::getCallData):
  • kjs/error_object.h: (KJS::NativeErrorConstructor::classInfo):
  • kjs/internal.cpp: (KJS::JSNumberCell::toObject): (KJS::JSNumberCell::toThisObject): (KJS::GetterSetter::mark): (KJS::GetterSetter::toPrimitive): (KJS::GetterSetter::toBoolean): (KJS::GetterSetter::toNumber): (KJS::GetterSetter::toString): (KJS::GetterSetter::toObject): (KJS::InternalFunction::InternalFunction): (KJS::InternalFunction::implementsHasInstance):
  • kjs/lookup.h: (KJS::HashEntry::):
  • kjs/nodes.cpp: (KJS::FuncDeclNode::makeFunction): (KJS::FuncExprNode::makeFunction):
  • kjs/object_object.cpp: (KJS::objectProtoFuncValueOf): (KJS::objectProtoFuncHasOwnProperty): (KJS::objectProtoFuncIsPrototypeOf): (KJS::objectProtoFuncDefineGetter): (KJS::objectProtoFuncDefineSetter): (KJS::objectProtoFuncLookupGetter): (KJS::objectProtoFuncLookupSetter): (KJS::objectProtoFuncPropertyIsEnumerable): (KJS::objectProtoFuncToLocaleString): (KJS::objectProtoFuncToString): (KJS::ObjectConstructor::ObjectConstructor): (KJS::constructObject): (KJS::constructWithObjectConstructor): (KJS::ObjectConstructor::getConstructData): (KJS::callObjectConstructor): (KJS::ObjectConstructor::getCallData):
  • kjs/object_object.h:
  • kjs/string_object.cpp: (KJS::replace): (KJS::stringProtoFuncToString): (KJS::stringProtoFuncValueOf): (KJS::stringProtoFuncCharAt): (KJS::stringProtoFuncCharCodeAt): (KJS::stringProtoFuncConcat): (KJS::stringProtoFuncIndexOf): (KJS::stringProtoFuncLastIndexOf): (KJS::stringProtoFuncMatch): (KJS::stringProtoFuncSearch): (KJS::stringProtoFuncReplace): (KJS::stringProtoFuncSlice): (KJS::stringProtoFuncSplit): (KJS::stringProtoFuncSubstr): (KJS::stringProtoFuncSubstring): (KJS::stringProtoFuncToLowerCase): (KJS::stringProtoFuncToUpperCase): (KJS::stringProtoFuncToLocaleLowerCase): (KJS::stringProtoFuncToLocaleUpperCase): (KJS::stringProtoFuncLocaleCompare): (KJS::stringProtoFuncBig): (KJS::stringProtoFuncSmall): (KJS::stringProtoFuncBlink): (KJS::stringProtoFuncBold): (KJS::stringProtoFuncFixed): (KJS::stringProtoFuncItalics): (KJS::stringProtoFuncStrike): (KJS::stringProtoFuncSub): (KJS::stringProtoFuncSup): (KJS::stringProtoFuncFontcolor): (KJS::stringProtoFuncFontsize): (KJS::stringProtoFuncAnchor): (KJS::stringProtoFuncLink): (KJS::stringFromCharCode): (KJS::StringConstructor::StringConstructor): (KJS::constructWithStringConstructor): (KJS::StringConstructor::getConstructData): (KJS::callStringConstructor): (KJS::StringConstructor::getCallData):
  • kjs/string_object.h:

JavaScriptGlue:

2008-06-23 Darin Adler <Darin Adler>

Reviewed by Geoff.

  • JSValueWrapper.cpp: (JSValueWrapper::JSObjectCallFunction): Updated to use getCallData and call instead of the old callAsFunction.

WebCore:

2008-06-23 Darin Adler <Darin Adler>

Reviewed by Geoff.

Update for JavaScript changes.

  • Use CallData and ConstructData instead of the obsolete implementsCall, callAsFunction, and construct functions.
  • Updated native function arguments, specifically to allow a JSValue rather than a JSObject for the this argument, and to call toThisObject as needed when treating it as an object.
  • Made some more class members private and protected, including virtual function overrides.
  • Eliminated the use of getCallData in the JavaScript bridging code as a way to check if an instance supports invokeDefaultMethod.
  • Eliminated unnecessary polymorphism in the NodeIterator and TreeWalker classes. They were using virtual functions simply to share an instance of the RefCounted template, which was not helpful.
  • bindings/js/JSAudioConstructor.cpp: (WebCore::constructAudio): (WebCore::JSAudioConstructor::getConstructData):
  • bindings/js/JSAudioConstructor.h: (WebCore::JSAudioConstructor::document): (WebCore::JSAudioConstructor::classInfo):
  • bindings/js/JSClipboardCustom.cpp: (WebCore::JSClipboard::types):
  • bindings/js/JSCustomSQLStatementCallback.cpp: (WebCore::JSCustomSQLStatementCallback::handleEvent):
  • bindings/js/JSCustomSQLStatementErrorCallback.cpp: (WebCore::JSCustomSQLStatementErrorCallback::handleEvent):
  • bindings/js/JSCustomSQLTransactionCallback.cpp: (WebCore::JSCustomSQLTransactionCallback::handleEvent):
  • bindings/js/JSCustomSQLTransactionErrorCallback.cpp: (WebCore::JSCustomSQLTransactionErrorCallback::handleEvent):
  • bindings/js/JSCustomVoidCallback.cpp: (WebCore::JSCustomVoidCallback::handleEvent):
  • bindings/js/JSCustomXPathNSResolver.cpp: (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
  • bindings/js/JSDOMBinding.h: (WebCore::DOMObject::DOMObject):
  • bindings/js/JSDOMWindowBase.cpp: (WebCore::windowProtoFuncAToB): (WebCore::windowProtoFuncBToA): (WebCore::windowProtoFuncOpen): (WebCore::windowProtoFuncSetTimeout): (WebCore::windowProtoFuncClearTimeout): (WebCore::windowProtoFuncSetInterval): (WebCore::windowProtoFuncAddEventListener): (WebCore::windowProtoFuncRemoveEventListener): (WebCore::windowProtoFuncShowModalDialog): (WebCore::windowProtoFuncNotImplemented): (WebCore::toJSDOMWindow):
  • bindings/js/JSDOMWindowBase.h:
  • bindings/js/JSDOMWindowShell.h: (WebCore::JSDOMWindowShell::classInfo):
  • bindings/js/JSEventListener.cpp: (WebCore::JSAbstractEventListener::handleEvent): (WebCore::JSLazyEventListener::parseCode):
  • bindings/js/JSEventTargetBase.cpp: (WebCore::retrieveEventTargetAndCorrespondingNode): (WebCore::jsEventTargetAddEventListener): (WebCore::jsEventTargetRemoveEventListener): (WebCore::jsEventTargetDispatchEvent):
  • bindings/js/JSEventTargetBase.h:
  • bindings/js/JSHTMLAppletElementCustom.cpp: (WebCore::JSHTMLAppletElement::customGetOwnPropertySlot): (WebCore::JSHTMLAppletElement::customPut): (WebCore::JSHTMLAppletElement::getCallData):
  • bindings/js/JSHTMLCollectionCustom.cpp: (WebCore::callHTMLCollection): (WebCore::JSHTMLCollection::getCallData):
  • bindings/js/JSHTMLDocumentCustom.cpp: (WebCore::JSHTMLDocument::open):
  • bindings/js/JSHTMLEmbedElementCustom.cpp: (WebCore::JSHTMLEmbedElement::customGetOwnPropertySlot): (WebCore::JSHTMLEmbedElement::customPut): (WebCore::JSHTMLEmbedElement::getCallData):
  • bindings/js/JSHTMLInputElementBase.cpp: (WebCore::jsHTMLInputElementBaseFunctionSetSelectionRange):
  • bindings/js/JSHTMLInputElementBase.h:
  • bindings/js/JSHTMLObjectElementCustom.cpp: (WebCore::JSHTMLObjectElement::customGetOwnPropertySlot): (WebCore::JSHTMLObjectElement::customPut): (WebCore::JSHTMLObjectElement::getCallData):
  • bindings/js/JSHTMLOptionElementConstructor.cpp: (WebCore::constructHTMLOptionElement): (WebCore::JSHTMLOptionElementConstructor::getConstructData):
  • bindings/js/JSHTMLOptionElementConstructor.h: (WebCore::JSHTMLOptionElementConstructor::document): (WebCore::JSHTMLOptionElementConstructor::classInfo):
  • bindings/js/JSImageConstructor.cpp: (WebCore::constructImage): (WebCore::JSImageConstructor::getConstructData):
  • bindings/js/JSImageConstructor.h: (WebCore::JSImageConstructor::document): (WebCore::JSImageConstructor::classInfo):
  • bindings/js/JSInspectedObjectWrapper.h: (WebCore::JSInspectedObjectWrapper::classInfo):
  • bindings/js/JSInspectorCallbackWrapper.cpp: (WebCore::JSInspectorCallbackWrapper::prepareIncomingValue):
  • bindings/js/JSJavaScriptCallFrameCustom.cpp: (WebCore::JSJavaScriptCallFrame::scopeChain):
  • bindings/js/JSNodeFilterCondition.cpp: (WebCore::JSNodeFilterCondition::JSNodeFilterCondition): (WebCore::JSNodeFilterCondition::mark): (WebCore::JSNodeFilterCondition::acceptNode):
  • bindings/js/JSNodeFilterCondition.h: (WebCore::JSNodeFilterCondition::create):
  • bindings/js/JSNodeFilterCustom.cpp: (WebCore::toNodeFilter):
  • bindings/js/JSNodeListCustom.cpp: (WebCore::callNodeList): (WebCore::JSNodeList::getCallData): (WebCore::JSNodeList::canGetItemsForName): (WebCore::JSNodeList::nameGetter):
  • bindings/js/JSPluginElementFunctions.cpp: (WebCore::runtimeObjectGetter): (WebCore::runtimeObjectPropertyGetter): (WebCore::runtimeObjectCustomGetOwnPropertySlot): (WebCore::runtimeObjectCustomPut): (WebCore::runtimeObjectGetCallData): (WebCore::pluginInstance): (WebCore::getRuntimeObject): (WebCore::callPlugin):
  • bindings/js/JSPluginElementFunctions.h:
  • bindings/js/JSQuarantinedObjectWrapper.cpp: (WebCore::JSQuarantinedObjectWrapper::put): (WebCore::JSQuarantinedObjectWrapper::construct): (WebCore::JSQuarantinedObjectWrapper::getConstructData): (WebCore::JSQuarantinedObjectWrapper::hasInstance): (WebCore::JSQuarantinedObjectWrapper::call): (WebCore::JSQuarantinedObjectWrapper::getCallData):
  • bindings/js/JSQuarantinedObjectWrapper.h: (WebCore::JSQuarantinedObjectWrapper::className):
  • bindings/js/JSRGBColor.cpp:
  • bindings/js/JSXMLHttpRequestConstructor.cpp: (WebCore::constructXMLHttpRequest): (WebCore::JSXMLHttpRequestConstructor::getConstructData):
  • bindings/js/JSXMLHttpRequestConstructor.h: (WebCore::JSXMLHttpRequestConstructor::document): (WebCore::JSXMLHttpRequestConstructor::classInfo):
  • bindings/js/JSXSLTProcessorConstructor.cpp: (WebCore::constructXSLTProcessor): (WebCore::JSXSLTProcessorConstructor::getConstructData):
  • bindings/js/JSXSLTProcessorConstructor.h: (WebCore::JSXSLTProcessorConstructor::classInfo):
  • bindings/js/ScheduledAction.cpp: (WebCore::ScheduledAction::ScheduledAction): (WebCore::ScheduledAction::execute):
  • bindings/js/ScheduledAction.h:
  • bindings/objc/WebScriptObject.mm: (-[WebScriptObject callWebScriptMethod:withArguments:]):
  • bindings/scripts/CodeGeneratorJS.pm:
  • bridge/NP_jsobject.cpp: (_NPN_InvokeDefault): (_NPN_Invoke):
  • bridge/c/c_instance.cpp: (KJS::Bindings::CInstance::supportsInvokeDefaultMethod):
  • bridge/c/c_instance.h:
  • bridge/jni/jni_jsobject.mm: (JavaJSObject::call):
  • bridge/objc/objc_instance.h:
  • bridge/objc/objc_instance.mm: (ObjcInstance::supportsInvokeDefaultMethod):
  • bridge/objc/objc_runtime.h: (KJS::Bindings::ObjcFallbackObjectImp::propertyName): (KJS::Bindings::ObjcFallbackObjectImp::classInfo):
  • bridge/objc/objc_runtime.mm: (Bindings::webScriptObjectClass): (Bindings::webUndefinedClass): (ObjcFallbackObjectImp::ObjcFallbackObjectImp): (callObjCFallbackObject): (ObjcFallbackObjectImp::getCallData):
  • bridge/qt/qt_instance.h:
  • bridge/runtime.cpp: (KJS::Bindings::Instance::createRuntimeObject): (KJS::Bindings::Instance::getInstance):
  • bridge/runtime.h: (KJS::Bindings::Field::~Field): (KJS::Bindings::Method::~Method): (KJS::Bindings::Class::~Class): (KJS::Bindings::Instance::supportsInvokeDefaultMethod):
  • bridge/runtime_method.cpp: (KJS::callRuntimeMethod): (KJS::RuntimeMethod::getCallData):
  • bridge/runtime_method.h: (KJS::RuntimeMethod::methods):
  • bridge/runtime_object.cpp: (RuntimeObjectImp::defaultValue): (callRuntimeObject): (RuntimeObjectImp::getCallData):
  • bridge/runtime_object.h: (KJS::RuntimeObjectImp::getInternalInstance): (KJS::RuntimeObjectImp::classInfo):
  • dom/NodeIterator.h:
  • dom/Traversal.cpp:
  • dom/Traversal.h:
  • dom/TreeWalker.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/date_object.cpp

    r34659 r34754  
    2222#include "config.h"
    2323#include "date_object.h"
    24 #include "date_object.lut.h"
     24
     25#include "DateMath.h"
    2526#include "JSString.h"
    26 
    27 #if HAVE(ERRNO_H)
    28 #include <errno.h>
    29 #endif
    30 
    31 #if HAVE(SYS_PARAM_H)
    32 #include <sys/param.h>
    33 #endif
    34 
    35 #if HAVE(SYS_TIME_H)
    36 #include <sys/time.h>
    37 #endif
    38 
    39 #if HAVE(SYS_TIMEB_H)
    40 #include <sys/timeb.h>
    41 #endif
    42 
     27#include "error_object.h"
     28#include "operations.h"
    4329#include <float.h>
    4430#include <limits.h>
     
    4935#include <string.h>
    5036#include <time.h>
    51 
    52 #include "error_object.h"
    53 #include "operations.h"
    54 #include "DateMath.h"
    55 
    5637#include <wtf/ASCIICType.h>
    5738#include <wtf/Assertions.h>
     
    6041#include <wtf/UnusedParam.h>
    6142
     43#if HAVE(ERRNO_H)
     44#include <errno.h>
     45#endif
     46
     47#if HAVE(SYS_PARAM_H)
     48#include <sys/param.h>
     49#endif
     50
     51#if HAVE(SYS_TIME_H)
     52#include <sys/time.h>
     53#endif
     54
     55#if HAVE(SYS_TIMEB_H)
     56#include <sys/timeb.h>
     57#endif
     58
    6259#if PLATFORM(MAC)
    63     #include <CoreFoundation/CoreFoundation.h>
     60#include <CoreFoundation/CoreFoundation.h>
    6461#endif
    6562
    6663using namespace WTF;
     64
     65namespace KJS {
     66
     67static JSValue* dateProtoFuncGetDate(ExecState*, JSObject*, JSValue*, const ArgList&);
     68static JSValue* dateProtoFuncGetDay(ExecState*, JSObject*, JSValue*, const ArgList&);
     69static JSValue* dateProtoFuncGetFullYear(ExecState*, JSObject*, JSValue*, const ArgList&);
     70static JSValue* dateProtoFuncGetHours(ExecState*, JSObject*, JSValue*, const ArgList&);
     71static JSValue* dateProtoFuncGetMilliSeconds(ExecState*, JSObject*, JSValue*, const ArgList&);
     72static JSValue* dateProtoFuncGetMinutes(ExecState*, JSObject*, JSValue*, const ArgList&);
     73static JSValue* dateProtoFuncGetMonth(ExecState*, JSObject*, JSValue*, const ArgList&);
     74static JSValue* dateProtoFuncGetSeconds(ExecState*, JSObject*, JSValue*, const ArgList&);
     75static JSValue* dateProtoFuncGetTime(ExecState*, JSObject*, JSValue*, const ArgList&);
     76static JSValue* dateProtoFuncGetTimezoneOffset(ExecState*, JSObject*, JSValue*, const ArgList&);
     77static JSValue* dateProtoFuncGetUTCDate(ExecState*, JSObject*, JSValue*, const ArgList&);
     78static JSValue* dateProtoFuncGetUTCDay(ExecState*, JSObject*, JSValue*, const ArgList&);
     79static JSValue* dateProtoFuncGetUTCFullYear(ExecState*, JSObject*, JSValue*, const ArgList&);
     80static JSValue* dateProtoFuncGetUTCHours(ExecState*, JSObject*, JSValue*, const ArgList&);
     81static JSValue* dateProtoFuncGetUTCMilliseconds(ExecState*, JSObject*, JSValue*, const ArgList&);
     82static JSValue* dateProtoFuncGetUTCMinutes(ExecState*, JSObject*, JSValue*, const ArgList&);
     83static JSValue* dateProtoFuncGetUTCMonth(ExecState*, JSObject*, JSValue*, const ArgList&);
     84static JSValue* dateProtoFuncGetUTCSeconds(ExecState*, JSObject*, JSValue*, const ArgList&);
     85static JSValue* dateProtoFuncGetYear(ExecState*, JSObject*, JSValue*, const ArgList&);
     86static JSValue* dateProtoFuncSetDate(ExecState*, JSObject*, JSValue*, const ArgList&);
     87static JSValue* dateProtoFuncSetFullYear(ExecState*, JSObject*, JSValue*, const ArgList&);
     88static JSValue* dateProtoFuncSetHours(ExecState*, JSObject*, JSValue*, const ArgList&);
     89static JSValue* dateProtoFuncSetMilliSeconds(ExecState*, JSObject*, JSValue*, const ArgList&);
     90static JSValue* dateProtoFuncSetMinutes(ExecState*, JSObject*, JSValue*, const ArgList&);
     91static JSValue* dateProtoFuncSetMonth(ExecState*, JSObject*, JSValue*, const ArgList&);
     92static JSValue* dateProtoFuncSetSeconds(ExecState*, JSObject*, JSValue*, const ArgList&);
     93static JSValue* dateProtoFuncSetTime(ExecState*, JSObject*, JSValue*, const ArgList&);
     94static JSValue* dateProtoFuncSetUTCDate(ExecState*, JSObject*, JSValue*, const ArgList&);
     95static JSValue* dateProtoFuncSetUTCFullYear(ExecState*, JSObject*, JSValue*, const ArgList&);
     96static JSValue* dateProtoFuncSetUTCHours(ExecState*, JSObject*, JSValue*, const ArgList&);
     97static JSValue* dateProtoFuncSetUTCMilliseconds(ExecState*, JSObject*, JSValue*, const ArgList&);
     98static JSValue* dateProtoFuncSetUTCMinutes(ExecState*, JSObject*, JSValue*, const ArgList&);
     99static JSValue* dateProtoFuncSetUTCMonth(ExecState*, JSObject*, JSValue*, const ArgList&);
     100static JSValue* dateProtoFuncSetUTCSeconds(ExecState*, JSObject*, JSValue*, const ArgList&);
     101static JSValue* dateProtoFuncSetYear(ExecState*, JSObject*, JSValue*, const ArgList&);
     102static JSValue* dateProtoFuncToDateString(ExecState*, JSObject*, JSValue*, const ArgList&);
     103static JSValue* dateProtoFuncToGMTString(ExecState*, JSObject*, JSValue*, const ArgList&);
     104static JSValue* dateProtoFuncToLocaleDateString(ExecState*, JSObject*, JSValue*, const ArgList&);
     105static JSValue* dateProtoFuncToLocaleString(ExecState*, JSObject*, JSValue*, const ArgList&);
     106static JSValue* dateProtoFuncToLocaleTimeString(ExecState*, JSObject*, JSValue*, const ArgList&);
     107static JSValue* dateProtoFuncToString(ExecState*, JSObject*, JSValue*, const ArgList&);
     108static JSValue* dateProtoFuncToTimeString(ExecState*, JSObject*, JSValue*, const ArgList&);
     109static JSValue* dateProtoFuncToUTCString(ExecState*, JSObject*, JSValue*, const ArgList&);
     110static JSValue* dateProtoFuncValueOf(ExecState*, JSObject*, JSValue*, const ArgList&);
     111
     112}
     113
     114#include "date_object.lut.h"
    67115
    68116namespace KJS {
     
    71119static double timeClip(double);
    72120
    73 inline int gmtoffset(const GregorianDateTime& t)
     121static inline int gmtoffset(const GregorianDateTime& t)
    74122{
    75123    return t.utcOffset;
    76124}
    77 
    78 
    79 /**
    80  * @internal
    81  *
    82  * Class to implement all methods that are properties of the
    83  * Date object
    84  */
    85 class DateFunction : public InternalFunction {
    86 public:
    87     DateFunction(ExecState *, FunctionPrototype *, int i, int len, const Identifier& );
    88 
    89     virtual JSValue *callAsFunction(ExecState *, JSObject *thisObj, const ArgList &args);
    90 
    91     enum { Parse, UTC, Now };
    92 
    93 private:
    94     int id;
    95 };
    96125
    97126struct DateInstance::Cache {
     
    117146}
    118147
    119 static UString formatLocaleDate(ExecState *exec, double time, bool includeDate, bool includeTime, const ArgList &args)
     148static UString formatLocaleDate(ExecState *exec, double time, bool includeDate, bool includeTime, const ArgList& args)
    120149{
    121150    CFDateFormatterStyle dateStyle = (includeDate ? kCFDateFormatterLongStyle : kCFDateFormatterNoStyle);
     
    302331//
    303332// Format of member function: f([years,] [months,] [days])
    304 static bool fillStructuresUsingDateArgs(ExecState *exec, const ArgList &args, int maxArgs, double *ms, GregorianDateTime *t)
     333static bool fillStructuresUsingDateArgs(ExecState *exec, const ArgList& args, int maxArgs, double *ms, GregorianDateTime *t)
    305334{
    306335    int idx = 0;
     
    369398bool DateInstance::getTime(GregorianDateTime &t, int &offset) const
    370399{
    371     double milli = internalValue()->getNumber();
     400    double milli = internalNumber();
    372401    if (isnan(milli))
    373402        return false;
     
    380409bool DateInstance::getUTCTime(GregorianDateTime &t) const
    381410{
    382     double milli = internalValue()->getNumber();
     411    double milli = internalNumber();
    383412    if (isnan(milli))
    384413        return false;
     
    390419bool DateInstance::getTime(double &milli, int &offset) const
    391420{
    392     milli = internalValue()->getNumber();
     421    milli = internalNumber();
    393422    if (isnan(milli))
    394423        return false;
     
    402431bool DateInstance::getUTCTime(double &milli) const
    403432{
    404     milli = internalValue()->getNumber();
     433    milli = internalNumber();
    405434    if (isnan(milli))
    406435        return false;
     
    420449
    421450/* Source for date_object.lut.h
    422    FIXMEL We could use templates to simplify the UTC variants.
    423 @begin dateTable 61
     451   FIXME: We could use templates to simplify the UTC variants.
     452@begin dateTable
    424453  toString              dateProtoFuncToString                DontEnum|Function       0
    425454  toUTCString           dateProtoFuncToUTCString             DontEnum|Function       0
     
    486515// TODO: MakeTime (15.9.11.1) etc. ?
    487516
     517static JSValue* dateParse(ExecState*, JSObject*, JSValue*, const ArgList&);
     518static JSValue* dateNow(ExecState*, JSObject*, JSValue*, const ArgList&);
     519static JSValue* dateUTC(ExecState*, JSObject*, JSValue*, const ArgList&);
     520
    488521DateConstructor::DateConstructor(ExecState* exec, FunctionPrototype* funcProto, DatePrototype* dateProto)
    489522  : InternalFunction(funcProto, Identifier(exec, dateProto->classInfo()->className))
    490523{
    491524  putDirect(exec->propertyNames().prototype, dateProto, DontEnum|DontDelete|ReadOnly);
    492   putDirectFunction(new (exec) DateFunction(exec, funcProto, DateFunction::Parse, 1, exec->propertyNames().parse), DontEnum);
    493   putDirectFunction(new (exec) DateFunction(exec, funcProto, DateFunction::UTC, 7, exec->propertyNames().UTC), DontEnum);
    494   putDirectFunction(new (exec) DateFunction(exec, funcProto, DateFunction::Now, 0, exec->propertyNames().now), DontEnum);
    495   putDirect(exec, exec->propertyNames().length, 7, ReadOnly|DontDelete|DontEnum);
    496 }
    497 
    498 ConstructType DateConstructor::getConstructData(ConstructData&)
    499 {
    500     return ConstructTypeNative;
     525  putDirectFunction(new (exec) PrototypeFunction(exec, funcProto, 1, exec->propertyNames().parse, dateParse), DontEnum);
     526  putDirectFunction(new (exec) PrototypeFunction(exec, funcProto, 7, exec->propertyNames().UTC, dateUTC), DontEnum);
     527  putDirectFunction(new (exec) PrototypeFunction(exec, funcProto, 0, exec->propertyNames().now, dateNow), DontEnum);
     528  putDirect(exec, exec->propertyNames().length, 7, ReadOnly | DontEnum | DontDelete);
    501529}
    502530
    503531// ECMA 15.9.3
    504 JSObject *DateConstructor::construct(ExecState *exec, const ArgList &args)
     532static JSObject* constructDate(ExecState* exec, JSObject*, const ArgList& args)
    505533{
    506534  int numArgs = args.size();
     
    512540  } else if (numArgs == 1) {
    513541    if (args[0]->isObject(&DateInstance::info))
    514       value = static_cast<DateInstance*>(args[0])->internalValue()->toNumber(exec);
     542      value = static_cast<DateInstance*>(args[0])->internalNumber();
    515543    else {
    516544      JSValue* primitive = args[0]->toPrimitive(exec);
     
    549577}
    550578
     579ConstructType DateConstructor::getConstructData(ConstructData& constructData)
     580{
     581    constructData.native.function = constructDate;
     582    return ConstructTypeNative;
     583}
     584
    551585// ECMA 15.9.2
    552 JSValue* DateConstructor::callAsFunction(ExecState* exec, JSObject * /*thisObj*/, const ArgList &/*args*/)
     586static JSValue* callDate(ExecState* exec, JSObject*, JSValue*, const ArgList&)
    553587{
    554588    time_t localTime = time(0);
     
    559593}
    560594
    561 // ------------------------------ DateFunction ----------------------------
    562 
    563 DateFunction::DateFunction(ExecState* exec, FunctionPrototype* funcProto, int i, int len, const Identifier& name)
    564     : InternalFunction(funcProto, name), id(i)
    565 {
    566     putDirect(exec, exec->propertyNames().length, len, DontDelete|ReadOnly|DontEnum);
    567 }
    568 
    569 // ECMA 15.9.4.2 - 3
    570 JSValue *DateFunction::callAsFunction(ExecState* exec, JSObject*, const ArgList& args)
    571 {
    572   if (id == Parse)
     595CallType DateConstructor::getCallData(CallData& callData)
     596{
     597    callData.native.function = callDate;
     598    return CallTypeNative;
     599}
     600
     601static JSValue* dateParse(ExecState* exec, JSObject*, JSValue*, const ArgList& args)
     602{
    573603    return jsNumber(exec, parseDate(args[0]->toString(exec)));
    574   else if (id == Now)
     604}
     605
     606static JSValue* dateNow(ExecState* exec, JSObject*, JSValue*, const ArgList&)
     607{
    575608    return jsNumber(exec, getCurrentUTCTime());
    576   else { // UTC
     609}
     610
     611static JSValue* dateUTC(ExecState* exec, JSObject*, JSValue*, const ArgList& args)
     612{
    577613    int n = args.size();
    578614    if (isnan(args[0]->toNumber(exec))
    579         || isnan(args[1]->toNumber(exec))
    580         || (n >= 3 && isnan(args[2]->toNumber(exec)))
    581         || (n >= 4 && isnan(args[3]->toNumber(exec)))
    582         || (n >= 5 && isnan(args[4]->toNumber(exec)))
    583         || (n >= 6 && isnan(args[5]->toNumber(exec)))
    584         || (n >= 7 && isnan(args[6]->toNumber(exec)))) {
    585       return jsNaN(exec);
     615            || isnan(args[1]->toNumber(exec))
     616            || (n >= 3 && isnan(args[2]->toNumber(exec)))
     617            || (n >= 4 && isnan(args[3]->toNumber(exec)))
     618            || (n >= 5 && isnan(args[4]->toNumber(exec)))
     619            || (n >= 6 && isnan(args[5]->toNumber(exec)))
     620            || (n >= 7 && isnan(args[6]->toNumber(exec)))) {
     621        return jsNaN(exec);
    586622    }
    587623
     
    596632    double ms = (n >= 7) ? args[6]->toNumber(exec) : 0;
    597633    return jsNumber(exec, gregorianDateTimeToMS(t, ms, true));
    598   }
    599634}
    600635
     
    9791014// Functions
    9801015
    981 JSValue* dateProtoFuncToString(ExecState* exec, JSObject* thisObj, const ArgList&)
    982 {
    983     if (!thisObj->inherits(&DateInstance::info))
     1016JSValue* dateProtoFuncToString(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
     1017{
     1018    if (!thisValue->isObject(&DateInstance::info))
    9841019        return throwError(exec, TypeError);
    9851020
    9861021    const bool utc = false;
    9871022
    988     DateInstance* thisDateObj = static_cast<DateInstance*>(thisObj);
    989     JSValue* v = thisDateObj->internalValue();
    990     double milli = v->toNumber(exec);
     1023    DateInstance* thisDateObj = static_cast<DateInstance*>(thisValue);
     1024    double milli = thisDateObj->internalNumber();
    9911025    if (isnan(milli))
    9921026        return jsString(exec, "Invalid Date");
     
    9971031}
    9981032
    999 JSValue* dateProtoFuncToUTCString(ExecState* exec, JSObject* thisObj, const ArgList&)
    1000 {
    1001     if (!thisObj->inherits(&DateInstance::info))
     1033JSValue* dateProtoFuncToUTCString(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
     1034{
     1035    if (!thisValue->isObject(&DateInstance::info))
    10021036        return throwError(exec, TypeError);
    10031037
    10041038    const bool utc = true;
    10051039
    1006     DateInstance* thisDateObj = static_cast<DateInstance*>(thisObj);
    1007     JSValue* v = thisDateObj->internalValue();
    1008     double milli = v->toNumber(exec);
     1040    DateInstance* thisDateObj = static_cast<DateInstance*>(thisValue);
     1041    double milli = thisDateObj->internalNumber();
    10091042    if (isnan(milli))
    10101043        return jsString(exec, "Invalid Date");
     
    10151048}
    10161049
    1017 JSValue* dateProtoFuncToDateString(ExecState* exec, JSObject* thisObj, const ArgList&)
    1018 {
    1019     if (!thisObj->inherits(&DateInstance::info))
     1050JSValue* dateProtoFuncToDateString(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
     1051{
     1052    if (!thisValue->isObject(&DateInstance::info))
    10201053        return throwError(exec, TypeError);
    10211054
    10221055    const bool utc = false;
    10231056
    1024     DateInstance* thisDateObj = static_cast<DateInstance*>(thisObj);
    1025     JSValue* v = thisDateObj->internalValue();
    1026     double milli = v->toNumber(exec);
     1057    DateInstance* thisDateObj = static_cast<DateInstance*>(thisValue);
     1058    double milli = thisDateObj->internalNumber();
    10271059    if (isnan(milli))
    10281060        return jsString(exec, "Invalid Date");
     
    10331065}
    10341066
    1035 JSValue* dateProtoFuncToTimeString(ExecState* exec, JSObject* thisObj, const ArgList&)
    1036 {
    1037     if (!thisObj->inherits(&DateInstance::info))
     1067JSValue* dateProtoFuncToTimeString(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
     1068{
     1069    if (!thisValue->isObject(&DateInstance::info))
    10381070        return throwError(exec, TypeError);
    10391071
    10401072    const bool utc = false;
    10411073
    1042     DateInstance* thisDateObj = static_cast<DateInstance*>(thisObj);
    1043     JSValue* v = thisDateObj->internalValue();
    1044     double milli = v->toNumber(exec);
     1074    DateInstance* thisDateObj = static_cast<DateInstance*>(thisValue);
     1075    double milli = thisDateObj->internalNumber();
    10451076    if (isnan(milli))
    10461077        return jsString(exec, "Invalid Date");
     
    10511082}
    10521083
    1053 JSValue* dateProtoFuncToLocaleString(ExecState* exec, JSObject* thisObj, const ArgList& args)
    1054 {
    1055     if (!thisObj->inherits(&DateInstance::info))
    1056         return throwError(exec, TypeError);
    1057 
    1058     DateInstance* thisDateObj = static_cast<DateInstance*>(thisObj);
    1059     JSValue* v = thisDateObj->internalValue();
    1060     double milli = v->toNumber(exec);
     1084JSValue* dateProtoFuncToLocaleString(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
     1085{
     1086    if (!thisValue->isObject(&DateInstance::info))
     1087        return throwError(exec, TypeError);
     1088
     1089    DateInstance* thisDateObj = static_cast<DateInstance*>(thisValue);
     1090    double milli = thisDateObj->internalNumber();
    10611091    if (isnan(milli))
    10621092        return jsString(exec, "Invalid Date");
     
    10761106}
    10771107
    1078 JSValue* dateProtoFuncToLocaleDateString(ExecState* exec, JSObject* thisObj, const ArgList& args)
    1079 {
    1080     if (!thisObj->inherits(&DateInstance::info))
    1081         return throwError(exec, TypeError);
    1082 
    1083     DateInstance* thisDateObj = static_cast<DateInstance*>(thisObj);
    1084     JSValue* v = thisDateObj->internalValue();
    1085     double milli = v->toNumber(exec);
     1108JSValue* dateProtoFuncToLocaleDateString(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
     1109{
     1110    if (!thisValue->isObject(&DateInstance::info))
     1111        return throwError(exec, TypeError);
     1112
     1113    DateInstance* thisDateObj = static_cast<DateInstance*>(thisValue);
     1114    double milli = thisDateObj->internalNumber();
    10861115    if (isnan(milli))
    10871116        return jsString(exec, "Invalid Date");
     
    11011130}
    11021131
    1103 JSValue* dateProtoFuncToLocaleTimeString(ExecState* exec, JSObject* thisObj, const ArgList& args)
    1104 {
    1105     if (!thisObj->inherits(&DateInstance::info))
    1106         return throwError(exec, TypeError);
    1107 
    1108     DateInstance* thisDateObj = static_cast<DateInstance*>(thisObj);
    1109     JSValue* v = thisDateObj->internalValue();
    1110     double milli = v->toNumber(exec);
     1132JSValue* dateProtoFuncToLocaleTimeString(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
     1133{
     1134    if (!thisValue->isObject(&DateInstance::info))
     1135        return throwError(exec, TypeError);
     1136
     1137    DateInstance* thisDateObj = static_cast<DateInstance*>(thisValue);
     1138    double milli = thisDateObj->internalNumber();
    11111139    if (isnan(milli))
    11121140        return jsString(exec, "Invalid Date");
     
    11261154}
    11271155
    1128 JSValue* dateProtoFuncValueOf(ExecState* exec, JSObject* thisObj, const ArgList&)
    1129 {
    1130     if (!thisObj->inherits(&DateInstance::info))
    1131         return throwError(exec, TypeError);
    1132 
    1133     DateInstance* thisDateObj = static_cast<DateInstance*>(thisObj);
    1134     JSValue* v = thisDateObj->internalValue();
    1135     double milli = v->toNumber(exec);
     1156JSValue* dateProtoFuncValueOf(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
     1157{
     1158    if (!thisValue->isObject(&DateInstance::info))
     1159        return throwError(exec, TypeError);
     1160
     1161    DateInstance* thisDateObj = static_cast<DateInstance*>(thisValue);
     1162    double milli = thisDateObj->internalNumber();
    11361163    if (isnan(milli))
    11371164        return jsNaN(exec);
     
    11401167}
    11411168
    1142 JSValue* dateProtoFuncGetTime(ExecState* exec, JSObject* thisObj, const ArgList&)
    1143 {
    1144     if (!thisObj->inherits(&DateInstance::info))
    1145         return throwError(exec, TypeError);
    1146 
    1147     DateInstance* thisDateObj = static_cast<DateInstance*>(thisObj);
    1148     JSValue* v = thisDateObj->internalValue();
    1149     double milli = v->toNumber(exec);
     1169JSValue* dateProtoFuncGetTime(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
     1170{
     1171    if (!thisValue->isObject(&DateInstance::info))
     1172        return throwError(exec, TypeError);
     1173
     1174    DateInstance* thisDateObj = static_cast<DateInstance*>(thisValue);
     1175    double milli = thisDateObj->internalNumber();
    11501176    if (isnan(milli))
    11511177        return jsNaN(exec);
     
    11541180}
    11551181
    1156 JSValue* dateProtoFuncGetFullYear(ExecState* exec, JSObject* thisObj, const ArgList&)
    1157 {
    1158     if (!thisObj->inherits(&DateInstance::info))
     1182JSValue* dateProtoFuncGetFullYear(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
     1183{
     1184    if (!thisValue->isObject(&DateInstance::info))
    11591185        return throwError(exec, TypeError);
    11601186
    11611187    const bool utc = false;
    11621188
    1163     DateInstance* thisDateObj = static_cast<DateInstance*>(thisObj);
    1164     JSValue* v = thisDateObj->internalValue();
    1165     double milli = v->toNumber(exec);
     1189    DateInstance* thisDateObj = static_cast<DateInstance*>(thisValue);
     1190    double milli = thisDateObj->internalNumber();
    11661191    if (isnan(milli))
    11671192        return jsNaN(exec);
     
    11721197}
    11731198
    1174 JSValue* dateProtoFuncGetUTCFullYear(ExecState* exec, JSObject* thisObj, const ArgList&)
    1175 {
    1176     if (!thisObj->inherits(&DateInstance::info))
     1199JSValue* dateProtoFuncGetUTCFullYear(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
     1200{
     1201    if (!thisValue->isObject(&DateInstance::info))
    11771202        return throwError(exec, TypeError);
    11781203
    11791204    const bool utc = true;
    11801205
    1181     DateInstance* thisDateObj = static_cast<DateInstance*>(thisObj);
    1182     JSValue* v = thisDateObj->internalValue();
    1183     double milli = v->toNumber(exec);
     1206    DateInstance* thisDateObj = static_cast<DateInstance*>(thisValue);
     1207    double milli = thisDateObj->internalNumber();
    11841208    if (isnan(milli))
    11851209        return jsNaN(exec);
     
    11901214}
    11911215
    1192 JSValue* dateProtoFuncToGMTString(ExecState* exec, JSObject* thisObj, const ArgList&)
    1193 {
    1194     if (!thisObj->inherits(&DateInstance::info))
     1216JSValue* dateProtoFuncToGMTString(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
     1217{
     1218    if (!thisValue->isObject(&DateInstance::info))
    11951219        return throwError(exec, TypeError);
    11961220
    11971221    const bool utc = true;
    11981222
    1199     DateInstance* thisDateObj = static_cast<DateInstance*>(thisObj);
    1200     JSValue* v = thisDateObj->internalValue();
    1201     double milli = v->toNumber(exec);
     1223    DateInstance* thisDateObj = static_cast<DateInstance*>(thisValue);
     1224    double milli = thisDateObj->internalNumber();
    12021225    if (isnan(milli))
    12031226        return jsString(exec, "Invalid Date");
     
    12081231}
    12091232
    1210 JSValue* dateProtoFuncGetMonth(ExecState* exec, JSObject* thisObj, const ArgList&)
    1211 {
    1212     if (!thisObj->inherits(&DateInstance::info))
     1233JSValue* dateProtoFuncGetMonth(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
     1234{
     1235    if (!thisValue->isObject(&DateInstance::info))
    12131236        return throwError(exec, TypeError);
    12141237
    12151238    const bool utc = false;
    12161239
    1217     DateInstance* thisDateObj = static_cast<DateInstance*>(thisObj);
    1218     JSValue* v = thisDateObj->internalValue();
    1219     double milli = v->toNumber(exec);
     1240    DateInstance* thisDateObj = static_cast<DateInstance*>(thisValue);
     1241    double milli = thisDateObj->internalNumber();
    12201242    if (isnan(milli))
    12211243        return jsNaN(exec);
     
    12261248}
    12271249
    1228 JSValue* dateProtoFuncGetUTCMonth(ExecState* exec, JSObject* thisObj, const ArgList&)
    1229 {
    1230     if (!thisObj->inherits(&DateInstance::info))
     1250JSValue* dateProtoFuncGetUTCMonth(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
     1251{
     1252    if (!thisValue->isObject(&DateInstance::info))
    12311253        return throwError(exec, TypeError);
    12321254
    12331255    const bool utc = true;
    12341256
    1235     DateInstance* thisDateObj = static_cast<DateInstance*>(thisObj);
    1236     JSValue* v = thisDateObj->internalValue();
    1237     double milli = v->toNumber(exec);
     1257    DateInstance* thisDateObj = static_cast<DateInstance*>(thisValue);
     1258    double milli = thisDateObj->internalNumber();
    12381259    if (isnan(milli))
    12391260        return jsNaN(exec);
     
    12441265}
    12451266
    1246 JSValue* dateProtoFuncGetDate(ExecState* exec, JSObject* thisObj, const ArgList&)
    1247 {
    1248     if (!thisObj->inherits(&DateInstance::info))
     1267JSValue* dateProtoFuncGetDate(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
     1268{
     1269    if (!thisValue->isObject(&DateInstance::info))
    12491270        return throwError(exec, TypeError);
    12501271
    12511272    const bool utc = false;
    12521273
    1253     DateInstance* thisDateObj = static_cast<DateInstance*>(thisObj);
    1254     JSValue* v = thisDateObj->internalValue();
    1255     double milli = v->toNumber(exec);
     1274    DateInstance* thisDateObj = static_cast<DateInstance*>(thisValue);
     1275    double milli = thisDateObj->internalNumber();
    12561276    if (isnan(milli))
    12571277        return jsNaN(exec);
     
    12621282}
    12631283
    1264 JSValue* dateProtoFuncGetUTCDate(ExecState* exec, JSObject* thisObj, const ArgList&)
    1265 {
    1266     if (!thisObj->inherits(&DateInstance::info))
     1284JSValue* dateProtoFuncGetUTCDate(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
     1285{
     1286    if (!thisValue->isObject(&DateInstance::info))
    12671287        return throwError(exec, TypeError);
    12681288
    12691289    const bool utc = true;
    12701290
    1271     DateInstance* thisDateObj = static_cast<DateInstance*>(thisObj);
    1272     JSValue* v = thisDateObj->internalValue();
    1273     double milli = v->toNumber(exec);
     1291    DateInstance* thisDateObj = static_cast<DateInstance*>(thisValue);
     1292    double milli = thisDateObj->internalNumber();
    12741293    if (isnan(milli))
    12751294        return jsNaN(exec);
     
    12801299}
    12811300
    1282 JSValue* dateProtoFuncGetDay(ExecState* exec, JSObject* thisObj, const ArgList&)
    1283 {
    1284     if (!thisObj->inherits(&DateInstance::info))
     1301JSValue* dateProtoFuncGetDay(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
     1302{
     1303    if (!thisValue->isObject(&DateInstance::info))
    12851304        return throwError(exec, TypeError);
    12861305
    12871306    const bool utc = false;
    12881307
    1289     DateInstance* thisDateObj = static_cast<DateInstance*>(thisObj);
    1290     JSValue* v = thisDateObj->internalValue();
    1291     double milli = v->toNumber(exec);
     1308    DateInstance* thisDateObj = static_cast<DateInstance*>(thisValue);
     1309    double milli = thisDateObj->internalNumber();
    12921310    if (isnan(milli))
    12931311        return jsNaN(exec);
     
    12981316}
    12991317
    1300 JSValue* dateProtoFuncGetUTCDay(ExecState* exec, JSObject* thisObj, const ArgList&)
    1301 {
    1302     if (!thisObj->inherits(&DateInstance::info))
     1318JSValue* dateProtoFuncGetUTCDay(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
     1319{
     1320    if (!thisValue->isObject(&DateInstance::info))
    13031321        return throwError(exec, TypeError);
    13041322
    13051323    const bool utc = true;
    13061324
    1307     DateInstance* thisDateObj = static_cast<DateInstance*>(thisObj);
    1308     JSValue* v = thisDateObj->internalValue();
    1309     double milli = v->toNumber(exec);
     1325    DateInstance* thisDateObj = static_cast<DateInstance*>(thisValue);
     1326    double milli = thisDateObj->internalNumber();
    13101327    if (isnan(milli))
    13111328        return jsNaN(exec);
     
    13161333}
    13171334
    1318 JSValue* dateProtoFuncGetHours(ExecState* exec, JSObject* thisObj, const ArgList&)
    1319 {
    1320     if (!thisObj->inherits(&DateInstance::info))
     1335JSValue* dateProtoFuncGetHours(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
     1336{
     1337    if (!thisValue->isObject(&DateInstance::info))
    13211338        return throwError(exec, TypeError);
    13221339
    13231340    const bool utc = false;
    13241341
    1325     DateInstance* thisDateObj = static_cast<DateInstance*>(thisObj);
    1326     JSValue* v = thisDateObj->internalValue();
    1327     double milli = v->toNumber(exec);
     1342    DateInstance* thisDateObj = static_cast<DateInstance*>(thisValue);
     1343    double milli = thisDateObj->internalNumber();
    13281344    if (isnan(milli))
    13291345        return jsNaN(exec);
     
    13341350}
    13351351
    1336 JSValue* dateProtoFuncGetUTCHours(ExecState* exec, JSObject* thisObj, const ArgList&)
    1337 {
    1338     if (!thisObj->inherits(&DateInstance::info))
     1352JSValue* dateProtoFuncGetUTCHours(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
     1353{
     1354    if (!thisValue->isObject(&DateInstance::info))
    13391355        return throwError(exec, TypeError);
    13401356
    13411357    const bool utc = true;
    13421358
    1343     DateInstance* thisDateObj = static_cast<DateInstance*>(thisObj);
    1344     JSValue* v = thisDateObj->internalValue();
    1345     double milli = v->toNumber(exec);
     1359    DateInstance* thisDateObj = static_cast<DateInstance*>(thisValue);
     1360    double milli = thisDateObj->internalNumber();
    13461361    if (isnan(milli))
    13471362        return jsNaN(exec);
     
    13521367}
    13531368
    1354 JSValue* dateProtoFuncGetMinutes(ExecState* exec, JSObject* thisObj, const ArgList&)
    1355 {
    1356     if (!thisObj->inherits(&DateInstance::info))
     1369JSValue* dateProtoFuncGetMinutes(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
     1370{
     1371    if (!thisValue->isObject(&DateInstance::info))
    13571372        return throwError(exec, TypeError);
    13581373
    13591374    const bool utc = false;
    13601375
    1361     DateInstance* thisDateObj = static_cast<DateInstance*>(thisObj);
    1362     JSValue* v = thisDateObj->internalValue();
    1363     double milli = v->toNumber(exec);
     1376    DateInstance* thisDateObj = static_cast<DateInstance*>(thisValue);
     1377    double milli = thisDateObj->internalNumber();
    13641378    if (isnan(milli))
    13651379        return jsNaN(exec);
     
    13701384}
    13711385
    1372 JSValue* dateProtoFuncGetUTCMinutes(ExecState* exec, JSObject* thisObj, const ArgList&)
    1373 {
    1374     if (!thisObj->inherits(&DateInstance::info))
     1386JSValue* dateProtoFuncGetUTCMinutes(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
     1387{
     1388    if (!thisValue->isObject(&DateInstance::info))
    13751389        return throwError(exec, TypeError);
    13761390
    13771391    const bool utc = true;
    13781392
    1379     DateInstance* thisDateObj = static_cast<DateInstance*>(thisObj);
    1380     JSValue* v = thisDateObj->internalValue();
    1381     double milli = v->toNumber(exec);
     1393    DateInstance* thisDateObj = static_cast<DateInstance*>(thisValue);
     1394    double milli = thisDateObj->internalNumber();
    13821395    if (isnan(milli))
    13831396        return jsNaN(exec);
     
    13881401}
    13891402
    1390 JSValue* dateProtoFuncGetSeconds(ExecState* exec, JSObject* thisObj, const ArgList&)
    1391 {
    1392     if (!thisObj->inherits(&DateInstance::info))
     1403JSValue* dateProtoFuncGetSeconds(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
     1404{
     1405    if (!thisValue->isObject(&DateInstance::info))
    13931406        return throwError(exec, TypeError);
    13941407
    13951408    const bool utc = false;
    13961409
    1397     DateInstance* thisDateObj = static_cast<DateInstance*>(thisObj);
    1398     JSValue* v = thisDateObj->internalValue();
    1399     double milli = v->toNumber(exec);
     1410    DateInstance* thisDateObj = static_cast<DateInstance*>(thisValue);
     1411    double milli = thisDateObj->internalNumber();
    14001412    if (isnan(milli))
    14011413        return jsNaN(exec);
     
    14061418}
    14071419
    1408 JSValue* dateProtoFuncGetUTCSeconds(ExecState* exec, JSObject* thisObj, const ArgList&)
    1409 {
    1410     if (!thisObj->inherits(&DateInstance::info))
     1420JSValue* dateProtoFuncGetUTCSeconds(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
     1421{
     1422    if (!thisValue->isObject(&DateInstance::info))
    14111423        return throwError(exec, TypeError);
    14121424
    14131425    const bool utc = true;
    14141426
    1415     DateInstance* thisDateObj = static_cast<DateInstance*>(thisObj);
    1416     JSValue* v = thisDateObj->internalValue();
    1417     double milli = v->toNumber(exec);
     1427    DateInstance* thisDateObj = static_cast<DateInstance*>(thisValue);
     1428    double milli = thisDateObj->internalNumber();
    14181429    if (isnan(milli))
    14191430        return jsNaN(exec);
     
    14241435}
    14251436
    1426 JSValue* dateProtoFuncGetMilliSeconds(ExecState* exec, JSObject* thisObj, const ArgList&)
    1427 {
    1428     if (!thisObj->inherits(&DateInstance::info))
    1429         return throwError(exec, TypeError);
    1430 
    1431     DateInstance* thisDateObj = static_cast<DateInstance*>(thisObj);
    1432     JSValue* v = thisDateObj->internalValue();
    1433     double milli = v->toNumber(exec);
     1437JSValue* dateProtoFuncGetMilliSeconds(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
     1438{
     1439    if (!thisValue->isObject(&DateInstance::info))
     1440        return throwError(exec, TypeError);
     1441
     1442    DateInstance* thisDateObj = static_cast<DateInstance*>(thisValue);
     1443    double milli = thisDateObj->internalNumber();
    14341444    if (isnan(milli))
    14351445        return jsNaN(exec);
     
    14401450}
    14411451
    1442 JSValue* dateProtoFuncGetUTCMilliseconds(ExecState* exec, JSObject* thisObj, const ArgList&)
    1443 {
    1444     if (!thisObj->inherits(&DateInstance::info))
    1445         return throwError(exec, TypeError);
    1446 
    1447     DateInstance* thisDateObj = static_cast<DateInstance*>(thisObj);
    1448     JSValue* v = thisDateObj->internalValue();
    1449     double milli = v->toNumber(exec);
     1452JSValue* dateProtoFuncGetUTCMilliseconds(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
     1453{
     1454    if (!thisValue->isObject(&DateInstance::info))
     1455        return throwError(exec, TypeError);
     1456
     1457    DateInstance* thisDateObj = static_cast<DateInstance*>(thisValue);
     1458    double milli = thisDateObj->internalNumber();
    14501459    if (isnan(milli))
    14511460        return jsNaN(exec);
     
    14561465}
    14571466
    1458 JSValue* dateProtoFuncGetTimezoneOffset(ExecState* exec, JSObject* thisObj, const ArgList&)
    1459 {
    1460     if (!thisObj->inherits(&DateInstance::info))
     1467JSValue* dateProtoFuncGetTimezoneOffset(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
     1468{
     1469    if (!thisValue->isObject(&DateInstance::info))
    14611470        return throwError(exec, TypeError);
    14621471
    14631472    const bool utc = false;
    14641473
    1465     DateInstance* thisDateObj = static_cast<DateInstance*>(thisObj);
    1466     JSValue* v = thisDateObj->internalValue();
    1467     double milli = v->toNumber(exec);
     1474    DateInstance* thisDateObj = static_cast<DateInstance*>(thisValue);
     1475    double milli = thisDateObj->internalNumber();
    14681476    if (isnan(milli))
    14691477        return jsNaN(exec);
     
    14741482}
    14751483
    1476 JSValue* dateProtoFuncSetTime(ExecState* exec, JSObject* thisObj, const ArgList& args)
    1477 {
    1478     if (!thisObj->inherits(&DateInstance::info))
    1479         return throwError(exec, TypeError);
    1480 
    1481     DateInstance* thisDateObj = static_cast<DateInstance*>(thisObj);
     1484JSValue* dateProtoFuncSetTime(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
     1485{
     1486    if (!thisValue->isObject(&DateInstance::info))
     1487        return throwError(exec, TypeError);
     1488
     1489    DateInstance* thisDateObj = static_cast<DateInstance*>(thisValue);
    14821490
    14831491    double milli = timeClip(args[0]->toNumber(exec));
     
    14871495}
    14881496
    1489 static JSValue* setNewValueFromTimeArgs(ExecState* exec, JSObject* thisObj, const ArgList& args, int numArgsToUse, bool inputIsUTC)
    1490 {
    1491     if (!thisObj->inherits(&DateInstance::info))
    1492         return throwError(exec, TypeError);
    1493 
    1494     DateInstance* thisDateObj = static_cast<DateInstance*>(thisObj);
    1495     JSValue* v = thisDateObj->internalValue();
    1496     double milli = v->toNumber(exec);
     1497static JSValue* setNewValueFromTimeArgs(ExecState* exec, JSValue* thisValue, const ArgList& args, int numArgsToUse, bool inputIsUTC)
     1498{
     1499    if (!thisValue->isObject(&DateInstance::info))
     1500        return throwError(exec, TypeError);
     1501
     1502    DateInstance* thisDateObj = static_cast<DateInstance*>(thisValue);
     1503    double milli = thisDateObj->internalNumber();
    14971504   
    14981505    if (args.isEmpty() || isnan(milli)) {
     
    15191526}
    15201527
    1521 static JSValue* setNewValueFromDateArgs(ExecState* exec, JSObject* thisObj, const ArgList& args, int numArgsToUse, bool inputIsUTC)
    1522 {
    1523     if (!thisObj->inherits(&DateInstance::info))
    1524         return throwError(exec, TypeError);
    1525 
    1526     DateInstance* thisDateObj = static_cast<DateInstance*>(thisObj);
     1528static JSValue* setNewValueFromDateArgs(ExecState* exec, JSValue* thisValue, const ArgList& args, int numArgsToUse, bool inputIsUTC)
     1529{
     1530    if (!thisValue->isObject(&DateInstance::info))
     1531        return throwError(exec, TypeError);
     1532
     1533    DateInstance* thisDateObj = static_cast<DateInstance*>(thisValue);
    15271534    if (args.isEmpty()) {
    15281535        JSValue* result = jsNaN(exec);
     
    15311538    }     
    15321539   
    1533     JSValue* v = thisDateObj->internalValue();
    1534     double milli = v->toNumber(exec);
     1540    double milli = thisDateObj->internalNumber();
    15351541    double ms = 0;
    15361542
     
    15571563}
    15581564
    1559 JSValue* dateProtoFuncSetMilliSeconds(ExecState* exec, JSObject* thisObj, const ArgList& args)
     1565JSValue* dateProtoFuncSetMilliSeconds(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
    15601566{
    15611567    const bool inputIsUTC = false;
    1562     return setNewValueFromTimeArgs(exec, thisObj, args, 1, inputIsUTC);
    1563 }
    1564 
    1565 JSValue* dateProtoFuncSetUTCMilliseconds(ExecState* exec, JSObject* thisObj, const ArgList& args)
     1568    return setNewValueFromTimeArgs(exec, thisValue, args, 1, inputIsUTC);
     1569}
     1570
     1571JSValue* dateProtoFuncSetUTCMilliseconds(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
    15661572{
    15671573    const bool inputIsUTC = true;
    1568     return setNewValueFromTimeArgs(exec, thisObj, args, 1, inputIsUTC);
    1569 }
    1570 
    1571 JSValue* dateProtoFuncSetSeconds(ExecState* exec, JSObject* thisObj, const ArgList& args)
     1574    return setNewValueFromTimeArgs(exec, thisValue, args, 1, inputIsUTC);
     1575}
     1576
     1577JSValue* dateProtoFuncSetSeconds(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
    15721578{
    15731579    const bool inputIsUTC = false;
    1574     return setNewValueFromTimeArgs(exec, thisObj, args, 2, inputIsUTC);
    1575 }
    1576 
    1577 JSValue* dateProtoFuncSetUTCSeconds(ExecState* exec, JSObject* thisObj, const ArgList& args)
     1580    return setNewValueFromTimeArgs(exec, thisValue, args, 2, inputIsUTC);
     1581}
     1582
     1583JSValue* dateProtoFuncSetUTCSeconds(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
    15781584{
    15791585    const bool inputIsUTC = true;
    1580     return setNewValueFromTimeArgs(exec, thisObj, args, 2, inputIsUTC);
    1581 }
    1582 
    1583 JSValue* dateProtoFuncSetMinutes(ExecState* exec, JSObject* thisObj, const ArgList& args)
     1586    return setNewValueFromTimeArgs(exec, thisValue, args, 2, inputIsUTC);
     1587}
     1588
     1589JSValue* dateProtoFuncSetMinutes(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
    15841590{
    15851591    const bool inputIsUTC = false;
    1586     return setNewValueFromTimeArgs(exec, thisObj, args, 3, inputIsUTC);
    1587 }
    1588 
    1589 JSValue* dateProtoFuncSetUTCMinutes(ExecState* exec, JSObject* thisObj, const ArgList& args)
     1592    return setNewValueFromTimeArgs(exec, thisValue, args, 3, inputIsUTC);
     1593}
     1594
     1595JSValue* dateProtoFuncSetUTCMinutes(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
    15901596{
    15911597    const bool inputIsUTC = true;
    1592     return setNewValueFromTimeArgs(exec, thisObj, args, 3, inputIsUTC);
    1593 }
    1594 
    1595 JSValue* dateProtoFuncSetHours(ExecState* exec, JSObject* thisObj, const ArgList& args)
     1598    return setNewValueFromTimeArgs(exec, thisValue, args, 3, inputIsUTC);
     1599}
     1600
     1601JSValue* dateProtoFuncSetHours(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
    15961602{
    15971603    const bool inputIsUTC = false;
    1598     return setNewValueFromTimeArgs(exec, thisObj, args, 4, inputIsUTC);
    1599 }
    1600 
    1601 JSValue* dateProtoFuncSetUTCHours(ExecState* exec, JSObject* thisObj, const ArgList& args)
     1604    return setNewValueFromTimeArgs(exec, thisValue, args, 4, inputIsUTC);
     1605}
     1606
     1607JSValue* dateProtoFuncSetUTCHours(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
    16021608{
    16031609    const bool inputIsUTC = true;
    1604     return setNewValueFromTimeArgs(exec, thisObj, args, 4, inputIsUTC);
    1605 }
    1606 
    1607 JSValue* dateProtoFuncSetDate(ExecState* exec, JSObject* thisObj, const ArgList& args)
     1610    return setNewValueFromTimeArgs(exec, thisValue, args, 4, inputIsUTC);
     1611}
     1612
     1613JSValue* dateProtoFuncSetDate(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
    16081614{
    16091615    const bool inputIsUTC = false;
    1610     return setNewValueFromDateArgs(exec, thisObj, args, 1, inputIsUTC);
    1611 }
    1612 
    1613 JSValue* dateProtoFuncSetUTCDate(ExecState* exec, JSObject* thisObj, const ArgList& args)
     1616    return setNewValueFromDateArgs(exec, thisValue, args, 1, inputIsUTC);
     1617}
     1618
     1619JSValue* dateProtoFuncSetUTCDate(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
    16141620{
    16151621    const bool inputIsUTC = true;
    1616     return setNewValueFromDateArgs(exec, thisObj, args, 1, inputIsUTC);
    1617 }
    1618 
    1619 JSValue* dateProtoFuncSetMonth(ExecState* exec, JSObject* thisObj, const ArgList& args)
     1622    return setNewValueFromDateArgs(exec, thisValue, args, 1, inputIsUTC);
     1623}
     1624
     1625JSValue* dateProtoFuncSetMonth(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
    16201626{
    16211627    const bool inputIsUTC = false;
    1622     return setNewValueFromDateArgs(exec, thisObj, args, 2, inputIsUTC);
    1623 }
    1624 
    1625 JSValue* dateProtoFuncSetUTCMonth(ExecState* exec, JSObject* thisObj, const ArgList& args)
     1628    return setNewValueFromDateArgs(exec, thisValue, args, 2, inputIsUTC);
     1629}
     1630
     1631JSValue* dateProtoFuncSetUTCMonth(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
    16261632{
    16271633    const bool inputIsUTC = true;
    1628     return setNewValueFromDateArgs(exec, thisObj, args, 2, inputIsUTC);
    1629 }
    1630 
    1631 JSValue* dateProtoFuncSetFullYear(ExecState* exec, JSObject* thisObj, const ArgList& args)
     1634    return setNewValueFromDateArgs(exec, thisValue, args, 2, inputIsUTC);
     1635}
     1636
     1637JSValue* dateProtoFuncSetFullYear(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
    16321638{
    16331639    const bool inputIsUTC = false;
    1634     return setNewValueFromDateArgs(exec, thisObj, args, 3, inputIsUTC);
    1635 }
    1636 
    1637 JSValue* dateProtoFuncSetUTCFullYear(ExecState* exec, JSObject* thisObj, const ArgList& args)
     1640    return setNewValueFromDateArgs(exec, thisValue, args, 3, inputIsUTC);
     1641}
     1642
     1643JSValue* dateProtoFuncSetUTCFullYear(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
    16381644{
    16391645    const bool inputIsUTC = true;
    1640     return setNewValueFromDateArgs(exec, thisObj, args, 3, inputIsUTC);
    1641 }
    1642 
    1643 JSValue* dateProtoFuncSetYear(ExecState* exec, JSObject* thisObj, const ArgList& args)
    1644 {
    1645     if (!thisObj->inherits(&DateInstance::info))
     1646    return setNewValueFromDateArgs(exec, thisValue, args, 3, inputIsUTC);
     1647}
     1648
     1649JSValue* dateProtoFuncSetYear(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
     1650{
     1651    if (!thisValue->isObject(&DateInstance::info))
    16461652        return throwError(exec, TypeError);
    16471653
    16481654    const bool utc = false;
    16491655
    1650     DateInstance* thisDateObj = static_cast<DateInstance*>(thisObj);     
     1656    DateInstance* thisDateObj = static_cast<DateInstance*>(thisValue);     
    16511657    if (args.isEmpty()) {
    16521658        JSValue* result = jsNaN(exec);
     
    16551661    }
    16561662   
    1657     JSValue* v = thisDateObj->internalValue();
    1658     double milli = v->toNumber(exec);
     1663    double milli = thisDateObj->internalNumber();
    16591664    double ms = 0;
    16601665
     
    16841689}
    16851690
    1686 JSValue* dateProtoFuncGetYear(ExecState* exec, JSObject* thisObj, const ArgList&)
    1687 {
    1688     if (!thisObj->inherits(&DateInstance::info))
     1691JSValue* dateProtoFuncGetYear(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
     1692{
     1693    if (!thisValue->isObject(&DateInstance::info))
    16891694        return throwError(exec, TypeError);
    16901695
    16911696    const bool utc = false;
    16921697
    1693     DateInstance* thisDateObj = static_cast<DateInstance*>(thisObj);
    1694     JSValue* v = thisDateObj->internalValue();
    1695     double milli = v->toNumber(exec);
     1698    DateInstance* thisDateObj = static_cast<DateInstance*>(thisValue);
     1699    double milli = thisDateObj->internalNumber();
    16961700    if (isnan(milli))
    16971701        return jsNaN(exec);
Note: See TracChangeset for help on using the changeset viewer.