Some JSValue cleanup
https://bugs.webkit.org/show_bug.cgi?id=69320
../JavaScriptCore:
Reviewed by Darin Adler.
No measurable performance change.
Removed some JSValue::get* functions. get* used to be an optimization
when every value operation was a virtual function call: get* would combine
two virtual calls into one. Now, with non-virtual, inlined functions, get*
isn't faster, and may be slightly slower.
Merged getBoolean(bool&) and getBoolean() into asBoolean().
Merged uncheckedGetNumber(), getJSNumber() and getNumber() into
asNumber().
- runtime/JSValue.h:
- runtime/JSValueInlineMethods.h:
(JSC::JSValue::asNumber):
(JSC::JSValue::asBoolean): As promised!
- runtime/NumberPrototype.cpp:
(JSC::toThisNumber):
(JSC::numberProtoFuncToExponential):
(JSC::numberProtoFuncToFixed):
(JSC::numberProtoFuncToPrecision):
(JSC::numberProtoFuncToString):
(JSC::numberProtoFuncToLocaleString):
(JSC::numberProtoFuncValueOf): Removed a bunch of uses of getJSNumber()
by switching to toThisNumber().
- API/JSCallbackObjectFunctions.h:
(JSC::::toNumber):
(JSC::DFG::Graph::valueOfNumberConstant):
(JSC::DFG::Graph::valueOfBooleanConstant):
(JSC::DFG::putByVal):
- interpreter/Interpreter.cpp:
(JSC::Interpreter::privateExecute):
(JSC::DEFINE_STUB_FUNCTION):
(JSC::DateInstance::internalNumber):
- runtime/FunctionPrototype.cpp:
(JSC::functionProtoFuncBind):
(JSC::compareNumbersForQSort): Replaced getNumber() => isNumber() / asNumber().
getBoolean() => isBoolean() / asBoolean(), uncheckedGetNumber() => asNumber().
- runtime/JSCell.cpp:
- runtime/JSCell.h: Nixed getJSNumber().
- runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncParseInt):
(JSC::gap):
(JSC::Stringifier::Stringifier):
(JSC::Stringifier::appendStringifiedValue):
- runtime/NumberObject.cpp:
- runtime/NumberObject.h:
(JSC::NumberObject::createStructure):
(JSC::JSValue::equalSlowCaseInline):
(JSC::JSValue::strictEqual):
(JSC::jsLess):
(JSC::jsLessEq):
(JSC::jsAdd): Replaced getNumber() => isNumber() / asNumber().
getBoolean() => isBoolean() / asBoolean(), uncheckedGetNumber() => asNumber().
../WebCore:
Reviewed by Darin Adler.
- bindings/js/JSDOMBinding.cpp:
(WebCore::valueToDate):
- bindings/js/JSErrorHandler.cpp:
(WebCore::JSErrorHandler::handleEvent):
- bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::handleEvent):
- bindings/js/JSSQLTransactionCustom.cpp:
(WebCore::JSSQLTransaction::executeSql):
- bindings/js/JSSQLTransactionSyncCustom.cpp:
(WebCore::JSSQLTransactionSync::executeSql):
- bindings/js/ScriptValue.cpp:
(WebCore::jsToInspectorValue):
- bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::dumpIfTerminal):
- bindings/objc/WebScriptObject.mm:
(+[WebScriptObject _convertValueToObjcValue:originRootObject:rootObject:]):
- bridge/jni/jsc/JNIUtilityPrivate.cpp:
(JSC::Bindings::convertValueToJValue): Updated for JSC changes.
../WebKit/mac:
Reviewed by Darin Adler.
(aeDescFromJSValue): Updated for JSC changes.