source: webkit/trunk/JavaScriptCore/jit/JITArithmetic.cpp@ 43122

Last change on this file since 43122 was 43122, checked in by [email protected], 16 years ago

JavaScriptCore:

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

Rubber Stamped by Sam Weinig.


Renamed JSValuePtr => JSValue.

  • API/APICast.h: (toJS): (toRef):
  • API/JSCallbackConstructor.h: (JSC::JSCallbackConstructor::createStructure):
  • API/JSCallbackFunction.cpp: (JSC::JSCallbackFunction::call):
  • API/JSCallbackFunction.h: (JSC::JSCallbackFunction::createStructure):
  • API/JSCallbackObject.h: (JSC::JSCallbackObject::createStructure):
  • API/JSCallbackObjectFunctions.h: (JSC::::asCallbackObject): (JSC::::put): (JSC::::hasInstance): (JSC::::call): (JSC::::staticValueGetter): (JSC::::staticFunctionGetter): (JSC::::callbackGetter):
  • API/JSContextRef.cpp:
  • API/JSObjectRef.cpp: (JSObjectMakeConstructor): (JSObjectSetPrototype): (JSObjectGetProperty): (JSObjectSetProperty): (JSObjectGetPropertyAtIndex): (JSObjectSetPropertyAtIndex):
  • API/JSValueRef.cpp: (JSValueGetType): (JSValueIsUndefined): (JSValueIsNull): (JSValueIsBoolean): (JSValueIsNumber): (JSValueIsString): (JSValueIsObject): (JSValueIsObjectOfClass): (JSValueIsEqual): (JSValueIsStrictEqual): (JSValueIsInstanceOfConstructor): (JSValueToBoolean): (JSValueToNumber): (JSValueToStringCopy): (JSValueToObject): (JSValueProtect): (JSValueUnprotect):
  • JavaScriptCore.exp:
  • bytecode/CodeBlock.cpp: (JSC::valueToSourceString): (JSC::constantName): (JSC::CodeBlock::dump):
  • bytecode/CodeBlock.h: (JSC::CodeBlock::getConstant): (JSC::CodeBlock::addUnexpectedConstant): (JSC::CodeBlock::unexpectedConstant):
  • bytecode/EvalCodeCache.h: (JSC::EvalCodeCache::get):
  • bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::addConstant): (JSC::BytecodeGenerator::addUnexpectedConstant): (JSC::BytecodeGenerator::emitLoad): (JSC::BytecodeGenerator::emitGetScopedVar): (JSC::BytecodeGenerator::emitPutScopedVar): (JSC::BytecodeGenerator::emitNewError): (JSC::keyForImmediateSwitch):
  • bytecompiler/BytecodeGenerator.h: (JSC::BytecodeGenerator::JSValueHashTraits::constructDeletedValue): (JSC::BytecodeGenerator::JSValueHashTraits::isDeletedValue):
  • debugger/Debugger.cpp: (JSC::evaluateInGlobalCallFrame):
  • debugger/Debugger.h:
  • debugger/DebuggerActivation.cpp: (JSC::DebuggerActivation::put): (JSC::DebuggerActivation::putWithAttributes): (JSC::DebuggerActivation::lookupGetter): (JSC::DebuggerActivation::lookupSetter):
  • debugger/DebuggerActivation.h: (JSC::DebuggerActivation::createStructure):
  • debugger/DebuggerCallFrame.cpp: (JSC::DebuggerCallFrame::evaluate):
  • debugger/DebuggerCallFrame.h: (JSC::DebuggerCallFrame::DebuggerCallFrame): (JSC::DebuggerCallFrame::exception):
  • interpreter/CachedCall.h: (JSC::CachedCall::CachedCall): (JSC::CachedCall::call): (JSC::CachedCall::setThis): (JSC::CachedCall::setArgument):
  • interpreter/CallFrame.cpp: (JSC::CallFrame::thisValue): (JSC::CallFrame::dumpCaller):
  • interpreter/CallFrame.h: (JSC::ExecState::setException): (JSC::ExecState::exception): (JSC::ExecState::exceptionSlot):
  • interpreter/CallFrameClosure.h: (JSC::CallFrameClosure::setArgument):
  • interpreter/Interpreter.cpp: (JSC::Interpreter::resolve): (JSC::Interpreter::resolveSkip): (JSC::Interpreter::resolveGlobal): (JSC::Interpreter::resolveBase): (JSC::Interpreter::resolveBaseAndProperty): (JSC::Interpreter::resolveBaseAndFunc): (JSC::isNotObject): (JSC::Interpreter::callEval): (JSC::Interpreter::unwindCallFrame): (JSC::Interpreter::throwException): (JSC::Interpreter::execute): (JSC::Interpreter::prepareForRepeatCall): (JSC::Interpreter::createExceptionScope): (JSC::Interpreter::tryCachePutByID): (JSC::Interpreter::tryCacheGetByID): (JSC::Interpreter::privateExecute): (JSC::Interpreter::retrieveArguments): (JSC::Interpreter::retrieveCaller): (JSC::Interpreter::retrieveLastCaller):
  • interpreter/Interpreter.h:
  • interpreter/Register.h: (JSC::Register::): (JSC::Register::Register): (JSC::Register::jsValue):
  • jit/JIT.cpp: (JSC::): (JSC::JIT::privateCompileMainPass):
  • jit/JIT.h:
  • jit/JITArithmetic.cpp: (JSC::JIT::compileFastArith_op_mod):
  • jit/JITCall.cpp: (JSC::JIT::unlinkCall): (JSC::JIT::compileOpCallInitializeCallFrame): (JSC::JIT::compileOpCall):
  • jit/JITCode.h: (JSC::): (JSC::JITCode::execute):
  • jit/JITInlineMethods.h: (JSC::JIT::emitGetVirtualRegister): (JSC::JIT::getConstantOperand): (JSC::JIT::emitPutJITStubArgFromVirtualRegister): (JSC::JIT::emitInitRegister):
  • jit/JITPropertyAccess.cpp: (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::patchGetByIdSelf): (JSC::JIT::patchPutByIdReplace): (JSC::JIT::privateCompileGetByIdSelf): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain): (JSC::JIT::privateCompilePutByIdReplace):
  • jit/JITStubs.cpp: (JSC::JITStubs::tryCachePutByID): (JSC::JITStubs::tryCacheGetByID): (JSC::JITStubs::cti_op_convert_this): (JSC::JITStubs::cti_op_add): (JSC::JITStubs::cti_op_pre_inc): (JSC::JITStubs::cti_op_loop_if_less): (JSC::JITStubs::cti_op_loop_if_lesseq): (JSC::JITStubs::cti_op_get_by_id_generic): (JSC::JITStubs::cti_op_get_by_id): (JSC::JITStubs::cti_op_get_by_id_second): (JSC::JITStubs::cti_op_get_by_id_self_fail): (JSC::JITStubs::cti_op_get_by_id_proto_list): (JSC::JITStubs::cti_op_get_by_id_proto_list_full): (JSC::JITStubs::cti_op_get_by_id_proto_fail): (JSC::JITStubs::cti_op_get_by_id_array_fail): (JSC::JITStubs::cti_op_get_by_id_string_fail): (JSC::JITStubs::cti_op_instanceof): (JSC::JITStubs::cti_op_del_by_id): (JSC::JITStubs::cti_op_mul): (JSC::JITStubs::cti_op_call_NotJSFunction): (JSC::JITStubs::cti_op_resolve): (JSC::JITStubs::cti_op_construct_NotJSConstruct): (JSC::JITStubs::cti_op_get_by_val): (JSC::JITStubs::cti_op_get_by_val_string): (JSC::JITStubs::cti_op_get_by_val_byte_array): (JSC::JITStubs::cti_op_resolve_func): (JSC::JITStubs::cti_op_sub): (JSC::JITStubs::cti_op_put_by_val): (JSC::JITStubs::cti_op_put_by_val_array): (JSC::JITStubs::cti_op_put_by_val_byte_array): (JSC::JITStubs::cti_op_lesseq): (JSC::JITStubs::cti_op_loop_if_true): (JSC::JITStubs::cti_op_load_varargs): (JSC::JITStubs::cti_op_negate): (JSC::JITStubs::cti_op_resolve_base): (JSC::JITStubs::cti_op_resolve_skip): (JSC::JITStubs::cti_op_resolve_global): (JSC::JITStubs::cti_op_div): (JSC::JITStubs::cti_op_pre_dec): (JSC::JITStubs::cti_op_jless): (JSC::JITStubs::cti_op_not): (JSC::JITStubs::cti_op_jtrue): (JSC::JITStubs::cti_op_post_inc): (JSC::JITStubs::cti_op_eq): (JSC::JITStubs::cti_op_lshift): (JSC::JITStubs::cti_op_bitand): (JSC::JITStubs::cti_op_rshift): (JSC::JITStubs::cti_op_bitnot): (JSC::JITStubs::cti_op_resolve_with_base): (JSC::JITStubs::cti_op_mod): (JSC::JITStubs::cti_op_less): (JSC::JITStubs::cti_op_neq): (JSC::JITStubs::cti_op_post_dec): (JSC::JITStubs::cti_op_urshift): (JSC::JITStubs::cti_op_bitxor): (JSC::JITStubs::cti_op_bitor): (JSC::JITStubs::cti_op_call_eval): (JSC::JITStubs::cti_op_throw): (JSC::JITStubs::cti_op_next_pname): (JSC::JITStubs::cti_op_typeof): (JSC::JITStubs::cti_op_is_undefined): (JSC::JITStubs::cti_op_is_boolean): (JSC::JITStubs::cti_op_is_number): (JSC::JITStubs::cti_op_is_string): (JSC::JITStubs::cti_op_is_object): (JSC::JITStubs::cti_op_is_function): (JSC::JITStubs::cti_op_stricteq): (JSC::JITStubs::cti_op_nstricteq): (JSC::JITStubs::cti_op_to_jsnumber): (JSC::JITStubs::cti_op_in): (JSC::JITStubs::cti_op_switch_imm): (JSC::JITStubs::cti_op_switch_char): (JSC::JITStubs::cti_op_switch_string): (JSC::JITStubs::cti_op_del_by_val): (JSC::JITStubs::cti_op_new_error): (JSC::JITStubs::cti_vm_throw):
  • jit/JITStubs.h:
  • jsc.cpp: (functionPrint): (functionDebug): (functionGC): (functionVersion): (functionRun): (functionLoad): (functionSetSamplingFlag): (functionClearSamplingFlag): (functionReadline): (functionQuit):
  • parser/Nodes.cpp: (JSC::processClauseList):
  • profiler/ProfileGenerator.cpp: (JSC::ProfileGenerator::addParentForConsoleStart):
  • profiler/Profiler.cpp: (JSC::Profiler::willExecute): (JSC::Profiler::didExecute): (JSC::Profiler::createCallIdentifier):
  • profiler/Profiler.h:
  • runtime/ArgList.cpp: (JSC::MarkedArgumentBuffer::slowAppend):
  • runtime/ArgList.h: (JSC::MarkedArgumentBuffer::at): (JSC::MarkedArgumentBuffer::append): (JSC::ArgList::ArgList): (JSC::ArgList::at):
  • runtime/Arguments.cpp: (JSC::Arguments::put):
  • runtime/Arguments.h: (JSC::Arguments::createStructure): (JSC::asArguments):
  • runtime/ArrayConstructor.cpp: (JSC::callArrayConstructor):
  • runtime/ArrayPrototype.cpp: (JSC::getProperty): (JSC::putProperty): (JSC::arrayProtoFuncToString): (JSC::arrayProtoFuncToLocaleString): (JSC::arrayProtoFuncJoin): (JSC::arrayProtoFuncConcat): (JSC::arrayProtoFuncPop): (JSC::arrayProtoFuncPush): (JSC::arrayProtoFuncReverse): (JSC::arrayProtoFuncShift): (JSC::arrayProtoFuncSlice): (JSC::arrayProtoFuncSort): (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::callBooleanConstructor): (JSC::constructBooleanFromImmediateBoolean):
  • runtime/BooleanConstructor.h:
  • runtime/BooleanObject.h: (JSC::asBooleanObject):
  • runtime/BooleanPrototype.cpp: (JSC::booleanProtoFuncToString): (JSC::booleanProtoFuncValueOf):
  • runtime/CallData.cpp: (JSC::call):
  • runtime/CallData.h:
  • runtime/Collector.cpp: (JSC::Heap::protect): (JSC::Heap::unprotect): (JSC::Heap::heap):
  • runtime/Collector.h:
  • runtime/Completion.cpp: (JSC::evaluate):
  • runtime/Completion.h: (JSC::Completion::Completion): (JSC::Completion::value): (JSC::Completion::setValue):
  • runtime/ConstructData.cpp: (JSC::construct):
  • runtime/ConstructData.h:
  • runtime/DateConstructor.cpp: (JSC::constructDate): (JSC::callDate): (JSC::dateParse): (JSC::dateNow): (JSC::dateUTC):
  • runtime/DateInstance.h: (JSC::asDateInstance):
  • runtime/DatePrototype.cpp: (JSC::dateProtoFuncToString): (JSC::dateProtoFuncToUTCString): (JSC::dateProtoFuncToDateString): (JSC::dateProtoFuncToTimeString): (JSC::dateProtoFuncToLocaleString): (JSC::dateProtoFuncToLocaleDateString): (JSC::dateProtoFuncToLocaleTimeString): (JSC::dateProtoFuncGetTime): (JSC::dateProtoFuncGetFullYear): (JSC::dateProtoFuncGetUTCFullYear): (JSC::dateProtoFuncToGMTString): (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::dateProtoFuncSetMilliSeconds): (JSC::dateProtoFuncSetUTCMilliseconds): (JSC::dateProtoFuncSetSeconds): (JSC::dateProtoFuncSetUTCSeconds): (JSC::dateProtoFuncSetMinutes): (JSC::dateProtoFuncSetUTCMinutes): (JSC::dateProtoFuncSetHours): (JSC::dateProtoFuncSetUTCHours): (JSC::dateProtoFuncSetDate): (JSC::dateProtoFuncSetUTCDate): (JSC::dateProtoFuncSetMonth): (JSC::dateProtoFuncSetUTCMonth): (JSC::dateProtoFuncSetFullYear): (JSC::dateProtoFuncSetUTCFullYear): (JSC::dateProtoFuncSetYear): (JSC::dateProtoFuncGetYear):
  • runtime/DatePrototype.h: (JSC::DatePrototype::createStructure):
  • runtime/ErrorConstructor.cpp: (JSC::callErrorConstructor):
  • runtime/ErrorPrototype.cpp: (JSC::errorProtoFuncToString):
  • runtime/ExceptionHelpers.cpp: (JSC::createInterruptedExecutionException): (JSC::createError): (JSC::createStackOverflowError): (JSC::createUndefinedVariableError): (JSC::createErrorMessage): (JSC::createInvalidParamError): (JSC::createNotAConstructorError): (JSC::createNotAFunctionError):
  • runtime/ExceptionHelpers.h:
  • runtime/FunctionConstructor.cpp: (JSC::callFunctionConstructor):
  • runtime/FunctionPrototype.cpp: (JSC::callFunctionPrototype): (JSC::functionProtoFuncToString): (JSC::functionProtoFuncApply): (JSC::functionProtoFuncCall):
  • runtime/FunctionPrototype.h: (JSC::FunctionPrototype::createStructure):
  • runtime/GetterSetter.cpp: (JSC::GetterSetter::toPrimitive): (JSC::GetterSetter::getPrimitiveNumber):
  • runtime/GetterSetter.h: (JSC::asGetterSetter):
  • runtime/InternalFunction.cpp: (JSC::InternalFunction::displayName):
  • runtime/InternalFunction.h: (JSC::InternalFunction::createStructure): (JSC::asInternalFunction):
  • runtime/JSActivation.cpp: (JSC::JSActivation::getOwnPropertySlot): (JSC::JSActivation::put): (JSC::JSActivation::putWithAttributes): (JSC::JSActivation::argumentsGetter):
  • runtime/JSActivation.h: (JSC::JSActivation::createStructure): (JSC::asActivation):
  • runtime/JSArray.cpp: (JSC::storageSize): (JSC::JSArray::JSArray): (JSC::JSArray::getOwnPropertySlot): (JSC::JSArray::put): (JSC::JSArray::putSlowCase): (JSC::JSArray::deleteProperty): (JSC::JSArray::setLength): (JSC::JSArray::pop): (JSC::JSArray::push): (JSC::JSArray::mark): (JSC::compareNumbersForQSort): (JSC::JSArray::sortNumeric): (JSC::JSArray::sort): (JSC::JSArray::compactForSorting): (JSC::JSArray::checkConsistency): (JSC::constructArray):
  • runtime/JSArray.h: (JSC::JSArray::getIndex): (JSC::JSArray::setIndex): (JSC::JSArray::createStructure): (JSC::asArray): (JSC::isJSArray):
  • runtime/JSByteArray.cpp: (JSC::JSByteArray::createStructure): (JSC::JSByteArray::put):
  • runtime/JSByteArray.h: (JSC::JSByteArray::getIndex): (JSC::JSByteArray::setIndex): (JSC::asByteArray): (JSC::isJSByteArray):
  • runtime/JSCell.cpp: (JSC::JSCell::put): (JSC::JSCell::getJSNumber):
  • runtime/JSCell.h: (JSC::asCell): (JSC::JSValue::asCell): (JSC::JSValue::isString): (JSC::JSValue::isGetterSetter): (JSC::JSValue::isObject): (JSC::JSValue::getString): (JSC::JSValue::getObject): (JSC::JSValue::getCallData): (JSC::JSValue::getConstructData): (JSC::JSValue::getUInt32): (JSC::JSValue::getTruncatedInt32): (JSC::JSValue::getTruncatedUInt32): (JSC::JSValue::mark): (JSC::JSValue::marked): (JSC::JSValue::toPrimitive): (JSC::JSValue::getPrimitiveNumber): (JSC::JSValue::toBoolean): (JSC::JSValue::toNumber): (JSC::JSValue::toString): (JSC::JSValue::toObject): (JSC::JSValue::toThisObject): (JSC::JSValue::needsThisConversion): (JSC::JSValue::toThisString): (JSC::JSValue::getJSNumber):
  • runtime/JSFunction.cpp: (JSC::JSFunction::call): (JSC::JSFunction::argumentsGetter): (JSC::JSFunction::callerGetter): (JSC::JSFunction::lengthGetter): (JSC::JSFunction::getOwnPropertySlot): (JSC::JSFunction::put): (JSC::JSFunction::construct):
  • runtime/JSFunction.h: (JSC::JSFunction::createStructure): (JSC::asFunction):
  • runtime/JSGlobalData.h:
  • runtime/JSGlobalObject.cpp: (JSC::markIfNeeded): (JSC::JSGlobalObject::put): (JSC::JSGlobalObject::putWithAttributes): (JSC::JSGlobalObject::reset): (JSC::JSGlobalObject::resetPrototype):
  • runtime/JSGlobalObject.h: (JSC::JSGlobalObject::createStructure): (JSC::JSGlobalObject::GlobalPropertyInfo::GlobalPropertyInfo): (JSC::asGlobalObject): (JSC::Structure::prototypeForLookup): (JSC::Structure::prototypeChain): (JSC::Structure::isValid):
  • runtime/JSGlobalObjectFunctions.cpp: (JSC::encode): (JSC::decode): (JSC::globalFuncEval): (JSC::globalFuncParseInt): (JSC::globalFuncParseFloat): (JSC::globalFuncIsNaN): (JSC::globalFuncIsFinite): (JSC::globalFuncDecodeURI): (JSC::globalFuncDecodeURIComponent): (JSC::globalFuncEncodeURI): (JSC::globalFuncEncodeURIComponent): (JSC::globalFuncEscape): (JSC::globalFuncUnescape): (JSC::globalFuncJSCPrint):
  • runtime/JSGlobalObjectFunctions.h:
  • runtime/JSImmediate.cpp: (JSC::JSImmediate::toThisObject): (JSC::JSImmediate::toObject): (JSC::JSImmediate::prototype): (JSC::JSImmediate::toString):
  • runtime/JSImmediate.h: (JSC::JSImmediate::isImmediate): (JSC::JSImmediate::isNumber): (JSC::JSImmediate::isIntegerNumber): (JSC::JSImmediate::isDoubleNumber): (JSC::JSImmediate::isPositiveIntegerNumber): (JSC::JSImmediate::isBoolean): (JSC::JSImmediate::isUndefinedOrNull): (JSC::JSImmediate::isEitherImmediate): (JSC::JSImmediate::areBothImmediate): (JSC::JSImmediate::areBothImmediateIntegerNumbers): (JSC::JSImmediate::makeValue): (JSC::JSImmediate::makeInt): (JSC::JSImmediate::makeDouble): (JSC::JSImmediate::makeBool): (JSC::JSImmediate::makeUndefined): (JSC::JSImmediate::makeNull): (JSC::JSImmediate::doubleValue): (JSC::JSImmediate::intValue): (JSC::JSImmediate::uintValue): (JSC::JSImmediate::boolValue): (JSC::JSImmediate::rawValue): (JSC::JSImmediate::trueImmediate): (JSC::JSImmediate::falseImmediate): (JSC::JSImmediate::undefinedImmediate): (JSC::JSImmediate::nullImmediate): (JSC::JSImmediate::zeroImmediate): (JSC::JSImmediate::oneImmediate): (JSC::JSImmediate::impossibleValue): (JSC::JSImmediate::toBoolean): (JSC::JSImmediate::getTruncatedUInt32): (JSC::JSImmediate::fromNumberOutsideIntegerRange): (JSC::JSImmediate::from): (JSC::JSImmediate::getTruncatedInt32): (JSC::JSImmediate::toDouble): (JSC::JSImmediate::getUInt32): (JSC::JSValue::JSValue): (JSC::JSValue::isUndefinedOrNull): (JSC::JSValue::isBoolean): (JSC::JSValue::getBoolean): (JSC::JSValue::toInt32): (JSC::JSValue::toUInt32): (JSC::JSValue::isCell): (JSC::JSValue::isInt32Fast): (JSC::JSValue::getInt32Fast): (JSC::JSValue::isUInt32Fast): (JSC::JSValue::getUInt32Fast): (JSC::JSValue::makeInt32Fast): (JSC::JSValue::areBothInt32Fast): (JSC::JSFastMath::canDoFastBitwiseOperations): (JSC::JSFastMath::equal): (JSC::JSFastMath::notEqual): (JSC::JSFastMath::andImmediateNumbers): (JSC::JSFastMath::xorImmediateNumbers): (JSC::JSFastMath::orImmediateNumbers): (JSC::JSFastMath::canDoFastRshift): (JSC::JSFastMath::canDoFastUrshift): (JSC::JSFastMath::rightShiftImmediateNumbers): (JSC::JSFastMath::canDoFastAdditiveOperations): (JSC::JSFastMath::addImmediateNumbers): (JSC::JSFastMath::subImmediateNumbers): (JSC::JSFastMath::incImmediateNumber): (JSC::JSFastMath::decImmediateNumber):
  • runtime/JSNotAnObject.cpp: (JSC::JSNotAnObject::toPrimitive): (JSC::JSNotAnObject::getPrimitiveNumber): (JSC::JSNotAnObject::put):
  • runtime/JSNotAnObject.h: (JSC::JSNotAnObject::createStructure):
  • runtime/JSNumberCell.cpp: (JSC::JSNumberCell::toPrimitive): (JSC::JSNumberCell::getPrimitiveNumber): (JSC::JSNumberCell::getJSNumber): (JSC::jsNumberCell):
  • runtime/JSNumberCell.h: (JSC::JSNumberCell::createStructure): (JSC::isNumberCell): (JSC::asNumberCell): (JSC::jsNumber): (JSC::JSValue::isDoubleNumber): (JSC::JSValue::getDoubleNumber): (JSC::JSValue::isNumber): (JSC::JSValue::uncheckedGetNumber): (JSC::jsNaN): (JSC::JSValue::toJSNumber): (JSC::JSValue::getNumber): (JSC::JSValue::numberToInt32): (JSC::JSValue::numberToUInt32):
  • runtime/JSObject.cpp: (JSC::JSObject::mark): (JSC::JSObject::put): (JSC::JSObject::putWithAttributes): (JSC::callDefaultValueFunction): (JSC::JSObject::getPrimitiveNumber): (JSC::JSObject::defaultValue): (JSC::JSObject::defineGetter): (JSC::JSObject::defineSetter): (JSC::JSObject::lookupGetter): (JSC::JSObject::lookupSetter): (JSC::JSObject::hasInstance): (JSC::JSObject::toNumber): (JSC::JSObject::toString): (JSC::JSObject::fillGetterPropertySlot):
  • runtime/JSObject.h: (JSC::JSObject::getDirect): (JSC::JSObject::getDirectLocation): (JSC::JSObject::offsetForLocation): (JSC::JSObject::locationForOffset): (JSC::JSObject::getDirectOffset): (JSC::JSObject::putDirectOffset): (JSC::JSObject::createStructure): (JSC::asObject): (JSC::JSObject::prototype): (JSC::JSObject::setPrototype): (JSC::JSValue::isObject): (JSC::JSObject::inlineGetOwnPropertySlot): (JSC::JSObject::getOwnPropertySlotForWrite): (JSC::JSObject::getPropertySlot): (JSC::JSObject::get): (JSC::JSObject::putDirect): (JSC::JSObject::putDirectWithoutTransition): (JSC::JSObject::toPrimitive): (JSC::JSValue::get): (JSC::JSValue::put): (JSC::JSObject::allocatePropertyStorageInline):
  • runtime/JSPropertyNameIterator.cpp: (JSC::JSPropertyNameIterator::toPrimitive): (JSC::JSPropertyNameIterator::getPrimitiveNumber):
  • runtime/JSPropertyNameIterator.h: (JSC::JSPropertyNameIterator::create): (JSC::JSPropertyNameIterator::next):
  • runtime/JSStaticScopeObject.cpp: (JSC::JSStaticScopeObject::put): (JSC::JSStaticScopeObject::putWithAttributes):
  • runtime/JSStaticScopeObject.h: (JSC::JSStaticScopeObject::JSStaticScopeObject): (JSC::JSStaticScopeObject::createStructure):
  • runtime/JSString.cpp: (JSC::JSString::toPrimitive): (JSC::JSString::getPrimitiveNumber): (JSC::JSString::getOwnPropertySlot):
  • runtime/JSString.h: (JSC::JSString::createStructure): (JSC::asString): (JSC::isJSString): (JSC::JSValue::toThisJSString):
  • runtime/JSValue.cpp: (JSC::JSValue::toInteger): (JSC::JSValue::toIntegerPreserveNaN):
  • runtime/JSValue.h: (JSC::JSValue::makeImmediate): (JSC::JSValue::asValue): (JSC::noValue): (JSC::jsImpossibleValue): (JSC::jsNull): (JSC::jsUndefined): (JSC::jsBoolean): (JSC::operator==): (JSC::operator!=): (JSC::JSValue::encode): (JSC::JSValue::decode): (JSC::JSValue::JSValue): (JSC::JSValue::operator bool): (JSC::JSValue::operator==): (JSC::JSValue::operator!=): (JSC::JSValue::isUndefined): (JSC::JSValue::isNull):
  • runtime/JSVariableObject.h: (JSC::JSVariableObject::symbolTablePut): (JSC::JSVariableObject::symbolTablePutWithAttributes):
  • runtime/JSWrapperObject.h: (JSC::JSWrapperObject::internalValue): (JSC::JSWrapperObject::setInternalValue):
  • runtime/Lookup.cpp: (JSC::setUpStaticFunctionSlot):
  • runtime/Lookup.h: (JSC::lookupPut):
  • runtime/MathObject.cpp: (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/MathObject.h: (JSC::MathObject::createStructure):
  • runtime/NativeErrorConstructor.cpp: (JSC::callNativeErrorConstructor):
  • runtime/NumberConstructor.cpp: (JSC::numberConstructorNaNValue): (JSC::numberConstructorNegInfinity): (JSC::numberConstructorPosInfinity): (JSC::numberConstructorMaxValue): (JSC::numberConstructorMinValue): (JSC::callNumberConstructor):
  • runtime/NumberConstructor.h: (JSC::NumberConstructor::createStructure):
  • runtime/NumberObject.cpp: (JSC::NumberObject::getJSNumber): (JSC::constructNumber):
  • runtime/NumberObject.h:
  • runtime/NumberPrototype.cpp: (JSC::numberProtoFuncToString): (JSC::numberProtoFuncToLocaleString): (JSC::numberProtoFuncValueOf): (JSC::numberProtoFuncToFixed): (JSC::numberProtoFuncToExponential): (JSC::numberProtoFuncToPrecision):
  • runtime/ObjectConstructor.cpp: (JSC::constructObject): (JSC::callObjectConstructor):
  • runtime/ObjectPrototype.cpp: (JSC::objectProtoFuncValueOf): (JSC::objectProtoFuncHasOwnProperty): (JSC::objectProtoFuncIsPrototypeOf): (JSC::objectProtoFuncDefineGetter): (JSC::objectProtoFuncDefineSetter): (JSC::objectProtoFuncLookupGetter): (JSC::objectProtoFuncLookupSetter): (JSC::objectProtoFuncPropertyIsEnumerable): (JSC::objectProtoFuncToLocaleString): (JSC::objectProtoFuncToString):
  • runtime/ObjectPrototype.h:
  • runtime/Operations.cpp: (JSC::JSValue::equalSlowCase): (JSC::JSValue::strictEqualSlowCase): (JSC::throwOutOfMemoryError): (JSC::jsAddSlowCase): (JSC::jsTypeStringForValue): (JSC::jsIsObjectType): (JSC::jsIsFunctionType):
  • runtime/Operations.h: (JSC::JSValue::equal): (JSC::JSValue::equalSlowCaseInline): (JSC::JSValue::strictEqual): (JSC::JSValue::strictEqualSlowCaseInline): (JSC::jsLess): (JSC::jsLessEq): (JSC::jsAdd): (JSC::countPrototypeChainEntriesAndCheckForProxies): (JSC::resolveBase):
  • runtime/PropertySlot.cpp: (JSC::PropertySlot::functionGetter):
  • runtime/PropertySlot.h: (JSC::PropertySlot::PropertySlot): (JSC::PropertySlot::getValue): (JSC::PropertySlot::putValue): (JSC::PropertySlot::setValueSlot): (JSC::PropertySlot::setValue): (JSC::PropertySlot::setCustom): (JSC::PropertySlot::setCustomIndex): (JSC::PropertySlot::slotBase): (JSC::PropertySlot::setBase): (JSC::PropertySlot::):
  • runtime/Protect.h: (JSC::gcProtect): (JSC::gcUnprotect): (JSC::ProtectedPtr::operator JSValue): (JSC::ProtectedJSValue::ProtectedJSValue): (JSC::ProtectedJSValue::get): (JSC::ProtectedJSValue::operator JSValue): (JSC::ProtectedJSValue::operator->): (JSC::ProtectedJSValue::~ProtectedJSValue): (JSC::ProtectedJSValue::operator=): (JSC::operator==): (JSC::operator!=):
  • runtime/RegExpConstructor.cpp: (JSC::RegExpConstructor::getBackref): (JSC::RegExpConstructor::getLastParen): (JSC::RegExpConstructor::getLeftContext): (JSC::RegExpConstructor::getRightContext): (JSC::regExpConstructorDollar1): (JSC::regExpConstructorDollar2): (JSC::regExpConstructorDollar3): (JSC::regExpConstructorDollar4): (JSC::regExpConstructorDollar5): (JSC::regExpConstructorDollar6): (JSC::regExpConstructorDollar7): (JSC::regExpConstructorDollar8): (JSC::regExpConstructorDollar9): (JSC::regExpConstructorInput): (JSC::regExpConstructorMultiline): (JSC::regExpConstructorLastMatch): (JSC::regExpConstructorLastParen): (JSC::regExpConstructorLeftContext): (JSC::regExpConstructorRightContext): (JSC::RegExpConstructor::put): (JSC::setRegExpConstructorInput): (JSC::setRegExpConstructorMultiline): (JSC::constructRegExp): (JSC::callRegExpConstructor):
  • runtime/RegExpConstructor.h: (JSC::RegExpConstructor::createStructure): (JSC::asRegExpConstructor):
  • runtime/RegExpMatchesArray.h: (JSC::RegExpMatchesArray::put):
  • runtime/RegExpObject.cpp: (JSC::regExpObjectGlobal): (JSC::regExpObjectIgnoreCase): (JSC::regExpObjectMultiline): (JSC::regExpObjectSource): (JSC::regExpObjectLastIndex): (JSC::RegExpObject::put): (JSC::setRegExpObjectLastIndex): (JSC::RegExpObject::test): (JSC::RegExpObject::exec): (JSC::callRegExpObject):
  • runtime/RegExpObject.h: (JSC::RegExpObject::createStructure): (JSC::asRegExpObject):
  • runtime/RegExpPrototype.cpp: (JSC::regExpProtoFuncTest): (JSC::regExpProtoFuncExec): (JSC::regExpProtoFuncCompile): (JSC::regExpProtoFuncToString):
  • runtime/StringConstructor.cpp: (JSC::stringFromCharCodeSlowCase): (JSC::stringFromCharCode): (JSC::callStringConstructor):
  • runtime/StringObject.cpp: (JSC::StringObject::put):
  • runtime/StringObject.h: (JSC::StringObject::createStructure): (JSC::asStringObject):
  • runtime/StringObjectThatMasqueradesAsUndefined.h: (JSC::StringObjectThatMasqueradesAsUndefined::createStructure):
  • runtime/StringPrototype.cpp: (JSC::stringProtoFuncReplace): (JSC::stringProtoFuncToString): (JSC::stringProtoFuncCharAt): (JSC::stringProtoFuncCharCodeAt): (JSC::stringProtoFuncConcat): (JSC::stringProtoFuncIndexOf): (JSC::stringProtoFuncLastIndexOf): (JSC::stringProtoFuncMatch): (JSC::stringProtoFuncSearch): (JSC::stringProtoFuncSlice): (JSC::stringProtoFuncSplit): (JSC::stringProtoFuncSubstr): (JSC::stringProtoFuncSubstring): (JSC::stringProtoFuncToLowerCase): (JSC::stringProtoFuncToUpperCase): (JSC::stringProtoFuncLocaleCompare): (JSC::stringProtoFuncBig): (JSC::stringProtoFuncSmall): (JSC::stringProtoFuncBlink): (JSC::stringProtoFuncBold): (JSC::stringProtoFuncFixed): (JSC::stringProtoFuncItalics): (JSC::stringProtoFuncStrike): (JSC::stringProtoFuncSub): (JSC::stringProtoFuncSup): (JSC::stringProtoFuncFontcolor): (JSC::stringProtoFuncFontsize): (JSC::stringProtoFuncAnchor): (JSC::stringProtoFuncLink):
  • runtime/Structure.cpp: (JSC::Structure::Structure): (JSC::Structure::changePrototypeTransition):
  • runtime/Structure.h: (JSC::Structure::create): (JSC::Structure::setPrototypeWithoutTransition): (JSC::Structure::storedPrototype):

JavaScriptGlue:

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

Rubber Stamped by Sam Weinig.


Renamed JSValuePtr => JSValue.

  • JSObject.cpp: (nativeCallFunction):
  • JSUtils.cpp: (KJSValueToJSObject): (JSObjectKJSValue): (KJSValueToCFTypeInternal): (KJSValueToCFType):
  • JSUtils.h:
  • JSValueWrapper.cpp: (JSValueWrapper::JSValueWrapper): (JSValueWrapper::GetValue): (JSValueWrapper::JSObjectCopyProperty): (JSValueWrapper::JSObjectSetProperty): (JSValueWrapper::JSObjectCallFunction):
  • JSValueWrapper.h:
  • UserObjectImp.cpp: (UserObjectImp::callAsFunction): (UserObjectImp::userObjectGetter): (UserObjectImp::getOwnPropertySlot): (UserObjectImp::put): (UserObjectImp::toPrimitive):
  • UserObjectImp.h: (UserObjectImp::createStructure):

WebCore:

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

Rubber Stamped by Sam Weinig.


Renamed JSValuePtr => JSValue.

  • bindings/js/JSAttrCustom.cpp: (WebCore::JSAttr::setValue):
  • bindings/js/JSCDATASectionCustom.cpp: (WebCore::toJSNewlyCreated):
  • bindings/js/JSCSSRuleCustom.cpp: (WebCore::toJS):
  • bindings/js/JSCSSStyleDeclarationCustom.cpp: (WebCore::JSCSSStyleDeclaration::nameGetter): (WebCore::JSCSSStyleDeclaration::customPut):
  • bindings/js/JSCSSValueCustom.cpp: (WebCore::toJS):
  • bindings/js/JSCanvasRenderingContext2DCustom.cpp: (WebCore::toJS): (WebCore::toHTMLCanvasStyle): (WebCore::JSCanvasRenderingContext2D::strokeStyle): (WebCore::JSCanvasRenderingContext2D::setStrokeStyle): (WebCore::JSCanvasRenderingContext2D::fillStyle): (WebCore::JSCanvasRenderingContext2D::setFillStyle): (WebCore::JSCanvasRenderingContext2D::setFillColor): (WebCore::JSCanvasRenderingContext2D::setStrokeColor): (WebCore::JSCanvasRenderingContext2D::strokeRect): (WebCore::JSCanvasRenderingContext2D::drawImage): (WebCore::JSCanvasRenderingContext2D::drawImageFromRect): (WebCore::JSCanvasRenderingContext2D::setShadow): (WebCore::JSCanvasRenderingContext2D::createPattern): (WebCore::JSCanvasRenderingContext2D::putImageData): (WebCore::JSCanvasRenderingContext2D::fillText): (WebCore::JSCanvasRenderingContext2D::strokeText):
  • bindings/js/JSClipboardCustom.cpp: (WebCore::JSClipboard::types): (WebCore::JSClipboard::clearData): (WebCore::JSClipboard::getData): (WebCore::JSClipboard::setData): (WebCore::JSClipboard::setDragImage):
  • bindings/js/JSConsoleCustom.cpp: (WebCore::JSConsole::profiles):
  • bindings/js/JSCoordinatesCustom.cpp: (WebCore::JSCoordinates::altitude): (WebCore::JSCoordinates::altitudeAccuracy): (WebCore::JSCoordinates::heading): (WebCore::JSCoordinates::speed):
  • bindings/js/JSCustomPositionCallback.cpp: (WebCore::JSCustomPositionCallback::handleEvent):
  • bindings/js/JSCustomPositionErrorCallback.cpp: (WebCore::JSCustomPositionErrorCallback::handleEvent):
  • 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): (WebCore::toVoidCallback):
  • bindings/js/JSCustomVoidCallback.h:
  • bindings/js/JSCustomXPathNSResolver.cpp: (WebCore::JSCustomXPathNSResolver::create): (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
  • bindings/js/JSCustomXPathNSResolver.h:
  • bindings/js/JSDOMApplicationCacheCustom.cpp: (WebCore::JSDOMApplicationCache::hasItem): (WebCore::JSDOMApplicationCache::add): (WebCore::JSDOMApplicationCache::remove): (WebCore::JSDOMApplicationCache::addEventListener): (WebCore::JSDOMApplicationCache::removeEventListener):
  • bindings/js/JSDOMBinding.cpp: (WebCore::jsStringOrNull): (WebCore::jsOwnedStringOrNull): (WebCore::jsStringOrUndefined): (WebCore::jsStringOrFalse): (WebCore::valueToStringWithNullCheck): (WebCore::valueToStringWithUndefinedOrNullCheck): (WebCore::reportException): (WebCore::reportCurrentException): (WebCore::setDOMException): (WebCore::objectToStringFunctionGetter):
  • bindings/js/JSDOMBinding.h: (WebCore::getDOMObjectWrapper): (WebCore::getDOMNodeWrapper): (WebCore::toJS):
  • bindings/js/JSDOMGlobalObject.cpp: (WebCore::JSDOMGlobalObject::findJSEventListener): (WebCore::JSDOMGlobalObject::findOrCreateJSEventListener): (WebCore::JSDOMGlobalObject::createJSAttributeEventListener):
  • bindings/js/JSDOMGlobalObject.h:
  • bindings/js/JSDOMStringListCustom.cpp: (WebCore::JSDOMStringList::getByIndex): (WebCore::JSDOMStringList::item):
  • bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::childFrameGetter): (WebCore::JSDOMWindowBase::indexGetter): (WebCore::JSDOMWindowBase::namedItemGetter): (WebCore::JSDOMWindowBase::getOwnPropertySlot): (WebCore::JSDOMWindowBase::put): (WebCore::JSDOMWindowBase::setReturnValueSlot): (WebCore::toJS): (WebCore::toJSDOMWindow):
  • bindings/js/JSDOMWindowBase.h:
  • bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::lookupGetter): (WebCore::JSDOMWindow::lookupSetter): (WebCore::JSDOMWindow::history): (WebCore::JSDOMWindow::location): (WebCore::JSDOMWindow::setLocation): (WebCore::JSDOMWindow::crypto): (WebCore::JSDOMWindow::event): (WebCore::JSDOMWindow::image): (WebCore::JSDOMWindow::option): (WebCore::JSDOMWindow::audio): (WebCore::JSDOMWindow::webKitPoint): (WebCore::JSDOMWindow::webKitCSSMatrix): (WebCore::JSDOMWindow::xmlHttpRequest): (WebCore::JSDOMWindow::xsltProcessor): (WebCore::JSDOMWindow::messageChannel): (WebCore::JSDOMWindow::worker): (WebCore::createWindow): (WebCore::JSDOMWindow::open): (WebCore::JSDOMWindow::showModalDialog): (WebCore::JSDOMWindow::postMessage): (WebCore::JSDOMWindow::setTimeout): (WebCore::JSDOMWindow::setInterval): (WebCore::JSDOMWindow::atob): (WebCore::JSDOMWindow::btoa): (WebCore::JSDOMWindow::addEventListener): (WebCore::JSDOMWindow::removeEventListener): (WebCore::toDOMWindow):
  • bindings/js/JSDOMWindowCustom.h: (WebCore::nonCachingStaticFunctionGetter): (WebCore::JSDOMWindow::customPut):
  • bindings/js/JSDOMWindowShell.cpp: (WebCore::JSDOMWindowShell::put): (WebCore::JSDOMWindowShell::putWithAttributes): (WebCore::JSDOMWindowShell::lookupGetter): (WebCore::JSDOMWindowShell::lookupSetter): (WebCore::toJS):
  • bindings/js/JSDOMWindowShell.h: (WebCore::JSDOMWindowShell::createStructure):
  • bindings/js/JSDatabaseCustom.cpp: (WebCore::JSDatabase::changeVersion): (WebCore::JSDatabase::transaction):
  • bindings/js/JSDocumentCustom.cpp: (WebCore::JSDocument::location): (WebCore::JSDocument::setLocation): (WebCore::toJS):
  • bindings/js/JSElementCustom.cpp: (WebCore::JSElement::setAttribute): (WebCore::JSElement::setAttributeNode): (WebCore::JSElement::setAttributeNS): (WebCore::JSElement::setAttributeNodeNS): (WebCore::toJSNewlyCreated):
  • bindings/js/JSEventCustom.cpp: (WebCore::JSEvent::clipboardData): (WebCore::toJS):
  • bindings/js/JSEventListener.cpp: (WebCore::JSEventListener::handleEvent):
  • bindings/js/JSEventTarget.cpp: (WebCore::toJS): (WebCore::toEventTarget):
  • bindings/js/JSEventTarget.h:
  • bindings/js/JSEventTargetBase.h:
  • bindings/js/JSGeolocationCustom.cpp: (WebCore::createPositionOptions): (WebCore::JSGeolocation::getCurrentPosition): (WebCore::JSGeolocation::watchPosition):
  • bindings/js/JSHTMLAllCollection.h: (WebCore::JSHTMLAllCollection::createStructure):
  • bindings/js/JSHTMLAppletElementCustom.cpp: (WebCore::JSHTMLAppletElement::customPut): (WebCore::JSHTMLAppletElement::nameGetter):
  • bindings/js/JSHTMLCollectionCustom.cpp: (WebCore::getNamedItems): (WebCore::callHTMLCollection): (WebCore::JSHTMLCollection::nameGetter): (WebCore::JSHTMLCollection::item): (WebCore::JSHTMLCollection::namedItem): (WebCore::toJS):
  • bindings/js/JSHTMLDocumentCustom.cpp: (WebCore::JSHTMLDocument::nameGetter): (WebCore::JSHTMLDocument::all): (WebCore::JSHTMLDocument::setAll): (WebCore::JSHTMLDocument::open): (WebCore::JSHTMLDocument::write): (WebCore::JSHTMLDocument::writeln):
  • bindings/js/JSHTMLEmbedElementCustom.cpp: (WebCore::JSHTMLEmbedElement::customPut): (WebCore::JSHTMLEmbedElement::nameGetter):
  • bindings/js/JSHTMLFormElementCustom.cpp: (WebCore::JSHTMLFormElement::nameGetter): (WebCore::JSHTMLFormElement::submit):
  • bindings/js/JSHTMLFrameElementCustom.cpp: (WebCore::JSHTMLFrameElement::setSrc): (WebCore::JSHTMLFrameElement::setLocation):
  • bindings/js/JSHTMLFrameSetElementCustom.cpp: (WebCore::JSHTMLFrameSetElement::nameGetter):
  • bindings/js/JSHTMLIFrameElementCustom.cpp: (WebCore::JSHTMLIFrameElement::setSrc):
  • bindings/js/JSHTMLInputElementCustom.cpp: (WebCore::JSHTMLInputElement::selectionStart): (WebCore::JSHTMLInputElement::setSelectionStart): (WebCore::JSHTMLInputElement::selectionEnd): (WebCore::JSHTMLInputElement::setSelectionEnd): (WebCore::JSHTMLInputElement::setSelectionRange):
  • bindings/js/JSHTMLObjectElementCustom.cpp: (WebCore::JSHTMLObjectElement::customPut): (WebCore::JSHTMLObjectElement::nameGetter):
  • bindings/js/JSHTMLOptionsCollectionCustom.cpp: (WebCore::JSHTMLOptionsCollection::length): (WebCore::JSHTMLOptionsCollection::setLength): (WebCore::JSHTMLOptionsCollection::indexSetter): (WebCore::JSHTMLOptionsCollection::add): (WebCore::JSHTMLOptionsCollection::remove):
  • bindings/js/JSHTMLSelectElementCustom.cpp: (WebCore::JSHTMLSelectElement::remove): (WebCore::selectIndexSetter): (WebCore::JSHTMLSelectElement::indexSetter):
  • bindings/js/JSHTMLSelectElementCustom.h:
  • bindings/js/JSHistoryCustom.cpp: (WebCore::nonCachingStaticBackFunctionGetter): (WebCore::nonCachingStaticForwardFunctionGetter): (WebCore::nonCachingStaticGoFunctionGetter): (WebCore::JSHistory::customPut):
  • bindings/js/JSImageDataCustom.cpp: (WebCore::toJS):
  • bindings/js/JSInspectedObjectWrapper.cpp: (WebCore::JSInspectedObjectWrapper::wrap): (WebCore::JSInspectedObjectWrapper::prepareIncomingValue):
  • bindings/js/JSInspectedObjectWrapper.h: (WebCore::JSInspectedObjectWrapper::wrapOutgoingValue):
  • bindings/js/JSInspectorCallbackWrapper.cpp: (WebCore::JSInspectorCallbackWrapper::wrap): (WebCore::JSInspectorCallbackWrapper::prepareIncomingValue):
  • bindings/js/JSInspectorCallbackWrapper.h: (WebCore::JSInspectorCallbackWrapper::wrapOutgoingValue):
  • bindings/js/JSInspectorControllerCustom.cpp: (WebCore::JSInspectorController::highlightDOMNode): (WebCore::JSInspectorController::addResourceSourceToFrame): (WebCore::JSInspectorController::addSourceToFrame): (WebCore::JSInspectorController::getResourceDocumentNode): (WebCore::JSInspectorController::search): (WebCore::JSInspectorController::databaseTableNames): (WebCore::JSInspectorController::inspectedWindow): (WebCore::JSInspectorController::setting): (WebCore::JSInspectorController::setSetting): (WebCore::JSInspectorController::wrapCallback): (WebCore::JSInspectorController::currentCallFrame): (WebCore::JSInspectorController::profiles):
  • bindings/js/JSJavaScriptCallFrameCustom.cpp: (WebCore::JSJavaScriptCallFrame::evaluate): (WebCore::JSJavaScriptCallFrame::thisObject): (WebCore::JSJavaScriptCallFrame::type): (WebCore::JSJavaScriptCallFrame::scopeChain):
  • bindings/js/JSLazyEventListener.cpp: (WebCore::JSLazyEventListener::parseCode):
  • bindings/js/JSLocationCustom.cpp: (WebCore::nonCachingStaticReplaceFunctionGetter): (WebCore::nonCachingStaticReloadFunctionGetter): (WebCore::nonCachingStaticAssignFunctionGetter): (WebCore::JSLocation::customPut): (WebCore::JSLocation::setHref): (WebCore::JSLocation::setProtocol): (WebCore::JSLocation::setHost): (WebCore::JSLocation::setHostname): (WebCore::JSLocation::setPort): (WebCore::JSLocation::setPathname): (WebCore::JSLocation::setSearch): (WebCore::JSLocation::setHash): (WebCore::JSLocation::replace): (WebCore::JSLocation::reload): (WebCore::JSLocation::assign): (WebCore::JSLocation::toString): (WebCore::JSLocationPrototype::customPut):
  • bindings/js/JSMessagePortCustom.cpp: (WebCore::JSMessagePort::startConversation): (WebCore::JSMessagePort::addEventListener): (WebCore::JSMessagePort::removeEventListener):
  • bindings/js/JSMimeTypeArrayCustom.cpp: (WebCore::JSMimeTypeArray::nameGetter):
  • bindings/js/JSNamedNodeMapCustom.cpp: (WebCore::JSNamedNodeMap::nameGetter):
  • bindings/js/JSNamedNodesCollection.cpp: (WebCore::JSNamedNodesCollection::lengthGetter): (WebCore::JSNamedNodesCollection::indexGetter):
  • bindings/js/JSNamedNodesCollection.h: (WebCore::JSNamedNodesCollection::createStructure):
  • bindings/js/JSNavigatorCustom.cpp: (WebCore::needsYouTubeQuirk): (WebCore::JSNavigator::appVersion):
  • bindings/js/JSNodeCustom.cpp: (WebCore::JSNode::insertBefore): (WebCore::JSNode::replaceChild): (WebCore::JSNode::removeChild): (WebCore::JSNode::appendChild): (WebCore::JSNode::addEventListener): (WebCore::JSNode::removeEventListener): (WebCore::createWrapper): (WebCore::toJSNewlyCreated): (WebCore::toJS):
  • bindings/js/JSNodeFilterCondition.cpp: (WebCore::JSNodeFilterCondition::JSNodeFilterCondition): (WebCore::JSNodeFilterCondition::acceptNode):
  • bindings/js/JSNodeFilterCondition.h: (WebCore::JSNodeFilterCondition::create):
  • bindings/js/JSNodeFilterCustom.cpp: (WebCore::JSNodeFilter::acceptNode): (WebCore::toNodeFilter):
  • bindings/js/JSNodeIteratorCustom.cpp: (WebCore::JSNodeIterator::nextNode): (WebCore::JSNodeIterator::previousNode):
  • bindings/js/JSNodeListCustom.cpp: (WebCore::callNodeList): (WebCore::JSNodeList::nameGetter):
  • bindings/js/JSPluginArrayCustom.cpp: (WebCore::JSPluginArray::nameGetter):
  • bindings/js/JSPluginCustom.cpp: (WebCore::JSPlugin::nameGetter):
  • bindings/js/JSPluginElementFunctions.cpp: (WebCore::runtimeObjectGetter): (WebCore::runtimeObjectPropertyGetter): (WebCore::runtimeObjectCustomPut): (WebCore::callPlugin):
  • bindings/js/JSPluginElementFunctions.h:
  • bindings/js/JSQuarantinedObjectWrapper.cpp: (WebCore::JSQuarantinedObjectWrapper::asWrapper): (WebCore::JSQuarantinedObjectWrapper::cachedValueGetter): (WebCore::JSQuarantinedObjectWrapper::transferExceptionToExecState): (WebCore::JSQuarantinedObjectWrapper::getOwnPropertySlot): (WebCore::JSQuarantinedObjectWrapper::put): (WebCore::JSQuarantinedObjectWrapper::construct): (WebCore::JSQuarantinedObjectWrapper::hasInstance): (WebCore::JSQuarantinedObjectWrapper::call):
  • bindings/js/JSQuarantinedObjectWrapper.h: (WebCore::JSQuarantinedObjectWrapper::createStructure):
  • bindings/js/JSRGBColor.cpp: (WebCore::getJSRGBColor): (jsRGBColorRed): (jsRGBColorGreen): (jsRGBColorBlue):
  • bindings/js/JSRGBColor.h: (WebCore::JSRGBColor::createStructure):
  • bindings/js/JSSQLResultSetRowListCustom.cpp: (WebCore::JSSQLResultSetRowList::item):
  • bindings/js/JSSQLTransactionCustom.cpp: (WebCore::JSSQLTransaction::executeSql):
  • bindings/js/JSSVGElementInstanceCustom.cpp: (WebCore::JSSVGElementInstance::addEventListener): (WebCore::JSSVGElementInstance::removeEventListener): (WebCore::toJS):
  • bindings/js/JSSVGLengthCustom.cpp: (WebCore::JSSVGLength::value): (WebCore::JSSVGLength::convertToSpecifiedUnits):
  • bindings/js/JSSVGMatrixCustom.cpp: (WebCore::JSSVGMatrix::inverse): (WebCore::JSSVGMatrix::rotateFromVector):
  • bindings/js/JSSVGPathSegCustom.cpp: (WebCore::toJS):
  • bindings/js/JSSVGPathSegListCustom.cpp: (WebCore::JSSVGPathSegList::clear): (WebCore::JSSVGPathSegList::initialize): (WebCore::JSSVGPathSegList::getItem): (WebCore::JSSVGPathSegList::insertItemBefore): (WebCore::JSSVGPathSegList::replaceItem): (WebCore::JSSVGPathSegList::removeItem): (WebCore::JSSVGPathSegList::appendItem):
  • bindings/js/JSSVGPointListCustom.cpp: (WebCore::finishGetter): (WebCore::finishSetter): (WebCore::finishSetterReadOnlyResult): (WebCore::JSSVGPointList::clear): (WebCore::JSSVGPointList::initialize): (WebCore::JSSVGPointList::getItem): (WebCore::JSSVGPointList::insertItemBefore): (WebCore::JSSVGPointList::replaceItem): (WebCore::JSSVGPointList::removeItem): (WebCore::JSSVGPointList::appendItem):
  • bindings/js/JSSVGTransformListCustom.cpp: (WebCore::finishGetter): (WebCore::finishSetter): (WebCore::finishSetterReadOnlyResult): (WebCore::JSSVGTransformList::clear): (WebCore::JSSVGTransformList::initialize): (WebCore::JSSVGTransformList::getItem): (WebCore::JSSVGTransformList::insertItemBefore): (WebCore::JSSVGTransformList::replaceItem): (WebCore::JSSVGTransformList::removeItem): (WebCore::JSSVGTransformList::appendItem):
  • bindings/js/JSStorageCustom.cpp: (WebCore::JSStorage::nameGetter): (WebCore::JSStorage::deleteProperty): (WebCore::JSStorage::customPut):
  • bindings/js/JSStyleSheetCustom.cpp: (WebCore::toJS):
  • bindings/js/JSStyleSheetListCustom.cpp: (WebCore::JSStyleSheetList::nameGetter):
  • bindings/js/JSTextCustom.cpp: (WebCore::toJSNewlyCreated):
  • bindings/js/JSTreeWalkerCustom.cpp: (WebCore::JSTreeWalker::parentNode): (WebCore::JSTreeWalker::firstChild): (WebCore::JSTreeWalker::lastChild): (WebCore::JSTreeWalker::nextSibling): (WebCore::JSTreeWalker::previousSibling): (WebCore::JSTreeWalker::previousNode): (WebCore::JSTreeWalker::nextNode):
  • bindings/js/JSWorkerContextCustom.cpp: (WebCore::JSWorkerContext::self): (WebCore::JSWorkerContext::setSelf): (WebCore::JSWorkerContext::xmlHttpRequest): (WebCore::JSWorkerContext::importScripts): (WebCore::JSWorkerContext::addEventListener): (WebCore::JSWorkerContext::removeEventListener): (WebCore::JSWorkerContext::setTimeout): (WebCore::JSWorkerContext::setInterval):
  • bindings/js/JSWorkerCustom.cpp: (WebCore::JSWorker::addEventListener): (WebCore::JSWorker::removeEventListener):
  • bindings/js/JSXMLHttpRequestCustom.cpp: (WebCore::JSXMLHttpRequest::open): (WebCore::JSXMLHttpRequest::setRequestHeader): (WebCore::JSXMLHttpRequest::send): (WebCore::JSXMLHttpRequest::getResponseHeader): (WebCore::JSXMLHttpRequest::overrideMimeType): (WebCore::JSXMLHttpRequest::addEventListener): (WebCore::JSXMLHttpRequest::removeEventListener): (WebCore::JSXMLHttpRequest::responseText):
  • bindings/js/JSXMLHttpRequestUploadCustom.cpp: (WebCore::JSXMLHttpRequestUpload::addEventListener): (WebCore::JSXMLHttpRequestUpload::removeEventListener):
  • bindings/js/JSXSLTProcessorCustom.cpp: (WebCore::JSXSLTProcessor::importStylesheet): (WebCore::JSXSLTProcessor::transformToFragment): (WebCore::JSXSLTProcessor::transformToDocument): (WebCore::JSXSLTProcessor::setParameter): (WebCore::JSXSLTProcessor::getParameter): (WebCore::JSXSLTProcessor::removeParameter):
  • bindings/js/ScheduledAction.cpp: (WebCore::ScheduledAction::create): (WebCore::ScheduledAction::ScheduledAction): (WebCore::ScheduledAction::executeFunctionInContext):
  • bindings/js/ScheduledAction.h:
  • bindings/js/ScriptCallStack.cpp: (WebCore::ScriptCallStack::ScriptCallStack): (WebCore::ScriptCallStack::initialize):
  • bindings/js/ScriptCallStack.h:
  • bindings/js/ScriptController.cpp: (WebCore::ScriptController::jsObjectForPluginElement):
  • bindings/js/ScriptFunctionCall.cpp: (WebCore::ScriptFunctionCall::appendArgument): (WebCore::ScriptFunctionCall::call): (WebCore::ScriptFunctionCall::construct):
  • bindings/js/ScriptFunctionCall.h:
  • bindings/js/ScriptObject.cpp: (WebCore::ScriptGlobalObject::get):
  • bindings/js/ScriptValue.h: (WebCore::ScriptValue::ScriptValue): (WebCore::ScriptValue::jsValue):
  • bindings/objc/WebScriptObject.mm: (-[WebScriptObject callWebScriptMethod:withArguments:]): (-[WebScriptObject evaluateWebScript:]): (-[WebScriptObject valueForKey:]): (-[WebScriptObject webScriptValueAtIndex:]): (+[WebScriptObject _convertValueToObjcValue:originRootObject:rootObject:]):
  • bindings/objc/WebScriptObjectPrivate.h:
  • bridge/NP_jsobject.cpp: (_NPN_InvokeDefault): (_NPN_Invoke): (_NPN_Evaluate): (_NPN_GetProperty): (_NPN_HasMethod): (_NPN_Construct):
  • bridge/c/c_instance.cpp: (JSC::Bindings::CInstance::invokeMethod): (JSC::Bindings::CInstance::invokeDefaultMethod): (JSC::Bindings::CInstance::invokeConstruct): (JSC::Bindings::CInstance::defaultValue): (JSC::Bindings::CInstance::stringValue): (JSC::Bindings::CInstance::numberValue): (JSC::Bindings::CInstance::booleanValue): (JSC::Bindings::CInstance::valueOf):
  • bridge/c/c_instance.h:
  • bridge/c/c_runtime.cpp: (JSC::Bindings::CField::valueFromInstance): (JSC::Bindings::CField::setValueToInstance):
  • bridge/c/c_runtime.h:
  • bridge/c/c_utility.cpp: (JSC::Bindings::convertValueToNPVariant): (JSC::Bindings::convertNPVariantToValue):
  • bridge/c/c_utility.h:
  • bridge/jni/jni_instance.cpp: (JavaInstance::stringValue): (JavaInstance::numberValue): (JavaInstance::booleanValue): (JavaInstance::invokeMethod): (JavaInstance::defaultValue): (JavaInstance::valueOf):
  • bridge/jni/jni_instance.h:
  • bridge/jni/jni_jsobject.h:
  • bridge/jni/jni_jsobject.mm: (JavaJSObject::call): (JavaJSObject::eval): (JavaJSObject::getMember): (JavaJSObject::getSlot): (JavaJSObject::convertValueToJObject): (JavaJSObject::convertJObjectToValue):
  • bridge/jni/jni_objc.mm: (JSC::Bindings::dispatchJNICall):
  • bridge/jni/jni_runtime.cpp: (JavaArray::convertJObjectToArray): (JavaField::dispatchValueFromInstance): (JavaField::valueFromInstance): (JavaField::dispatchSetValueToInstance): (JavaField::setValueToInstance): (JavaArray::setValueAt): (JavaArray::valueAt):
  • bridge/jni/jni_runtime.h:
  • bridge/jni/jni_utility.cpp: (JSC::Bindings::convertArrayInstanceToJavaArray): (JSC::Bindings::convertValueToJValue):
  • bridge/jni/jni_utility.h:
  • bridge/objc/WebScriptObject.h:
  • bridge/objc/objc_class.h:
  • bridge/objc/objc_class.mm: (JSC::Bindings::ObjcClass::fallbackObject):
  • bridge/objc/objc_instance.h:
  • bridge/objc/objc_instance.mm: (ObjcInstance::invokeMethod): (ObjcInstance::invokeDefaultMethod): (ObjcInstance::setValueOfUndefinedField): (ObjcInstance::getValueOfUndefinedField): (ObjcInstance::defaultValue): (ObjcInstance::stringValue): (ObjcInstance::numberValue): (ObjcInstance::booleanValue): (ObjcInstance::valueOf):
  • bridge/objc/objc_runtime.h: (JSC::Bindings::ObjcFallbackObjectImp::createStructure):
  • bridge/objc/objc_runtime.mm: (JSC::Bindings::ObjcField::valueFromInstance): (JSC::Bindings::convertValueToObjcObject): (JSC::Bindings::ObjcField::setValueToInstance): (JSC::Bindings::ObjcArray::setValueAt): (JSC::Bindings::ObjcArray::valueAt): (JSC::Bindings::ObjcFallbackObjectImp::put): (JSC::Bindings::callObjCFallbackObject): (JSC::Bindings::ObjcFallbackObjectImp::defaultValue):
  • bridge/objc/objc_utility.h:
  • bridge/objc/objc_utility.mm: (JSC::Bindings::convertValueToObjcValue): (JSC::Bindings::convertNSStringToString): (JSC::Bindings::convertObjcValueToValue):
  • bridge/runtime.h: (JSC::Bindings::Class::fallbackObject): (JSC::Bindings::Instance::setValueOfUndefinedField): (JSC::Bindings::Instance::invokeDefaultMethod): (JSC::Bindings::Instance::invokeConstruct): (JSC::Bindings::Instance::put):
  • bridge/runtime_array.cpp: (JSC::RuntimeArray::lengthGetter): (JSC::RuntimeArray::indexGetter): (JSC::RuntimeArray::put):
  • bridge/runtime_array.h: (JSC::RuntimeArray::createStructure):
  • bridge/runtime_method.cpp: (JSC::RuntimeMethod::lengthGetter): (JSC::callRuntimeMethod):
  • bridge/runtime_method.h: (JSC::RuntimeMethod::createStructure):
  • bridge/runtime_object.cpp: (JSC::RuntimeObjectImp::fallbackObjectGetter): (JSC::RuntimeObjectImp::fieldGetter): (JSC::RuntimeObjectImp::methodGetter): (JSC::RuntimeObjectImp::put): (JSC::RuntimeObjectImp::defaultValue): (JSC::callRuntimeObject): (JSC::callRuntimeConstructor):
  • bridge/runtime_object.h: (JSC::RuntimeObjectImp::createStructure):
  • inspector/JavaScriptCallFrame.cpp: (WebCore::JavaScriptCallFrame::evaluate):
  • inspector/JavaScriptCallFrame.h:
  • inspector/JavaScriptProfile.cpp: (WebCore::toJS):
  • inspector/JavaScriptProfile.h:
  • inspector/JavaScriptProfileNode.cpp: (WebCore::toJS):
  • inspector/JavaScriptProfileNode.h:

