Changeset 39670 in webkit for trunk/JavaScriptCore/jit


Ignore:
Timestamp:
Jan 6, 2009, 9:11:57 PM (16 years ago)
Author:
[email protected]
Message:

JavaScriptCore:

2009-01-05 Gavin Barraclough <[email protected]>

Reviewed by Oliver Hunt.

Replace all uses of JSValue* with a new smart pointer type, JSValuePtr.


A JavaScript value may be a heap object or boxed primitive, represented by a
pointer, or may be an unboxed immediate value, such as an integer. Since a
value may dynamically need to contain either a pointer value or an immediate,
we encode immediates as pointer values (since all valid JSCell pointers are
allocated at alligned addesses, unaligned addresses are available to encode
immediates). As such all JavaScript values are represented using a JSValue*.

This implementation is encumbered by a number of constraints. It ties the
JSValue representation to the size of pointer on the platform, which, for
example, means that we currently can represent different ranges of integers
as immediates on x86 and x86-64. It also prevents us from overloading the
to-boolean conversion used to test for noValue() - effectively forcing us
to represent noValue() as 0. This would potentially be problematic were we
to wish to encode integer values differently (e.g. were we to use the v8
encoding, where pointers are tagged with 1 and integers with 0, then the
immediate integer 0 would conflict with noValue()).

This patch replaces all usage of JSValue* with a new class, JSValuePtr,
which encapsulates the pointer. JSValuePtr maintains the same interface as
JSValue*, overloading operator-> and operator bool such that previous
operations in the code on variables of type JSValue* are still supported.

In order to provide a ProtectPtr<> type with support for the new value
representation (without using the internal JSValue type directly), a new
ProtectJSValuePtr type has been added, equivalent to the previous type
ProtectPtr<JSValue>.

This patch is likely the first in a sequence of three changes. With the
value now encapsulated it will likely make sense to migrate the functionality
from JSValue into JSValuePtr, such that the internal pointer representation
need not be exposed. Through migrating the functionality to the wrapper
class the existing JSValue should be rendered redundant, and the class is
likely to be removed (the JSValuePtr now wrapping a pointer to a JSCell).
At this stage it will likely make sense to rename JSValuePtr to JSValue.

