Ignore:
Timestamp:
Oct 4, 2011, 7:38:49 PM (14 years ago)
Author:
[email protected]
Message:

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):

  • dfg/DFGGraph.h:

(JSC::DFG::Graph::valueOfNumberConstant):
(JSC::DFG::Graph::valueOfBooleanConstant):

  • dfg/DFGOperations.cpp:

(JSC::DFG::putByVal):

  • interpreter/Interpreter.cpp:

(JSC::Interpreter::privateExecute):

  • jit/JITStubs.cpp:

(JSC::DEFINE_STUB_FUNCTION):

  • runtime/DateInstance.h:

(JSC::DateInstance::internalNumber):

  • runtime/FunctionPrototype.cpp:

(JSC::functionProtoFuncBind):

  • runtime/JSArray.cpp:

(JSC::compareNumbersForQSort): Replaced getNumber() => isNumber() / asNumber().
getBoolean() => isBoolean() / asBoolean(), uncheckedGetNumber() => asNumber().

  • runtime/JSCell.cpp:
  • runtime/JSCell.h: Nixed getJSNumber().
  • runtime/JSGlobalObjectFunctions.cpp:

(JSC::globalFuncParseInt):

  • runtime/JSONObject.cpp:

(JSC::gap):
(JSC::Stringifier::Stringifier):
(JSC::Stringifier::appendStringifiedValue):

  • runtime/NumberObject.cpp:
  • runtime/NumberObject.h:

(JSC::NumberObject::createStructure):

  • runtime/Operations.h:

(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.

  • WebView/WebView.mm:

(aeDescFromJSValue): Updated for JSC changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSCell.h

    r96381 r96673  
    9797
    9898        virtual JSObject* toThisObject(ExecState*) const;
    99         JSValue getJSNumber() const;
    10099
    101100        void* vptr() const { ASSERT(!isZapped()); return *reinterpret_cast<void* const*>(this); }
     
    303302    }
    304303
    305     inline JSValue JSValue::getJSNumber() const
    306     {
    307         if (isInt32() || isDouble())
    308             return *this;
    309         if (isCell())
    310             return asCell()->getJSNumber();
    311         return JSValue();
    312     }
    313 
    314304    inline JSObject* JSValue::toObject(ExecState* exec) const
    315305    {
Note: See TracChangeset for help on using the changeset viewer.