WebKit/mac:

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

Rubber Stamped by Sam Weinig.


Renamed JSValuePtr => JSValue.

  • Plugins/Hosted/NetscapePluginInstanceProxy.h:
  • Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::evaluate): (WebKit::NetscapePluginInstanceProxy::invoke): (WebKit::NetscapePluginInstanceProxy::invokeDefault): (WebKit::NetscapePluginInstanceProxy::construct): (WebKit::NetscapePluginInstanceProxy::getProperty): (WebKit::NetscapePluginInstanceProxy::setProperty): (WebKit::NetscapePluginInstanceProxy::hasMethod): (WebKit::NetscapePluginInstanceProxy::addValueToArray): (WebKit::NetscapePluginInstanceProxy::marshalValue): (WebKit::NetscapePluginInstanceProxy::demarshalValueFromArray): (WebKit::NetscapePluginInstanceProxy::demarshalValue): (WebKit::NetscapePluginInstanceProxy::demarshalValues):
  • Plugins/Hosted/ProxyInstance.h:
  • Plugins/Hosted/ProxyInstance.mm: (WebKit::ProxyField::valueFromInstance): (WebKit::ProxyField::setValueToInstance): (WebKit::ProxyInstance::invoke): (WebKit::ProxyInstance::invokeMethod): (WebKit::ProxyInstance::invokeDefaultMethod): (WebKit::ProxyInstance::invokeConstruct): (WebKit::ProxyInstance::defaultValue): (WebKit::ProxyInstance::stringValue): (WebKit::ProxyInstance::numberValue): (WebKit::ProxyInstance::booleanValue): (WebKit::ProxyInstance::valueOf): (WebKit::ProxyInstance::fieldValue): (WebKit::ProxyInstance::setFieldValue):
  • WebView/WebFrame.mm: (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
  • WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFrame _convertValueToObjcValue:]): (-[WebScriptCallFrame exception]): (-[WebScriptCallFrame evaluateWebScript:]):
  • WebView/WebView.mm: (aeDescFromJSValue): (-[WebView aeDescByEvaluatingJavaScriptFromString:]):