https://bugs.webkit.org/show_bug.cgi?id=23114

  • API/APICast.h: (toJS): (toRef):
  • API/JSBase.cpp: (JSEvaluateScript):
  • 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::BytecodeGenerator): (JSC::BytecodeGenerator::addConstant): (JSC::BytecodeGenerator::addUnexpectedConstant): (JSC::BytecodeGenerator::emitLoad): (JSC::BytecodeGenerator::emitLoadJSV): (JSC::BytecodeGenerator::emitGetScopedVar): (JSC::BytecodeGenerator::emitPutScopedVar): (JSC::BytecodeGenerator::emitNewError): (JSC::keyForImmediateSwitch):
  • bytecompiler/BytecodeGenerator.h: (JSC::BytecodeGenerator::JSValueHashTraits::constructDeletedValue): (JSC::BytecodeGenerator::JSValueHashTraits::isDeletedValue):
  • debugger/DebuggerCallFrame.cpp: (JSC::DebuggerCallFrame::evaluate):
  • debugger/DebuggerCallFrame.h: (JSC::DebuggerCallFrame::DebuggerCallFrame): (JSC::DebuggerCallFrame::exception):
  • interpreter/CallFrame.cpp: (JSC::CallFrame::thisValue):
  • interpreter/CallFrame.h: (JSC::ExecState::setException): (JSC::ExecState::exception): (JSC::ExecState::exceptionSlot): (JSC::ExecState::hadException):
  • interpreter/Interpreter.cpp: (JSC::fastIsNumber): (JSC::fastToInt32): (JSC::fastToUInt32): (JSC::jsLess): (JSC::jsLessEq): (JSC::jsAddSlowCase): (JSC::jsAdd): (JSC::jsTypeStringForValue): (JSC::jsIsObjectType): (JSC::jsIsFunctionType): (JSC::Interpreter::resolve): (JSC::Interpreter::resolveSkip): (JSC::Interpreter::resolveGlobal): (JSC::inlineResolveBase): (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::checkTimeout): (JSC::Interpreter::createExceptionScope): (JSC::cachePrototypeChain): (JSC::Interpreter::tryCachePutByID): (JSC::countPrototypeChainEntriesAndCheckForProxies): (JSC::Interpreter::tryCacheGetByID): (JSC::Interpreter::privateExecute): (JSC::Interpreter::retrieveArguments): (JSC::Interpreter::retrieveCaller): (JSC::Interpreter::retrieveLastCaller): (JSC::Interpreter::tryCTICachePutByID): (JSC::Interpreter::tryCTICacheGetByID): (JSC::returnToThrowTrampoline): (JSC::Interpreter::cti_op_convert_this): (JSC::Interpreter::cti_op_add): (JSC::Interpreter::cti_op_pre_inc): (JSC::Interpreter::cti_op_loop_if_less): (JSC::Interpreter::cti_op_loop_if_lesseq): (JSC::Interpreter::cti_op_get_by_id_generic): (JSC::Interpreter::cti_op_get_by_id): (JSC::Interpreter::cti_op_get_by_id_second): (JSC::Interpreter::cti_op_get_by_id_self_fail): (JSC::Interpreter::cti_op_get_by_id_proto_list): (JSC::Interpreter::cti_op_get_by_id_proto_list_full): (JSC::Interpreter::cti_op_get_by_id_proto_fail): (JSC::Interpreter::cti_op_get_by_id_array_fail): (JSC::Interpreter::cti_op_get_by_id_string_fail): (JSC::Interpreter::cti_op_instanceof): (JSC::Interpreter::cti_op_del_by_id): (JSC::Interpreter::cti_op_mul): (JSC::Interpreter::cti_op_call_NotJSFunction): (JSC::Interpreter::cti_op_resolve): (JSC::Interpreter::cti_op_construct_NotJSConstruct): (JSC::Interpreter::cti_op_get_by_val): (JSC::Interpreter::cti_op_resolve_func): (JSC::Interpreter::cti_op_sub): (JSC::Interpreter::cti_op_put_by_val): (JSC::Interpreter::cti_op_put_by_val_array): (JSC::Interpreter::cti_op_lesseq): (JSC::Interpreter::cti_op_loop_if_true): (JSC::Interpreter::cti_op_negate): (JSC::Interpreter::cti_op_resolve_base): (JSC::Interpreter::cti_op_resolve_skip): (JSC::Interpreter::cti_op_resolve_global): (JSC::Interpreter::cti_op_div): (JSC::Interpreter::cti_op_pre_dec): (JSC::Interpreter::cti_op_jless): (JSC::Interpreter::cti_op_not): (JSC::Interpreter::cti_op_jtrue): (JSC::Interpreter::cti_op_post_inc): (JSC::Interpreter::cti_op_eq): (JSC::Interpreter::cti_op_lshift): (JSC::Interpreter::cti_op_bitand): (JSC::Interpreter::cti_op_rshift): (JSC::Interpreter::cti_op_bitnot): (JSC::Interpreter::cti_op_resolve_with_base): (JSC::Interpreter::cti_op_mod): (JSC::Interpreter::cti_op_less): (JSC::Interpreter::cti_op_neq): (JSC::Interpreter::cti_op_post_dec): (JSC::Interpreter::cti_op_urshift): (JSC::Interpreter::cti_op_bitxor): (JSC::Interpreter::cti_op_bitor): (JSC::Interpreter::cti_op_call_eval): (JSC::Interpreter::cti_op_throw): (JSC::Interpreter::cti_op_next_pname): (JSC::Interpreter::cti_op_typeof): (JSC::Interpreter::cti_op_is_undefined): (JSC::Interpreter::cti_op_is_boolean): (JSC::Interpreter::cti_op_is_number): (JSC::Interpreter::cti_op_is_string): (JSC::Interpreter::cti_op_is_object): (JSC::Interpreter::cti_op_is_function): (JSC::Interpreter::cti_op_stricteq): (JSC::Interpreter::cti_op_nstricteq): (JSC::Interpreter::cti_op_to_jsnumber): (JSC::Interpreter::cti_op_in): (JSC::Interpreter::cti_op_switch_imm): (JSC::Interpreter::cti_op_switch_char): (JSC::Interpreter::cti_op_switch_string): (JSC::Interpreter::cti_op_del_by_val): (JSC::Interpreter::cti_op_new_error): (JSC::Interpreter::cti_vm_throw):
  • interpreter/Interpreter.h: (JSC::Interpreter::isJSArray): (JSC::Interpreter::isJSString):
  • interpreter/Register.h: (JSC::Register::): (JSC::Register::Register): (JSC::Register::jsValue): (JSC::Register::getJSValue):
  • jit/JIT.cpp: (JSC::): (JSC::JIT::compileOpStrictEq): (JSC::JIT::privateCompileMainPass): (JSC::JIT::privateCompileSlowCases):
  • jit/JIT.h: (JSC::): (JSC::JIT::execute):
  • jit/JITArithmetic.cpp: (JSC::JIT::compileFastArith_op_rshift): (JSC::JIT::compileFastArithSlow_op_rshift):
  • jit/JITCall.cpp: (JSC::JIT::unlinkCall): (JSC::JIT::compileOpCallInitializeCallFrame): (JSC::JIT::compileOpCall):
  • jit/JITInlineMethods.h: (JSC::JIT::emitGetVirtualRegister): (JSC::JIT::getConstantOperand): (JSC::JIT::isOperandConstant31BitImmediateInt): (JSC::JIT::emitPutJITStubArgFromVirtualRegister): (JSC::JIT::emitInitRegister):
  • jit/JITPropertyAccess.cpp: (JSC::resizePropertyStorage): (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):
  • jsc.cpp: (functionPrint): (functionDebug): (functionGC): (functionVersion): (functionRun): (functionLoad): (functionReadline): (functionQuit):
  • parser/Nodes.cpp: (JSC::NullNode::emitBytecode): (JSC::ArrayNode::emitBytecode): (JSC::FunctionCallValueNode::emitBytecode): (JSC::FunctionCallResolveNode::emitBytecode): (JSC::VoidNode::emitBytecode): (JSC::ConstDeclNode::emitCodeSingle): (JSC::ReturnNode::emitBytecode): (JSC::processClauseList): (JSC::EvalNode::emitBytecode): (JSC::FunctionBodyNode::emitBytecode): (JSC::ProgramNode::emitBytecode):
  • 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::ArgList::slowAppend):
  • runtime/ArgList.h: (JSC::ArgList::at): (JSC::ArgList::append):
  • 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::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): (JSC::Heap::collect):
  • runtime/Collector.h:
  • runtime/Completion.cpp: (JSC::evaluate):
  • runtime/Completion.h: (JSC::Completion::Completion): (JSC::Completion::value): (JSC::Completion::setValue): (JSC::Completion::isValueCompletion):
  • 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::dateProtoFuncValueOf): (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/InitializeThreading.cpp:
  • 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::getPropertyNames): (JSC::JSArray::setLength): (JSC::JSArray::pop): (JSC::JSArray::push): (JSC::JSArray::mark): (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):
  • runtime/JSCell.cpp: (JSC::JSCell::put): (JSC::JSCell::getJSNumber):
  • runtime/JSCell.h: (JSC::asCell): (JSC::JSValue::asCell): (JSC::JSValue::toPrimitive): (JSC::JSValue::getPrimitiveNumber): (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):
  • 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::isPositiveNumber): (JSC::JSImmediate::isBoolean): (JSC::JSImmediate::isUndefinedOrNull): (JSC::JSImmediate::isNegative): (JSC::JSImmediate::isEitherImmediate): (JSC::JSImmediate::isAnyImmediate): (JSC::JSImmediate::areBothImmediate): (JSC::JSImmediate::areBothImmediateNumbers): (JSC::JSImmediate::andImmediateNumbers): (JSC::JSImmediate::xorImmediateNumbers): (JSC::JSImmediate::orImmediateNumbers): (JSC::JSImmediate::rightShiftImmediateNumbers): (JSC::JSImmediate::canDoFastAdditiveOperations): (JSC::JSImmediate::addImmediateNumbers): (JSC::JSImmediate::subImmediateNumbers): (JSC::JSImmediate::incImmediateNumber): (JSC::JSImmediate::decImmediateNumber): (JSC::JSImmediate::makeValue): (JSC::JSImmediate::makeInt): (JSC::JSImmediate::makeBool): (JSC::JSImmediate::makeUndefined): (JSC::JSImmediate::makeNull): (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::from): (JSC::JSImmediate::getTruncatedInt32): (JSC::JSImmediate::toDouble): (JSC::JSImmediate::getUInt32): (JSC::jsNull): (JSC::jsBoolean): (JSC::jsUndefined): (JSC::JSValue::isUndefined): (JSC::JSValue::isNull): (JSC::JSValue::isUndefinedOrNull): (JSC::JSValue::isBoolean): (JSC::JSValue::getBoolean): (JSC::JSValue::toInt32): (JSC::JSValue::toUInt32): (JSC::toInt32): (JSC::toUInt32):
  • 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): (JSC::jsNaN):
  • runtime/JSNumberCell.h: (JSC::JSNumberCell::createStructure): (JSC::asNumberCell): (JSC::jsNumber): (JSC::JSValue::toJSNumber):
  • 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::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):
  • runtime/JSValue.h: (JSC::JSValuePtr::makeImmediate): (JSC::JSValuePtr::immediateValue): (JSC::JSValuePtr::JSValuePtr): (JSC::JSValuePtr::operator->): (JSC::JSValuePtr::hasValue): (JSC::JSValuePtr::operator==): (JSC::JSValuePtr::operator!=): (JSC::JSValuePtr::encode): (JSC::JSValuePtr::decode): (JSC::JSValue::asValue): (JSC::noValue): (JSC::operator==): (JSC::operator!=):
  • runtime/JSVariableObject.h: (JSC::JSVariableObject::symbolTablePut): (JSC::JSVariableObject::symbolTablePutWithAttributes):
  • runtime/JSWrapperObject.cpp: (JSC::JSWrapperObject::mark):
  • 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::constructNumberFromImmediateNumber):
  • 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::equal): (JSC::equalSlowCase): (JSC::strictEqual): (JSC::strictEqualSlowCase): (JSC::throwOutOfMemoryError):
  • runtime/Operations.h: (JSC::equalSlowCaseInline): (JSC::strictEqualSlowCaseInline):
  • 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::ProtectedPtr): (JSC::ProtectedPtr::operator JSValuePtr): (JSC::ProtectedJSValuePtr::ProtectedJSValuePtr): (JSC::ProtectedJSValuePtr::get): (JSC::ProtectedJSValuePtr::operator JSValuePtr): (JSC::ProtectedJSValuePtr::operator->): (JSC::::ProtectedPtr): (JSC::::~ProtectedPtr): (JSC::::operator): (JSC::ProtectedJSValuePtr::~ProtectedJSValuePtr): (JSC::ProtectedJSValuePtr::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): (JSC::Structure::createCachedPrototypeChain):
  • runtime/Structure.h: (JSC::Structure::create): (JSC::Structure::setPrototypeWithoutTransition): (JSC::Structure::storedPrototype):

