1. 05 Nov, 2012 1 commit
    • fpizlo@apple.com's avatar
      Reduce the verbosity of referring to QNaN in JavaScriptCore · 3494d02f
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=101174
      
      Reviewed by Geoffrey Garen.
      
      Introduces a #define QNaN in JSValue.h, and replaces all previous uses of
      std::numeric_limits<double>::quiet_NaN() with QNaN.
      
      * API/JSValueRef.cpp:
      (JSValueMakeNumber):
      (JSValueToNumber):
      * dfg/DFGSpeculativeJIT.cpp:
      (JSC::DFG::SpeculativeJIT::compileGetByValOnFloatTypedArray):
      * jit/JITPropertyAccess.cpp:
      (JSC::JIT::emitFloatTypedArrayGetByVal):
      * runtime/CachedTranscendentalFunction.h:
      (JSC::CachedTranscendentalFunction::initialize):
      * runtime/DateConstructor.cpp:
      (JSC::constructDate):
      * runtime/DateInstanceCache.h:
      (JSC::DateInstanceData::DateInstanceData):
      (JSC::DateInstanceCache::reset):
      * runtime/ExceptionHelpers.cpp:
      (JSC::InterruptedExecutionError::defaultValue):
      (JSC::TerminatedExecutionError::defaultValue):
      * runtime/JSCell.h:
      (JSC::JSValue::getPrimitiveNumber):
      * runtime/JSDateMath.cpp:
      (JSC::parseDateFromNullTerminatedCharacters):
      * runtime/JSGlobalData.cpp:
      (JSC::JSGlobalData::JSGlobalData):
      (JSC::JSGlobalData::resetDateCache):
      * runtime/JSGlobalObjectFunctions.cpp:
      (JSC::parseInt):
      (JSC::jsStrDecimalLiteral):
      (JSC::toDouble):
      (JSC::jsToNumber):
      (JSC::parseFloat):
      * runtime/JSValue.cpp:
      (JSC::JSValue::toNumberSlowCase):
      * runtime/JSValue.h:
      (JSC):
      * runtime/JSValueInlineMethods.h:
      (JSC::jsNaN):
      * runtime/MathObject.cpp:
      (JSC::mathProtoFuncMax):
      (JSC::mathProtoFuncMin):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133493 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3494d02f
  2. 10 Jun, 2011 1 commit
    • barraclough@apple.com's avatar
      https://bugs.webkit.org/show_bug.cgi?id=16777 · f1fa579d
      barraclough@apple.com authored
      Eliminate JSC::NaN and JSC::Inf
      
      Reviewed by Sam Weinig.
      
      There's no good reason for -K-J-S- JSC to have its own NAN and infinity constants.
      The ones in std::numeric_limits are perfectly good.
      Remove JSC::Inf, JSC::NaN, switch some cases of (isnan || isinf) to !isfinite.
      
      Source/JavaScriptCore: 
      
      * API/JSCallbackObjectFunctions.h:
      (JSC::::toNumber):
      * API/JSValueRef.cpp:
      (JSValueMakeNumber):
      (JSValueToNumber):
      * JavaScriptCore.exp:
      * runtime/CachedTranscendentalFunction.h:
      (JSC::CachedTranscendentalFunction::initialize):
      * runtime/DateConstructor.cpp:
      (JSC::constructDate):
      * runtime/DateInstanceCache.h:
      (JSC::DateInstanceData::DateInstanceData):
      (JSC::DateInstanceCache::reset):
      * runtime/JSCell.cpp:
      * runtime/JSCell.h:
      (JSC::JSCell::JSValue::getPrimitiveNumber):
      (JSC::JSCell::JSValue::toNumber):
      * runtime/JSGlobalData.cpp:
      (JSC::JSGlobalData::JSGlobalData):
      (JSC::JSGlobalData::resetDateCache):
      * runtime/JSGlobalObject.cpp:
      (JSC::JSGlobalObject::reset):
      * runtime/JSGlobalObjectFunctions.cpp:
      (JSC::globalFuncParseInt):
      (JSC::globalFuncIsFinite):
      * runtime/JSNotAnObject.cpp:
      (JSC::JSNotAnObject::toNumber):
      * runtime/JSValue.cpp:
      * runtime/JSValue.h:
      * runtime/JSValueInlineMethods.h:
      (JSC::jsNaN):
      * runtime/MathObject.cpp:
      (JSC::mathProtoFuncMax):
      (JSC::mathProtoFuncMin):
      * runtime/NumberConstructor.cpp:
      (JSC::numberConstructorNegInfinity):
      (JSC::numberConstructorPosInfinity):
      * runtime/NumberPrototype.cpp:
      (JSC::numberProtoFuncToExponential):
      (JSC::numberProtoFuncToFixed):
      (JSC::numberProtoFuncToPrecision):
      (JSC::numberProtoFuncToString):
      * runtime/UString.cpp:
      * wtf/DecimalNumber.h:
      (WTF::DecimalNumber::DecimalNumber):
      * wtf/dtoa.cpp:
      (WTF::dtoa):
      
      Source/WebCore: 
      
      * bindings/js/JSDataViewCustom.cpp:
      (WebCore::getDataViewMember):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@88587 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f1fa579d
  3. 01 Jan, 2011 1 commit
    • abarth@webkit.org's avatar
      Move JavaScriptCore to Source · 76da8fc1
      abarth@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=51604
      
      Reviewed by Eric Seidel.
      
      Update references to JavaScriptCore to point to the new location.
      
      * Android.mk:
      * CMakeLists.txt:
      * DerivedSources.pro:
      * GNUmakefile.am:
      * Makefile:
      * WebKit.pri:
      * WebKit.pro:
      * wscript:
      
      Tools: 
      
      Update references to JavaScriptCore to point to the new location.
      
      * BuildSlaveSupport/build.webkit.org-config/master.cfg:
      * DumpRenderTree/qt/DumpRenderTree.pro:
      * DumpRenderTree/qt/ImageDiff.pro:
      * DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro:
      * DumpRenderTree/wscript:
      * Scripts/build-jsc:
      * Scripts/build-webkit:
      * Scripts/do-file-rename:
      * Scripts/do-webcore-rename:
      * Scripts/run-javascriptcore-tests:
      * Scripts/update-javascriptcore-test-results:
      * Scripts/webkitdirs.pm:
      * Scripts/webkitpy/common/config/build_unittest.py:
      * Scripts/webkitpy/style/checker.py:
      * Scripts/webkitpy/style/checker_unittest.py:
      * Scripts/webkitpy/style/checkers/cpp_unittest.py:
      * WebKitTestRunner/InjectedBundle/qt/InjectedBundle.pro:
      * WebKitTestRunner/qt/WebKitTestRunner.pro:
      * wx/build/settings.py:
      
      WebCore: 
      
      Update references to JavaScriptCore.
      
      * Android.derived.jscbindings.mk:
      * Android.v8bindings.mk:
      * CMakeLists.txt:
      * WebCore.gyp/WebCore.gyp:
      * WebCore.pro:
        - These changes are subtle and might not be 100% correct.
      * move-js-headers.sh:
      
      WebKit/chromium: 
      
      * WebKit.gyp:
        - Point to JavaScriptCore in its new location.
      
      WebKit/gtk: 
      
      * GNUmakefile.am:
      * docs/GNUmakefile.am:
        - Point to JavaScriptCore in its new location.
      
      WebKit/qt: 
      
      * WebKit_pch.h:
      * docs/qtwebkit.qdocconf:
        - Point to JavaScriptCore in its new location.
      
      WebKit/win: 
      
      * WebKit.vcproj/WebKit.sln:
        - Point to JavaScriptCore in its new location.
      
      WebKit/wx: 
      
      * bindings/python/wscript:
      * wscript:
        - Point to JavaScriptCore in its new location.
      
      WebKit2: 
      
      * WebKit2.pro:
        - Point to JavaScriptCore in its new location.
      
      Websites/bugs.webkit.org: 
      
      * PrettyPatch/PrettyPatch.rb:
        - Remove reference to JavaScriptCore as a source directory.
      
      Websites/webkit.org: 
      
      * coding/assertion-guidelines.html:
        - Update documentation to point to the new location of
          JavaScriptCore.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74855 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      76da8fc1
  4. 25 Oct, 2010 1 commit
    • oliver@apple.com's avatar
      2010-10-25 Oliver Hunt <oliver@apple.com> · 5b67d9e4
      oliver@apple.com authored
              Reviewed by Gavin Barraclough.
      
              Remove exec and globalData arguments from jsNumber
              https://bugs.webkit.org/show_bug.cgi?id=48270
      
              Remove the now unused exec and globalData arguments from jsNumber
              and mechanically update all users of jsNumber.
      
              * API/JSValueRef.cpp:
              (JSValueMakeNumber):
              * bytecompiler/BytecodeGenerator.cpp:
              (JSC::BytecodeGenerator::emitLoad):
              * bytecompiler/NodesCodegen.cpp:
              (JSC::ArrayNode::emitBytecode):
              * jit/JITArithmetic.cpp:
              (JSC::JIT::emit_op_mod):
              * jit/JITArithmetic32_64.cpp:
              (JSC::JIT::emit_op_mod):
              * jit/JITOpcodes.cpp:
              (JSC::JIT::emit_op_jfalse):
              (JSC::JIT::emit_op_jtrue):
              * jit/JITStubs.cpp:
              (JSC::DEFINE_STUB_FUNCTION):
              * jsc.cpp:
              (functionRun):
              * runtime/Arguments.cpp:
              (JSC::Arguments::getOwnPropertySlot):
              (JSC::Arguments::getOwnPropertyDescriptor):
              * runtime/ArrayConstructor.cpp:
              (JSC::ArrayConstructor::ArrayConstructor):
              * runtime/ArrayPrototype.cpp:
              (JSC::arrayProtoFuncPop):
              (JSC::arrayProtoFuncPush):
              (JSC::arrayProtoFuncShift):
              (JSC::arrayProtoFuncSplice):
              (JSC::arrayProtoFuncUnShift):
              (JSC::arrayProtoFuncFilter):
              (JSC::arrayProtoFuncMap):
              (JSC::arrayProtoFuncEvery):
              (JSC::arrayProtoFuncForEach):
              (JSC::arrayProtoFuncSome):
              (JSC::arrayProtoFuncReduce):
              (JSC::arrayProtoFuncReduceRight):
              (JSC::arrayProtoFuncIndexOf):
              (JSC::arrayProtoFuncLastIndexOf):
              * runtime/BooleanConstructor.cpp:
              (JSC::BooleanConstructor::BooleanConstructor):
              * runtime/CachedTranscendentalFunction.h:
              (JSC::CachedTranscendentalFunction::operator()):
              * runtime/DateConstructor.cpp:
              (JSC::DateConstructor::DateConstructor):
              (JSC::dateParse):
              (JSC::dateNow):
              (JSC::dateUTC):
              * runtime/DateInstance.cpp:
              (JSC::DateInstance::DateInstance):
              * runtime/DatePrototype.cpp:
              (JSC::dateProtoFuncGetFullYear):
              (JSC::dateProtoFuncGetUTCFullYear):
              (JSC::dateProtoFuncGetMonth):
              (JSC::dateProtoFuncGetUTCMonth):
              (JSC::dateProtoFuncGetDate):
              (JSC::dateProtoFuncGetUTCDate):
              (JSC::dateProtoFuncGetDay):
              (JSC::dateProtoFuncGetUTCDay):
              (JSC::dateProtoFuncGetHours):
              (JSC::dateProtoFuncGetUTCHours):
              (JSC::dateProtoFuncGetMinutes):
              (JSC::dateProtoFuncGetUTCMinutes):
              (JSC::dateProtoFuncGetSeconds):
              (JSC::dateProtoFuncGetUTCSeconds):
              (JSC::dateProtoFuncGetMilliSeconds):
              (JSC::dateProtoFuncGetUTCMilliseconds):
              (JSC::dateProtoFuncGetTimezoneOffset):
              (JSC::dateProtoFuncSetTime):
              (JSC::setNewValueFromTimeArgs):
              (JSC::setNewValueFromDateArgs):
              (JSC::dateProtoFuncSetYear):
              (JSC::dateProtoFuncGetYear):
              * runtime/Error.cpp:
              (JSC::addErrorSourceInfo):
              (JSC::addErrorDivotInfo):
              * runtime/ErrorConstructor.cpp:
              (JSC::ErrorConstructor::ErrorConstructor):
              * runtime/FunctionConstructor.cpp:
              (JSC::FunctionConstructor::FunctionConstructor):
              * runtime/FunctionPrototype.cpp:
              (JSC::FunctionPrototype::FunctionPrototype):
              * runtime/JSArray.cpp:
              (JSC::JSArray::getOwnPropertySlot):
              (JSC::JSArray::getOwnPropertyDescriptor):
              * runtime/JSByteArray.cpp:
              (JSC::JSByteArray::JSByteArray):
              * runtime/JSByteArray.h:
              (JSC::JSByteArray::getIndex):
              * runtime/JSFunction.cpp:
              (JSC::JSFunction::JSFunction):
              (JSC::JSFunction::lengthGetter):
              (JSC::JSFunction::getOwnPropertyDescriptor):
              * runtime/JSGlobalObject.cpp:
              (JSC::JSGlobalObject::reset):
              * runtime/JSGlobalObjectFunctions.cpp:
              (JSC::globalFuncParseInt):
              (JSC::globalFuncParseFloat):
              * runtime/JSNumberCell.h:
              (JSC::JSValue::JSValue):
              (JSC::jsNaN):
              (JSC::JSValue::toJSNumber):
              * runtime/JSONObject.cpp:
              (JSC::unwrapBoxedPrimitive):
              (JSC::PropertyNameForFunctionCall::value):
              (JSC::JSONStringify):
              * runtime/JSString.cpp:
              (JSC::JSString::getStringPropertyDescriptor):
              * runtime/JSString.h:
              (JSC::JSString::getStringPropertySlot):
              * runtime/JSValue.h:
              (JSC::jsDoubleNumber):
              (JSC::jsNumber):
              (JSC::jsNaN):
              (JSC::JSValue::JSValue):
              (JSC::JSValue::toJSNumber):
              * runtime/LiteralParser.cpp:
              (JSC::LiteralParser::parse):
              * runtime/MathObject.cpp:
              (JSC::MathObject::MathObject):
              (JSC::mathProtoFuncAbs):
              (JSC::mathProtoFuncACos):
              (JSC::mathProtoFuncASin):
              (JSC::mathProtoFuncATan):
              (JSC::mathProtoFuncATan2):
              (JSC::mathProtoFuncCeil):
              (JSC::mathProtoFuncCos):
              (JSC::mathProtoFuncExp):
              (JSC::mathProtoFuncFloor):
              (JSC::mathProtoFuncLog):
              (JSC::mathProtoFuncMax):
              (JSC::mathProtoFuncMin):
              (JSC::mathProtoFuncPow):
              (JSC::mathProtoFuncRandom):
              (JSC::mathProtoFuncRound):
              (JSC::mathProtoFuncSin):
              (JSC::mathProtoFuncSqrt):
              (JSC::mathProtoFuncTan):
              * runtime/NativeErrorConstructor.cpp:
              (JSC::NativeErrorConstructor::NativeErrorConstructor):
              * runtime/NumberConstructor.cpp:
              (JSC::NumberConstructor::NumberConstructor):
              (JSC::numberConstructorNaNValue):
              (JSC::numberConstructorNegInfinity):
              (JSC::numberConstructorPosInfinity):
              (JSC::numberConstructorMaxValue):
              (JSC::numberConstructorMinValue):
              (JSC::constructWithNumberConstructor):
              (JSC::callNumberConstructor):
              * runtime/NumberPrototype.cpp:
              (JSC::NumberPrototype::NumberPrototype):
              * runtime/ObjectConstructor.cpp:
              (JSC::ObjectConstructor::ObjectConstructor):
              * runtime/Operations.cpp:
              (JSC::jsAddSlowCase):
              * runtime/Operations.h:
              (JSC::jsAdd):
              * runtime/PrototypeFunction.cpp:
              (JSC::PrototypeFunction::PrototypeFunction):
              * runtime/RegExpConstructor.cpp:
              (JSC::RegExpConstructor::RegExpConstructor):
              (JSC::RegExpMatchesArray::fillArrayInstance):
              * runtime/RegExpObject.cpp:
              (JSC::regExpObjectLastIndex):
              * runtime/StringConstructor.cpp:
              (JSC::StringConstructor::StringConstructor):
              * runtime/StringPrototype.cpp:
              (JSC::StringPrototype::StringPrototype):
              (JSC::stringProtoFuncReplace):
              (JSC::stringProtoFuncCharCodeAt):
              (JSC::stringProtoFuncIndexOf):
              (JSC::stringProtoFuncLastIndexOf):
              (JSC::stringProtoFuncSearch):
              (JSC::stringProtoFuncLocaleCompare):
      2010-10-25  Oliver Hunt  <oliver@apple.com>
      
              Reviewed by Gavin Barraclough.
      
              Remove exec and globalData arguments from jsNumber
              https://bugs.webkit.org/show_bug.cgi?id=48270
      
              Don't pass exec to jsNumber
      
              * JSUtils.cpp:
              (JSObjectKJSValue):
              * UserObjectImp.cpp:
              (UserObjectImp::toPrimitive):
      2010-10-25  Oliver Hunt  <oliver@apple.com>
      
              Reviewed by Gavin Barraclough.
      
              Remove exec and globalData arguments from jsNumber
              https://bugs.webkit.org/show_bug.cgi?id=48270
      
              Mechanical removal of exec parameter to jsNumber.
      
              * bindings/js/JSAudioConstructor.cpp:
              (WebCore::JSAudioConstructor::JSAudioConstructor):
              * bindings/js/JSCSSStyleDeclarationCustom.cpp:
              (WebCore::JSCSSStyleDeclaration::nameGetter):
              * bindings/js/JSCoordinatesCustom.cpp:
              (WebCore::JSCoordinates::altitude):
              (WebCore::JSCoordinates::altitudeAccuracy):
              (WebCore::JSCoordinates::heading):
              (WebCore::JSCoordinates::speed):
              * bindings/js/JSDOMWindowCustom.cpp:
              (WebCore::JSDOMWindow::setTimeout):
              (WebCore::JSDOMWindow::setInterval):
              * bindings/js/JSDeviceMotionEventCustom.cpp:
              (WebCore::createAccelerationObject):
              (WebCore::createRotationRateObject):
              (WebCore::JSDeviceMotionEvent::interval):
              * bindings/js/JSDeviceOrientationEventCustom.cpp:
              (WebCore::JSDeviceOrientationEvent::alpha):
              (WebCore::JSDeviceOrientationEvent::beta):
              (WebCore::JSDeviceOrientationEvent::gamma):
              * bindings/js/JSGeolocationCustom.cpp:
              (WebCore::JSGeolocation::watchPosition):
              * bindings/js/JSHTMLInputElementCustom.cpp:
              (WebCore::JSHTMLInputElement::selectionStart):
              (WebCore::JSHTMLInputElement::selectionEnd):
              * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
              (WebCore::JSHTMLOptionsCollection::length):
              * bindings/js/JSIDBKeyCustom.cpp:
              (WebCore::toJS):
              * bindings/js/JSInjectedScriptHostCustom.cpp:
              (WebCore::InjectedScriptHost::createInjectedScript):
              (WebCore::JSInjectedScriptHost::pushNodePathToFrontend):
              * bindings/js/JSOptionConstructor.cpp:
              (WebCore::JSOptionConstructor::JSOptionConstructor):
              * bindings/js/JSSQLResultSetRowListCustom.cpp:
              (WebCore::JSSQLResultSetRowList::item):
              * bindings/js/JSSVGLengthCustom.cpp:
              (WebCore::JSSVGLength::value):
              * bindings/js/JSScriptProfileNodeCustom.cpp:
              (WebCore::JSScriptProfileNode::callUID):
              * bindings/js/JSWebGLRenderingContextCustom.cpp:
              (WebCore::toJS):
              * bindings/js/JSWorkerContextCustom.cpp:
              (WebCore::JSWorkerContext::setTimeout):
              (WebCore::JSWorkerContext::setInterval):
              * bindings/js/JSWorkerContextErrorHandler.cpp:
              (WebCore::JSWorkerContextErrorHandler::handleEvent):
              * bindings/js/ScriptFunctionCall.cpp:
              (WebCore::ScriptCallArgumentHandler::appendArgument):
              * bindings/js/SerializedScriptValue.cpp:
              (WebCore::CloneDeserializer::readTerminal):
              * bindings/scripts/CodeGeneratorJS.pm:
              * bridge/c/c_instance.cpp:
              (JSC::Bindings::CInstance::numberValue):
              * bridge/c/c_utility.cpp:
              (JSC::Bindings::convertNPVariantToValue):
              * bridge/jni/jsc/JNIBridgeJSC.cpp:
              (JavaField::valueFromInstance):
              (JavaArray::valueAt):
              * bridge/jni/jsc/JavaInstanceJSC.cpp:
              (JavaInstance::numberValue):
              (JavaInstance::invokeMethod):
              * bridge/objc/objc_instance.mm:
              (ObjcInstance::numberValue):
              * bridge/objc/objc_utility.mm:
              (JSC::Bindings::convertObjcValueToValue):
              * bridge/runtime_array.cpp:
              (JSC::RuntimeArray::lengthGetter):
              * bridge/runtime_method.cpp:
              (JSC::RuntimeMethod::lengthGetter):
      2010-10-25  Oliver Hunt  <oliver@apple.com>
      
              Reviewed by Gavin Barraclough.
      
              Remove exec and globalData arguments from jsNumber
              https://bugs.webkit.org/show_bug.cgi?id=48270
      
              Mechanical removal of exec parameter to jsNumber
      
              * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
              (WebKit::NetscapePluginInstanceProxy::demarshalValueFromArray):
              * Plugins/Hosted/ProxyInstance.mm:
              (WebKit::ProxyInstance::numberValue):
      2010-10-25  Oliver Hunt  <oliver@apple.com>
      
              Reviewed by Gavin Barraclough.
      
              Remove exec and globalData arguments from jsNumber
              https://bugs.webkit.org/show_bug.cgi?id=48270
      
              Mechanical removal of exec parameter to jsNumber
      
              * WebProcess/Plugins/NPRuntimeObjectMap.cpp:
              (WebKit::NPRuntimeObjectMap::convertNPVariantToJSValue):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70496 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5b67d9e4
  5. 06 May, 2010 1 commit
    • barraclough@apple.com's avatar
      Bug 38714 - Add result caching for Math.sin · b65f042b
      barraclough@apple.com authored
      Reviewed by Geoff Garen.
      
      Math.sin is frequently called with the same operand, caching the result should
      improve performance.  CachedTranscendentalFunction adds a generic mechanism to
      cache results for pure functions with the signature "double func(double)", and
      where NaN maps to NaN.
      
      CachedTranscendentalFunction uses a very simple hash function designed to be
      fast to execute since we cannot cache the result, and trivial to JIT generate,
      should we wish to do so.
      
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * runtime/CachedTranscendentalFunction.h: Added.
      (JSC::CachedTranscendentalFunction::CachedTranscendentalFunction):
      (JSC::CachedTranscendentalFunction::~CachedTranscendentalFunction):
      (JSC::CachedTranscendentalFunction::operator()):
      (JSC::CachedTranscendentalFunction::initialize):
      (JSC::CachedTranscendentalFunction::hash):
      * runtime/JSGlobalData.h:
      * runtime/MathObject.cpp:
      (JSC::mathProtoFuncSin):
      * wtf/Platform.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@58935 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b65f042b