Changeset 43153 in webkit for trunk/JavaScriptCore/jit


Ignore:
Timestamp:
May 2, 2009, 6:58:45 PM (16 years ago)
Author:
[email protected]
Message:

JavaScriptCore:

2009-05-02 Geoffrey Garen <[email protected]>

Reviewed by Sam Weinig.

Simplified null-ish JSValues.


Replaced calls to noValue() with calls to JSValue() (which is what
noValue() returned). Removed noValue().


Replaced almost all uses of jsImpossibleValue() with uses of JSValue().
Its one remaining use is for construction of hash table deleted values.
For that specific task, I made a new, private constructor with a special
tag. Removed jsImpossibleValue().


Removed "JSValue()" initialiazers, since default construction happens...
by default.

  • API/JSCallbackObjectFunctions.h: (JSC::::call):
  • bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::emitLoad):
  • bytecompiler/BytecodeGenerator.h:
  • debugger/DebuggerCallFrame.cpp: (JSC::DebuggerCallFrame::evaluate):
  • debugger/DebuggerCallFrame.h: (JSC::DebuggerCallFrame::DebuggerCallFrame):
  • interpreter/CallFrame.h: (JSC::ExecState::clearException):
  • interpreter/Interpreter.cpp: (JSC::Interpreter::privateExecute): (JSC::Interpreter::retrieveLastCaller):
  • interpreter/Register.h: (JSC::Register::Register):
  • jit/JITCall.cpp: (JSC::JIT::unlinkCall): (JSC::JIT::compileOpCallInitializeCallFrame): (JSC::JIT::compileOpCall):
  • jit/JITStubs.cpp: (JSC::JITStubs::cti_op_call_eval): (JSC::JITStubs::cti_vm_throw):
  • profiler/Profiler.cpp: (JSC::Profiler::willExecute): (JSC::Profiler::didExecute):
  • runtime/ArrayPrototype.cpp: (JSC::getProperty):
  • runtime/Completion.cpp: (JSC::evaluate):
  • runtime/Completion.h: (JSC::Completion::Completion):
  • runtime/GetterSetter.cpp: (JSC::GetterSetter::getPrimitiveNumber):
  • runtime/JSArray.cpp: (JSC::JSArray::putSlowCase): (JSC::JSArray::deleteProperty): (JSC::JSArray::increaseVectorLength): (JSC::JSArray::setLength): (JSC::JSArray::pop): (JSC::JSArray::sort): (JSC::JSArray::compactForSorting):
  • runtime/JSCell.cpp: (JSC::JSCell::getJSNumber):
  • runtime/JSCell.h: (JSC::JSValue::getJSNumber):
  • runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData):
  • runtime/JSImmediate.h: (JSC::JSImmediate::fromNumberOutsideIntegerRange): (JSC::JSImmediate::from):
  • runtime/JSNumberCell.cpp: (JSC::jsNumberCell):
  • runtime/JSObject.cpp: (JSC::callDefaultValueFunction):
  • runtime/JSObject.h: (JSC::JSObject::getDirect):
  • runtime/JSPropertyNameIterator.cpp: (JSC::JSPropertyNameIterator::toPrimitive):
  • runtime/JSPropertyNameIterator.h: (JSC::JSPropertyNameIterator::next):
  • runtime/JSValue.h: (JSC::JSValue::): (JSC::JSValueHashTraits::constructDeletedValue): (JSC::JSValueHashTraits::isDeletedValue): (JSC::JSValue::JSValue):
  • runtime/JSWrapperObject.h: (JSC::JSWrapperObject::JSWrapperObject):
  • runtime/Operations.h: (JSC::resolveBase):
  • runtime/PropertySlot.h: (JSC::PropertySlot::clearBase): (JSC::PropertySlot::clearValue):

WebCore:

2009-05-02 Geoffrey Garen <[email protected]>

Reviewed by Sam Weinig.