JavaScriptGlue:

2009-01-05 Gavin Barraclough <[email protected]>

Rubber Stamped by Oliver Hunt.

Replace all uses of JSValue* with new wrapper class, JSValuePtr.
See JavaScriptCore/ChangeLog for more detailed description.

  • 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-01-05 Gavin Barraclough <[email protected]>

Rubber Stamped by Oliver Hunt.

Replace all uses of JSValue* with new wrapper class, JSValuePtr.
See JavaScriptCore/ChangeLog for more detailed description.

  • bindings/js/JSAttrCustom.cpp: (WebCore::JSAttr::setValue):
  • bindings/js/JSCSSRuleCustom.cpp: (WebCore::toJS):
  • bindings/js/JSCSSStyleDeclarationCustom.cpp: (WebCore::JSCSSStyleDeclaration::nameGetter): (WebCore::JSCSSStyleDeclaration::customPut):
  • bindings/js/JSCSSValueCustom.cpp: (WebCore::toJS):
  • bindings/js/JSCanvasPixelArrayCustom.h: (WebCore::JSCanvasPixelArray::getByIndex): (WebCore::JSCanvasPixelArray::indexSetter):
  • 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/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::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::findJSUnprotectedEventListener): (WebCore::JSDOMGlobalObject::findOrCreateJSUnprotectedEventListener):
  • bindings/js/JSDOMGlobalObject.h:
  • bindings/js/JSDOMWindowBase.cpp: (WebCore::createWindow): (WebCore::showModalDialog): (jsDOMWindowBaseCrypto): (jsDOMWindowBaseEvent): (jsDOMWindowBaseImage): (jsDOMWindowBaseMessageChannel): (jsDOMWindowBaseOption): (jsDOMWindowBaseXMLHttpRequest): (jsDOMWindowBaseAudio): (jsDOMWindowBaseWorker): (jsDOMWindowBaseXSLTProcessor): (setJSDOMWindowBaseEvent): (setJSDOMWindowBaseAudio): (setJSDOMWindowBaseImage): (setJSDOMWindowBaseMessageChannel): (setJSDOMWindowBaseOption): (setJSDOMWindowBaseWorker): (setJSDOMWindowBaseXMLHttpRequest): (setJSDOMWindowBaseXSLTProcessor): (WebCore::JSDOMWindowBase::childFrameGetter): (WebCore::JSDOMWindowBase::indexGetter): (WebCore::JSDOMWindowBase::namedItemGetter): (WebCore::JSDOMWindowBase::getOwnPropertySlot): (WebCore::JSDOMWindowBase::put): (WebCore::JSDOMWindowBase::clear): (windowProtoFuncOpen): (windowProtoFuncShowModalDialog): (windowProtoFuncNotImplemented): (WebCore::JSDOMWindowBase::setReturnValueSlot): (WebCore::JSDOMWindowBase::installTimeout): (WebCore::toJS): (WebCore::toJSDOMWindow):
  • bindings/js/JSDOMWindowBase.h:
  • bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::lookupGetter): (WebCore::JSDOMWindow::lookupSetter): (WebCore::JSDOMWindow::setLocation): (WebCore::JSDOMWindow::postMessage): (WebCore::setTimeoutOrInterval): (WebCore::JSDOMWindow::setTimeout): (WebCore::JSDOMWindow::clearTimeout): (WebCore::JSDOMWindow::setInterval): (WebCore::JSDOMWindow::clearInterval): (WebCore::JSDOMWindow::atob): (WebCore::JSDOMWindow::btoa): (WebCore::JSDOMWindow::addEventListener): (WebCore::JSDOMWindow::removeEventListener): (WebCore::toDOMWindow): (WebCore::nonCachingStaticCloseFunctionGetter): (WebCore::nonCachingStaticBlurFunctionGetter): (WebCore::nonCachingStaticFocusFunctionGetter): (WebCore::nonCachingStaticPostMessageFunctionGetter):
  • bindings/js/JSDOMWindowCustom.h: (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::JSAbstractEventListener::handleEvent): (WebCore::eventParameterName): (WebCore::JSLazyEventListener::parseCode):
  • bindings/js/JSEventTarget.cpp: (WebCore::toJS):
  • bindings/js/JSEventTarget.h:
  • bindings/js/JSEventTargetBase.h:
  • bindings/js/JSEventTargetNodeCustom.cpp: (WebCore::JSEventTargetNode::addEventListener): (WebCore::JSEventTargetNode::removeEventListener):
  • 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):
  • 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::selectionEnd):
  • 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/JSJavaScriptCallFrameCustom.cpp: (WebCore::JSJavaScriptCallFrame::evaluate): (WebCore::JSJavaScriptCallFrame::thisObject): (WebCore::JSJavaScriptCallFrame::type): (WebCore::JSJavaScriptCallFrame::scopeChain):
  • 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):
  • bindings/js/JSMessageChannelConstructor.h:
  • 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::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::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):
  • bindings/js/JSSVGLengthCustom.cpp: (WebCore::JSSVGLength::value): (WebCore::JSSVGLength::convertToSpecifiedUnits):
  • bindings/js/JSSVGMatrixCustom.cpp: (WebCore::JSSVGMatrix::multiply): (WebCore::JSSVGMatrix::inverse): (WebCore::JSSVGMatrix::translate): (WebCore::JSSVGMatrix::scale): (WebCore::JSSVGMatrix::scaleNonUniform): (WebCore::JSSVGMatrix::rotate): (WebCore::JSSVGMatrix::rotateFromVector): (WebCore::JSSVGMatrix::flipX): (WebCore::JSSVGMatrix::flipY): (WebCore::JSSVGMatrix::skewX): (WebCore::JSSVGMatrix::skewY):
  • 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/JSWorkerContextBase.cpp: (WebCore::JSWorkerContextBase::put):
  • bindings/js/JSWorkerContextBase.h:
  • bindings/js/JSWorkerContextCustom.cpp: (WebCore::JSWorkerContext::self): (WebCore::JSWorkerContext::setSelf): (WebCore::JSWorkerContext::addEventListener): (WebCore::JSWorkerContext::removeEventListener):
  • 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::ScheduledAction): (WebCore::ScheduledAction::execute):
  • bindings/js/ScheduledAction.h:
  • bindings/js/ScriptCallStack.cpp: (WebCore::ScriptCallStack::ScriptCallStack): (WebCore::ScriptCallStack::initialize):
  • bindings/js/ScriptController.cpp: (WebCore::ScriptController::createScriptObjectForPluginElement):
  • bindings/js/ScriptValue.cpp: (WebCore::ScriptValue::getString): (WebCore::ScriptValue::isNull): (WebCore::ScriptValue::isUndefined):
  • 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:
  • bindings/scripts/CodeGeneratorJS.pm:
  • 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.cpp: (JSC::Bindings::Instance::getValueOfField): (JSC::Bindings::Instance::setValueOfField):
  • bridge/runtime.h: (JSC::Bindings::Class::fallbackObject): (JSC::Bindings::Instance::getValueOfUndefinedField): (JSC::Bindings::Instance::setValueOfUndefinedField): (JSC::Bindings::Instance::invokeDefaultMethod): (JSC::Bindings::Instance::invokeConstruct): (JSC::Bindings::Instance::valueOf):
  • 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/InspectorController.cpp:
  • 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:
  • xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::dropProtection):