WebKit/qt:

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

Rubber Stamped by Sam Weinig.


Renamed JSValuePtr => JSValue.

  • Api/qwebelement.cpp: (setupScriptContext): (setupScriptObject): (QWebElement::evaluateScript): (QWebElement::functions): (QWebElement::scriptableProperty): (QWebElement::setScriptableProperty): (QWebElement::scriptableProperties):

WebKit/win:

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

Rubber Stamped by Sam Weinig.


Renamed JSValuePtr => JSValue.

  • WebView.cpp: (WebView::stringByEvaluatingJavaScriptFromString):

WebKit/wx:

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

Rubber Stamped by Sam Weinig.


Renamed JSValuePtr => JSValue.

  • WebFrame.cpp: (wxWebFrame::RunScript):
File size: 37.9 KB
Line 
1/*
2 * Copyright (C) 2008 Apple Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#include "config.h"
27#include "JIT.h"
28
29#if ENABLE(JIT)
30
31#include "CodeBlock.h"
32#include "JITInlineMethods.h"
33#include "JSArray.h"
34#include "JSFunction.h"
35#include "Interpreter.h"
36#include "ResultType.h"
37#include "SamplingTool.h"
38
39#ifndef NDEBUG
40#include <stdio.h>
41#endif
42
43#define __ m_assembler.
44
45using namespace std;
46
47#if PLATFORM(MAC)
48
49static inline bool isSSE2Present()
50{
51 return true; // All X86 Macs are guaranteed to support at least SSE2
52}
53
54#else
55
56static bool isSSE2Present()
57{
58 static const int SSE2FeatureBit = 1 << 26;
59 struct SSE2Check {
60 SSE2Check()
61 {
62 int flags;
63#if COMPILER(MSVC)
64 _asm {
65 mov eax, 1 // cpuid function 1 gives us the standard feature set
66 cpuid;
67 mov flags, edx;
68 }
69#elif COMPILER(GCC)
70 asm (
71 "movl $0x1, %%eax;"
72 "pushl %%ebx;"
73 "cpuid;"
74 "popl %%ebx;"
75 "movl %%edx, %0;"
76 : "=g" (flags)
77 :
78 : "%eax", "%ecx", "%edx"
79 );
80#else
81 flags = 0;
82#endif
83 present = (flags & SSE2FeatureBit) != 0;
84 }
85 bool present;
86 };
87 static SSE2Check check;
88 return check.present;
89}
90
91#endif
92
93namespace JSC {
94
95void JIT::compileFastArith_op_lshift(unsigned result, unsigned op1, unsigned op2)
96{
97 emitGetVirtualRegisters(op1, regT0, op2, regT2);
98 // FIXME: would we be better using 'emitJumpSlowCaseIfNotImmediateIntegers'? - we *probably* ought to be consistent.
99 emitJumpSlowCaseIfNotImmediateInteger(regT0);
100 emitJumpSlowCaseIfNotImmediateInteger(regT2);
101 emitFastArithImmToInt(regT0);
102 emitFastArithImmToInt(regT2);
103#if !PLATFORM(X86)
104 // Mask with 0x1f as per ecma-262 11.7.2 step 7.
105 // On 32-bit x86 this is not necessary, since the shift anount is implicitly masked in the instruction.
106 and32(Imm32(0x1f), regT2);
107#endif
108 lshift32(regT2, regT0);
109#if !USE(ALTERNATE_JSIMMEDIATE)
110 addSlowCase(branchAdd32(Overflow, regT0, regT0));
111 signExtend32ToPtr(regT0, regT0);
112#endif
113 emitFastArithReTagImmediate(regT0, regT0);
114 emitPutVirtualRegister(result);
115}
116void JIT::compileFastArithSlow_op_lshift(unsigned result, unsigned op1, unsigned op2, Vector<SlowCaseEntry>::iterator& iter)
117{
118#if USE(ALTERNATE_JSIMMEDIATE)
119 UNUSED_PARAM(op1);
120 UNUSED_PARAM(op2);
121 linkSlowCase(iter);
122 linkSlowCase(iter);
123#else
124 // If we are limited to 32-bit immediates there is a third slow case, which required the operands to have been reloaded.
125 Jump notImm1 = getSlowCase(iter);
126 Jump notImm2 = getSlowCase(iter);
127 linkSlowCase(iter);
128 emitGetVirtualRegisters(op1, regT0, op2, regT2);
129 notImm1.link(this);
130 notImm2.link(this);
131#endif
132 emitPutJITStubArg(regT0, 1);
133 emitPutJITStubArg(regT2, 2);
134 emitCTICall(JITStubs::cti_op_lshift);
135 emitPutVirtualRegister(result);
136}
137
138void JIT::compileFastArith_op_rshift(unsigned result, unsigned op1, unsigned op2)
139{
140 if (isOperandConstantImmediateInt(op2)) {
141 emitGetVirtualRegister(op1, regT0);
142 emitJumpSlowCaseIfNotImmediateInteger(regT0);
143 // Mask with 0x1f as per ecma-262 11.7.2 step 7.
144#if USE(ALTERNATE_JSIMMEDIATE)
145 rshift32(Imm32(getConstantOperandImmediateInt(op2) & 0x1f), regT0);
146#else
147 rshiftPtr(Imm32(getConstantOperandImmediateInt(op2) & 0x1f), regT0);
148#endif
149 } else {
150 emitGetVirtualRegisters(op1, regT0, op2, regT2);
151 if (isSSE2Present()) {
152 Jump lhsIsInt = emitJumpIfImmediateInteger(regT0);
153#if USE(ALTERNATE_JSIMMEDIATE)
154 addSlowCase(emitJumpIfNotImmediateNumber(regT0));
155 __ movq_rr(regT0, X86::xmm0);
156#else
157 emitJumpSlowCaseIfNotJSCell(regT0, op1);
158 addSlowCase(checkStructure(regT0, m_globalData->numberStructure.get()));
159 __ movsd_mr(FIELD_OFFSET(JSNumberCell, m_value), regT0, X86::xmm0);
160#endif
161 __ cvttsd2si_rr(X86::xmm0, regT0);
162 addSlowCase(branch32(Equal, regT0, Imm32(0x80000000)));
163#if !USE(ALTERNATE_JSIMMEDIATE)
164 add32(regT0, regT0);
165 addSlowCase(__ jo());
166#endif
167 lhsIsInt.link(this);
168 } else
169 emitJumpSlowCaseIfNotImmediateInteger(regT0);
170 emitJumpSlowCaseIfNotImmediateInteger(regT2);
171 emitFastArithImmToInt(regT2);
172#if !PLATFORM(X86)
173 // Mask with 0x1f as per ecma-262 11.7.2 step 7.
174 // On 32-bit x86 this is not necessary, since the shift anount is implicitly masked in the instruction.
175 and32(Imm32(0x1f), regT2);
176#endif
177#if USE(ALTERNATE_JSIMMEDIATE)
178 rshift32(regT2, regT0);
179#else
180 rshiftPtr(regT2, regT0);
181#endif
182 }
183#if USE(ALTERNATE_JSIMMEDIATE)
184 emitFastArithIntToImmNoCheck(regT0, regT0);
185#else
186 orPtr(Imm32(JSImmediate::TagTypeNumber), regT0);
187#endif
188 emitPutVirtualRegister(result);
189}
190void JIT::compileFastArithSlow_op_rshift(unsigned result, unsigned op1, unsigned op2, Vector<SlowCaseEntry>::iterator& iter)
191{
192 linkSlowCase(iter);
193 if (isOperandConstantImmediateInt(op2))
194 emitPutJITStubArgFromVirtualRegister(op2, 2, regT2);
195 else {
196 if (isSSE2Present()) {
197#if USE(ALTERNATE_JSIMMEDIATE)
198 linkSlowCase(iter);
199#else
200 linkSlowCaseIfNotJSCell(iter, op1);
201 linkSlowCase(iter);
202 linkSlowCase(iter);
203#endif
204 linkSlowCase(iter);
205 // We're reloading op1 to regT0 as we can no longer guarantee that
206 // we have not munged the operand. It may have already been shifted
207 // correctly, but it still will not have been tagged.
208 emitGetVirtualRegister(op1, regT0);
209 } else {
210 linkSlowCase(iter);
211 linkSlowCase(iter);
212 }
213 emitPutJITStubArg(regT2, 2);
214 }
215
216 emitPutJITStubArg(regT0, 1);
217 emitCTICall(JITStubs::cti_op_rshift);
218 emitPutVirtualRegister(result);
219}
220
221void JIT::compileFastArith_op_bitand(unsigned result, unsigned op1, unsigned op2)
222{
223 if (isOperandConstantImmediateInt(op1)) {
224 emitGetVirtualRegister(op2, regT0);
225 emitJumpSlowCaseIfNotImmediateInteger(regT0);
226#if USE(ALTERNATE_JSIMMEDIATE)
227 int32_t imm = getConstantOperandImmediateInt(op1);
228 andPtr(Imm32(imm), regT0);
229 if (imm >= 0)
230 emitFastArithIntToImmNoCheck(regT0, regT0);
231#else
232 andPtr(Imm32(static_cast<int32_t>(JSImmediate::rawValue(getConstantOperand(op1)))), regT0);
233#endif
234 } else if (isOperandConstantImmediateInt(op2)) {
235 emitGetVirtualRegister(op1, regT0);
236 emitJumpSlowCaseIfNotImmediateInteger(regT0);
237#if USE(ALTERNATE_JSIMMEDIATE)
238 int32_t imm = getConstantOperandImmediateInt(op2);
239 andPtr(Imm32(imm), regT0);
240 if (imm >= 0)
241 emitFastArithIntToImmNoCheck(regT0, regT0);
242#else
243 andPtr(Imm32(static_cast<int32_t>(JSImmediate::rawValue(getConstantOperand(op2)))), regT0);
244#endif
245 } else {
246 emitGetVirtualRegisters(op1, regT0, op2, regT1);
247 andPtr(regT1, regT0);
248 emitJumpSlowCaseIfNotImmediateInteger(regT0);
249 }
250 emitPutVirtualRegister(result);
251}
252void JIT::compileFastArithSlow_op_bitand(unsigned result, unsigned op1, unsigned op2, Vector<SlowCaseEntry>::iterator& iter)
253{
254 linkSlowCase(iter);
255 if (isOperandConstantImmediateInt(op1)) {
256 emitPutJITStubArgFromVirtualRegister(op1, 1, regT2);
257 emitPutJITStubArg(regT0, 2);
258 } else if (isOperandConstantImmediateInt(op2)) {
259 emitPutJITStubArg(regT0, 1);
260 emitPutJITStubArgFromVirtualRegister(op2, 2, regT2);
261 } else {
262 emitPutJITStubArgFromVirtualRegister(op1, 1, regT2);
263 emitPutJITStubArg(regT1, 2);
264 }
265 emitCTICall(JITStubs::cti_op_bitand);
266 emitPutVirtualRegister(result);
267}
268
269#if PLATFORM(X86) || PLATFORM(X86_64)
270void JIT::compileFastArith_op_mod(unsigned result, unsigned op1, unsigned op2)
271{
272 emitGetVirtualRegisters(op1, X86::eax, op2, X86::ecx);
273 emitJumpSlowCaseIfNotImmediateInteger(X86::eax);
274 emitJumpSlowCaseIfNotImmediateInteger(X86::ecx);
275#if USE(ALTERNATE_JSIMMEDIATE)
276 addSlowCase(branchPtr(Equal, X86::ecx, ImmPtr(JSValue::encode(jsNumber(m_globalData, 0)))));
277 m_assembler.cdq();
278 m_assembler.idivl_r(X86::ecx);
279#else
280 emitFastArithDeTagImmediate(X86::eax);
281 addSlowCase(emitFastArithDeTagImmediateJumpIfZero(X86::ecx));
282 m_assembler.cdq();
283 m_assembler.idivl_r(X86::ecx);
284 signExtend32ToPtr(X86::edx, X86::edx);
285#endif
286 emitFastArithReTagImmediate(X86::edx, X86::eax);
287 emitPutVirtualRegister(result);
288}
289void JIT::compileFastArithSlow_op_mod(unsigned result, unsigned, unsigned, Vector<SlowCaseEntry>::iterator& iter)
290{
291#if USE(ALTERNATE_JSIMMEDIATE)
292 linkSlowCase(iter);
293 linkSlowCase(iter);
294 linkSlowCase(iter);
295#else
296 Jump notImm1 = getSlowCase(iter);
297 Jump notImm2 = getSlowCase(iter);
298 linkSlowCase(iter);
299 emitFastArithReTagImmediate(X86::eax, X86::eax);
300 emitFastArithReTagImmediate(X86::ecx, X86::ecx);
301 notImm1.link(this);
302 notImm2.link(this);
303#endif
304 emitPutJITStubArg(X86::eax, 1);
305 emitPutJITStubArg(X86::ecx, 2);
306 emitCTICall(JITStubs::cti_op_mod);
307 emitPutVirtualRegister(result);
308}
309#else
310void JIT::compileFastArith_op_mod(unsigned result, unsigned op1, unsigned op2)
311{
312 emitPutJITStubArgFromVirtualRegister(op1, 1, regT2);
313 emitPutJITStubArgFromVirtualRegister(op2, 2, regT2);
314 emitCTICall(JITStubs::cti_op_mod);
315 emitPutVirtualRegister(result);
316}
317void JIT::compileFastArithSlow_op_mod(unsigned, unsigned, unsigned, Vector<SlowCaseEntry>::iterator&)
318{
319 ASSERT_NOT_REACHED();
320}
321#endif
322
323void JIT::compileFastArith_op_post_inc(unsigned result, unsigned srcDst)
324{
325 emitGetVirtualRegister(srcDst, regT0);
326 move(regT0, regT1);
327 emitJumpSlowCaseIfNotImmediateInteger(regT0);
328#if USE(ALTERNATE_JSIMMEDIATE)
329 addSlowCase(branchAdd32(Overflow, Imm32(1), regT1));
330 emitFastArithIntToImmNoCheck(regT1, regT1);
331#else
332 addSlowCase(branchAdd32(Overflow, Imm32(1 << JSImmediate::IntegerPayloadShift), regT1));
333 signExtend32ToPtr(regT1, regT1);
334#endif
335 emitPutVirtualRegister(srcDst, regT1);
336 emitPutVirtualRegister(result);
337}
338void JIT::compileFastArithSlow_op_post_inc(unsigned result, unsigned srcDst, Vector<SlowCaseEntry>::iterator& iter)
339{
340 linkSlowCase(iter);
341 linkSlowCase(iter);
342 emitPutJITStubArg(regT0, 1);
343 emitCTICall(JITStubs::cti_op_post_inc);
344 emitPutVirtualRegister(srcDst, regT1);
345 emitPutVirtualRegister(result);
346}
347
348void JIT::compileFastArith_op_post_dec(unsigned result, unsigned srcDst)
349{
350 emitGetVirtualRegister(srcDst, regT0);
351 move(regT0, regT1);
352 emitJumpSlowCaseIfNotImmediateInteger(regT0);
353#if USE(ALTERNATE_JSIMMEDIATE)
354 addSlowCase(branchSub32(Zero, Imm32(1), regT1));
355 emitFastArithIntToImmNoCheck(regT1, regT1);
356#else
357 addSlowCase(branchSub32(Zero, Imm32(1 << JSImmediate::IntegerPayloadShift), regT1));
358 signExtend32ToPtr(regT1, regT1);
359#endif
360 emitPutVirtualRegister(srcDst, regT1);
361 emitPutVirtualRegister(result);
362}
363void JIT::compileFastArithSlow_op_post_dec(unsigned result, unsigned srcDst, Vector<SlowCaseEntry>::iterator& iter)
364{
365 linkSlowCase(iter);
366 linkSlowCase(iter);
367 emitPutJITStubArg(regT0, 1);
368 emitCTICall(JITStubs::cti_op_post_dec);
369 emitPutVirtualRegister(srcDst, regT1);
370 emitPutVirtualRegister(result);
371}
372
373void JIT::compileFastArith_op_pre_inc(unsigned srcDst)
374{
375 emitGetVirtualRegister(srcDst, regT0);
376 emitJumpSlowCaseIfNotImmediateInteger(regT0);
377#if USE(ALTERNATE_JSIMMEDIATE)
378 addSlowCase(branchAdd32(Overflow, Imm32(1), regT0));
379 emitFastArithIntToImmNoCheck(regT0, regT0);
380#else
381 addSlowCase(branchAdd32(Overflow, Imm32(1 << JSImmediate::IntegerPayloadShift), regT0));
382 signExtend32ToPtr(regT0, regT0);
383#endif
384 emitPutVirtualRegister(srcDst);
385}
386void JIT::compileFastArithSlow_op_pre_inc(unsigned srcDst, Vector<SlowCaseEntry>::iterator& iter)
387{
388 Jump notImm = getSlowCase(iter);
389 linkSlowCase(iter);
390 emitGetVirtualRegister(srcDst, regT0);
391 notImm.link(this);
392 emitPutJITStubArg(regT0, 1);
393 emitCTICall(JITStubs::cti_op_pre_inc);
394 emitPutVirtualRegister(srcDst);
395}
396
397void JIT::compileFastArith_op_pre_dec(unsigned srcDst)
398{
399 emitGetVirtualRegister(srcDst, regT0);
400 emitJumpSlowCaseIfNotImmediateInteger(regT0);
401#if USE(ALTERNATE_JSIMMEDIATE)
402 addSlowCase(branchSub32(Zero, Imm32(1), regT0));
403 emitFastArithIntToImmNoCheck(regT0, regT0);
404#else
405 addSlowCase(branchSub32(Zero, Imm32(1 << JSImmediate::IntegerPayloadShift), regT0));
406 signExtend32ToPtr(regT0, regT0);
407#endif
408 emitPutVirtualRegister(srcDst);
409}
410void JIT::compileFastArithSlow_op_pre_dec(unsigned srcDst, Vector<SlowCaseEntry>::iterator& iter)
411{
412 Jump notImm = getSlowCase(iter);
413 linkSlowCase(iter);
414 emitGetVirtualRegister(srcDst, regT0);
415 notImm.link(this);
416 emitPutJITStubArg(regT0, 1);
417 emitCTICall(JITStubs::cti_op_pre_dec);
418 emitPutVirtualRegister(srcDst);
419}
420
421
422#if !ENABLE(JIT_OPTIMIZE_ARITHMETIC)
423
424void JIT::compileFastArith_op_add(Instruction* currentInstruction)
425{
426 unsigned result = currentInstruction[1].u.operand;
427 unsigned op1 = currentInstruction[2].u.operand;
428 unsigned op2 = currentInstruction[3].u.operand;
429
430 emitPutJITStubArgFromVirtualRegister(op1, 1, regT2);
431 emitPutJITStubArgFromVirtualRegister(op2, 2, regT2);
432 emitCTICall(JITStubs::cti_op_add);
433 emitPutVirtualRegister(result);
434}
435void JIT::compileFastArithSlow_op_add(Instruction*, Vector<SlowCaseEntry>::iterator&)
436{
437 ASSERT_NOT_REACHED();
438}
439
440void JIT::compileFastArith_op_mul(Instruction* currentInstruction)
441{
442 unsigned result = currentInstruction[1].u.operand;
443 unsigned op1 = currentInstruction[2].u.operand;
444 unsigned op2 = currentInstruction[3].u.operand;
445
446 emitPutJITStubArgFromVirtualRegister(op1, 1, regT2);
447 emitPutJITStubArgFromVirtualRegister(op2, 2, regT2);
448 emitCTICall(JITStubs::cti_op_mul);
449 emitPutVirtualRegister(result);
450}
451void JIT::compileFastArithSlow_op_mul(Instruction*, Vector<SlowCaseEntry>::iterator&)
452{
453 ASSERT_NOT_REACHED();
454}
455
456void JIT::compileFastArith_op_sub(Instruction* currentInstruction)
457{
458 unsigned result = currentInstruction[1].u.operand;
459 unsigned op1 = currentInstruction[2].u.operand;
460 unsigned op2 = currentInstruction[3].u.operand;
461
462 emitPutJITStubArgFromVirtualRegister(op1, 1, regT2);
463 emitPutJITStubArgFromVirtualRegister(op2, 2, regT2);
464 emitCTICall(JITStubs::cti_op_sub);
465 emitPutVirtualRegister(result);
466}
467void JIT::compileFastArithSlow_op_sub(Instruction*, Vector<SlowCaseEntry>::iterator&)
468{
469 ASSERT_NOT_REACHED();
470}
471
472#elif USE(ALTERNATE_JSIMMEDIATE) // *AND* ENABLE(JIT_OPTIMIZE_ARITHMETIC)
473
474void JIT::compileBinaryArithOp(OpcodeID opcodeID, unsigned, unsigned op1, unsigned op2, OperandTypes)
475{
476 emitGetVirtualRegisters(op1, X86::eax, op2, X86::edx);
477 emitJumpSlowCaseIfNotImmediateInteger(X86::eax);
478 emitJumpSlowCaseIfNotImmediateInteger(X86::edx);
479 if (opcodeID == op_add)
480 addSlowCase(branchAdd32(Overflow, X86::edx, X86::eax));
481 else if (opcodeID == op_sub)
482 addSlowCase(branchSub32(Overflow, X86::edx, X86::eax));
483 else {
484 ASSERT(opcodeID == op_mul);
485 addSlowCase(branchMul32(Overflow, X86::edx, X86::eax));
486 addSlowCase(branchTest32(Zero, X86::eax));
487 }
488 emitFastArithIntToImmNoCheck(X86::eax, X86::eax);
489}
490
491void JIT::compileBinaryArithOpSlowCase(OpcodeID opcodeID, Vector<SlowCaseEntry>::iterator& iter, unsigned, unsigned op1, unsigned, OperandTypes types)
492{
493 // We assume that subtracting TagTypeNumber is equivalent to adding DoubleEncodeOffset.
494 COMPILE_ASSERT(((JSImmediate::TagTypeNumber + JSImmediate::DoubleEncodeOffset) == 0), TagTypeNumber_PLUS_DoubleEncodeOffset_EQUALS_0);
495
496 Jump notImm1 = getSlowCase(iter);
497 Jump notImm2 = getSlowCase(iter);
498
499 linkSlowCase(iter); // Integer overflow case - we could handle this in JIT code, but this is likely rare.
500 if (opcodeID == op_mul) // op_mul has an extra slow case to handle 0 * negative number.
501 linkSlowCase(iter);
502 emitGetVirtualRegister(op1, X86::eax);
503
504 Label stubFunctionCall(this);
505 emitPutJITStubArg(X86::eax, 1);
506 emitPutJITStubArg(X86::edx, 2);
507 if (opcodeID == op_add)
508 emitCTICall(JITStubs::cti_op_add);
509 else if (opcodeID == op_sub)
510 emitCTICall(JITStubs::cti_op_sub);
511 else {
512 ASSERT(opcodeID == op_mul);
513 emitCTICall(JITStubs::cti_op_mul);
514 }
515 Jump end = jump();
516
517 // if we get here, eax is not an int32, edx not yet checked.
518 notImm1.link(this);
519 if (!types.first().definitelyIsNumber())
520 emitJumpIfNotImmediateNumber(X86::eax).linkTo(stubFunctionCall, this);
521 if (!types.second().definitelyIsNumber())
522 emitJumpIfNotImmediateNumber(X86::edx).linkTo(stubFunctionCall, this);
523 addPtr(tagTypeNumberRegister, X86::eax);
524 m_assembler.movq_rr(X86::eax, X86::xmm1);
525 Jump op2isDouble = emitJumpIfNotImmediateInteger(X86::edx);
526 m_assembler.cvtsi2sd_rr(X86::edx, X86::xmm2);
527 Jump op2wasInteger = jump();
528
529 // if we get here, eax IS an int32, edx is not.
530 notImm2.link(this);
531 if (!types.second().definitelyIsNumber())
532 emitJumpIfNotImmediateNumber(X86::edx).linkTo(stubFunctionCall, this);
533 m_assembler.cvtsi2sd_rr(X86::eax, X86::xmm1);
534 op2isDouble.link(this);
535 addPtr(tagTypeNumberRegister, X86::edx);
536 m_assembler.movq_rr(X86::edx, X86::xmm2);
537 op2wasInteger.link(this);
538
539 if (opcodeID == op_add)
540 m_assembler.addsd_rr(X86::xmm2, X86::xmm1);
541 else if (opcodeID == op_sub)
542 m_assembler.subsd_rr(X86::xmm2, X86::xmm1);
543 else {
544 ASSERT(opcodeID == op_mul);
545 m_assembler.mulsd_rr(X86::xmm2, X86::xmm1);
546 }
547 m_assembler.movq_rr(X86::xmm1, X86::eax);
548 subPtr(tagTypeNumberRegister, X86::eax);
549
550 end.link(this);
551}
552
553void JIT::compileFastArith_op_add(Instruction* currentInstruction)
554{
555 unsigned result = currentInstruction[1].u.operand;
556 unsigned op1 = currentInstruction[2].u.operand;
557 unsigned op2 = currentInstruction[3].u.operand;
558 OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
559
560 if (!types.first().mightBeNumber() || !types.second().mightBeNumber()) {
561 emitPutJITStubArgFromVirtualRegister(op1, 1, X86::ecx);
562 emitPutJITStubArgFromVirtualRegister(op2, 2, X86::ecx);
563 emitCTICall(JITStubs::cti_op_add);
564 emitPutVirtualRegister(result);
565 return;
566 }
567
568 if (isOperandConstantImmediateInt(op1)) {
569 emitGetVirtualRegister(op2, X86::eax);
570 emitJumpSlowCaseIfNotImmediateInteger(X86::eax);
571 addSlowCase(branchAdd32(Overflow, Imm32(getConstantOperandImmediateInt(op1)), X86::eax));
572 emitFastArithIntToImmNoCheck(X86::eax, X86::eax);
573 } else if (isOperandConstantImmediateInt(op2)) {
574 emitGetVirtualRegister(op1, X86::eax);
575 emitJumpSlowCaseIfNotImmediateInteger(X86::eax);
576 addSlowCase(branchAdd32(Overflow, Imm32(getConstantOperandImmediateInt(op2)), X86::eax));
577 emitFastArithIntToImmNoCheck(X86::eax, X86::eax);
578 } else
579 compileBinaryArithOp(op_add, result, op1, op2, types);
580
581 emitPutVirtualRegister(result);
582}
583void JIT::compileFastArithSlow_op_add(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
584{
585 unsigned result = currentInstruction[1].u.operand;
586 unsigned op1 = currentInstruction[2].u.operand;
587 unsigned op2 = currentInstruction[3].u.operand;
588 OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
589
590 if (isOperandConstantImmediateInt(op1)) {
591 linkSlowCase(iter);
592 linkSlowCase(iter);
593 emitPutJITStubArgFromVirtualRegister(op1, 1, X86::ecx);
594 emitPutJITStubArgFromVirtualRegister(op2, 2, X86::ecx);
595 emitCTICall(JITStubs::cti_op_add);
596 } else if (isOperandConstantImmediateInt(op2)) {
597 linkSlowCase(iter);
598 linkSlowCase(iter);
599 emitPutJITStubArgFromVirtualRegister(op1, 1, X86::ecx);
600 emitPutJITStubArgFromVirtualRegister(op2, 2, X86::ecx);
601 emitCTICall(JITStubs::cti_op_add);
602 } else
603 compileBinaryArithOpSlowCase(op_add, iter, result, op1, op2, types);
604
605 emitPutVirtualRegister(result);
606}
607
608void JIT::compileFastArith_op_mul(Instruction* currentInstruction)
609{
610 unsigned result = currentInstruction[1].u.operand;
611 unsigned op1 = currentInstruction[2].u.operand;
612 unsigned op2 = currentInstruction[3].u.operand;
613 OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
614
615 // For now, only plant a fast int case if the constant operand is greater than zero.
616 int32_t value;
617 if (isOperandConstantImmediateInt(op1) && ((value = getConstantOperandImmediateInt(op1)) > 0)) {
618 emitGetVirtualRegister(op2, X86::eax);
619 emitJumpSlowCaseIfNotImmediateInteger(X86::eax);
620 addSlowCase(branchMul32(Overflow, Imm32(value), X86::eax, X86::eax));
621 emitFastArithReTagImmediate(X86::eax, X86::eax);
622 } else if (isOperandConstantImmediateInt(op2) && ((value = getConstantOperandImmediateInt(op2)) > 0)) {
623 emitGetVirtualRegister(op1, X86::eax);
624 emitJumpSlowCaseIfNotImmediateInteger(X86::eax);
625 addSlowCase(branchMul32(Overflow, Imm32(value), X86::eax, X86::eax));
626 emitFastArithReTagImmediate(X86::eax, X86::eax);
627 } else
628 compileBinaryArithOp(op_mul, result, op1, op2, types);
629
630 emitPutVirtualRegister(result);
631}
632void JIT::compileFastArithSlow_op_mul(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
633{
634 unsigned result = currentInstruction[1].u.operand;
635 unsigned op1 = currentInstruction[2].u.operand;
636 unsigned op2 = currentInstruction[3].u.operand;
637 OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
638
639 if ((isOperandConstantImmediateInt(op1) && (getConstantOperandImmediateInt(op1) > 0))
640 || (isOperandConstantImmediateInt(op2) && (getConstantOperandImmediateInt(op2) > 0))) {
641 linkSlowCase(iter);
642 linkSlowCase(iter);
643 // There is an extra slow case for (op1 * -N) or (-N * op2), to check for 0 since this should produce a result of -0.
644 emitPutJITStubArgFromVirtualRegister(op1, 1, X86::ecx);
645 emitPutJITStubArgFromVirtualRegister(op2, 2, X86::ecx);
646 emitCTICall(JITStubs::cti_op_mul);
647 } else
648 compileBinaryArithOpSlowCase(op_mul, iter, result, op1, op2, types);
649
650 emitPutVirtualRegister(result);
651}
652
653void JIT::compileFastArith_op_sub(Instruction* currentInstruction)
654{
655 unsigned result = currentInstruction[1].u.operand;
656 unsigned op1 = currentInstruction[2].u.operand;
657 unsigned op2 = currentInstruction[3].u.operand;
658 OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
659
660 compileBinaryArithOp(op_sub, result, op1, op2, types);
661
662 emitPutVirtualRegister(result);
663}
664void JIT::compileFastArithSlow_op_sub(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
665{
666 unsigned result = currentInstruction[1].u.operand;
667 unsigned op1 = currentInstruction[2].u.operand;
668 unsigned op2 = currentInstruction[3].u.operand;
669 OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
670
671 compileBinaryArithOpSlowCase(op_sub, iter, result, op1, op2, types);
672
673 emitPutVirtualRegister(result);
674}
675
676#else
677
678typedef X86Assembler::JmpSrc JmpSrc;
679typedef X86Assembler::JmpDst JmpDst;
680typedef X86Assembler::XMMRegisterID XMMRegisterID;
681
682
683void JIT::compileBinaryArithOp(OpcodeID opcodeID, unsigned dst, unsigned src1, unsigned src2, OperandTypes types)
684{
685 Structure* numberStructure = m_globalData->numberStructure.get();
686 JmpSrc wasJSNumberCell1;
687 JmpSrc wasJSNumberCell2;
688
689 emitGetVirtualRegisters(src1, X86::eax, src2, X86::edx);
690
691 if (types.second().isReusable() && isSSE2Present()) {
692 ASSERT(types.second().mightBeNumber());
693
694 // Check op2 is a number
695 __ testl_i32r(JSImmediate::TagTypeNumber, X86::edx);
696 JmpSrc op2imm = __ jne();
697 if (!types.second().definitelyIsNumber()) {
698 emitJumpSlowCaseIfNotJSCell(X86::edx, src2);
699 __ cmpl_im(reinterpret_cast<unsigned>(numberStructure), FIELD_OFFSET(JSCell, m_structure), X86::edx);
700 addSlowCase(__ jne());
701 }
702
703 // (1) In this case src2 is a reusable number cell.
704 // Slow case if src1 is not a number type.
705 __ testl_i32r(JSImmediate::TagTypeNumber, X86::eax);
706 JmpSrc op1imm = __ jne();
707 if (!types.first().definitelyIsNumber()) {
708 emitJumpSlowCaseIfNotJSCell(X86::eax, src1);
709 __ cmpl_im(reinterpret_cast<unsigned>(numberStructure), FIELD_OFFSET(JSCell, m_structure), X86::eax);
710 addSlowCase(__ jne());
711 }
712
713 // (1a) if we get here, src1 is also a number cell
714 __ movsd_mr(FIELD_OFFSET(JSNumberCell, m_value), X86::eax, X86::xmm0);
715 JmpSrc loadedDouble = __ jmp();
716 // (1b) if we get here, src1 is an immediate
717 __ linkJump(op1imm, __ label());
718 emitFastArithImmToInt(X86::eax);
719 __ cvtsi2sd_rr(X86::eax, X86::xmm0);
720 // (1c)
721 __ linkJump(loadedDouble, __ label());
722 if (opcodeID == op_add)
723 __ addsd_mr(FIELD_OFFSET(JSNumberCell, m_value), X86::edx, X86::xmm0);
724 else if (opcodeID == op_sub)
725 __ subsd_mr(FIELD_OFFSET(JSNumberCell, m_value), X86::edx, X86::xmm0);
726 else {
727 ASSERT(opcodeID == op_mul);
728 __ mulsd_mr(FIELD_OFFSET(JSNumberCell, m_value), X86::edx, X86::xmm0);
729 }
730
731 // Store the result to the JSNumberCell and jump.
732 __ movsd_rm(X86::xmm0, FIELD_OFFSET(JSNumberCell, m_value), X86::edx);
733 __ movl_rr(X86::edx, X86::eax);
734 emitPutVirtualRegister(dst);
735 wasJSNumberCell2 = __ jmp();
736
737 // (2) This handles cases where src2 is an immediate number.
738 // Two slow cases - either src1 isn't an immediate, or the subtract overflows.
739 __ linkJump(op2imm, __ label());
740 emitJumpSlowCaseIfNotImmediateInteger(X86::eax);
741 } else if (types.first().isReusable() && isSSE2Present()) {
742 ASSERT(types.first().mightBeNumber());
743
744 // Check op1 is a number
745 __ testl_i32r(JSImmediate::TagTypeNumber, X86::eax);
746 JmpSrc op1imm = __ jne();
747 if (!types.first().definitelyIsNumber()) {
748 emitJumpSlowCaseIfNotJSCell(X86::eax, src1);
749 __ cmpl_im(reinterpret_cast<unsigned>(numberStructure), FIELD_OFFSET(JSCell, m_structure), X86::eax);
750 addSlowCase(__ jne());
751 }
752
753 // (1) In this case src1 is a reusable number cell.
754 // Slow case if src2 is not a number type.
755 __ testl_i32r(JSImmediate::TagTypeNumber, X86::edx);
756 JmpSrc op2imm = __ jne();
757 if (!types.second().definitelyIsNumber()) {
758 emitJumpSlowCaseIfNotJSCell(X86::edx, src2);
759 __ cmpl_im(reinterpret_cast<unsigned>(numberStructure), FIELD_OFFSET(JSCell, m_structure), X86::edx);
760 addSlowCase(__ jne());
761 }
762
763 // (1a) if we get here, src2 is also a number cell
764 __ movsd_mr(FIELD_OFFSET(JSNumberCell, m_value), X86::edx, X86::xmm1);
765 JmpSrc loadedDouble = __ jmp();
766 // (1b) if we get here, src2 is an immediate
767 __ linkJump(op2imm, __ label());
768 emitFastArithImmToInt(X86::edx);
769 __ cvtsi2sd_rr(X86::edx, X86::xmm1);
770 // (1c)
771 __ linkJump(loadedDouble, __ label());
772 __ movsd_mr(FIELD_OFFSET(JSNumberCell, m_value), X86::eax, X86::xmm0);
773 if (opcodeID == op_add)
774 __ addsd_rr(X86::xmm1, X86::xmm0);
775 else if (opcodeID == op_sub)
776 __ subsd_rr(X86::xmm1, X86::xmm0);
777 else {
778 ASSERT(opcodeID == op_mul);
779 __ mulsd_rr(X86::xmm1, X86::xmm0);
780 }
781 __ movsd_rm(X86::xmm0, FIELD_OFFSET(JSNumberCell, m_value), X86::eax);
782 emitPutVirtualRegister(dst);
783
784 // Store the result to the JSNumberCell and jump.
785 __ movsd_rm(X86::xmm0, FIELD_OFFSET(JSNumberCell, m_value), X86::eax);
786 emitPutVirtualRegister(dst);
787 wasJSNumberCell1 = __ jmp();
788
789 // (2) This handles cases where src1 is an immediate number.
790 // Two slow cases - either src2 isn't an immediate, or the subtract overflows.
791 __ linkJump(op1imm, __ label());
792 emitJumpSlowCaseIfNotImmediateInteger(X86::edx);
793 } else
794 emitJumpSlowCaseIfNotImmediateIntegers(X86::eax, X86::edx, X86::ecx);
795
796 if (opcodeID == op_add) {
797 emitFastArithDeTagImmediate(X86::eax);
798 __ addl_rr(X86::edx, X86::eax);
799 addSlowCase(__ jo());
800 } else if (opcodeID == op_sub) {
801 __ subl_rr(X86::edx, X86::eax);
802 addSlowCase(__ jo());
803 signExtend32ToPtr(X86::eax, X86::eax);
804 emitFastArithReTagImmediate(X86::eax, X86::eax);
805 } else {
806 ASSERT(opcodeID == op_mul);
807 // convert eax & edx from JSImmediates to ints, and check if either are zero
808 emitFastArithImmToInt(X86::edx);
809 Jump op1Zero = emitFastArithDeTagImmediateJumpIfZero(X86::eax);
810 __ testl_rr(X86::edx, X86::edx);
811 JmpSrc op2NonZero = __ jne();
812 op1Zero.link(this);
813 // if either input is zero, add the two together, and check if the result is < 0.
814 // If it is, we have a problem (N < 0), (N * 0) == -0, not representatble as a JSImmediate.
815 __ movl_rr(X86::eax, X86::ecx);
816 __ addl_rr(X86::edx, X86::ecx);
817 addSlowCase(__ js());
818 // Skip the above check if neither input is zero
819 __ linkJump(op2NonZero, __ label());
820 __ imull_rr(X86::edx, X86::eax);
821 addSlowCase(__ jo());
822 signExtend32ToPtr(X86::eax, X86::eax);
823 emitFastArithReTagImmediate(X86::eax, X86::eax);
824 }
825 emitPutVirtualRegister(dst);
826
827 if (types.second().isReusable() && isSSE2Present()) {
828 __ linkJump(wasJSNumberCell2, __ label());
829 }
830 else if (types.first().isReusable() && isSSE2Present()) {
831 __ linkJump(wasJSNumberCell1, __ label());
832 }
833}
834
835void JIT::compileBinaryArithOpSlowCase(OpcodeID opcodeID, Vector<SlowCaseEntry>::iterator& iter, unsigned dst, unsigned src1, unsigned src2, OperandTypes types)
836{
837 linkSlowCase(iter);
838 if (types.second().isReusable() && isSSE2Present()) {
839 if (!types.first().definitelyIsNumber()) {
840 linkSlowCaseIfNotJSCell(iter, src1);
841 linkSlowCase(iter);
842 }
843 if (!types.second().definitelyIsNumber()) {
844 linkSlowCaseIfNotJSCell(iter, src2);
845 linkSlowCase(iter);
846 }
847 } else if (types.first().isReusable() && isSSE2Present()) {
848 if (!types.first().definitelyIsNumber()) {
849 linkSlowCaseIfNotJSCell(iter, src1);
850 linkSlowCase(iter);
851 }
852 if (!types.second().definitelyIsNumber()) {
853 linkSlowCaseIfNotJSCell(iter, src2);
854 linkSlowCase(iter);
855 }
856 }
857 linkSlowCase(iter);
858
859 // additional entry point to handle -0 cases.
860 if (opcodeID == op_mul)
861 linkSlowCase(iter);
862
863 emitPutJITStubArgFromVirtualRegister(src1, 1, X86::ecx);
864 emitPutJITStubArgFromVirtualRegister(src2, 2, X86::ecx);
865 if (opcodeID == op_add)
866 emitCTICall(JITStubs::cti_op_add);
867 else if (opcodeID == op_sub)
868 emitCTICall(JITStubs::cti_op_sub);
869 else {
870 ASSERT(opcodeID == op_mul);
871 emitCTICall(JITStubs::cti_op_mul);
872 }
873 emitPutVirtualRegister(dst);
874}
875
876void JIT::compileFastArith_op_add(Instruction* currentInstruction)
877{
878 unsigned result = currentInstruction[1].u.operand;
879 unsigned op1 = currentInstruction[2].u.operand;
880 unsigned op2 = currentInstruction[3].u.operand;
881
882 if (isOperandConstantImmediateInt(op1)) {
883 emitGetVirtualRegister(op2, X86::eax);
884 emitJumpSlowCaseIfNotImmediateInteger(X86::eax);
885 addSlowCase(branchAdd32(Overflow, Imm32(getConstantOperandImmediateInt(op1) << JSImmediate::IntegerPayloadShift), X86::eax));
886 signExtend32ToPtr(X86::eax, X86::eax);
887 emitPutVirtualRegister(result);
888 } else if (isOperandConstantImmediateInt(op2)) {
889 emitGetVirtualRegister(op1, X86::eax);
890 emitJumpSlowCaseIfNotImmediateInteger(X86::eax);
891 addSlowCase(branchAdd32(Overflow, Imm32(getConstantOperandImmediateInt(op2) << JSImmediate::IntegerPayloadShift), X86::eax));
892 signExtend32ToPtr(X86::eax, X86::eax);
893 emitPutVirtualRegister(result);
894 } else {
895 OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
896 if (types.first().mightBeNumber() && types.second().mightBeNumber())
897 compileBinaryArithOp(op_add, result, op1, op2, OperandTypes::fromInt(currentInstruction[4].u.operand));
898 else {
899 emitPutJITStubArgFromVirtualRegister(op1, 1, X86::ecx);
900 emitPutJITStubArgFromVirtualRegister(op2, 2, X86::ecx);
901 emitCTICall(JITStubs::cti_op_add);
902 emitPutVirtualRegister(result);
903 }
904 }
905}
906void JIT::compileFastArithSlow_op_add(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
907{
908 unsigned result = currentInstruction[1].u.operand;
909 unsigned op1 = currentInstruction[2].u.operand;
910 unsigned op2 = currentInstruction[3].u.operand;
911
912 if (isOperandConstantImmediateInt(op1)) {
913 Jump notImm = getSlowCase(iter);
914 linkSlowCase(iter);
915 sub32(Imm32(getConstantOperandImmediateInt(op1) << JSImmediate::IntegerPayloadShift), X86::eax);
916 notImm.link(this);
917 emitPutJITStubArgFromVirtualRegister(op1, 1, X86::ecx);
918 emitPutJITStubArg(X86::eax, 2);
919 emitCTICall(JITStubs::cti_op_add);
920 emitPutVirtualRegister(result);
921 } else if (isOperandConstantImmediateInt(op2)) {
922 Jump notImm = getSlowCase(iter);
923 linkSlowCase(iter);
924 sub32(Imm32(getConstantOperandImmediateInt(op2) << JSImmediate::IntegerPayloadShift), X86::eax);
925 notImm.link(this);
926 emitPutJITStubArg(X86::eax, 1);
927 emitPutJITStubArgFromVirtualRegister(op2, 2, X86::ecx);
928 emitCTICall(JITStubs::cti_op_add);
929 emitPutVirtualRegister(result);
930 } else {
931 OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
932 ASSERT(types.first().mightBeNumber() && types.second().mightBeNumber());
933 compileBinaryArithOpSlowCase(op_add, iter, result, op1, op2, types);
934 }
935}
936
937void JIT::compileFastArith_op_mul(Instruction* currentInstruction)
938{
939 unsigned result = currentInstruction[1].u.operand;
940 unsigned op1 = currentInstruction[2].u.operand;
941 unsigned op2 = currentInstruction[3].u.operand;
942
943 // For now, only plant a fast int case if the constant operand is greater than zero.
944 int32_t value;
945 if (isOperandConstantImmediateInt(op1) && ((value = getConstantOperandImmediateInt(op1)) > 0)) {
946 emitGetVirtualRegister(op2, X86::eax);
947 emitJumpSlowCaseIfNotImmediateInteger(X86::eax);
948 emitFastArithDeTagImmediate(X86::eax);
949 addSlowCase(branchMul32(Overflow, Imm32(value), X86::eax, X86::eax));
950 signExtend32ToPtr(X86::eax, X86::eax);
951 emitFastArithReTagImmediate(X86::eax, X86::eax);
952 emitPutVirtualRegister(result);
953 } else if (isOperandConstantImmediateInt(op2) && ((value = getConstantOperandImmediateInt(op2)) > 0)) {
954 emitGetVirtualRegister(op1, X86::eax);
955 emitJumpSlowCaseIfNotImmediateInteger(X86::eax);
956 emitFastArithDeTagImmediate(X86::eax);
957 addSlowCase(branchMul32(Overflow, Imm32(value), X86::eax, X86::eax));
958 signExtend32ToPtr(X86::eax, X86::eax);
959 emitFastArithReTagImmediate(X86::eax, X86::eax);
960 emitPutVirtualRegister(result);
961 } else
962 compileBinaryArithOp(op_mul, result, op1, op2, OperandTypes::fromInt(currentInstruction[4].u.operand));
963}
964void JIT::compileFastArithSlow_op_mul(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
965{
966 unsigned result = currentInstruction[1].u.operand;
967 unsigned op1 = currentInstruction[2].u.operand;
968 unsigned op2 = currentInstruction[3].u.operand;
969
970 if ((isOperandConstantImmediateInt(op1) && (getConstantOperandImmediateInt(op1) > 0))
971 || (isOperandConstantImmediateInt(op2) && (getConstantOperandImmediateInt(op2) > 0))) {
972 linkSlowCase(iter);
973 linkSlowCase(iter);
974 // There is an extra slow case for (op1 * -N) or (-N * op2), to check for 0 since this should produce a result of -0.
975 emitPutJITStubArgFromVirtualRegister(op1, 1, X86::ecx);
976 emitPutJITStubArgFromVirtualRegister(op2, 2, X86::ecx);
977 emitCTICall(JITStubs::cti_op_mul);
978 emitPutVirtualRegister(result);
979 } else
980 compileBinaryArithOpSlowCase(op_mul, iter, result, op1, op2, OperandTypes::fromInt(currentInstruction[4].u.operand));
981}
982
983void JIT::compileFastArith_op_sub(Instruction* currentInstruction)
984{
985 compileBinaryArithOp(op_sub, currentInstruction[1].u.operand, currentInstruction[2].u.operand, currentInstruction[3].u.operand, OperandTypes::fromInt(currentInstruction[4].u.operand));
986}
987void JIT::compileFastArithSlow_op_sub(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
988{
989 compileBinaryArithOpSlowCase(op_sub, iter, currentInstruction[1].u.operand, currentInstruction[2].u.operand, currentInstruction[3].u.operand, OperandTypes::fromInt(currentInstruction[4].u.operand));
990}
991
992#endif
993
994} // namespace JSC
995
996#endif // ENABLE(JIT)
Note: See TracBrowser for help on using the repository browser.