Simplified null-ish JSValues.


Replaced calls to noValue() with calls to JSValue() (which is what
noValue() returned). Removed noValue().


Removed "JSValue()" initialiazers, since default construction happens...
by default.

  • bindings/js/JSDOMBinding.cpp: (WebCore::setDOMException):
  • bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::open): (WebCore::JSDOMWindow::showModalDialog):
  • bindings/js/JSEventListener.cpp: (WebCore::JSEventListener::handleEvent):
  • bindings/js/JSJavaScriptCallFrameCustom.cpp: (WebCore::JSJavaScriptCallFrame::evaluate):
  • bindings/js/JSSQLResultSetRowListCustom.cpp: (WebCore::JSSQLResultSetRowList::item):
  • bindings/js/ScriptController.cpp: (WebCore::ScriptController::evaluate):
  • bindings/js/ScriptValue.h: (WebCore::ScriptValue::ScriptValue): (WebCore::ScriptValue::hasNoValue):
  • bindings/js/WorkerScriptController.cpp: (WebCore::WorkerScriptController::evaluate):
  • bridge/jni/jni_instance.cpp: (JavaInstance::invokeMethod):
  • bridge/jni/jni_runtime.cpp: (JavaField::dispatchValueFromInstance): (JavaField::dispatchSetValueToInstance):
  • bridge/runtime.h: (JSC::Bindings::Instance::invokeConstruct):

WebKit/mac:

2009-05-02 Geoffrey Garen <[email protected]>

Reviewed by Sam Weinig.

Simplified null-ish JSValues.


Replaced calls to noValue() with calls to JSValue() (which is what
noValue() returned). Removed noValue().


Removed "JSValue()" initialiazers, since default construction happens...
by default.

  • WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFrame evaluateWebScript:]):