WebKit/mac:

2009-01-05 Gavin Barraclough <[email protected]>

Rubber Stamped by Oliver Hunt.

Replace all uses of JSValue* with new wrapper class, JSValuePtr.
See JavaScriptCore/ChangeLog for more detailed description.

  • WebView/WebFrame.mm: (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
  • WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFrame _convertValueToObjcValue:]): (-[WebScriptCallFrame exception]): (-[WebScriptCallFrame evaluateWebScript:]):
  • WebView/WebView.mm: (aeDescFromJSValue): (-[WebView aeDescByEvaluatingJavaScriptFromString:]):
Location:
trunk/JavaScriptCore/jit
Files:
6 edited

Legend:

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

    r39577 r39670  
    146146extern "C" {
    147147   
    148     __declspec(naked) JSValue* ctiTrampoline(void* code, RegisterFile*, CallFrame*, JSValue** exception, Profiler**, JSGlobalData*)
     148    __declspec(naked) JSValueEncodedAsPointer* ctiTrampoline(void* code, RegisterFile*, CallFrame*, JSValuePtr* exception, Profiler**, JSGlobalData*)
    149149    {
    150150        __asm {
     
    228228
    229229    // They are equal - set the result to true. (Or false, if negated).
    230     move(ImmPtr(jsBoolean(!negated)), X86::eax);
     230    move(ImmPtr(JSValuePtr::encode(jsBoolean(!negated))), X86::eax);
    231231    Jump bothWereImmediatesAndEqual = jump();
    232232
     
    236236    firstNotImmediate.link(this);
    237237    emitJumpSlowCaseIfJSCell(X86::edx);
    238     addSlowCase(jePtr(X86::edx, ImmPtr(JSImmediate::zeroImmediate())));
     238    addSlowCase(jePtr(X86::edx, ImmPtr(JSValuePtr::encode(JSImmediate::zeroImmediate()))));
    239239    Jump firstWasNotImmediate = jump();
    240240
     
    242242    // If eax is 0 jump to a slow case, otherwise these values are not equal.
    243243    secondNotImmediate.link(this);
    244     addSlowCase(jePtr(X86::eax, ImmPtr(JSImmediate::zeroImmediate())));
     244    addSlowCase(jePtr(X86::eax, ImmPtr(JSValuePtr::encode(JSImmediate::zeroImmediate()))));
    245245
    246246    // We get here if the two values are different immediates, or one is 0 and the other is a JSCell.
     
    248248    bothWereImmediatesButNotEqual.link(this);
    249249    firstWasNotImmediate.link(this);
    250     move(ImmPtr(jsBoolean(negated)), X86::eax);
     250    move(ImmPtr(JSValuePtr::encode(jsBoolean(negated))), X86::eax);
    251251   
    252252    bothWereImmediatesAndEqual.link(this);
     
    349349                emitGetVirtualRegister(op1, X86::eax);
    350350                emitJumpSlowCaseIfNotImmNum(X86::eax);
    351                 addJump(jlPtr(X86::eax, ImmPtr(getConstantOperand(op2))), target + 3);
     351                addJump(jlPtr(X86::eax, ImmPtr(JSValuePtr::encode(getConstantOperand(op2)))), target + 3);
    352352            } else {
    353353                emitGetVirtualRegisters(op1, X86::eax, op2, X86::edx);
     
    367367                emitGetVirtualRegister(op1, X86::eax);
    368368                emitJumpSlowCaseIfNotImmNum(X86::eax);
    369                 addJump(jlePtr(X86::eax, ImmPtr(getConstantOperand(op2))), target + 3);
     369                addJump(jlePtr(X86::eax, ImmPtr(JSValuePtr::encode(getConstantOperand(op2)))), target + 3);
    370370            } else {
    371371                emitGetVirtualRegisters(op1, X86::eax, op2, X86::edx);
     
    420420
    421421            // optimistically load true result
    422             move(ImmPtr(jsBoolean(true)), X86::eax);
     422            move(ImmPtr(JSValuePtr::encode(jsBoolean(true))), X86::eax);
    423423
    424424            Label loop(this);
     
    430430            Jump exit = jePtr(X86::ecx, X86::edx);
    431431
    432             jnePtr(X86::ecx, ImmPtr(jsNull()), loop);
    433 
    434             move(ImmPtr(jsBoolean(false)), X86::eax);
     432            jnePtr(X86::ecx, ImmPtr(JSValuePtr::encode(jsNull())), loop);
     433
     434            move(ImmPtr(JSValuePtr::encode(jsBoolean(false))), X86::eax);
    435435
    436436            exit.link(this);
     
    619619            emitGetVirtualRegister(currentInstruction[1].u.operand, X86::eax);
    620620
    621             Jump isZero = jePtr(X86::eax, ImmPtr(JSImmediate::zeroImmediate()));
     621            Jump isZero = jePtr(X86::eax, ImmPtr(JSValuePtr::encode(JSImmediate::zeroImmediate())));
    622622            addJump(jnz32(X86::eax, Imm32(JSImmediate::TagBitTypeInteger)), target + 2);
    623623
    624             addJump(jePtr(X86::eax, ImmPtr(jsBoolean(true))), target + 2);
    625             addSlowCase(jnePtr(X86::eax, ImmPtr(jsBoolean(false))));
     624            addJump(jePtr(X86::eax, ImmPtr(JSValuePtr::encode(jsBoolean(true)))), target + 2);
     625            addSlowCase(jnePtr(X86::eax, ImmPtr(JSValuePtr::encode(jsBoolean(false)))));
    626626
    627627            isZero.link(this);
     
    692692                emitGetVirtualRegister(op1, X86::eax);
    693693                emitJumpSlowCaseIfNotImmNum(X86::eax);
    694                 addJump(jgePtr(X86::eax, ImmPtr(getConstantOperand(op2))), target + 3);
     694                addJump(jgePtr(X86::eax, ImmPtr(JSValuePtr::encode(getConstantOperand(op2)))), target + 3);
    695695            } else {
    696696                emitGetVirtualRegisters(op1, X86::eax, op2, X86::edx);
     
    713713            emitGetVirtualRegister(currentInstruction[1].u.operand, X86::eax);
    714714
    715             addJump(jePtr(X86::eax, ImmPtr(JSImmediate::zeroImmediate())), target + 2);
     715            addJump(jePtr(X86::eax, ImmPtr(JSValuePtr::encode(JSImmediate::zeroImmediate()))), target + 2);
    716716            Jump isNonZero = jnz32(X86::eax, Imm32(JSImmediate::TagBitTypeInteger));
    717717
    718             addJump(jePtr(X86::eax, ImmPtr(jsBoolean(false))), target + 2);
    719             addSlowCase(jnePtr(X86::eax, ImmPtr(jsBoolean(true))));
     718            addJump(jePtr(X86::eax, ImmPtr(JSValuePtr::encode(jsBoolean(false)))), target + 2);
     719            addSlowCase(jnePtr(X86::eax, ImmPtr(JSValuePtr::encode(jsBoolean(true)))));
    720720
    721721            isNonZero.link(this);
     
    737737            isImmediate.link(this);
    738738            and32(Imm32(~JSImmediate::ExtendedTagBitUndefined), X86::eax);
    739             addJump(jePtr(X86::eax, ImmPtr(jsNull())), target + 2);           
     739            addJump(jePtr(X86::eax, ImmPtr(JSValuePtr::encode(jsNull()))), target + 2);           
    740740
    741741            wasNotImmediate.link(this);
     
    757757            isImmediate.link(this);
    758758            and32(Imm32(~JSImmediate::ExtendedTagBitUndefined), X86::eax);
    759             addJump(jnePtr(X86::eax, ImmPtr(jsNull())), target + 2);           
     759            addJump(jnePtr(X86::eax, ImmPtr(JSValuePtr::encode(jsNull()))), target + 2);           
    760760
    761761            wasNotImmediate.link(this);
     
    767767        }
    768768        case op_unexpected_load: {
    769             JSValue* v = m_codeBlock->unexpectedConstant(currentInstruction[2].u.operand);
    770             move(ImmPtr(v), X86::eax);
     769            JSValuePtr v = m_codeBlock->unexpectedConstant(currentInstruction[2].u.operand);
     770            move(ImmPtr(JSValuePtr::encode(v)), X86::eax);
    771771            emitPutVirtualRegister(currentInstruction[1].u.operand);
    772772            NEXT_OPCODE(op_unexpected_load);
     
    834834            emitGetVirtualRegister(currentInstruction[1].u.operand, X86::eax);
    835835
    836             Jump isZero = jePtr(X86::eax, ImmPtr(JSImmediate::zeroImmediate()));
     836            Jump isZero = jePtr(X86::eax, ImmPtr(JSValuePtr::encode(JSImmediate::zeroImmediate())));
    837837            addJump(jnz32(X86::eax, Imm32(JSImmediate::TagBitTypeInteger)), target + 2);
    838838
    839             addJump(jePtr(X86::eax, ImmPtr(jsBoolean(true))), target + 2);
    840             addSlowCase(jnePtr(X86::eax, ImmPtr(jsBoolean(false))));
     839            addJump(jePtr(X86::eax, ImmPtr(JSValuePtr::encode(jsBoolean(true)))), target + 2);
     840            addSlowCase(jnePtr(X86::eax, ImmPtr(JSValuePtr::encode(jsBoolean(false)))));
    841841
    842842            isZero.link(this);
     
    10571057        }
    10581058        case op_new_error: {
    1059             JSValue* message = m_codeBlock->unexpectedConstant(currentInstruction[3].u.operand);
     1059            JSValuePtr message = m_codeBlock->unexpectedConstant(currentInstruction[3].u.operand);
    10601060            emitPutJITStubArgConstant(currentInstruction[2].u.operand, 1);
    1061             emitPutJITStubArgConstant(message, 2);
     1061            emitPutJITStubArgConstant(JSValuePtr::encode(message), 2);
    10621062            emitPutJITStubArgConstant(m_codeBlock->lineNumberForBytecodeOffset(m_bytecodeIndex), 3);
    10631063            emitCTICall(Interpreter::cti_op_new_error);
     
    12891289        }
    12901290        case op_loop_if_less: {
     1291            unsigned op2 = currentInstruction[2].u.operand;
    12911292            unsigned target = currentInstruction[3].u.operand;
    1292             JSValue* src2imm = getConstantImmediateNumericArg(currentInstruction[2].u.operand);
    1293             if (src2imm) {
     1293            if (isOperandConstantImmediateInt(op2)) {
    12941294                linkSlowCase(iter);
    12951295                emitPutJITStubArg(X86::eax, 1);
    1296                 emitPutJITStubArgFromVirtualRegister(currentInstruction[2].u.operand, 2, X86::ecx);
     1296                emitPutJITStubArgFromVirtualRegister(op2, 2, X86::ecx);
    12971297                emitCTICall(Interpreter::cti_op_loop_if_less);
    12981298                emitJumpSlowToHot(jnz32(X86::eax), target + 3);
     
    13161316        }
    13171317        case op_loop_if_lesseq: {
     1318            unsigned op2 = currentInstruction[2].u.operand;
    13181319            unsigned target = currentInstruction[3].u.operand;
    1319             JSValue* src2imm = getConstantImmediateNumericArg(currentInstruction[2].u.operand);
    1320             if (src2imm) {
     1320            if (isOperandConstantImmediateInt(op2)) {
    13211321                linkSlowCase(iter);
    13221322                emitPutJITStubArg(X86::eax, 1);
     
    13761376        }
    13771377        case op_jnless: {
     1378            unsigned op2 = currentInstruction[2].u.operand;
    13781379            unsigned target = currentInstruction[3].u.operand;
    1379             JSValue* src2imm = getConstantImmediateNumericArg(currentInstruction[2].u.operand);
    1380             if (src2imm) {
     1380            if (isOperandConstantImmediateInt(op2)) {
    13811381                linkSlowCase(iter);
    13821382                emitPutJITStubArg(X86::eax, 1);
  • trunk/JavaScriptCore/jit/JIT.h

    r39540 r39670  
    5050#define ARG_callFrame static_cast<CallFrame*>(ARGS[STUB_ARGS_callFrame])
    5151#define ARG_registerFile static_cast<RegisterFile*>(ARGS[STUB_ARGS_registerFile])
    52 #define ARG_exception static_cast<JSValue**>(ARGS[STUB_ARGS_exception])
     52#define ARG_exception static_cast<JSValuePtr*>(ARGS[STUB_ARGS_exception])
    5353#define ARG_profilerReference static_cast<Profiler**>(ARGS[STUB_ARGS_profilerReference])
    5454#define ARG_globalData static_cast<JSGlobalData*>(ARGS[STUB_ARGS_globalData])
     
    5656#define ARG_setCallFrame(newCallFrame) (ARGS[STUB_ARGS_callFrame] = (newCallFrame))
    5757
    58 #define ARG_src1 static_cast<JSValue*>(ARGS[1])
    59 #define ARG_src2 static_cast<JSValue*>(ARGS[2])
    60 #define ARG_src3 static_cast<JSValue*>(ARGS[3])
    61 #define ARG_src4 static_cast<JSValue*>(ARGS[4])
    62 #define ARG_src5 static_cast<JSValue*>(ARGS[5])
     58#define ARG_src1 JSValuePtr::decode(static_cast<JSValueEncodedAsPointer*>(ARGS[1]))
     59#define ARG_src2 JSValuePtr::decode(static_cast<JSValueEncodedAsPointer*>(ARGS[2]))
     60#define ARG_src3 JSValuePtr::decode(static_cast<JSValueEncodedAsPointer*>(ARGS[3]))
     61#define ARG_src4 JSValuePtr::decode(static_cast<JSValueEncodedAsPointer*>(ARGS[4]))
     62#define ARG_src5 JSValuePtr::decode(static_cast<JSValueEncodedAsPointer*>(ARGS[5]))
    6363#define ARG_id1 static_cast<Identifier*>(ARGS[1])
    6464#define ARG_id2 static_cast<Identifier*>(ARGS[2])
     
    9898    struct StructureStubInfo;
    9999
    100     typedef JSValue* (JIT_STUB *CTIHelper_j)(STUB_ARGS);
     100    typedef JSValueEncodedAsPointer* (JIT_STUB *CTIHelper_j)(STUB_ARGS);
    101101    typedef JSObject* (JIT_STUB *CTIHelper_o)(STUB_ARGS);
    102102    typedef JSPropertyNameIterator* (JIT_STUB *CTIHelper_p)(STUB_ARGS);
     
    194194
    195195    extern "C" {
    196         JSValue* ctiTrampoline(
     196        JSValueEncodedAsPointer* ctiTrampoline(
    197197#if PLATFORM(X86_64)
    198198            // FIXME: (bug #22910) this will force all arguments onto the stack (regparm(0) does not appear to have any effect).
     
    200200            void*, void*, void*, void*, void*, void*,
    201201#endif
    202             void* code, RegisterFile*, CallFrame*, JSValue** exception, Profiler**, JSGlobalData*);
     202            void* code, RegisterFile*, CallFrame*, JSValuePtr* exception, Profiler**, JSGlobalData*);
    203203        void ctiVMThrowTrampoline();
    204204    };
     
    342342        static void unlinkCall(CallLinkInfo*);
    343343
    344         inline static JSValue* execute(void* code, RegisterFile* registerFile, CallFrame* callFrame, JSGlobalData* globalData, JSValue** exception)
    345         {
    346             return ctiTrampoline(
     344        inline static JSValuePtr execute(void* code, RegisterFile* registerFile, CallFrame* callFrame, JSGlobalData* globalData, JSValuePtr* exception)
     345        {
     346            return JSValuePtr::decode(ctiTrampoline(
    347347#if PLATFORM(X86_64)
    348348                0, 0, 0, 0, 0, 0,
    349349#endif
    350                 code, registerFile, callFrame, exception, Profiler::enabledProfilerReference(), globalData);
     350                code, registerFile, callFrame, exception, Profiler::enabledProfilerReference(), globalData));
    351351        }
    352352
     
    433433        void emitGetFromCallFrameHeader(RegisterFile::CallFrameHeaderEntry entry, RegisterID to);
    434434
    435         JSValue* getConstantImmediateNumericArg(unsigned src);
    436         JSValue* getConstantOperand(unsigned src);
     435        JSValuePtr getConstantOperand(unsigned src);
    437436        int32_t getConstantOperandImmediateInt(unsigned src);
    438437        bool isOperandConstantImmediateInt(unsigned src);
  • trunk/JavaScriptCore/jit/JITArithmetic.cpp

    r39540 r39670  
    9494void JIT::compileFastArith_op_rshift(unsigned result, unsigned op1, unsigned op2)
    9595{
    96     if (JSValue* value = getConstantImmediateNumericArg(op2)) {
     96    if (isOperandConstantImmediateInt(op2)) {
    9797        emitGetVirtualRegister(op1, X86::eax);
    9898        emitJumpSlowCaseIfNotImmNum(X86::eax);
    9999        // Mask with 0x1f as per ecma-262 11.7.2 step 7.
    100         rshiftPtr(Imm32(JSImmediate::getTruncatedUInt32(value) & 0x1f), X86::eax);
     100        rshiftPtr(Imm32(JSImmediate::getTruncatedUInt32(getConstantOperand(op2)) & 0x1f), X86::eax);
    101101    } else {
    102102        emitGetVirtualRegisters(op1, X86::eax, op2, X86::ecx);
     
    117117{
    118118    linkSlowCase(iter);
    119     if (getConstantImmediateNumericArg(op2))
     119    if (isOperandConstantImmediateInt(op2))
    120120        emitPutJITStubArgFromVirtualRegister(op2, 2, X86::ecx);
    121121    else {
  • trunk/JavaScriptCore/jit/JITCall.cpp

    r39440 r39670  
    5050    // (and, if a new JSFunction happened to be constructed at the same location, we could get a false positive
    5151    // match).  Reset the check so it no longer matches.
    52     DataLabelPtr::patch(callLinkInfo->hotPathBegin, JSImmediate::impossibleValue());
     52    DataLabelPtr::patch(callLinkInfo->hotPathBegin, JSValuePtr::encode(JSImmediate::impossibleValue()));
    5353}
    5454
     
    7676    loadPtr(Address(X86::ecx, FIELD_OFFSET(JSFunction, m_scopeChain) + FIELD_OFFSET(ScopeChain, m_node)), X86::edx); // newScopeChain
    7777
    78     storePtr(ImmPtr(noValue()), Address(callFrameRegister, RegisterFile::OptionalCalleeArguments * static_cast<int>(sizeof(Register))));
     78    storePtr(ImmPtr(JSValuePtr::encode(noValue())), Address(callFrameRegister, RegisterFile::OptionalCalleeArguments * static_cast<int>(sizeof(Register))));
    7979    storePtr(X86::ecx, Address(callFrameRegister, RegisterFile::Callee * static_cast<int>(sizeof(Register))));
    8080    storePtr(X86::edx, Address(callFrameRegister, RegisterFile::ScopeChain * static_cast<int>(sizeof(Register))));
     
    212212
    213213        emitCTICall(Interpreter::cti_op_call_eval);
    214         wasEval = jnePtr(X86::eax, ImmPtr(JSImmediate::impossibleValue()));
     214        wasEval = jnePtr(X86::eax, ImmPtr(JSValuePtr::encode(JSImmediate::impossibleValue())));
    215215    }
    216216
     
    219219    emitGetVirtualRegister(callee, X86::ecx);
    220220    DataLabelPtr addressOfLinkedFunctionCheck;
    221     Jump jumpToSlow = jnePtrWithPatch(X86::ecx, addressOfLinkedFunctionCheck, ImmPtr(JSImmediate::impossibleValue()));
     221    Jump jumpToSlow = jnePtrWithPatch(X86::ecx, addressOfLinkedFunctionCheck, ImmPtr(JSValuePtr::encode(JSImmediate::impossibleValue())));
    222222    addSlowCase(jumpToSlow);
    223223    ASSERT(differenceBetween(addressOfLinkedFunctionCheck, jumpToSlow) == patchOffsetOpCallCompareToJump);
     
    240240    // Fast version of stack frame initialization, directly relative to edi.
    241241    // Note that this omits to set up RegisterFile::CodeBlock, which is set in the callee
    242     storePtr(ImmPtr(noValue()), Address(callFrameRegister, (registerOffset + RegisterFile::OptionalCalleeArguments) * static_cast<int>(sizeof(Register))));
     242    storePtr(ImmPtr(JSValuePtr::encode(noValue())), Address(callFrameRegister, (registerOffset + RegisterFile::OptionalCalleeArguments) * static_cast<int>(sizeof(Register))));
    243243    storePtr(X86::ecx, Address(callFrameRegister, (registerOffset + RegisterFile::Callee) * static_cast<int>(sizeof(Register))));
    244244    loadPtr(Address(X86::ecx, FIELD_OFFSET(JSFunction, m_scopeChain) + FIELD_OFFSET(ScopeChain, m_node)), X86::edx); // newScopeChain
  • trunk/JavaScriptCore/jit/JITInlineMethods.h

    r39540 r39670  
    5454    // TODO: we want to reuse values that are already in registers if we can - add a register allocator!
    5555    if (m_codeBlock->isConstantRegisterIndex(src)) {
    56         JSValue* value = m_codeBlock->getConstant(src);
    57         move(ImmPtr(value), dst);
     56        JSValuePtr value = m_codeBlock->getConstant(src);
     57        move(ImmPtr(JSValuePtr::encode(value)), dst);
    5858        killLastResultRegister();
    5959        return;
     
    113113}
    114114
    115 ALWAYS_INLINE JSValue* JIT::getConstantImmediateNumericArg(unsigned src)
    116 {
    117     if (m_codeBlock->isConstantRegisterIndex(src)) {
    118         JSValue* value = m_codeBlock->getConstant(src);
    119         return JSImmediate::isNumber(value) ? value : noValue();
    120     }
    121     return noValue();
    122 }
    123 
    124 ALWAYS_INLINE JSValue* JIT::getConstantOperand(unsigned src)
     115ALWAYS_INLINE JSValuePtr JIT::getConstantOperand(unsigned src)
    125116{
    126117    ASSERT(m_codeBlock->isConstantRegisterIndex(src));
     
    143134        return false;
    144135
    145     JSValue* value = getConstantOperand(src);
     136    JSValuePtr value = getConstantOperand(src);
    146137
    147138#if USE(ALTERNATE_JSIMMEDIATE)
     
    160151{
    161152    if (m_codeBlock->isConstantRegisterIndex(src)) {
    162         JSValue* value = m_codeBlock->getConstant(src);
    163         emitPutJITStubArgConstant(value, argumentNumber);
     153        JSValuePtr value = m_codeBlock->getConstant(src);
     154        emitPutJITStubArgConstant(JSValuePtr::encode(value), argumentNumber);
    164155    } else {
    165156        loadPtr(Address(callFrameRegister, src * sizeof(Register)), scratch);
     
    211202ALWAYS_INLINE void JIT::emitInitRegister(unsigned dst)
    212203{
    213     storePtr(ImmPtr(jsUndefined()), Address(callFrameRegister, dst * sizeof(Register)));
     204    storePtr(ImmPtr(JSValuePtr::encode(jsUndefined())), Address(callFrameRegister, dst * sizeof(Register)));
    214205    // FIXME: #ifndef NDEBUG, Write the correct m_type to the register.
    215206}
  • trunk/JavaScriptCore/jit/JITPropertyAccess.cpp

    r39440 r39670  
    183183}
    184184
    185 static JSValue* resizePropertyStorage(JSObject* baseObject, int32_t oldSize, int32_t newSize)
     185static JSValueEncodedAsPointer* resizePropertyStorage(JSObject* baseObject, int32_t oldSize, int32_t newSize)
    186186{
    187187    baseObject->allocatePropertyStorage(oldSize, newSize);
    188     return baseObject;
     188    return JSValuePtr::encode(baseObject);
    189189}
    190190
     
    212212    for (RefPtr<Structure>* it = chain->head(); *it; ++it) {
    213213        // null check the prototype
    214         successCases.append(jePtr(X86::ecx, ImmPtr(jsNull())));
     214        successCases.append(jePtr(X86::ecx, ImmPtr(JSValuePtr::encode(jsNull()))));
    215215
    216216        // Check the structure id
     
    253253    // write the value
    254254    loadPtr(Address(X86::eax, FIELD_OFFSET(JSObject, m_propertyStorage)), X86::eax);
    255     storePtr(X86::edx, Address(X86::eax, cachedOffset * sizeof(JSValue*)));
     255    storePtr(X86::edx, Address(X86::eax, cachedOffset * sizeof(JSValuePtr)));
    256256
    257257    ret();
     
    290290    void* displacementAddress = reinterpret_cast<void*>(reinterpret_cast<intptr_t>(stubInfo->hotPathBegin) + patchOffsetGetByIdPropertyMapOffset);
    291291    DataLabelPtr::patch(structureAddress, structure);
    292     DataLabel32::patch(displacementAddress, cachedOffset * sizeof(JSValue*));
     292    DataLabel32::patch(displacementAddress, cachedOffset * sizeof(JSValuePtr));
    293293}
    294294
     
    303303    void* displacementAddress = reinterpret_cast<char*>(stubInfo->hotPathBegin) + patchOffsetPutByIdPropertyMapOffset;
    304304    DataLabelPtr::patch(structureAddress, structure);
    305     DataLabel32::patch(displacementAddress, cachedOffset * sizeof(JSValue*));
     305    DataLabel32::patch(displacementAddress, cachedOffset * sizeof(JSValuePtr));
    306306}
    307307
     
    355355    // Checks out okay! - getDirectOffset
    356356    loadPtr(Address(X86::eax, FIELD_OFFSET(JSObject, m_propertyStorage)), X86::eax);
    357     loadPtr(Address(X86::eax, cachedOffset * sizeof(JSValue*)), X86::eax);
     357    loadPtr(Address(X86::eax, cachedOffset * sizeof(JSValuePtr)), X86::eax);
    358358    ret();
    359359
     
    394394
    395395    // Checks out okay! - getDirectOffset
    396     loadPtr(Address(X86::edx, cachedOffset * sizeof(JSValue*)), X86::eax);
     396    loadPtr(Address(X86::edx, cachedOffset * sizeof(JSValuePtr)), X86::eax);
    397397
    398398    Jump success = jump();
     
    432432
    433433    // Checks out okay! - getDirectOffset
    434     loadPtr(Address(X86::edx, cachedOffset * sizeof(JSValue*)), X86::eax);
     434    loadPtr(Address(X86::edx, cachedOffset * sizeof(JSValuePtr)), X86::eax);
    435435
    436436    ret();
     
    454454    Jump failureCase = checkStructure(X86::eax, structure);
    455455    loadPtr(Address(X86::eax, FIELD_OFFSET(JSObject, m_propertyStorage)), X86::eax);
    456     loadPtr(Address(X86::eax, cachedOffset * sizeof(JSValue*)), X86::eax);
     456    loadPtr(Address(X86::eax, cachedOffset * sizeof(JSValuePtr)), X86::eax);
    457457    Jump success = jump();
    458458
     
    501501
    502502    // Checks out okay! - getDirectOffset
    503     loadPtr(Address(X86::edx, cachedOffset * sizeof(JSValue*)), X86::eax);
     503    loadPtr(Address(X86::edx, cachedOffset * sizeof(JSValuePtr)), X86::eax);
    504504
    505505    Jump success = jump();
     
    556556    PropertyStorage* protoPropertyStorage = &protoObject->m_propertyStorage;
    557557    loadPtr(protoPropertyStorage, X86::edx);
    558     loadPtr(Address(X86::edx, cachedOffset * sizeof(JSValue*)), X86::eax);
     558    loadPtr(Address(X86::edx, cachedOffset * sizeof(JSValuePtr)), X86::eax);
    559559    Jump success = jump();
    560560
     
    615615    PropertyStorage* protoPropertyStorage = &protoObject->m_propertyStorage;
    616616    loadPtr(protoPropertyStorage, X86::edx);
    617     loadPtr(Address(X86::edx, cachedOffset * sizeof(JSValue*)), X86::eax);
     617    loadPtr(Address(X86::edx, cachedOffset * sizeof(JSValuePtr)), X86::eax);
    618618    Jump success = jump();
    619619
     
    665665    PropertyStorage* protoPropertyStorage = &protoObject->m_propertyStorage;
    666666    loadPtr(protoPropertyStorage, X86::edx);
    667     loadPtr(Address(X86::edx, cachedOffset * sizeof(JSValue*)), X86::eax);
     667    loadPtr(Address(X86::edx, cachedOffset * sizeof(JSValuePtr)), X86::eax);
    668668    ret();
    669669
     
    686686    // checks out okay! - putDirectOffset
    687687    loadPtr(Address(X86::eax, FIELD_OFFSET(JSObject, m_propertyStorage)), X86::eax);
    688     storePtr(X86::edx, Address(X86::eax, cachedOffset * sizeof(JSValue*)));
     688    storePtr(X86::edx, Address(X86::eax, cachedOffset * sizeof(JSValuePtr)));
    689689    ret();
    690690
Note: See TracChangeset for help on using the changeset viewer.