Location:
trunk/JavaScriptCore/jit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/jit/JITCall.cpp

    r43122 r43153  
    5050    // (and, if a new JSFunction happened to be constructed at the same location, we could get a false positive
    5151    // match).  Reset the check so it no longer matches.
    52     callLinkInfo->hotPathBegin.repatch(JSValue::encode(jsImpossibleValue()));
     52    callLinkInfo->hotPathBegin.repatch(JSValue::encode(JSValue()));
    5353}
    5454
     
    7676    loadPtr(Address(regT2, FIELD_OFFSET(JSFunction, m_scopeChain) + FIELD_OFFSET(ScopeChain, m_node)), regT1); // newScopeChain
    7777
    78     storePtr(ImmPtr(JSValue::encode(noValue())), Address(callFrameRegister, RegisterFile::OptionalCalleeArguments * static_cast<int>(sizeof(Register))));
     78    storePtr(ImmPtr(JSValue::encode(JSValue())), Address(callFrameRegister, RegisterFile::OptionalCalleeArguments * static_cast<int>(sizeof(Register))));
    7979    storePtr(regT2, Address(callFrameRegister, RegisterFile::Callee * static_cast<int>(sizeof(Register))));
    8080    storePtr(regT1, Address(callFrameRegister, RegisterFile::ScopeChain * static_cast<int>(sizeof(Register))));
     
    145145
    146146        emitCTICall(JITStubs::cti_op_call_eval);
    147         wasEval = branchPtr(NotEqual, regT0, ImmPtr(JSValue::encode(jsImpossibleValue())));
     147        wasEval = branchPtr(NotEqual, regT0, ImmPtr(JSValue::encode(JSValue())));
    148148    }
    149149
     
    213213
    214214        emitCTICall(JITStubs::cti_op_call_eval);
    215         wasEval = branchPtr(NotEqual, regT0, ImmPtr(JSValue::encode(jsImpossibleValue())));
     215        wasEval = branchPtr(NotEqual, regT0, ImmPtr(JSValue::encode(JSValue())));
    216216    }
    217217
     
    220220    emitGetVirtualRegister(callee, regT2);
    221221    DataLabelPtr addressOfLinkedFunctionCheck;
    222     Jump jumpToSlow = branchPtrWithPatch(NotEqual, regT2, addressOfLinkedFunctionCheck, ImmPtr(JSValue::encode(jsImpossibleValue())));
     222    Jump jumpToSlow = branchPtrWithPatch(NotEqual, regT2, addressOfLinkedFunctionCheck, ImmPtr(JSValue::encode(JSValue())));
    223223    addSlowCase(jumpToSlow);
    224224    ASSERT(differenceBetween(addressOfLinkedFunctionCheck, jumpToSlow) == patchOffsetOpCallCompareToJump);
     
    241241    // Fast version of stack frame initialization, directly relative to edi.
    242242    // Note that this omits to set up RegisterFile::CodeBlock, which is set in the callee
    243     storePtr(ImmPtr(JSValue::encode(noValue())), Address(callFrameRegister, (registerOffset + RegisterFile::OptionalCalleeArguments) * static_cast<int>(sizeof(Register))));
     243    storePtr(ImmPtr(JSValue::encode(JSValue())), Address(callFrameRegister, (registerOffset + RegisterFile::OptionalCalleeArguments) * static_cast<int>(sizeof(Register))));
    244244    storePtr(regT2, Address(callFrameRegister, (registerOffset + RegisterFile::Callee) * static_cast<int>(sizeof(Register))));
    245245    loadPtr(Address(regT2, FIELD_OFFSET(JSFunction, m_scopeChain) + FIELD_OFFSET(ScopeChain, m_node)), regT1); // newScopeChain
  • trunk/JavaScriptCore/jit/JITStubs.cpp

    r43122 r43153  
    299299#define CHECK_FOR_EXCEPTION() \
    300300    do { \
    301         if (UNLIKELY(ARG_globalData->exception != noValue())) \
     301        if (UNLIKELY(ARG_globalData->exception != JSValue())) \
    302302            VM_THROW_EXCEPTION(); \
    303303    } while (0)
    304304#define CHECK_FOR_EXCEPTION_AT_END() \
    305305    do { \
    306         if (UNLIKELY(ARG_globalData->exception != noValue())) \
     306        if (UNLIKELY(ARG_globalData->exception != JSValue())) \
    307307            VM_THROW_EXCEPTION_AT_END(); \
    308308    } while (0)
    309309#define CHECK_FOR_EXCEPTION_VOID() \
    310310    do { \
    311         if (UNLIKELY(ARG_globalData->exception != noValue())) { \
     311        if (UNLIKELY(ARG_globalData->exception != JSValue())) { \
    312312            VM_THROW_EXCEPTION_AT_END(); \
    313313            return; \
     
    18951895
    18961896    if (thisValue == globalObject && funcVal == globalObject->evalFunction()) {
    1897         JSValue exceptionValue = noValue();
     1897        JSValue exceptionValue;
    18981898        JSValue result = interpreter->callEval(callFrame, registerFile, argv, argCount, registerOffset, exceptionValue);
    1899         if (UNLIKELY(exceptionValue != noValue())) {
     1899        if (UNLIKELY(exceptionValue != JSValue())) {
    19001900            ARG_globalData->exception = exceptionValue;
    19011901            VM_THROW_EXCEPTION_AT_END();
     
    19041904    }
    19051905
    1906     return JSValue::encode(jsImpossibleValue());
     1906    return JSValue::encode(JSValue());
    19071907}
    19081908
     
    22592259    JSValue exceptionValue = globalData->exception;
    22602260    ASSERT(exceptionValue);
    2261     globalData->exception = noValue();
     2261    globalData->exception = JSValue();
    22622262
    22632263    HandlerInfo* handler = globalData->interpreter->throwException(callFrame, exceptionValue, vPCIndex, false);
Note: See TracChangeset for help on using the changeset viewer.