JavaScriptCore:
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 8 Aug 2005 04:07:46 +0000 (04:07 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 8 Aug 2005 04:07:46 +0000 (04:07 +0000)
        Rubber stamped by Maciej.

        - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4313
          eliminate KJS::Value and KJS::Object smart pointer wrappers (for simplicity and speed)

        * JavaScriptCore.xcodeproj/project.pbxproj: Removed object_wrapper.h.

        Global replaces and other wonderful stuff.

        * bindings/NP_jsobject.cpp:
        (_NPN_Invoke):
        (_NPN_Evaluate):
        (_NPN_GetProperty):
        (_NPN_SetProperty):
        (_NPN_HasMethod):
        (_NPN_SetException):
        * bindings/c/c_instance.cpp:
        (KJS::Bindings::CInstance::CInstance):
        (KJS::Bindings::CInstance::invokeMethod):
        (KJS::Bindings::CInstance::invokeDefaultMethod):
        (KJS::Bindings::CInstance::defaultValue):
        (KJS::Bindings::CInstance::stringValue):
        (KJS::Bindings::CInstance::numberValue):
        (KJS::Bindings::CInstance::booleanValue):
        (KJS::Bindings::CInstance::valueOf):
        * bindings/c/c_instance.h:
        * bindings/c/c_runtime.cpp:
        (CField::valueFromInstance):
        (CField::setValueToInstance):
        * bindings/c/c_runtime.h:
        * bindings/c/c_utility.cpp:
        (convertNPStringToUTF16):
        (convertUTF8ToUTF16):
        (coerceValueToNPVariantStringType):
        (convertValueToNPVariant):
        (convertNPVariantToValue):
        * bindings/c/c_utility.h:
        * bindings/jni/jni_instance.cpp:
        (JavaInstance::stringValue):
        (JavaInstance::numberValue):
        (JavaInstance::booleanValue):
        (JavaInstance::invokeMethod):
        (JavaInstance::invokeDefaultMethod):
        (JavaInstance::defaultValue):
        (JavaInstance::valueOf):
        * bindings/jni/jni_instance.h:
        * bindings/jni/jni_jsobject.cpp:
        (JSObject::invoke):
        (JSObject::call):
        (JSObject::eval):
        (JSObject::getMember):
        (JSObject::getSlot):
        (JSObject::toString):
        (JSObject::convertValueToJObject):
        (JSObject::convertJObjectToValue):
        (JSObject::listFromJArray):
        * bindings/jni/jni_jsobject.h:
        * bindings/jni/jni_objc.mm:
        (KJS::Bindings::dispatchJNICall):
        * bindings/jni/jni_runtime.cpp:
        (JavaArray::convertJObjectToArray):
        (JavaField::dispatchValueFromInstance):
        (JavaField::valueFromInstance):
        (JavaField::dispatchSetValueToInstance):
        (JavaField::setValueToInstance):
        (JavaArray::setValueAt):
        (JavaArray::valueAt):
        * bindings/jni/jni_runtime.h:
        (KJS::Bindings::JavaString::ustring):
        * bindings/jni/jni_utility.cpp:
        (KJS::Bindings::getJavaVM):
        (KJS::Bindings::getJNIEnv):
        (KJS::Bindings::getMethodID):
        (KJS::Bindings::callJNIVoidMethod):
        (KJS::Bindings::callJNIObjectMethod):
        (KJS::Bindings::callJNIBooleanMethod):
        (KJS::Bindings::callJNIStaticBooleanMethod):
        (KJS::Bindings::callJNIByteMethod):
        (KJS::Bindings::callJNICharMethod):
        (KJS::Bindings::callJNIShortMethod):
        (KJS::Bindings::callJNIIntMethod):
        (KJS::Bindings::callJNILongMethod):
        (KJS::Bindings::callJNIFloatMethod):
        (KJS::Bindings::callJNIDoubleMethod):
        (KJS::Bindings::callJNIVoidMethodA):
        (KJS::Bindings::callJNIObjectMethodA):
        (KJS::Bindings::callJNIByteMethodA):
        (KJS::Bindings::callJNICharMethodA):
        (KJS::Bindings::callJNIShortMethodA):
        (KJS::Bindings::callJNIIntMethodA):
        (KJS::Bindings::callJNILongMethodA):
        (KJS::Bindings::callJNIFloatMethodA):
        (KJS::Bindings::callJNIDoubleMethodA):
        (KJS::Bindings::callJNIBooleanMethodA):
        (KJS::Bindings::callJNIVoidMethodIDA):
        (KJS::Bindings::callJNIObjectMethodIDA):
        (KJS::Bindings::callJNIByteMethodIDA):
        (KJS::Bindings::callJNICharMethodIDA):
        (KJS::Bindings::callJNIShortMethodIDA):
        (KJS::Bindings::callJNIIntMethodIDA):
        (KJS::Bindings::callJNILongMethodIDA):
        (KJS::Bindings::callJNIFloatMethodIDA):
        (KJS::Bindings::callJNIDoubleMethodIDA):
        (KJS::Bindings::callJNIBooleanMethodIDA):
        (KJS::Bindings::getCharactersFromJString):
        (KJS::Bindings::releaseCharactersForJString):
        (KJS::Bindings::getCharactersFromJStringInEnv):
        (KJS::Bindings::releaseCharactersForJStringInEnv):
        (KJS::Bindings::getUCharactersFromJStringInEnv):
        (KJS::Bindings::releaseUCharactersForJStringInEnv):
        (KJS::Bindings::JNITypeFromClassName):
        (KJS::Bindings::signatureFromPrimitiveType):
        (KJS::Bindings::JNITypeFromPrimitiveType):
        (KJS::Bindings::getJNIField):
        (KJS::Bindings::convertValueToJValue):
        * bindings/jni/jni_utility.h:
        * bindings/objc/WebScriptObject.mm:
        (_didExecute):
        (-[WebScriptObject _initializeWithObjectImp:originExecutionContext:Bindings::executionContext:Bindings::]):
        (-[WebScriptObject _initWithObjectImp:originExecutionContext:Bindings::executionContext:Bindings::]):
        (-[WebScriptObject _imp]):
        (-[WebScriptObject _executionContext]):
        (-[WebScriptObject _setExecutionContext:]):
        (-[WebScriptObject _originExecutionContext]):
        (-[WebScriptObject _setOriginExecutionContext:]):
        (+[WebScriptObject throwException:]):
        (listFromNSArray):
        (-[WebScriptObject callWebScriptMethod:withArguments:]):
        (-[WebScriptObject evaluateWebScript:]):
        (-[WebScriptObject setValue:forKey:]):
        (-[WebScriptObject valueForKey:]):
        (-[WebScriptObject removeWebScriptKey:]):
        (-[WebScriptObject stringRepresentation]):
        (-[WebScriptObject webScriptValueAtIndex:]):
        (-[WebScriptObject setException:]):
        (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:Bindings::]):
        * bindings/objc/WebScriptObjectPrivate.h:
        * bindings/objc/objc_class.h:
        * bindings/objc/objc_class.mm:
        (KJS::Bindings::ObjcClass::fallbackObject):
        * bindings/objc/objc_instance.h:
        * bindings/objc/objc_instance.mm:
        (ObjcInstance::invokeMethod):
        (ObjcInstance::invokeDefaultMethod):
        (ObjcInstance::setValueOfField):
        (ObjcInstance::setValueOfUndefinedField):
        (ObjcInstance::getValueOfField):
        (ObjcInstance::getValueOfUndefinedField):
        (ObjcInstance::defaultValue):
        (ObjcInstance::stringValue):
        (ObjcInstance::numberValue):
        (ObjcInstance::booleanValue):
        (ObjcInstance::valueOf):
        * bindings/objc/objc_runtime.h:
        * bindings/objc/objc_runtime.mm:
        (ObjcField::valueFromInstance):
        (convertValueToObjcObject):
        (ObjcField::setValueToInstance):
        (ObjcArray::setValueAt):
        (ObjcArray::valueAt):
        (ObjcFallbackObjectImp::put):
        (ObjcFallbackObjectImp::callAsFunction):
        (ObjcFallbackObjectImp::defaultValue):
        * bindings/objc/objc_utility.h:
        * bindings/objc/objc_utility.mm:
        (Bindings::JSMethodNameToObjCMethodName):
        (Bindings::convertValueToObjcValue):
        (Bindings::convertNSStringToString):
        (Bindings::convertObjcValueToValue):
        (Bindings::objcValueTypeForType):
        (Bindings::createObjcInstanceForValue):
        * bindings/runtime.cpp:
        (Instance::getValueOfField):
        (Instance::setValueOfField):
        (Instance::createRuntimeObject):
        (Instance::createLanguageInstanceForValue):
        * bindings/runtime.h:
        (KJS::Bindings::Constructor::~Constructor):
        (KJS::Bindings::Field::~Field):
        (KJS::Bindings::MethodList::MethodList):
        (KJS::Bindings::Class::fallbackObject):
        (KJS::Bindings::Class::~Class):
        (KJS::Bindings::Instance::Instance):
        (KJS::Bindings::Instance::getValueOfUndefinedField):
        (KJS::Bindings::Instance::supportsSetValueOfUndefinedField):
        (KJS::Bindings::Instance::setValueOfUndefinedField):
        (KJS::Bindings::Instance::valueOf):
        (KJS::Bindings::Instance::setExecutionContext):
        (KJS::Bindings::Instance::~Instance):
        (KJS::Bindings::Array::~Array):
        * bindings/runtime_array.cpp:
        (RuntimeArrayImp::RuntimeArrayImp):
        (RuntimeArrayImp::lengthGetter):
        (RuntimeArrayImp::indexGetter):
        (RuntimeArrayImp::put):
        * bindings/runtime_array.h:
        * bindings/runtime_method.cpp:
        (RuntimeMethodImp::lengthGetter):
        (RuntimeMethodImp::callAsFunction):
        * bindings/runtime_method.h:
        * bindings/runtime_object.cpp:
        (RuntimeObjectImp::fallbackObjectGetter):
        (RuntimeObjectImp::fieldGetter):
        (RuntimeObjectImp::methodGetter):
        (RuntimeObjectImp::getOwnPropertySlot):
        (RuntimeObjectImp::put):
        (RuntimeObjectImp::defaultValue):
        (RuntimeObjectImp::callAsFunction):
        * bindings/runtime_object.h:
        * kjs/array_instance.h:
        * kjs/array_object.cpp:
        (ArrayInstanceImp::ArrayInstanceImp):
        (ArrayInstanceImp::lengthGetter):
        (ArrayInstanceImp::getOwnPropertySlot):
        (ArrayInstanceImp::put):
        (ArrayInstanceImp::propList):
        (ArrayInstanceImp::setLength):
        (compareByStringForQSort):
        (compareWithCompareFunctionForQSort):
        (ArrayInstanceImp::sort):
        (ArrayInstanceImp::pushUndefinedObjectsToEnd):
        (ArrayPrototypeImp::ArrayPrototypeImp):
        (ArrayProtoFuncImp::ArrayProtoFuncImp):
        (ArrayProtoFuncImp::callAsFunction):
        (ArrayObjectImp::ArrayObjectImp):
        (ArrayObjectImp::construct):
        (ArrayObjectImp::callAsFunction):
        * kjs/array_object.h:
        * kjs/bool_object.cpp:
        (BooleanPrototypeImp::BooleanPrototypeImp):
        (BooleanProtoFuncImp::BooleanProtoFuncImp):
        (BooleanProtoFuncImp::callAsFunction):
        (BooleanObjectImp::BooleanObjectImp):
        (BooleanObjectImp::construct):
        (BooleanObjectImp::callAsFunction):
        * kjs/bool_object.h:
        * kjs/collector.cpp:
        (KJS::Collector::markStackObjectsConservatively):
        (KJS::Collector::collect):
        (KJS::className):
        * kjs/completion.h:
        (KJS::Completion::Completion):
        (KJS::Completion::value):
        (KJS::Completion::isValueCompletion):
        * kjs/context.h:
        (KJS::ContextImp::variableObject):
        (KJS::ContextImp::setVariableObject):
        (KJS::ContextImp::thisValue):
        (KJS::ContextImp::activationObject):
        (KJS::ContextImp::pushScope):
        * kjs/date_object.cpp:
        (formatLocaleDate):
        (KJS::timeFromArgs):
        (KJS::DatePrototypeImp::DatePrototypeImp):
        (KJS::DateProtoFuncImp::DateProtoFuncImp):
        (KJS::DateProtoFuncImp::callAsFunction):
        (KJS::DateObjectImp::DateObjectImp):
        (KJS::DateObjectImp::construct):
        (KJS::DateObjectImp::callAsFunction):
        (KJS::DateObjectFuncImp::DateObjectFuncImp):
        (KJS::DateObjectFuncImp::callAsFunction):
        (KJS::parseDate):
        (KJS::KRFCDate_parseDate):
        (KJS::timeClip):
        * kjs/date_object.h:
        * kjs/debugger.cpp:
        (Debugger::exception):
        (Debugger::callEvent):
        (Debugger::returnEvent):
        * kjs/debugger.h:
        * kjs/error_object.cpp:
        (ErrorPrototypeImp::ErrorPrototypeImp):
        (ErrorProtoFuncImp::ErrorProtoFuncImp):
        (ErrorProtoFuncImp::callAsFunction):
        (ErrorObjectImp::ErrorObjectImp):
        (ErrorObjectImp::construct):
        (ErrorObjectImp::callAsFunction):
        (NativeErrorPrototypeImp::NativeErrorPrototypeImp):
        (NativeErrorImp::NativeErrorImp):
        (NativeErrorImp::construct):
        (NativeErrorImp::callAsFunction):
        * kjs/error_object.h:
        * kjs/function.cpp:
        (KJS::FunctionImp::FunctionImp):
        (KJS::FunctionImp::callAsFunction):
        (KJS::FunctionImp::processParameters):
        (KJS::FunctionImp::argumentsGetter):
        (KJS::FunctionImp::lengthGetter):
        (KJS::FunctionImp::put):
        (KJS::DeclaredFunctionImp::DeclaredFunctionImp):
        (KJS::DeclaredFunctionImp::construct):
        (KJS::ArgumentsImp::ArgumentsImp):
        (KJS::ArgumentsImp::mappedIndexGetter):
        (KJS::ArgumentsImp::put):
        (KJS::ActivationImp::argumentsGetter):
        (KJS::GlobalFuncImp::GlobalFuncImp):
        (KJS::encode):
        (KJS::decode):
        (KJS::GlobalFuncImp::callAsFunction):
        * kjs/function.h:
        * kjs/function_object.cpp:
        (FunctionPrototypeImp::FunctionPrototypeImp):
        (FunctionPrototypeImp::callAsFunction):
        (FunctionProtoFuncImp::FunctionProtoFuncImp):
        (FunctionProtoFuncImp::callAsFunction):
        (FunctionObjectImp::FunctionObjectImp):
        (FunctionObjectImp::construct):
        (FunctionObjectImp::callAsFunction):
        * kjs/function_object.h:
        * kjs/internal.cpp:
        (KJS::UndefinedImp::toPrimitive):
        (KJS::UndefinedImp::toObject):
        (KJS::NullImp::toPrimitive):
        (KJS::NullImp::toObject):
        (KJS::BooleanImp::toPrimitive):
        (KJS::BooleanImp::toObject):
        (KJS::StringImp::toPrimitive):
        (KJS::StringImp::toObject):
        (KJS::NumberImp::toPrimitive):
        (KJS::NumberImp::toObject):
        (KJS::NumberImp::getUInt32):
        (KJS::LabelStack::push):
        (KJS::ContextImp::ContextImp):
        (KJS::InterpreterImp::globalInit):
        (KJS::InterpreterImp::globalClear):
        (KJS::InterpreterImp::InterpreterImp):
        (KJS::InterpreterImp::initGlobalObject):
        (KJS::InterpreterImp::clear):
        (KJS::InterpreterImp::mark):
        (KJS::InterpreterImp::evaluate):
        (KJS::InternalFunctionImp::hasInstance):
        (KJS::roundValue):
        (KJS::printInfo):
        * kjs/internal.h:
        (KJS::InterpreterImp::builtinObject):
        (KJS::InterpreterImp::builtinFunction):
        (KJS::InterpreterImp::builtinArray):
        (KJS::InterpreterImp::builtinBoolean):
        (KJS::InterpreterImp::builtinString):
        (KJS::InterpreterImp::builtinNumber):
        (KJS::InterpreterImp::builtinDate):
        (KJS::InterpreterImp::builtinRegExp):
        (KJS::InterpreterImp::builtinError):
        (KJS::InterpreterImp::builtinObjectPrototype):
        (KJS::InterpreterImp::builtinFunctionPrototype):
        (KJS::InterpreterImp::builtinArrayPrototype):
        (KJS::InterpreterImp::builtinBooleanPrototype):
        (KJS::InterpreterImp::builtinStringPrototype):
        (KJS::InterpreterImp::builtinNumberPrototype):
        (KJS::InterpreterImp::builtinDatePrototype):
        (KJS::InterpreterImp::builtinRegExpPrototype):
        (KJS::InterpreterImp::builtinErrorPrototype):
        (KJS::InterpreterImp::builtinEvalError):
        (KJS::InterpreterImp::builtinRangeError):
        (KJS::InterpreterImp::builtinReferenceError):
        (KJS::InterpreterImp::builtinSyntaxError):
        (KJS::InterpreterImp::builtinTypeError):
        (KJS::InterpreterImp::builtinURIError):
        (KJS::InterpreterImp::builtinEvalErrorPrototype):
        (KJS::InterpreterImp::builtinRangeErrorPrototype):
        (KJS::InterpreterImp::builtinReferenceErrorPrototype):
        (KJS::InterpreterImp::builtinSyntaxErrorPrototype):
        (KJS::InterpreterImp::builtinTypeErrorPrototype):
        (KJS::InterpreterImp::builtinURIErrorPrototype):
        * kjs/interpreter.cpp:
        (Context::variableObject):
        (Context::thisValue):
        (Interpreter::Interpreter):
        (Interpreter::globalObject):
        (Interpreter::evaluate):
        (Interpreter::builtinObject):
        (Interpreter::builtinFunction):
        (Interpreter::builtinArray):
        (Interpreter::builtinBoolean):
        (Interpreter::builtinString):
        (Interpreter::builtinNumber):
        (Interpreter::builtinDate):
        (Interpreter::builtinRegExp):
        (Interpreter::builtinError):
        (Interpreter::builtinObjectPrototype):
        (Interpreter::builtinFunctionPrototype):
        (Interpreter::builtinArrayPrototype):
        (Interpreter::builtinBooleanPrototype):
        (Interpreter::builtinStringPrototype):
        (Interpreter::builtinNumberPrototype):
        (Interpreter::builtinDatePrototype):
        (Interpreter::builtinRegExpPrototype):
        (Interpreter::builtinErrorPrototype):
        (Interpreter::builtinEvalError):
        (Interpreter::builtinRangeError):
        (Interpreter::builtinReferenceError):
        (Interpreter::builtinSyntaxError):
        (Interpreter::builtinTypeError):
        (Interpreter::builtinURIError):
        (Interpreter::builtinEvalErrorPrototype):
        (Interpreter::builtinRangeErrorPrototype):
        (Interpreter::builtinReferenceErrorPrototype):
        (Interpreter::builtinSyntaxErrorPrototype):
        (Interpreter::builtinTypeErrorPrototype):
        (Interpreter::builtinURIErrorPrototype):
        (Interpreter::createLanguageInstanceForValue):
        * kjs/interpreter.h:
        (KJS::Interpreter::isGlobalObject):
        (KJS::ExecState::setException):
        (KJS::ExecState::clearException):
        (KJS::ExecState::exception):
        (KJS::ExecState::hadException):
        (KJS::ExecState::ExecState):
        * kjs/list.cpp:
        (KJS::List::at):
        * kjs/list.h:
        (KJS::List::operator[]):
        (KJS::ListIterator::operator->):
        (KJS::ListIterator::operator*):
        (KJS::ListIterator::operator++):
        (KJS::ListIterator::operator--):
        * kjs/lookup.h:
        (KJS::staticFunctionGetter):
        (KJS::staticValueGetter):
        (KJS::lookupPut):
        (KJS::cacheGlobalObject):
        * kjs/math_object.cpp:
        (MathObjectImp::getValueProperty):
        (MathFuncImp::MathFuncImp):
        (MathFuncImp::callAsFunction):
        * kjs/math_object.h:
        * kjs/nodes.cpp:
        (Node::evaluateReference):
        (Node::throwError):
        (Node::setExceptionDetailsIfNeeded):
        (NullNode::evaluate):
        (BooleanNode::evaluate):
        (NumberNode::evaluate):
        (StringNode::evaluate):
        (RegExpNode::evaluate):
        (ThisNode::evaluate):
        (ResolveNode::evaluate):
        (ResolveNode::evaluateReference):
        (GroupNode::evaluate):
        (ElementNode::evaluate):
        (ArrayNode::evaluate):
        (ObjectLiteralNode::evaluate):
        (PropertyValueNode::evaluate):
        (PropertyNode::evaluate):
        (AccessorNode1::evaluate):
        (AccessorNode1::evaluateReference):
        (AccessorNode2::evaluate):
        (AccessorNode2::evaluateReference):
        (ArgumentListNode::evaluate):
        (ArgumentListNode::evaluateList):
        (ArgumentsNode::evaluate):
        (NewExprNode::evaluate):
        (FunctionCallNode::evaluate):
        (PostfixNode::evaluate):
        (DeleteNode::evaluate):
        (VoidNode::evaluate):
        (TypeOfNode::evaluate):
        (PrefixNode::evaluate):
        (UnaryPlusNode::evaluate):
        (NegateNode::evaluate):
        (BitwiseNotNode::evaluate):
        (LogicalNotNode::evaluate):
        (MultNode::evaluate):
        (AddNode::evaluate):
        (ShiftNode::evaluate):
        (RelationalNode::evaluate):
        (EqualNode::evaluate):
        (BitOperNode::evaluate):
        (BinaryLogicalNode::evaluate):
        (ConditionalNode::evaluate):
        (AssignNode::evaluate):
        (CommaNode::evaluate):
        (StatListNode::execute):
        (AssignExprNode::evaluate):
        (VarDeclNode::evaluate):
        (VarDeclNode::processVarDecls):
        (VarDeclListNode::evaluate):
        (ExprStatementNode::execute):
        (IfNode::execute):
        (DoWhileNode::execute):
        (WhileNode::execute):
        (ForNode::execute):
        (ForInNode::execute):
        (ContinueNode::execute):
        (BreakNode::execute):
        (ReturnNode::execute):
        (WithNode::execute):
        (CaseClauseNode::evaluate):
        (ClauseListNode::evaluate):
        (CaseBlockNode::evaluate):
        (CaseBlockNode::evalBlock):
        (SwitchNode::execute):
        (ThrowNode::execute):
        (CatchNode::execute):
        (TryNode::execute):
        (ParameterNode::evaluate):
        (FuncDeclNode::processFuncDecl):
        (FuncExprNode::evaluate):
        (SourceElementsNode::execute):
        * kjs/nodes.h:
        (KJS::StatementNode::evaluate):
        * kjs/number_object.cpp:
        (NumberPrototypeImp::NumberPrototypeImp):
        (NumberProtoFuncImp::NumberProtoFuncImp):
        (NumberProtoFuncImp::callAsFunction):
        (NumberObjectImp::NumberObjectImp):
        (NumberObjectImp::getValueProperty):
        (NumberObjectImp::construct):
        (NumberObjectImp::callAsFunction):
        * kjs/number_object.h:
        * kjs/object.cpp:
        (KJS::ObjectImp::call):
        (KJS::ObjectImp::mark):
        (KJS::ObjectImp::classInfo):
        (KJS::ObjectImp::get):
        (KJS::ObjectImp::getProperty):
        (KJS::ObjectImp::getPropertySlot):
        (KJS::ObjectImp::put):
        (KJS::ObjectImp::hasOwnProperty):
        (KJS::ObjectImp::defaultValue):
        (KJS::ObjectImp::findPropertyHashEntry):
        (KJS::ObjectImp::construct):
        (KJS::ObjectImp::callAsFunction):
        (KJS::ObjectImp::hasInstance):
        (KJS::ObjectImp::propList):
        (KJS::ObjectImp::toPrimitive):
        (KJS::ObjectImp::toNumber):
        (KJS::ObjectImp::toString):
        (KJS::ObjectImp::toObject):
        (KJS::ObjectImp::putDirect):
        (KJS::Error::create):
        (KJS::error):
        * kjs/object.h:
        (KJS::):
        (KJS::ObjectImp::getPropertySlot):
        (KJS::AllocatedValueImp::isObject):
        (KJS::ObjectImp::ObjectImp):
        (KJS::ObjectImp::internalValue):
        (KJS::ObjectImp::setInternalValue):
        (KJS::ObjectImp::prototype):
        (KJS::ObjectImp::setPrototype):
        (KJS::ObjectImp::inherits):
        * kjs/object_object.cpp:
        (ObjectPrototypeImp::ObjectPrototypeImp):
        (ObjectProtoFuncImp::ObjectProtoFuncImp):
        (ObjectProtoFuncImp::callAsFunction):
        (ObjectObjectImp::ObjectObjectImp):
        (ObjectObjectImp::construct):
        (ObjectObjectImp::callAsFunction):
        * kjs/object_object.h:
        * kjs/operations.cpp:
        (KJS::equal):
        (KJS::strictEqual):
        (KJS::relation):
        (KJS::add):
        (KJS::mult):
        * kjs/operations.h:
        * kjs/property_map.cpp:
        (KJS::PropertyMap::mark):
        (KJS::PropertyMap::addEnumerablesToReferenceList):
        (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList):
        (KJS::PropertyMap::save):
        (KJS::PropertyMap::restore):
        * kjs/property_map.h:
        * kjs/property_slot.cpp:
        (KJS::PropertySlot::undefinedGetter):
        * kjs/property_slot.h:
        (KJS::PropertySlot::getValue):
        * kjs/protect.h:
        (KJS::gcUnprotectNullTolerant):
        (KJS::ProtectedValue::ProtectedValue):
        (KJS::ProtectedValue::~ProtectedValue):
        (KJS::ProtectedValue::operator=):
        (KJS::ProtectedValue::operator ValueImp *):
        (KJS::ProtectedValue::operator->):
        * kjs/protected_object.h:
        (KJS::ProtectedObject::ProtectedObject):
        (KJS::ProtectedObject::operator=):
        (KJS::ProtectedObject::operator ValueImp *):
        (KJS::ProtectedObject::operator ObjectImp *):
        (KJS::ProtectedObject::operator->):
        (KJS::ProtectedReference::ProtectedReference):
        (KJS::ProtectedReference::~ProtectedReference):
        (KJS::ProtectedReference::operator=):
        * kjs/protected_values.cpp:
        (KJS::ProtectedValues::getProtectCount):
        (KJS::ProtectedValues::increaseProtectCount):
        (KJS::ProtectedValues::insert):
        (KJS::ProtectedValues::decreaseProtectCount):
        * kjs/protected_values.h:
        * kjs/reference.cpp:
        (KJS::Reference::Reference):
        (KJS::Reference::makeValueReference):
        (KJS::Reference::getBase):
        (KJS::Reference::getValue):
        (KJS::Reference::putValue):
        (KJS::Reference::deleteValue):
        * kjs/reference.h:
        (KJS::Reference::baseIfMutable):
        * kjs/regexp_object.cpp:
        (RegExpPrototypeImp::RegExpPrototypeImp):
        (RegExpProtoFuncImp::RegExpProtoFuncImp):
        (RegExpProtoFuncImp::callAsFunction):
        (RegExpObjectImp::RegExpObjectImp):
        (RegExpObjectImp::arrayOfMatches):
        (RegExpObjectImp::backrefGetter):
        (RegExpObjectImp::construct):
        (RegExpObjectImp::callAsFunction):
        * kjs/regexp_object.h:
        * kjs/string_object.cpp:
        (StringInstanceImp::lengthGetter):
        (StringInstanceImp::indexGetter):
        (StringInstanceImp::getOwnPropertySlot):
        (StringInstanceImp::put):
        (StringPrototypeImp::StringPrototypeImp):
        (StringProtoFuncImp::StringProtoFuncImp):
        (regExpIsGlobal):
        (replace):
        (StringProtoFuncImp::callAsFunction):
        (StringObjectImp::StringObjectImp):
        (StringObjectImp::construct):
        (StringObjectImp::callAsFunction):
        (StringObjectFuncImp::StringObjectFuncImp):
        (StringObjectFuncImp::callAsFunction):
        * kjs/string_object.h:
        * kjs/testkjs.cpp:
        (TestFunctionImp::callAsFunction):
        (VersionFunctionImp::callAsFunction):
        (main):
        * kjs/value.cpp:
        (KJS::AllocatedValueImp::operator new):
        (KJS::AllocatedValueImp::getUInt32):
        (KJS::ValueImp::toInteger):
        (KJS::ValueImp::toInt32):
        (KJS::ValueImp::toUInt32):
        (KJS::ValueImp::toUInt16):
        (KJS::ValueImp::toObject):
        (KJS::AllocatedValueImp::getBoolean):
        (KJS::AllocatedValueImp::getNumber):
        (KJS::AllocatedValueImp::getString):
        (KJS::AllocatedValueImp::getObject):
        (KJS::jsString):
        (KJS::jsNumber):
        (KJS::ConstantValues::init):
        (KJS::ConstantValues::clear):
        (KJS::ConstantValues::mark):
        * kjs/value.h:
        (KJS::):
        (KJS::jsUndefined):
        (KJS::jsNull):
        (KJS::jsBoolean):
        (KJS::jsNaN):
        (KJS::ValueImp::ValueImp):
        (KJS::ValueImp::~ValueImp):
        (KJS::AllocatedValueImp::AllocatedValueImp):
        (KJS::AllocatedValueImp::~AllocatedValueImp):
        (KJS::AllocatedValueImp::isBoolean):
        (KJS::AllocatedValueImp::isNumber):
        (KJS::AllocatedValueImp::isString):
        (KJS::AllocatedValueImp::isObject):
        (KJS::AllocatedValueImp::marked):
        (KJS::AllocatedValueImp::mark):
        (KJS::ValueImp::downcast):
        (KJS::ValueImp::isUndefined):
        (KJS::ValueImp::isNull):
        (KJS::ValueImp::isUndefinedOrNull):
        (KJS::ValueImp::isBoolean):
        (KJS::ValueImp::isNumber):
        (KJS::ValueImp::isString):
        (KJS::ValueImp::isObject):
        (KJS::ValueImp::getBoolean):
        (KJS::ValueImp::getNumber):
        (KJS::ValueImp::getString):
        (KJS::ValueImp::getObject):
        (KJS::ValueImp::getUInt32):
        (KJS::ValueImp::mark):
        (KJS::ValueImp::marked):
        (KJS::ValueImp::type):
        (KJS::ValueImp::toPrimitive):
        (KJS::ValueImp::toBoolean):
        (KJS::ValueImp::toNumber):
        (KJS::ValueImp::toString):
        (KJS::jsZero):
        (KJS::jsOne):
        (KJS::jsTwo):
        (KJS::Undefined):
        (KJS::Null):
        (KJS::Boolean):
        (KJS::Number):
        (KJS::String):

WebCore:

        Rubber stamped by Maciej.

        - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4313
          eliminate KJS::Value and KJS::Object smart pointer wrappers (for simplicity and speed)

        * khtml/ecma/domparser.cpp:
        (KJS::DOMParserConstructorImp::construct):
        (KJS::DOMParserProtoFunc::callAsFunction):
        * khtml/ecma/domparser.h:
        * khtml/ecma/kjs_binding.cpp:
        (KJS::ScriptInterpreter::ScriptInterpreter):
        (KJS::ScriptInterpreter::isGlobalObject):
        (KJS::ScriptInterpreter::createLanguageInstanceForValue):
        (KJS::getStringOrNull):
        (KJS::ValueToVariant):
        (KJS::setDOMException):
        * khtml/ecma/kjs_binding.h:
        (KJS::DOMFunction::toPrimitive):
        (KJS::cacheDOMObject):
        * khtml/ecma/kjs_css.cpp:
        (KJS::DOMCSSStyleDeclaration::indexGetter):
        (KJS::DOMCSSStyleDeclaration::cssPropertyGetter):
        (KJS::DOMCSSStyleDeclaration::getValueProperty):
        (KJS::DOMCSSStyleDeclaration::put):
        (KJS::DOMCSSStyleDeclarationProtoFunc::callAsFunction):
        (KJS::DOMStyleSheet::getValueProperty):
        (KJS::DOMStyleSheet::put):
        (KJS::DOMStyleSheetList::getValueProperty):
        (KJS::DOMStyleSheetList::indexGetter):
        (KJS::DOMStyleSheetList::nameGetter):
        (KJS::DOMStyleSheetListFunc::callAsFunction):
        (KJS::DOMMediaList::getValueProperty):
        (KJS::DOMMediaList::indexGetter):
        (KJS::DOMMediaList::put):
        (KJS::KJS::DOMMediaListProtoFunc::callAsFunction):
        (KJS::DOMCSSStyleSheet::getValueProperty):
        (KJS::DOMCSSStyleSheetProtoFunc::callAsFunction):
        (KJS::DOMCSSRuleList::getValueProperty):
        (KJS::DOMCSSRuleList::indexGetter):
        (KJS::DOMCSSRuleListFunc::callAsFunction):
        (KJS::DOMCSSRule::getValueProperty):
        (KJS::DOMCSSRule::put):
        (KJS::DOMCSSRule::putValueProperty):
        (KJS::DOMCSSRuleFunc::callAsFunction):
        (KJS::CSSRuleConstructor::getValueProperty):
        (KJS::getCSSRuleConstructor):
        (KJS::DOMCSSValue::getValueProperty):
        (KJS::DOMCSSValue::put):
        (KJS::getDOMCSSValue):
        (KJS::CSSValueConstructor::getValueProperty):
        (KJS::getCSSValueConstructor):
        (KJS::DOMCSSPrimitiveValue::getValueProperty):
        (KJS::DOMCSSPrimitiveValueProtoFunc::callAsFunction):
        (KJS::CSSPrimitiveValueConstructor::getValueProperty):
        (KJS::getCSSPrimitiveValueConstructor):
        (KJS::DOMCSSValueList::getValueProperty):
        (KJS::DOMCSSValueList::indexGetter):
        (KJS::DOMCSSValueListFunc::callAsFunction):
        (KJS::DOMRGBColor::getValueProperty):
        (KJS::DOMRect::getValueProperty):
        (KJS::DOMCounter::getValueProperty):
        * khtml/ecma/kjs_css.h:
        * khtml/ecma/kjs_dom.cpp:
        (KJS::DOMNode::getValueProperty):
        (KJS::DOMNode::put):
        (KJS::DOMNode::putValueProperty):
        (KJS::DOMNode::toPrimitive):
        (KJS::DOMNode::getListener):
        (KJS::DOMNodeProtoFunc::callAsFunction):
        (KJS::DOMNodeList::toPrimitive):
        (KJS::DOMNodeList::getValueProperty):
        (KJS::DOMNodeList::indexGetter):
        (KJS::DOMNodeList::nameGetter):
        (KJS::DOMNodeList::callAsFunction):
        (KJS::DOMNodeListFunc::DOMNodeListFunc):
        (KJS::DOMNodeListFunc::callAsFunction):
        (KJS::DOMAttr::getValueProperty):
        (KJS::DOMAttr::put):
        (KJS::DOMAttr::putValueProperty):
        (KJS::DOMDocument::getValueProperty):
        (KJS::DOMDocument::put):
        (KJS::DOMDocument::putValueProperty):
        (KJS::DOMDocumentProtoFunc::callAsFunction):
        (KJS::DOMElement::getValueProperty):
        (KJS::DOMElement::attributeGetter):
        (KJS::DOMElement::getOwnPropertySlot):
        (KJS::DOMElementProtoFunc::callAsFunction):
        (KJS::DOMDOMImplementationProtoFunc::callAsFunction):
        (KJS::DOMDocumentType::getValueProperty):
        (KJS::DOMNamedNodeMap::lengthGetter):
        (KJS::DOMNamedNodeMap::indexGetter):
        (KJS::DOMNamedNodeMapProtoFunc::callAsFunction):
        (KJS::DOMProcessingInstruction::getValueProperty):
        (KJS::DOMProcessingInstruction::put):
        (KJS::DOMNotation::getValueProperty):
        (KJS::DOMEntity::getValueProperty):
        (KJS::NodeConstructor::getValueProperty):
        (KJS::DOMExceptionConstructor::getValueProperty):
        (KJS::DOMNamedNodesCollection::lengthGetter):
        (KJS::DOMNamedNodesCollection::indexGetter):
        (KJS::DOMCharacterData::getValueProperty):
        (KJS::DOMCharacterData::put):
        (KJS::DOMCharacterDataProtoFunc::callAsFunction):
        (KJS::DOMTextProtoFunc::callAsFunction):
        * khtml/ecma/kjs_dom.h:
        * khtml/ecma/kjs_events.cpp:
        (KJS::JSAbstractEventListener::handleEvent):
        (KJS::JSUnprotectedEventListener::JSUnprotectedEventListener):
        (KJS::JSUnprotectedEventListener::~JSUnprotectedEventListener):
        (KJS::JSUnprotectedEventListener::listenerObj):
        (KJS::JSUnprotectedEventListener::windowObj):
        (KJS::JSUnprotectedEventListener::mark):
        (KJS::JSEventListener::JSEventListener):
        (KJS::JSEventListener::~JSEventListener):
        (KJS::JSEventListener::listenerObj):
        (KJS::JSEventListener::windowObj):
        (KJS::JSLazyEventListener::JSLazyEventListener):
        (KJS::JSLazyEventListener::handleEvent):
        (KJS::JSLazyEventListener::listenerObj):
        (KJS::JSLazyEventListener::parseCode):
        (KJS::getNodeEventListener):
        (KJS::EventConstructor::getValueProperty):
        (KJS::getEventConstructor):
        (KJS::DOMEvent::getValueProperty):
        (KJS::DOMEvent::put):
        (KJS::DOMEvent::putValueProperty):
        (KJS::DOMEventProtoFunc::callAsFunction):
        (KJS::getDOMEvent):
        (KJS::EventExceptionConstructor::getValueProperty):
        (KJS::getEventExceptionConstructor):
        (KJS::DOMUIEvent::getValueProperty):
        (KJS::DOMUIEventProtoFunc::callAsFunction):
        (KJS::DOMMouseEvent::getValueProperty):
        (KJS::DOMMouseEventProtoFunc::callAsFunction):
        (KJS::DOMKeyboardEvent::getValueProperty):
        (KJS::DOMKeyboardEventProtoFunc::callAsFunction):
        (KJS::MutationEventConstructor::getValueProperty):
        (KJS::getMutationEventConstructor):
        (KJS::DOMMutationEvent::getValueProperty):
        (KJS::DOMMutationEventProtoFunc::callAsFunction):
        (KJS::DOMWheelEvent::getValueProperty):
        (KJS::DOMWheelEventProtoFunc::callAsFunction):
        (KJS::stringOrUndefined):
        (KJS::Clipboard::getValueProperty):
        (KJS::Clipboard::put):
        (KJS::Clipboard::putValueProperty):
        (KJS::ClipboardProtoFunc::callAsFunction):
        * khtml/ecma/kjs_events.h:
        (KJS::JSAbstractEventListener::listenerObjImp):
        * khtml/ecma/kjs_html.cpp:
        (KJS::KJS::HTMLDocFunction::callAsFunction):
        (KJS::HTMLDocument::namedItemGetter):
        (KJS::HTMLDocument::getValueProperty):
        (KJS::KJS::HTMLDocument::put):
        (KJS::KJS::HTMLDocument::putValueProperty):
        (KJS::HTMLElement::formIndexGetter):
        (KJS::HTMLElement::formNameGetter):
        (KJS::HTMLElement::selectIndexGetter):
        (KJS::HTMLElement::framesetNameGetter):
        (KJS::HTMLElement::frameWindowPropertyGetter):
        (KJS::HTMLElement::runtimeObjectGetter):
        (KJS::HTMLElement::runtimeObjectPropertyGetter):
        (KJS::HTMLElement::getOwnPropertySlot):
        (KJS::KJS::HTMLElement::implementsCall):
        (KJS::KJS::HTMLElement::callAsFunction):
        (KJS::HTMLElement::htmlGetter):
        (KJS::HTMLElement::headGetter):
        (KJS::HTMLElement::linkGetter):
        (KJS::HTMLElement::titleGetter):
        (KJS::HTMLElement::metaGetter):
        (KJS::HTMLElement::baseGetter):
        (KJS::HTMLElement::isIndexGetter):
        (KJS::HTMLElement::styleGetter):
        (KJS::HTMLElement::bodyGetter):
        (KJS::HTMLElement::formGetter):
        (KJS::HTMLElement::selectGetter):
        (KJS::HTMLElement::optGroupGetter):
        (KJS::HTMLElement::optionGetter):
        (KJS::getInputSelectionStart):
        (KJS::getInputSelectionEnd):
        (KJS::HTMLElement::inputGetter):
        (KJS::HTMLElement::textAreaGetter):
        (KJS::HTMLElement::buttonGetter):
        (KJS::HTMLElement::labelGetter):
        (KJS::HTMLElement::fieldSetGetter):
        (KJS::HTMLElement::legendGetter):
        (KJS::HTMLElement::uListGetter):
        (KJS::HTMLElement::oListGetter):
        (KJS::HTMLElement::dListGetter):
        (KJS::HTMLElement::dirGetter):
        (KJS::HTMLElement::menuGetter):
        (KJS::HTMLElement::liGetter):
        (KJS::HTMLElement::divGetter):
        (KJS::HTMLElement::paragraphGetter):
        (KJS::HTMLElement::headingGetter):
        (KJS::HTMLElement::blockQuoteGetter):
        (KJS::HTMLElement::quoteGetter):
        (KJS::HTMLElement::preGetter):
        (KJS::HTMLElement::brGetter):
        (KJS::HTMLElement::baseFontGetter):
        (KJS::HTMLElement::fontGetter):
        (KJS::HTMLElement::hrGetter):
        (KJS::HTMLElement::modGetter):
        (KJS::HTMLElement::anchorGetter):
        (KJS::HTMLElement::imageGetter):
        (KJS::HTMLElement::objectGetter):
        (KJS::HTMLElement::paramGetter):
        (KJS::HTMLElement::appletGetter):
        (KJS::HTMLElement::mapGetter):
        (KJS::HTMLElement::areaGetter):
        (KJS::HTMLElement::scriptGetter):
        (KJS::HTMLElement::tableGetter):
        (KJS::HTMLElement::tableCaptionGetter):
        (KJS::HTMLElement::tableColGetter):
        (KJS::HTMLElement::tableSectionGetter):
        (KJS::HTMLElement::tableRowGetter):
        (KJS::HTMLElement::tableCellGetter):
        (KJS::HTMLElement::frameSetGetter):
        (KJS::HTMLElement::frameGetter):
        (KJS::HTMLElement::iFrameGetter):
        (KJS::HTMLElement::marqueeGetter):
        (KJS::HTMLElement::getValueProperty):
        (KJS::HTMLElementFunction::HTMLElementFunction):
        (KJS::KJS::HTMLElementFunction::callAsFunction):
        (KJS::KJS::HTMLElement::put):
        (KJS::HTMLElement::htmlSetter):
        (KJS::HTMLElement::headSetter):
        (KJS::HTMLElement::linkSetter):
        (KJS::HTMLElement::titleSetter):
        (KJS::HTMLElement::metaSetter):
        (KJS::HTMLElement::baseSetter):
        (KJS::HTMLElement::isIndexSetter):
        (KJS::HTMLElement::styleSetter):
        (KJS::HTMLElement::bodySetter):
        (KJS::HTMLElement::formSetter):
        (KJS::HTMLElement::selectSetter):
        (KJS::HTMLElement::optGroupSetter):
        (KJS::HTMLElement::optionSetter):
        (KJS::HTMLElement::inputSetter):
        (KJS::HTMLElement::textAreaSetter):
        (KJS::HTMLElement::buttonSetter):
        (KJS::HTMLElement::labelSetter):
        (KJS::HTMLElement::fieldSetSetter):
        (KJS::HTMLElement::legendSetter):
        (KJS::HTMLElement::uListSetter):
        (KJS::HTMLElement::oListSetter):
        (KJS::HTMLElement::dListSetter):
        (KJS::HTMLElement::dirSetter):
        (KJS::HTMLElement::menuSetter):
        (KJS::HTMLElement::liSetter):
        (KJS::HTMLElement::divSetter):
        (KJS::HTMLElement::paragraphSetter):
        (KJS::HTMLElement::headingSetter):
        (KJS::HTMLElement::blockQuoteSetter):
        (KJS::HTMLElement::quoteSetter):
        (KJS::HTMLElement::preSetter):
        (KJS::HTMLElement::brSetter):
        (KJS::HTMLElement::baseFontSetter):
        (KJS::HTMLElement::fontSetter):
        (KJS::HTMLElement::hrSetter):
        (KJS::HTMLElement::modSetter):
        (KJS::HTMLElement::anchorSetter):
        (KJS::HTMLElement::imageSetter):
        (KJS::HTMLElement::objectSetter):
        (KJS::HTMLElement::paramSetter):
        (KJS::HTMLElement::appletSetter):
        (KJS::HTMLElement::mapSetter):
        (KJS::HTMLElement::areaSetter):
        (KJS::HTMLElement::scriptSetter):
        (KJS::HTMLElement::tableSetter):
        (KJS::HTMLElement::tableCaptionSetter):
        (KJS::HTMLElement::tableColSetter):
        (KJS::HTMLElement::tableSectionSetter):
        (KJS::HTMLElement::tableRowSetter):
        (KJS::HTMLElement::tableCellSetter):
        (KJS::HTMLElement::frameSetSetter):
        (KJS::HTMLElement::frameSetter):
        (KJS::HTMLElement::iFrameSetter):
        (KJS::HTMLElement::marqueeSetter):
        (KJS::HTMLElement::putValueProperty):
        (KJS::HTMLCollection::lengthGetter):
        (KJS::HTMLCollection::indexGetter):
        (KJS::HTMLCollection::nameGetter):
        (KJS::HTMLCollection::getOwnPropertySlot):
        (KJS::KJS::HTMLCollection::callAsFunction):
        (KJS::KJS::HTMLCollection::getNamedItems):
        (KJS::KJS::HTMLCollectionProtoFunc::callAsFunction):
        (KJS::HTMLSelectCollection::selectedIndexGetter):
        (KJS::KJS::HTMLSelectCollection::put):
        (KJS::OptionConstructorImp::construct):
        (KJS::ImageConstructorImp::construct):
        (KJS::Image::getValueProperty):
        (KJS::Image::put):
        (KJS::Image::putValueProperty):
        (KJS::isGradient):
        (KJS::isImagePattern):
        (KJS::KJS::Context2DFunction::callAsFunction):
        (KJS::Context2D::getValueProperty):
        (KJS::Context2D::put):
        (KJS::colorRefFromValue):
        (KJS::colorFromValue):
        (KJS::Context2D::setShadow):
        (KJS::Context2D::updateFillImagePattern):
        (KJS::Context2D::updateStrokeImagePattern):
        (KJS::Context2D::putValueProperty):
        (KJS::Context2D::Context2D):
        (KJS::Context2D::mark):
        (KJS::GradientFunction::callAsFunction):
        (KJS::Gradient::getValueProperty):
        (KJS::Gradient::put):
        (KJS::Gradient::putValueProperty):
        (KJS::ImagePattern::getValueProperty):
        (KJS::ImagePattern::put):
        (KJS::ImagePattern::putValueProperty):
        * khtml/ecma/kjs_html.h:
        * khtml/ecma/kjs_navigator.cpp:
        (KJS::Navigator::getValueProperty):
        (KJS::Plugins::getValueProperty):
        (KJS::Plugins::indexGetter):
        (KJS::Plugins::nameGetter):
        (KJS::MimeTypes::getValueProperty):
        (KJS::MimeTypes::indexGetter):
        (KJS::MimeTypes::nameGetter):
        (KJS::Plugin::getValueProperty):
        (KJS::Plugin::indexGetter):
        (KJS::Plugin::nameGetter):
        (KJS::MimeType::getValueProperty):
        (KJS::PluginsFunc::callAsFunction):
        (KJS::NavigatorFunc::callAsFunction):
        * khtml/ecma/kjs_navigator.h:
        * khtml/ecma/kjs_proxy.cpp:
        (KJSProxyImpl::evaluate):
        (TestFunctionImp::callAsFunction):
        (KJSProxyImpl::initScript):
        (KJSProxy::proxy):
        * khtml/ecma/kjs_range.cpp:
        (KJS::DOMRange::getValueProperty):
        (KJS::DOMRangeProtoFunc::callAsFunction):
        (KJS::RangeConstructor::getValueProperty):
        * khtml/ecma/kjs_range.h:
        * khtml/ecma/kjs_traversal.cpp:
        (KJS::DOMNodeIterator::getValueProperty):
        (KJS::DOMNodeIteratorProtoFunc::callAsFunction):
        (KJS::NodeFilterConstructor::getValueProperty):
        (KJS::getNodeFilterConstructor):
        (KJS::DOMNodeFilterProtoFunc::callAsFunction):
        (KJS::DOMTreeWalker::getValueProperty):
        (KJS::DOMTreeWalker::put):
        (KJS::DOMTreeWalkerProtoFunc::callAsFunction):
        (KJS::JSNodeFilterCondition::JSNodeFilterCondition):
        (KJS::JSNodeFilterCondition::acceptNode):
        * khtml/ecma/kjs_traversal.h:
        * khtml/ecma/kjs_views.cpp:
        (KJS::DOMAbstractView::getValueProperty):
        (KJS::DOMAbstractViewFunc::callAsFunction):
        * khtml/ecma/kjs_views.h:
        * khtml/ecma/kjs_window.cpp:
        (KJS::Screen::getValueProperty):
        (KJS::Window::retrieveWindow):
        (KJS::Window::retrieveActive):
        (KJS::Window::retrieve):
        (KJS::parseFeatures):
        (KJS::showModalDialog):
        (KJS::Window::getValueProperty):
        (KJS::Window::childFrameGetter):
        (KJS::Window::namedFrameGetter):
        (KJS::Window::indexGetter):
        (KJS::Window::namedItemGetter):
        (KJS::Window::put):
        (KJS::Window::installTimeout):
        (KJS::Window::setListener):
        (KJS::Window::getListener):
        (KJS::Window::getJSEventListener):
        (KJS::Window::getJSUnprotectedEventListener):
        (KJS::Window::getJSLazyEventListener):
        (KJS::WindowFunc::callAsFunction):
        (KJS::ScheduledAction::ScheduledAction):
        (KJS::ScheduledAction::execute):
        (KJS::WindowQObject::installTimeout):
        (KJS::FrameArray::getValueProperty):
        (KJS::FrameArray::indexGetter):
        (KJS::FrameArray::nameGetter):
        (KJS::Location::getValueProperty):
        (KJS::Location::put):
        (KJS::Location::toPrimitive):
        (KJS::LocationFunc::callAsFunction):
        (KJS::Selection::getValueProperty):
        (KJS::Selection::toPrimitive):
        (KJS::SelectionFunc::callAsFunction):
        (KJS::BarInfo::getValueProperty):
        (KJS::History::getValueProperty):
        (KJS::HistoryFunc::callAsFunction):
        (KJS::Konqueror::get):
        (KJS::KonquerorFunc::callAsFunction):
        * khtml/ecma/kjs_window.h:
        * khtml/ecma/xmlhttprequest.cpp:
        (KJS::XMLHttpRequestConstructorImp::construct):
        (KJS::XMLHttpRequest::getValueProperty):
        (KJS::XMLHttpRequest::put):
        (KJS::XMLHttpRequest::putValueProperty):
        (KJS::XMLHttpRequest::getAllResponseHeaders):
        (KJS::XMLHttpRequest::getResponseHeader):
        (KJS::XMLHttpRequest::getStatus):
        (KJS::XMLHttpRequest::getStatusText):
        (KJS::XMLHttpRequestProtoFunc::callAsFunction):
        * khtml/ecma/xmlhttprequest.h:
        * khtml/ecma/xmlserializer.cpp:
        (KJS::XMLSerializerConstructorImp::construct):
        (KJS::XMLSerializerProtoFunc::callAsFunction):
        * khtml/ecma/xmlserializer.h:
        * kwq/DOMUtility.mm:
        (KJS::ScriptInterpreter::createObjcInstanceForValue):
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::bindingRootObject):
        (KWQKHTMLPart::windowScriptObject):
        (KWQKHTMLPart::windowScriptNPObject):
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge executionContextForView:]):
        * kwq/WebCoreScriptDebugger.mm:
        (WebCoreScriptDebuggerImp::callEvent):
        (WebCoreScriptDebuggerImp::returnEvent):
        (-[WebCoreScriptDebugger finalize]):
        (-[WebCoreScriptCallFrame _convertValueToObjcValue:]):
        (-[WebCoreScriptCallFrame scopeChain]):
        (-[WebCoreScriptCallFrame evaluateWebScript:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@10084 268f45cc-cd09-0410-ab3c-d52691b4dbfc

122 files changed:
JavaScriptCore/ChangeLog
JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
JavaScriptCore/bindings/NP_jsobject.cpp
JavaScriptCore/bindings/c/c_instance.cpp
JavaScriptCore/bindings/c/c_instance.h
JavaScriptCore/bindings/c/c_runtime.cpp
JavaScriptCore/bindings/c/c_runtime.h
JavaScriptCore/bindings/c/c_utility.cpp
JavaScriptCore/bindings/c/c_utility.h
JavaScriptCore/bindings/jni/jni_instance.cpp
JavaScriptCore/bindings/jni/jni_instance.h
JavaScriptCore/bindings/jni/jni_jsobject.cpp
JavaScriptCore/bindings/jni/jni_jsobject.h
JavaScriptCore/bindings/jni/jni_objc.mm
JavaScriptCore/bindings/jni/jni_runtime.cpp
JavaScriptCore/bindings/jni/jni_runtime.h
JavaScriptCore/bindings/jni/jni_utility.cpp
JavaScriptCore/bindings/jni/jni_utility.h
JavaScriptCore/bindings/objc/WebScriptObject.mm
JavaScriptCore/bindings/objc/WebScriptObjectPrivate.h
JavaScriptCore/bindings/objc/objc_class.h
JavaScriptCore/bindings/objc/objc_class.mm
JavaScriptCore/bindings/objc/objc_instance.h
JavaScriptCore/bindings/objc/objc_instance.mm
JavaScriptCore/bindings/objc/objc_runtime.h
JavaScriptCore/bindings/objc/objc_runtime.mm
JavaScriptCore/bindings/objc/objc_utility.h
JavaScriptCore/bindings/objc/objc_utility.mm
JavaScriptCore/bindings/runtime.cpp
JavaScriptCore/bindings/runtime.h
JavaScriptCore/bindings/runtime_array.cpp
JavaScriptCore/bindings/runtime_array.h
JavaScriptCore/bindings/runtime_method.cpp
JavaScriptCore/bindings/runtime_method.h
JavaScriptCore/bindings/runtime_object.cpp
JavaScriptCore/bindings/runtime_object.h
JavaScriptCore/kjs/array_instance.h
JavaScriptCore/kjs/array_object.cpp
JavaScriptCore/kjs/array_object.h
JavaScriptCore/kjs/bool_object.cpp
JavaScriptCore/kjs/bool_object.h
JavaScriptCore/kjs/collector.cpp
JavaScriptCore/kjs/completion.h
JavaScriptCore/kjs/context.h
JavaScriptCore/kjs/date_object.cpp
JavaScriptCore/kjs/date_object.h
JavaScriptCore/kjs/debugger.cpp
JavaScriptCore/kjs/debugger.h
JavaScriptCore/kjs/error_object.cpp
JavaScriptCore/kjs/error_object.h
JavaScriptCore/kjs/function.cpp
JavaScriptCore/kjs/function.h
JavaScriptCore/kjs/function_object.cpp
JavaScriptCore/kjs/function_object.h
JavaScriptCore/kjs/internal.cpp
JavaScriptCore/kjs/internal.h
JavaScriptCore/kjs/interpreter.cpp
JavaScriptCore/kjs/interpreter.h
JavaScriptCore/kjs/list.cpp
JavaScriptCore/kjs/list.h
JavaScriptCore/kjs/lookup.h
JavaScriptCore/kjs/math_object.cpp
JavaScriptCore/kjs/math_object.h
JavaScriptCore/kjs/nodes.cpp
JavaScriptCore/kjs/nodes.h
JavaScriptCore/kjs/number_object.cpp
JavaScriptCore/kjs/number_object.h
JavaScriptCore/kjs/object.cpp
JavaScriptCore/kjs/object.h
JavaScriptCore/kjs/object_object.cpp
JavaScriptCore/kjs/object_object.h
JavaScriptCore/kjs/operations.cpp
JavaScriptCore/kjs/operations.h
JavaScriptCore/kjs/property_map.cpp
JavaScriptCore/kjs/property_map.h
JavaScriptCore/kjs/property_slot.cpp
JavaScriptCore/kjs/property_slot.h
JavaScriptCore/kjs/protect.h
JavaScriptCore/kjs/protected_object.h
JavaScriptCore/kjs/protected_values.cpp
JavaScriptCore/kjs/protected_values.h
JavaScriptCore/kjs/reference.cpp
JavaScriptCore/kjs/reference.h
JavaScriptCore/kjs/regexp_object.cpp
JavaScriptCore/kjs/regexp_object.h
JavaScriptCore/kjs/string_object.cpp
JavaScriptCore/kjs/string_object.h
JavaScriptCore/kjs/testkjs.cpp
JavaScriptCore/kjs/value.cpp
JavaScriptCore/kjs/value.h
WebCore/ChangeLog-2005-08-23
WebCore/khtml/ecma/domparser.cpp
WebCore/khtml/ecma/domparser.h
WebCore/khtml/ecma/kjs_binding.cpp
WebCore/khtml/ecma/kjs_binding.h
WebCore/khtml/ecma/kjs_css.cpp
WebCore/khtml/ecma/kjs_css.h
WebCore/khtml/ecma/kjs_dom.cpp
WebCore/khtml/ecma/kjs_dom.h
WebCore/khtml/ecma/kjs_events.cpp
WebCore/khtml/ecma/kjs_events.h
WebCore/khtml/ecma/kjs_html.cpp
WebCore/khtml/ecma/kjs_html.h
WebCore/khtml/ecma/kjs_navigator.cpp
WebCore/khtml/ecma/kjs_navigator.h
WebCore/khtml/ecma/kjs_proxy.cpp
WebCore/khtml/ecma/kjs_range.cpp
WebCore/khtml/ecma/kjs_range.h
WebCore/khtml/ecma/kjs_traversal.cpp
WebCore/khtml/ecma/kjs_traversal.h
WebCore/khtml/ecma/kjs_views.cpp
WebCore/khtml/ecma/kjs_views.h
WebCore/khtml/ecma/kjs_window.cpp
WebCore/khtml/ecma/kjs_window.h
WebCore/khtml/ecma/xmlhttprequest.cpp
WebCore/khtml/ecma/xmlhttprequest.h
WebCore/khtml/ecma/xmlserializer.cpp
WebCore/khtml/ecma/xmlserializer.h
WebCore/kwq/DOMUtility.mm
WebCore/kwq/KWQKHTMLPart.mm
WebCore/kwq/WebCoreBridge.mm
WebCore/kwq/WebCoreScriptDebugger.mm

index f4d55f3de10d0128afb7c0dca6bd159f9a0bd0ce..04d1d97229293e94cbed34fa50f7e63a1a78e877 100644 (file)
@@ -1,3 +1,696 @@
+2005-08-07  Darin Adler  <darin@apple.com>
+
+        Rubber stamped by Maciej.
+
+        - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4313
+          eliminate KJS::Value and KJS::Object smart pointer wrappers (for simplicity and speed)
+
+        * JavaScriptCore.xcodeproj/project.pbxproj: Removed object_wrapper.h.
+
+        Global replaces and other wonderful stuff.
+
+        * bindings/NP_jsobject.cpp:
+        (_NPN_Invoke):
+        (_NPN_Evaluate):
+        (_NPN_GetProperty):
+        (_NPN_SetProperty):
+        (_NPN_HasMethod):
+        (_NPN_SetException):
+        * bindings/c/c_instance.cpp:
+        (KJS::Bindings::CInstance::CInstance):
+        (KJS::Bindings::CInstance::invokeMethod):
+        (KJS::Bindings::CInstance::invokeDefaultMethod):
+        (KJS::Bindings::CInstance::defaultValue):
+        (KJS::Bindings::CInstance::stringValue):
+        (KJS::Bindings::CInstance::numberValue):
+        (KJS::Bindings::CInstance::booleanValue):
+        (KJS::Bindings::CInstance::valueOf):
+        * bindings/c/c_instance.h:
+        * bindings/c/c_runtime.cpp:
+        (CField::valueFromInstance):
+        (CField::setValueToInstance):
+        * bindings/c/c_runtime.h:
+        * bindings/c/c_utility.cpp:
+        (convertNPStringToUTF16):
+        (convertUTF8ToUTF16):
+        (coerceValueToNPVariantStringType):
+        (convertValueToNPVariant):
+        (convertNPVariantToValue):
+        * bindings/c/c_utility.h:
+        * bindings/jni/jni_instance.cpp:
+        (JavaInstance::stringValue):
+        (JavaInstance::numberValue):
+        (JavaInstance::booleanValue):
+        (JavaInstance::invokeMethod):
+        (JavaInstance::invokeDefaultMethod):
+        (JavaInstance::defaultValue):
+        (JavaInstance::valueOf):
+        * bindings/jni/jni_instance.h:
+        * bindings/jni/jni_jsobject.cpp:
+        (JSObject::invoke):
+        (JSObject::call):
+        (JSObject::eval):
+        (JSObject::getMember):
+        (JSObject::getSlot):
+        (JSObject::toString):
+        (JSObject::convertValueToJObject):
+        (JSObject::convertJObjectToValue):
+        (JSObject::listFromJArray):
+        * bindings/jni/jni_jsobject.h:
+        * bindings/jni/jni_objc.mm:
+        (KJS::Bindings::dispatchJNICall):
+        * bindings/jni/jni_runtime.cpp:
+        (JavaArray::convertJObjectToArray):
+        (JavaField::dispatchValueFromInstance):
+        (JavaField::valueFromInstance):
+        (JavaField::dispatchSetValueToInstance):
+        (JavaField::setValueToInstance):
+        (JavaArray::setValueAt):
+        (JavaArray::valueAt):
+        * bindings/jni/jni_runtime.h:
+        (KJS::Bindings::JavaString::ustring):
+        * bindings/jni/jni_utility.cpp:
+        (KJS::Bindings::getJavaVM):
+        (KJS::Bindings::getJNIEnv):
+        (KJS::Bindings::getMethodID):
+        (KJS::Bindings::callJNIVoidMethod):
+        (KJS::Bindings::callJNIObjectMethod):
+        (KJS::Bindings::callJNIBooleanMethod):
+        (KJS::Bindings::callJNIStaticBooleanMethod):
+        (KJS::Bindings::callJNIByteMethod):
+        (KJS::Bindings::callJNICharMethod):
+        (KJS::Bindings::callJNIShortMethod):
+        (KJS::Bindings::callJNIIntMethod):
+        (KJS::Bindings::callJNILongMethod):
+        (KJS::Bindings::callJNIFloatMethod):
+        (KJS::Bindings::callJNIDoubleMethod):
+        (KJS::Bindings::callJNIVoidMethodA):
+        (KJS::Bindings::callJNIObjectMethodA):
+        (KJS::Bindings::callJNIByteMethodA):
+        (KJS::Bindings::callJNICharMethodA):
+        (KJS::Bindings::callJNIShortMethodA):
+        (KJS::Bindings::callJNIIntMethodA):
+        (KJS::Bindings::callJNILongMethodA):
+        (KJS::Bindings::callJNIFloatMethodA):
+        (KJS::Bindings::callJNIDoubleMethodA):
+        (KJS::Bindings::callJNIBooleanMethodA):
+        (KJS::Bindings::callJNIVoidMethodIDA):
+        (KJS::Bindings::callJNIObjectMethodIDA):
+        (KJS::Bindings::callJNIByteMethodIDA):
+        (KJS::Bindings::callJNICharMethodIDA):
+        (KJS::Bindings::callJNIShortMethodIDA):
+        (KJS::Bindings::callJNIIntMethodIDA):
+        (KJS::Bindings::callJNILongMethodIDA):
+        (KJS::Bindings::callJNIFloatMethodIDA):
+        (KJS::Bindings::callJNIDoubleMethodIDA):
+        (KJS::Bindings::callJNIBooleanMethodIDA):
+        (KJS::Bindings::getCharactersFromJString):
+        (KJS::Bindings::releaseCharactersForJString):
+        (KJS::Bindings::getCharactersFromJStringInEnv):
+        (KJS::Bindings::releaseCharactersForJStringInEnv):
+        (KJS::Bindings::getUCharactersFromJStringInEnv):
+        (KJS::Bindings::releaseUCharactersForJStringInEnv):
+        (KJS::Bindings::JNITypeFromClassName):
+        (KJS::Bindings::signatureFromPrimitiveType):
+        (KJS::Bindings::JNITypeFromPrimitiveType):
+        (KJS::Bindings::getJNIField):
+        (KJS::Bindings::convertValueToJValue):
+        * bindings/jni/jni_utility.h:
+        * bindings/objc/WebScriptObject.mm:
+        (_didExecute):
+        (-[WebScriptObject _initializeWithObjectImp:originExecutionContext:Bindings::executionContext:Bindings::]):
+        (-[WebScriptObject _initWithObjectImp:originExecutionContext:Bindings::executionContext:Bindings::]):
+        (-[WebScriptObject _imp]):
+        (-[WebScriptObject _executionContext]):
+        (-[WebScriptObject _setExecutionContext:]):
+        (-[WebScriptObject _originExecutionContext]):
+        (-[WebScriptObject _setOriginExecutionContext:]):
+        (+[WebScriptObject throwException:]):
+        (listFromNSArray):
+        (-[WebScriptObject callWebScriptMethod:withArguments:]):
+        (-[WebScriptObject evaluateWebScript:]):
+        (-[WebScriptObject setValue:forKey:]):
+        (-[WebScriptObject valueForKey:]):
+        (-[WebScriptObject removeWebScriptKey:]):
+        (-[WebScriptObject stringRepresentation]):
+        (-[WebScriptObject webScriptValueAtIndex:]):
+        (-[WebScriptObject setException:]):
+        (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:Bindings::]):
+        * bindings/objc/WebScriptObjectPrivate.h:
+        * bindings/objc/objc_class.h:
+        * bindings/objc/objc_class.mm:
+        (KJS::Bindings::ObjcClass::fallbackObject):
+        * bindings/objc/objc_instance.h:
+        * bindings/objc/objc_instance.mm:
+        (ObjcInstance::invokeMethod):
+        (ObjcInstance::invokeDefaultMethod):
+        (ObjcInstance::setValueOfField):
+        (ObjcInstance::setValueOfUndefinedField):
+        (ObjcInstance::getValueOfField):
+        (ObjcInstance::getValueOfUndefinedField):
+        (ObjcInstance::defaultValue):
+        (ObjcInstance::stringValue):
+        (ObjcInstance::numberValue):
+        (ObjcInstance::booleanValue):
+        (ObjcInstance::valueOf):
+        * bindings/objc/objc_runtime.h:
+        * bindings/objc/objc_runtime.mm:
+        (ObjcField::valueFromInstance):
+        (convertValueToObjcObject):
+        (ObjcField::setValueToInstance):
+        (ObjcArray::setValueAt):
+        (ObjcArray::valueAt):
+        (ObjcFallbackObjectImp::put):
+        (ObjcFallbackObjectImp::callAsFunction):
+        (ObjcFallbackObjectImp::defaultValue):
+        * bindings/objc/objc_utility.h:
+        * bindings/objc/objc_utility.mm:
+        (Bindings::JSMethodNameToObjCMethodName):
+        (Bindings::convertValueToObjcValue):
+        (Bindings::convertNSStringToString):
+        (Bindings::convertObjcValueToValue):
+        (Bindings::objcValueTypeForType):
+        (Bindings::createObjcInstanceForValue):
+        * bindings/runtime.cpp:
+        (Instance::getValueOfField):
+        (Instance::setValueOfField):
+        (Instance::createRuntimeObject):
+        (Instance::createLanguageInstanceForValue):
+        * bindings/runtime.h:
+        (KJS::Bindings::Constructor::~Constructor):
+        (KJS::Bindings::Field::~Field):
+        (KJS::Bindings::MethodList::MethodList):
+        (KJS::Bindings::Class::fallbackObject):
+        (KJS::Bindings::Class::~Class):
+        (KJS::Bindings::Instance::Instance):
+        (KJS::Bindings::Instance::getValueOfUndefinedField):
+        (KJS::Bindings::Instance::supportsSetValueOfUndefinedField):
+        (KJS::Bindings::Instance::setValueOfUndefinedField):
+        (KJS::Bindings::Instance::valueOf):
+        (KJS::Bindings::Instance::setExecutionContext):
+        (KJS::Bindings::Instance::~Instance):
+        (KJS::Bindings::Array::~Array):
+        * bindings/runtime_array.cpp:
+        (RuntimeArrayImp::RuntimeArrayImp):
+        (RuntimeArrayImp::lengthGetter):
+        (RuntimeArrayImp::indexGetter):
+        (RuntimeArrayImp::put):
+        * bindings/runtime_array.h:
+        * bindings/runtime_method.cpp:
+        (RuntimeMethodImp::lengthGetter):
+        (RuntimeMethodImp::callAsFunction):
+        * bindings/runtime_method.h:
+        * bindings/runtime_object.cpp:
+        (RuntimeObjectImp::fallbackObjectGetter):
+        (RuntimeObjectImp::fieldGetter):
+        (RuntimeObjectImp::methodGetter):
+        (RuntimeObjectImp::getOwnPropertySlot):
+        (RuntimeObjectImp::put):
+        (RuntimeObjectImp::defaultValue):
+        (RuntimeObjectImp::callAsFunction):
+        * bindings/runtime_object.h:
+        * kjs/array_instance.h:
+        * kjs/array_object.cpp:
+        (ArrayInstanceImp::ArrayInstanceImp):
+        (ArrayInstanceImp::lengthGetter):
+        (ArrayInstanceImp::getOwnPropertySlot):
+        (ArrayInstanceImp::put):
+        (ArrayInstanceImp::propList):
+        (ArrayInstanceImp::setLength):
+        (compareByStringForQSort):
+        (compareWithCompareFunctionForQSort):
+        (ArrayInstanceImp::sort):
+        (ArrayInstanceImp::pushUndefinedObjectsToEnd):
+        (ArrayPrototypeImp::ArrayPrototypeImp):
+        (ArrayProtoFuncImp::ArrayProtoFuncImp):
+        (ArrayProtoFuncImp::callAsFunction):
+        (ArrayObjectImp::ArrayObjectImp):
+        (ArrayObjectImp::construct):
+        (ArrayObjectImp::callAsFunction):
+        * kjs/array_object.h:
+        * kjs/bool_object.cpp:
+        (BooleanPrototypeImp::BooleanPrototypeImp):
+        (BooleanProtoFuncImp::BooleanProtoFuncImp):
+        (BooleanProtoFuncImp::callAsFunction):
+        (BooleanObjectImp::BooleanObjectImp):
+        (BooleanObjectImp::construct):
+        (BooleanObjectImp::callAsFunction):
+        * kjs/bool_object.h:
+        * kjs/collector.cpp:
+        (KJS::Collector::markStackObjectsConservatively):
+        (KJS::Collector::collect):
+        (KJS::className):
+        * kjs/completion.h:
+        (KJS::Completion::Completion):
+        (KJS::Completion::value):
+        (KJS::Completion::isValueCompletion):
+        * kjs/context.h:
+        (KJS::ContextImp::variableObject):
+        (KJS::ContextImp::setVariableObject):
+        (KJS::ContextImp::thisValue):
+        (KJS::ContextImp::activationObject):
+        (KJS::ContextImp::pushScope):
+        * kjs/date_object.cpp:
+        (formatLocaleDate):
+        (KJS::timeFromArgs):
+        (KJS::DatePrototypeImp::DatePrototypeImp):
+        (KJS::DateProtoFuncImp::DateProtoFuncImp):
+        (KJS::DateProtoFuncImp::callAsFunction):
+        (KJS::DateObjectImp::DateObjectImp):
+        (KJS::DateObjectImp::construct):
+        (KJS::DateObjectImp::callAsFunction):
+        (KJS::DateObjectFuncImp::DateObjectFuncImp):
+        (KJS::DateObjectFuncImp::callAsFunction):
+        (KJS::parseDate):
+        (KJS::KRFCDate_parseDate):
+        (KJS::timeClip):
+        * kjs/date_object.h:
+        * kjs/debugger.cpp:
+        (Debugger::exception):
+        (Debugger::callEvent):
+        (Debugger::returnEvent):
+        * kjs/debugger.h:
+        * kjs/error_object.cpp:
+        (ErrorPrototypeImp::ErrorPrototypeImp):
+        (ErrorProtoFuncImp::ErrorProtoFuncImp):
+        (ErrorProtoFuncImp::callAsFunction):
+        (ErrorObjectImp::ErrorObjectImp):
+        (ErrorObjectImp::construct):
+        (ErrorObjectImp::callAsFunction):
+        (NativeErrorPrototypeImp::NativeErrorPrototypeImp):
+        (NativeErrorImp::NativeErrorImp):
+        (NativeErrorImp::construct):
+        (NativeErrorImp::callAsFunction):
+        * kjs/error_object.h:
+        * kjs/function.cpp:
+        (KJS::FunctionImp::FunctionImp):
+        (KJS::FunctionImp::callAsFunction):
+        (KJS::FunctionImp::processParameters):
+        (KJS::FunctionImp::argumentsGetter):
+        (KJS::FunctionImp::lengthGetter):
+        (KJS::FunctionImp::put):
+        (KJS::DeclaredFunctionImp::DeclaredFunctionImp):
+        (KJS::DeclaredFunctionImp::construct):
+        (KJS::ArgumentsImp::ArgumentsImp):
+        (KJS::ArgumentsImp::mappedIndexGetter):
+        (KJS::ArgumentsImp::put):
+        (KJS::ActivationImp::argumentsGetter):
+        (KJS::GlobalFuncImp::GlobalFuncImp):
+        (KJS::encode):
+        (KJS::decode):
+        (KJS::GlobalFuncImp::callAsFunction):
+        * kjs/function.h:
+        * kjs/function_object.cpp:
+        (FunctionPrototypeImp::FunctionPrototypeImp):
+        (FunctionPrototypeImp::callAsFunction):
+        (FunctionProtoFuncImp::FunctionProtoFuncImp):
+        (FunctionProtoFuncImp::callAsFunction):
+        (FunctionObjectImp::FunctionObjectImp):
+        (FunctionObjectImp::construct):
+        (FunctionObjectImp::callAsFunction):
+        * kjs/function_object.h:
+        * kjs/internal.cpp:
+        (KJS::UndefinedImp::toPrimitive):
+        (KJS::UndefinedImp::toObject):
+        (KJS::NullImp::toPrimitive):
+        (KJS::NullImp::toObject):
+        (KJS::BooleanImp::toPrimitive):
+        (KJS::BooleanImp::toObject):
+        (KJS::StringImp::toPrimitive):
+        (KJS::StringImp::toObject):
+        (KJS::NumberImp::toPrimitive):
+        (KJS::NumberImp::toObject):
+        (KJS::NumberImp::getUInt32):
+        (KJS::LabelStack::push):
+        (KJS::ContextImp::ContextImp):
+        (KJS::InterpreterImp::globalInit):
+        (KJS::InterpreterImp::globalClear):
+        (KJS::InterpreterImp::InterpreterImp):
+        (KJS::InterpreterImp::initGlobalObject):
+        (KJS::InterpreterImp::clear):
+        (KJS::InterpreterImp::mark):
+        (KJS::InterpreterImp::evaluate):
+        (KJS::InternalFunctionImp::hasInstance):
+        (KJS::roundValue):
+        (KJS::printInfo):
+        * kjs/internal.h:
+        (KJS::InterpreterImp::builtinObject):
+        (KJS::InterpreterImp::builtinFunction):
+        (KJS::InterpreterImp::builtinArray):
+        (KJS::InterpreterImp::builtinBoolean):
+        (KJS::InterpreterImp::builtinString):
+        (KJS::InterpreterImp::builtinNumber):
+        (KJS::InterpreterImp::builtinDate):
+        (KJS::InterpreterImp::builtinRegExp):
+        (KJS::InterpreterImp::builtinError):
+        (KJS::InterpreterImp::builtinObjectPrototype):
+        (KJS::InterpreterImp::builtinFunctionPrototype):
+        (KJS::InterpreterImp::builtinArrayPrototype):
+        (KJS::InterpreterImp::builtinBooleanPrototype):
+        (KJS::InterpreterImp::builtinStringPrototype):
+        (KJS::InterpreterImp::builtinNumberPrototype):
+        (KJS::InterpreterImp::builtinDatePrototype):
+        (KJS::InterpreterImp::builtinRegExpPrototype):
+        (KJS::InterpreterImp::builtinErrorPrototype):
+        (KJS::InterpreterImp::builtinEvalError):
+        (KJS::InterpreterImp::builtinRangeError):
+        (KJS::InterpreterImp::builtinReferenceError):
+        (KJS::InterpreterImp::builtinSyntaxError):
+        (KJS::InterpreterImp::builtinTypeError):
+        (KJS::InterpreterImp::builtinURIError):
+        (KJS::InterpreterImp::builtinEvalErrorPrototype):
+        (KJS::InterpreterImp::builtinRangeErrorPrototype):
+        (KJS::InterpreterImp::builtinReferenceErrorPrototype):
+        (KJS::InterpreterImp::builtinSyntaxErrorPrototype):
+        (KJS::InterpreterImp::builtinTypeErrorPrototype):
+        (KJS::InterpreterImp::builtinURIErrorPrototype):
+        * kjs/interpreter.cpp:
+        (Context::variableObject):
+        (Context::thisValue):
+        (Interpreter::Interpreter):
+        (Interpreter::globalObject):
+        (Interpreter::evaluate):
+        (Interpreter::builtinObject):
+        (Interpreter::builtinFunction):
+        (Interpreter::builtinArray):
+        (Interpreter::builtinBoolean):
+        (Interpreter::builtinString):
+        (Interpreter::builtinNumber):
+        (Interpreter::builtinDate):
+        (Interpreter::builtinRegExp):
+        (Interpreter::builtinError):
+        (Interpreter::builtinObjectPrototype):
+        (Interpreter::builtinFunctionPrototype):
+        (Interpreter::builtinArrayPrototype):
+        (Interpreter::builtinBooleanPrototype):
+        (Interpreter::builtinStringPrototype):
+        (Interpreter::builtinNumberPrototype):
+        (Interpreter::builtinDatePrototype):
+        (Interpreter::builtinRegExpPrototype):
+        (Interpreter::builtinErrorPrototype):
+        (Interpreter::builtinEvalError):
+        (Interpreter::builtinRangeError):
+        (Interpreter::builtinReferenceError):
+        (Interpreter::builtinSyntaxError):
+        (Interpreter::builtinTypeError):
+        (Interpreter::builtinURIError):
+        (Interpreter::builtinEvalErrorPrototype):
+        (Interpreter::builtinRangeErrorPrototype):
+        (Interpreter::builtinReferenceErrorPrototype):
+        (Interpreter::builtinSyntaxErrorPrototype):
+        (Interpreter::builtinTypeErrorPrototype):
+        (Interpreter::builtinURIErrorPrototype):
+        (Interpreter::createLanguageInstanceForValue):
+        * kjs/interpreter.h:
+        (KJS::Interpreter::isGlobalObject):
+        (KJS::ExecState::setException):
+        (KJS::ExecState::clearException):
+        (KJS::ExecState::exception):
+        (KJS::ExecState::hadException):
+        (KJS::ExecState::ExecState):
+        * kjs/list.cpp:
+        (KJS::List::at):
+        * kjs/list.h:
+        (KJS::List::operator[]):
+        (KJS::ListIterator::operator->):
+        (KJS::ListIterator::operator*):
+        (KJS::ListIterator::operator++):
+        (KJS::ListIterator::operator--):
+        * kjs/lookup.h:
+        (KJS::staticFunctionGetter):
+        (KJS::staticValueGetter):
+        (KJS::lookupPut):
+        (KJS::cacheGlobalObject):
+        * kjs/math_object.cpp:
+        (MathObjectImp::getValueProperty):
+        (MathFuncImp::MathFuncImp):
+        (MathFuncImp::callAsFunction):
+        * kjs/math_object.h:
+        * kjs/nodes.cpp:
+        (Node::evaluateReference):
+        (Node::throwError):
+        (Node::setExceptionDetailsIfNeeded):
+        (NullNode::evaluate):
+        (BooleanNode::evaluate):
+        (NumberNode::evaluate):
+        (StringNode::evaluate):
+        (RegExpNode::evaluate):
+        (ThisNode::evaluate):
+        (ResolveNode::evaluate):
+        (ResolveNode::evaluateReference):
+        (GroupNode::evaluate):
+        (ElementNode::evaluate):
+        (ArrayNode::evaluate):
+        (ObjectLiteralNode::evaluate):
+        (PropertyValueNode::evaluate):
+        (PropertyNode::evaluate):
+        (AccessorNode1::evaluate):
+        (AccessorNode1::evaluateReference):
+        (AccessorNode2::evaluate):
+        (AccessorNode2::evaluateReference):
+        (ArgumentListNode::evaluate):
+        (ArgumentListNode::evaluateList):
+        (ArgumentsNode::evaluate):
+        (NewExprNode::evaluate):
+        (FunctionCallNode::evaluate):
+        (PostfixNode::evaluate):
+        (DeleteNode::evaluate):
+        (VoidNode::evaluate):
+        (TypeOfNode::evaluate):
+        (PrefixNode::evaluate):
+        (UnaryPlusNode::evaluate):
+        (NegateNode::evaluate):
+        (BitwiseNotNode::evaluate):
+        (LogicalNotNode::evaluate):
+        (MultNode::evaluate):
+        (AddNode::evaluate):
+        (ShiftNode::evaluate):
+        (RelationalNode::evaluate):
+        (EqualNode::evaluate):
+        (BitOperNode::evaluate):
+        (BinaryLogicalNode::evaluate):
+        (ConditionalNode::evaluate):
+        (AssignNode::evaluate):
+        (CommaNode::evaluate):
+        (StatListNode::execute):
+        (AssignExprNode::evaluate):
+        (VarDeclNode::evaluate):
+        (VarDeclNode::processVarDecls):
+        (VarDeclListNode::evaluate):
+        (ExprStatementNode::execute):
+        (IfNode::execute):
+        (DoWhileNode::execute):
+        (WhileNode::execute):
+        (ForNode::execute):
+        (ForInNode::execute):
+        (ContinueNode::execute):
+        (BreakNode::execute):
+        (ReturnNode::execute):
+        (WithNode::execute):
+        (CaseClauseNode::evaluate):
+        (ClauseListNode::evaluate):
+        (CaseBlockNode::evaluate):
+        (CaseBlockNode::evalBlock):
+        (SwitchNode::execute):
+        (ThrowNode::execute):
+        (CatchNode::execute):
+        (TryNode::execute):
+        (ParameterNode::evaluate):
+        (FuncDeclNode::processFuncDecl):
+        (FuncExprNode::evaluate):
+        (SourceElementsNode::execute):
+        * kjs/nodes.h:
+        (KJS::StatementNode::evaluate):
+        * kjs/number_object.cpp:
+        (NumberPrototypeImp::NumberPrototypeImp):
+        (NumberProtoFuncImp::NumberProtoFuncImp):
+        (NumberProtoFuncImp::callAsFunction):
+        (NumberObjectImp::NumberObjectImp):
+        (NumberObjectImp::getValueProperty):
+        (NumberObjectImp::construct):
+        (NumberObjectImp::callAsFunction):
+        * kjs/number_object.h:
+        * kjs/object.cpp:
+        (KJS::ObjectImp::call):
+        (KJS::ObjectImp::mark):
+        (KJS::ObjectImp::classInfo):
+        (KJS::ObjectImp::get):
+        (KJS::ObjectImp::getProperty):
+        (KJS::ObjectImp::getPropertySlot):
+        (KJS::ObjectImp::put):
+        (KJS::ObjectImp::hasOwnProperty):
+        (KJS::ObjectImp::defaultValue):
+        (KJS::ObjectImp::findPropertyHashEntry):
+        (KJS::ObjectImp::construct):
+        (KJS::ObjectImp::callAsFunction):
+        (KJS::ObjectImp::hasInstance):
+        (KJS::ObjectImp::propList):
+        (KJS::ObjectImp::toPrimitive):
+        (KJS::ObjectImp::toNumber):
+        (KJS::ObjectImp::toString):
+        (KJS::ObjectImp::toObject):
+        (KJS::ObjectImp::putDirect):
+        (KJS::Error::create):
+        (KJS::error):
+        * kjs/object.h:
+        (KJS::):
+        (KJS::ObjectImp::getPropertySlot):
+        (KJS::AllocatedValueImp::isObject):
+        (KJS::ObjectImp::ObjectImp):
+        (KJS::ObjectImp::internalValue):
+        (KJS::ObjectImp::setInternalValue):
+        (KJS::ObjectImp::prototype):
+        (KJS::ObjectImp::setPrototype):
+        (KJS::ObjectImp::inherits):
+        * kjs/object_object.cpp:
+        (ObjectPrototypeImp::ObjectPrototypeImp):
+        (ObjectProtoFuncImp::ObjectProtoFuncImp):
+        (ObjectProtoFuncImp::callAsFunction):
+        (ObjectObjectImp::ObjectObjectImp):
+        (ObjectObjectImp::construct):
+        (ObjectObjectImp::callAsFunction):
+        * kjs/object_object.h:
+        * kjs/operations.cpp:
+        (KJS::equal):
+        (KJS::strictEqual):
+        (KJS::relation):
+        (KJS::add):
+        (KJS::mult):
+        * kjs/operations.h:
+        * kjs/property_map.cpp:
+        (KJS::PropertyMap::mark):
+        (KJS::PropertyMap::addEnumerablesToReferenceList):
+        (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList):
+        (KJS::PropertyMap::save):
+        (KJS::PropertyMap::restore):
+        * kjs/property_map.h:
+        * kjs/property_slot.cpp:
+        (KJS::PropertySlot::undefinedGetter):
+        * kjs/property_slot.h:
+        (KJS::PropertySlot::getValue):
+        * kjs/protect.h:
+        (KJS::gcUnprotectNullTolerant):
+        (KJS::ProtectedValue::ProtectedValue):
+        (KJS::ProtectedValue::~ProtectedValue):
+        (KJS::ProtectedValue::operator=):
+        (KJS::ProtectedValue::operator ValueImp *):
+        (KJS::ProtectedValue::operator->):
+        * kjs/protected_object.h:
+        (KJS::ProtectedObject::ProtectedObject):
+        (KJS::ProtectedObject::operator=):
+        (KJS::ProtectedObject::operator ValueImp *):
+        (KJS::ProtectedObject::operator ObjectImp *):
+        (KJS::ProtectedObject::operator->):
+        (KJS::ProtectedReference::ProtectedReference):
+        (KJS::ProtectedReference::~ProtectedReference):
+        (KJS::ProtectedReference::operator=):
+        * kjs/protected_values.cpp:
+        (KJS::ProtectedValues::getProtectCount):
+        (KJS::ProtectedValues::increaseProtectCount):
+        (KJS::ProtectedValues::insert):
+        (KJS::ProtectedValues::decreaseProtectCount):
+        * kjs/protected_values.h:
+        * kjs/reference.cpp:
+        (KJS::Reference::Reference):
+        (KJS::Reference::makeValueReference):
+        (KJS::Reference::getBase):
+        (KJS::Reference::getValue):
+        (KJS::Reference::putValue):
+        (KJS::Reference::deleteValue):
+        * kjs/reference.h:
+        (KJS::Reference::baseIfMutable):
+        * kjs/regexp_object.cpp:
+        (RegExpPrototypeImp::RegExpPrototypeImp):
+        (RegExpProtoFuncImp::RegExpProtoFuncImp):
+        (RegExpProtoFuncImp::callAsFunction):
+        (RegExpObjectImp::RegExpObjectImp):
+        (RegExpObjectImp::arrayOfMatches):
+        (RegExpObjectImp::backrefGetter):
+        (RegExpObjectImp::construct):
+        (RegExpObjectImp::callAsFunction):
+        * kjs/regexp_object.h:
+        * kjs/string_object.cpp:
+        (StringInstanceImp::lengthGetter):
+        (StringInstanceImp::indexGetter):
+        (StringInstanceImp::getOwnPropertySlot):
+        (StringInstanceImp::put):
+        (StringPrototypeImp::StringPrototypeImp):
+        (StringProtoFuncImp::StringProtoFuncImp):
+        (regExpIsGlobal):
+        (replace):
+        (StringProtoFuncImp::callAsFunction):
+        (StringObjectImp::StringObjectImp):
+        (StringObjectImp::construct):
+        (StringObjectImp::callAsFunction):
+        (StringObjectFuncImp::StringObjectFuncImp):
+        (StringObjectFuncImp::callAsFunction):
+        * kjs/string_object.h:
+        * kjs/testkjs.cpp:
+        (TestFunctionImp::callAsFunction):
+        (VersionFunctionImp::callAsFunction):
+        (main):
+        * kjs/value.cpp:
+        (KJS::AllocatedValueImp::operator new):
+        (KJS::AllocatedValueImp::getUInt32):
+        (KJS::ValueImp::toInteger):
+        (KJS::ValueImp::toInt32):
+        (KJS::ValueImp::toUInt32):
+        (KJS::ValueImp::toUInt16):
+        (KJS::ValueImp::toObject):
+        (KJS::AllocatedValueImp::getBoolean):
+        (KJS::AllocatedValueImp::getNumber):
+        (KJS::AllocatedValueImp::getString):
+        (KJS::AllocatedValueImp::getObject):
+        (KJS::jsString):
+        (KJS::jsNumber):
+        (KJS::ConstantValues::init):
+        (KJS::ConstantValues::clear):
+        (KJS::ConstantValues::mark):
+        * kjs/value.h:
+        (KJS::):
+        (KJS::jsUndefined):
+        (KJS::jsNull):
+        (KJS::jsBoolean):
+        (KJS::jsNaN):
+        (KJS::ValueImp::ValueImp):
+        (KJS::ValueImp::~ValueImp):
+        (KJS::AllocatedValueImp::AllocatedValueImp):
+        (KJS::AllocatedValueImp::~AllocatedValueImp):
+        (KJS::AllocatedValueImp::isBoolean):
+        (KJS::AllocatedValueImp::isNumber):
+        (KJS::AllocatedValueImp::isString):
+        (KJS::AllocatedValueImp::isObject):
+        (KJS::AllocatedValueImp::marked):
+        (KJS::AllocatedValueImp::mark):
+        (KJS::ValueImp::downcast):
+        (KJS::ValueImp::isUndefined):
+        (KJS::ValueImp::isNull):
+        (KJS::ValueImp::isUndefinedOrNull):
+        (KJS::ValueImp::isBoolean):
+        (KJS::ValueImp::isNumber):
+        (KJS::ValueImp::isString):
+        (KJS::ValueImp::isObject):
+        (KJS::ValueImp::getBoolean):
+        (KJS::ValueImp::getNumber):
+        (KJS::ValueImp::getString):
+        (KJS::ValueImp::getObject):
+        (KJS::ValueImp::getUInt32):
+        (KJS::ValueImp::mark):
+        (KJS::ValueImp::marked):
+        (KJS::ValueImp::type):
+        (KJS::ValueImp::toPrimitive):
+        (KJS::ValueImp::toBoolean):
+        (KJS::ValueImp::toNumber):
+        (KJS::ValueImp::toString):
+        (KJS::jsZero):
+        (KJS::jsOne):
+        (KJS::jsTwo):
+        (KJS::Undefined):
+        (KJS::Null):
+        (KJS::Boolean):
+        (KJS::Number):
+        (KJS::String):
+
 2005-08-06  Maciej Stachowiak  <mjs@apple.com>
 
         Reviewed by Darin.
index 947a7fa12a08857e42650343ec12b00274a27539..a28d75e3c64f3ac1d2f4162ba4eda7962d4fe97f 100644 (file)
 /* Begin PBXBuildFile section */
                65305EAF08A58DDE00F31E73 /* protected_object.h in Headers */ = {isa = PBXBuildFile; fileRef = 65305EAE08A58DDE00F31E73 /* protected_object.h */; settings = {ATTRIBUTES = (Private, ); }; };
                65305EB008A58E0900F31E73 /* protected_object.h in Headers */ = {isa = PBXBuildFile; fileRef = 65305EAE08A58DDE00F31E73 /* protected_object.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               6539AACB08A3225A00223EE2 /* object_wrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 6539AACA08A3225A00223EE2 /* object_wrapper.h */; settings = {ATTRIBUTES = (Private, ); }; };
                65621E6D089E859700760F35 /* property_slot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65621E6B089E859700760F35 /* property_slot.cpp */; };
                65621E6E089E859700760F35 /* property_slot.h in Headers */ = {isa = PBXBuildFile; fileRef = 65621E6C089E859700760F35 /* property_slot.h */; settings = {ATTRIBUTES = (Private, ); }; };
                65621E6F089E85D300760F35 /* property_slot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65621E6B089E859700760F35 /* property_slot.cpp */; };
                65621E70089E85D300760F35 /* property_slot.h in Headers */ = {isa = PBXBuildFile; fileRef = 65621E6C089E859700760F35 /* property_slot.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               65BBAEE008A329B300357728 /* object_wrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 6539AACA08A3225A00223EE2 /* object_wrapper.h */; settings = {ATTRIBUTES = (Private, ); }; };
                932F5B400822A1C700736975 /* array_object.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A84E0255597D01FF60F7 /* array_object.h */; settings = {ATTRIBUTES = (Private, ); }; };
                932F5B420822A1C700736975 /* collector.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A8530255597D01FF60F7 /* collector.h */; settings = {ATTRIBUTES = (Private, ); }; };
                932F5B430822A1C700736975 /* date_object.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A8560255597D01FF60F7 /* date_object.h */; settings = {ATTRIBUTES = (Private, ); }; };
                651F6412039D5B5F0078395C /* dtoa.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = dtoa.cpp; sourceTree = "<group>"; };
                651F6413039D5B5F0078395C /* dtoa.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = dtoa.h; sourceTree = "<group>"; };
                65305EAE08A58DDE00F31E73 /* protected_object.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = protected_object.h; sourceTree = "<group>"; };
-               6539AACA08A3225A00223EE2 /* object_wrapper.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = object_wrapper.h; sourceTree = "<group>"; };
                65417205039E02E70058BFEB /* get.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = get.c; path = pcre/get.c; sourceTree = "<group>"; };
                65417206039E02E70058BFEB /* maketables.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = maketables.c; path = pcre/maketables.c; sourceTree = "<group>"; };
                65417207039E02E70058BFEB /* pcre.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pcre.c; path = pcre/pcre.c; sourceTree = "<group>"; };
                        isa = PBXGroup;
                        children = (
                                65305EAE08A58DDE00F31E73 /* protected_object.h */,
-                               6539AACA08A3225A00223EE2 /* object_wrapper.h */,
                                65621E6B089E859700760F35 /* property_slot.cpp */,
                                65621E6C089E859700760F35 /* property_slot.h */,
                                938772E5038BFE19008635CE /* array_instance.h */,
                                932F5B8F0822A1C700736975 /* fast_malloc.h in Headers */,
                                932FC11D0824A6A3005B3C75 /* create_hash_table in Headers */,
                                65621E6E089E859700760F35 /* property_slot.h in Headers */,
-                               6539AACB08A3225A00223EE2 /* object_wrapper.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                A85D8204087B2822006A9172 /* nodes.h in Headers */,
                                A85D8205087B2822006A9172 /* number_object.h in Headers */,
                                A85D8206087B2822006A9172 /* object_object.h in Headers */,
-                               65BBAEE008A329B300357728 /* object_wrapper.h in Headers */,
                                A85D8207087B2822006A9172 /* object.h in Headers */,
                                A85D8208087B2822006A9172 /* operations.h in Headers */,
                                A85D8209087B2822006A9172 /* property_map.h in Headers */,
index 6a24d098a63b9b10dc8d5e970f03cb61489ad8fe..1ebc53b1126a0674306edcc10a0f9de36d060691 100644 (file)
@@ -149,24 +149,24 @@ bool _NPN_Invoke (NPP npp, NPObject *o, NPIdentifier methodName, const NPVariant
            // Lookup the function object.
            ExecState *exec = obj->executionContext->interpreter()->globalExec();
            Interpreter::lock();
-           Value func = obj->imp->get (exec, identiferFromNPIdentifier(i->value.string));
+           ValueImp *func = obj->imp->get (exec, identiferFromNPIdentifier(i->value.string));
            Interpreter::unlock();
 
-           if (func.isNull()) {
+           if (func->isNull()) {
                NPN_InitializeVariantAsNull(result);
                return false;
            }
-           else if ( func.type() == UndefinedType) {
+           else if (func->isUndefined()) {
                NPN_InitializeVariantAsUndefined(result);
                return false;
            }
            else {
                // Call the function object.
-               ObjectImp *funcImp = static_cast<ObjectImp*>(func.imp());
-               Object thisObj = Object(const_cast<ObjectImp*>(obj->imp));
+               ObjectImp *funcImp = static_cast<ObjectImp*>(func);
+               ObjectImp *thisObj = const_cast<ObjectImp*>(obj->imp);
                List argList = listFromVariantArgs(exec, args, argCount);
                Interpreter::lock();
-               Value resultV = funcImp->call (exec, thisObj, argList);
+               ValueImp *resultV = funcImp->call (exec, thisObj, argList);
                Interpreter::unlock();
 
                // Convert and return the result of the function call.
@@ -193,8 +193,7 @@ bool _NPN_Evaluate (NPP npp, NPObject *o, NPString *s, NPVariant *variant)
            return false;
 
         ExecState *exec = obj->executionContext->interpreter()->globalExec();
-        Object thisObj = Object(const_cast<ObjectImp*>(obj->imp));
-        Value result;
+        ValueImp *result;
         
         Interpreter::lock();
         NPUTF16 *scriptString;
@@ -205,7 +204,7 @@ bool _NPN_Evaluate (NPP npp, NPObject *o, NPString *s, NPVariant *variant)
         
         if (type == Normal) {
             result = completion.value();
-            if (result.isNull()) {
+            if (!result) {
                 result = Undefined();
             }
         }
@@ -234,21 +233,9 @@ bool _NPN_GetProperty (NPP npp, NPObject *o, NPIdentifier propertyName, NPVarian
         ExecState *exec = obj->executionContext->interpreter()->globalExec();
 
         PrivateIdentifier *i = (PrivateIdentifier *)propertyName;
-        if (i->isString) {
-            if (!obj->imp->hasProperty (exec, identiferFromNPIdentifier(i->value.string))) {
-                NPN_InitializeVariantAsNull(variant);
-                return false;
-            }
-        }
-        else {
-            if (!obj->imp->hasProperty (exec, i->value.number)) {
-                NPN_InitializeVariantAsNull(variant);
-                return false;
-            }
-        }
         
         Interpreter::lock();
-        Value result;
+        ValueImp *result;
         if (i->isString) {
             result = obj->imp->get (exec, identiferFromNPIdentifier(i->value.string));
         }
@@ -257,11 +244,11 @@ bool _NPN_GetProperty (NPP npp, NPObject *o, NPIdentifier propertyName, NPVarian
         }
         Interpreter::unlock();
 
-        if (result.isNull()) {
+        if (result->isNull()) {
             NPN_InitializeVariantAsNull(variant);
             return false;
         }
-        else if (result.type() == UndefinedType) {
+        else if (result->isUndefined()) {
             NPN_InitializeVariantAsUndefined(variant);
             return false;
         }
@@ -292,7 +279,6 @@ bool _NPN_SetProperty (NPP npp, NPObject *o, NPIdentifier propertyName, const NP
 
         ExecState *exec = obj->executionContext->interpreter()->globalExec();
         Interpreter::lock();
-        Value result;
         PrivateIdentifier *i = (PrivateIdentifier *)propertyName;
         if (i->isString) {
             obj->imp->put (exec, identiferFromNPIdentifier(i->value.string), convertNPVariantToValue(exec, variant));
@@ -394,10 +380,10 @@ bool _NPN_HasMethod(NPP npp, NPObject *o, NPIdentifier methodName)
         // Lookup the function object.
         ExecState *exec = obj->executionContext->interpreter()->globalExec();
         Interpreter::lock();
-        Value func = obj->imp->get (exec, identiferFromNPIdentifier(i->value.string));
+        ValueImp *func = obj->imp->get (exec, identiferFromNPIdentifier(i->value.string));
         Interpreter::unlock();
 
-        if (func.isNull() || func.type() == UndefinedType) {
+        if (func->isUndefined()) {
             return false;
         }
         
@@ -417,7 +403,7 @@ void _NPN_SetException (NPObject *o, const NPUTF8 *message)
         JavaScriptObject *obj = (JavaScriptObject *)o; 
         ExecState *exec = obj->executionContext->interpreter()->globalExec();
         Interpreter::lock();
-        Object err = Error::create(exec, GeneralError, message);
+        ObjectImp *err = Error::create(exec, GeneralError, message);
         exec->setException (err);
         Interpreter::unlock();
     }
index 9428bb4e3fccaebc22a0256160f1758dc6f2dde5..f0e5f1659eab44a2f3848310031803375ece007d 100644 (file)
 }
 #endif
 
-using namespace KJS::Bindings;
-using namespace KJS;
+namespace KJS {
+namespace Bindings {
 
 CInstance::CInstance (NPObject *o) 
 {
     _object = _NPN_RetainObject (o);
     _class = 0;
     setExecutionContext (0);
-};
+}
 
 CInstance::~CInstance () 
 {
@@ -94,9 +94,9 @@ void CInstance::end()
     // Do nothing.
 }
 
-Value CInstance::invokeMethod (KJS::ExecState *exec, const MethodList &methodList, const List &args)
+ValueImp *CInstance::invokeMethod (ExecState *exec, const MethodList &methodList, const List &args)
 {
-    Value resultValue;
+    ValueImp *resultValue;
 
     // Overloading methods are not allowed by NPObjects.  Should only be one
     // name match for a particular method.
@@ -146,9 +146,9 @@ Value CInstance::invokeMethod (KJS::ExecState *exec, const MethodList &methodLis
 }
 
 
-Value CInstance::invokeDefaultMethod (KJS::ExecState *exec, const List &args)
+ValueImp *CInstance::invokeDefaultMethod (ExecState *exec, const List &args)
 {
-    Value resultValue;
+    ValueImp *resultValue;
 
     if (_object->_class->invokeDefault) {     
         unsigned i, count = args.size();
@@ -188,44 +188,44 @@ Value CInstance::invokeDefaultMethod (KJS::ExecState *exec, const List &args)
 }
 
 
-KJS::Value CInstance::defaultValue (KJS::Type hint) const
+ValueImp *CInstance::defaultValue (Type hint) const
 {
-    if (hint == KJS::StringType) {
+    if (hint == StringType) {
         return stringValue();
     }
-    else if (hint == KJS::NumberType) {
+    else if (hint == NumberType) {
         return numberValue();
     }
-    else if (hint == KJS::BooleanType) {
+    else if (hint == BooleanType) {
         return booleanValue();
     }
     
     return valueOf();
 }
 
-KJS::Value CInstance::stringValue() const
+ValueImp *CInstance::stringValue() const
 {
     char buf[1024];
-    snprintf (buf, 1024, "NPObject %p, NPClass %p", _object, _object->_class);
-    KJS::String v(buf);
-    return v;
+    snprintf(buf, 1024, "NPObject %p, NPClass %p", _object, _object->_class);
+    return jsString(buf);
 }
 
-KJS::Value CInstance::numberValue() const
+ValueImp *CInstance::numberValue() const
 {
     // FIXME:  Implement something sensible
-    KJS::Number v(0);
-    return v;
+    return jsNumber(0);
 }
 
-KJS::Value CInstance::booleanValue() const
+ValueImp *CInstance::booleanValue() const
 {
     // FIXME:  Implement something sensible
-    KJS::Boolean v((bool)0);
-    return v;
+    return jsBoolean(false);
 }
 
-KJS::Value CInstance::valueOf() const 
+ValueImp *CInstance::valueOf() const 
 {
     return stringValue();
-};
+}
+
+}
+}
index 96d248c370658f765d043aad9f27b85eb35dbf19..19af3b5900c7b9602fb713ecce577dc1a9f169c0 100644 (file)
@@ -51,15 +51,15 @@ public:
     virtual void begin();
     virtual void end();
     
-    virtual Value valueOf() const;
-    virtual Value defaultValue (KJS::Type hint) const;
+    virtual ValueImp *valueOf() const;
+    virtual ValueImp *defaultValue (KJS::Type hint) const;
 
-    virtual Value invokeMethod (ExecState *exec, const MethodList &method, const List &args);
-    virtual Value invokeDefaultMethod (ExecState *exec, const List &args);
+    virtual ValueImp *invokeMethod (ExecState *exec, const MethodList &method, const List &args);
+    virtual ValueImp *invokeDefaultMethod (ExecState *exec, const List &args);
 
-    Value stringValue() const;
-    Value numberValue() const;
-    Value booleanValue() const;
+    ValueImp *stringValue() const;
+    ValueImp *numberValue() const;
+    ValueImp *booleanValue() const;
     
     NPObject *getObject() const { return _object; }
 
index 931c1d5daf79665fc9a6e21ba76783333800757b..324a4eba7349929d22c44df1284c3e2d0114bdda 100644 (file)
@@ -41,11 +41,11 @@ using namespace KJS::Bindings;
 
 // ---------------------- CField ----------------------
 
-Value CField::valueFromInstance(KJS::ExecState *exec, const Instance *inst) const
+ValueImp *CField::valueFromInstance(ExecState *exec, const Instance *inst) const
 {
     const CInstance *instance = static_cast<const CInstance*>(inst);
     NPObject *obj = instance->getObject();
-    Value aValue;
+    ValueImp *aValue;
     NPVariant property;
     VOID_TO_NPVARIANT(property);
     if (obj->_class->getProperty) {
@@ -58,7 +58,7 @@ Value CField::valueFromInstance(KJS::ExecState *exec, const Instance *inst) cons
     return aValue;
 }
 
-void CField::setValueToInstance(KJS::ExecState *exec, const Instance *inst, const KJS::Value &aValue) const
+void CField::setValueToInstance(ExecState *exec, const Instance *inst, ValueImp *aValue) const
 {
     const CInstance *instance = static_cast<const CInstance*>(inst);
     NPObject *obj = instance->getObject();
index 5cf8f8c314b731668d450058954fa243116fc0ba..10d2f02ecc8503126ce797f1ddf5fcbc73e7db44 100644 (file)
@@ -35,7 +35,6 @@
 
 namespace KJS
 {
-class Value;
 
 namespace Bindings
 {
@@ -49,8 +48,8 @@ public:
         _fieldIdentifier = ident;
     };
     
-    virtual KJS::Value valueFromInstance(KJS::ExecState *exec, const Instance *instance) const;
-    virtual void setValueToInstance(KJS::ExecState *exec, const Instance *instance, const KJS::Value &aValue) const;
+    virtual ValueImp *valueFromInstance(ExecState *exec, const Instance *instance) const;
+    virtual void setValueToInstance(ExecState *exec, const Instance *instance, ValueImp *aValue) const;
     
     virtual const char *name() const { return _NPN_UTF8FromIdentifier(_fieldIdentifier); }
     virtual RuntimeType type() const { return ""; }
@@ -85,8 +84,8 @@ public:
 
     CArray &operator=(const CArray &other);
     
-    virtual void setValueAt(KJS::ExecState *exec, unsigned int index, const KJS::Value &aValue) const;
-    virtual KJS::Value valueAt(KJS::ExecState *exec, unsigned int index) const;
+    virtual void setValueAt(ExecState *exec, unsigned int index, ValueImp *aValue) const;
+    virtual ValueImp *valueAt(ExecState *exec, unsigned int index) const;
     virtual unsigned int getLength() const;
     
     virtual ~CArray();
index 0acc4beb71946678d28435a73cb493f65b958596..b868869790354991ee68d15c779e50b19818fa57 100644 (file)
@@ -37,55 +37,55 @@ using namespace KJS;
 using namespace KJS::Bindings;
 
 // Requires free() of returned UTF16Chars.
-void convertNPStringToUTF16 (const NPString *string, NPUTF16 **UTF16Chars, unsigned int *UTF16Length)
+void convertNPStringToUTF16(const NPString *string, NPUTF16 **UTF16Chars, unsigned int *UTF16Length)
 {
-    convertUTF8ToUTF16 (string->UTF8Characters, string->UTF8Length, UTF16Chars, UTF16Length);
+    convertUTF8ToUTF16(string->UTF8Characters, string->UTF8Length, UTF16Chars, UTF16Length);
 }
 
 // Requires free() of returned UTF16Chars.
-void convertUTF8ToUTF16 (const NPUTF8 *UTF8Chars, int UTF8Length, NPUTF16 **UTF16Chars, unsigned int *UTF16Length)
+void convertUTF8ToUTF16(const NPUTF8 *UTF8Chars, int UTF8Length, NPUTF16 **UTF16Chars, unsigned int *UTF16Length)
 {
-    assert (UTF8Chars);
+    assert(UTF8Chars);
     
     if (UTF8Length == -1)
         UTF8Length = strlen(UTF8Chars);
         
-    CFStringRef stringRef = CFStringCreateWithBytes (NULL, (const UInt8*)UTF8Chars, (CFIndex)UTF8Length, kCFStringEncodingUTF8, false);
+    CFStringRef stringRef = CFStringCreateWithBytes(NULL, (const UInt8*)UTF8Chars, (CFIndex)UTF8Length, kCFStringEncodingUTF8, false);
 
-    *UTF16Length = (unsigned int)CFStringGetLength (stringRef);
-    *UTF16Chars = (NPUTF16 *)malloc (sizeof(NPUTF16) * (*UTF16Length));
+    *UTF16Length = (unsigned int)CFStringGetLength(stringRef);
+    *UTF16Chars = (NPUTF16 *)malloc(sizeof(NPUTF16) * (*UTF16Length));
 
     // Convert the string to UTF16.
     CFRange range = { 0, *UTF16Length };
-    CFStringGetCharacters (stringRef, range, (UniChar *)*UTF16Chars);
-    CFRelease (stringRef);
+    CFStringGetCharacters(stringRef, range, (UniChar *)*UTF16Chars);
+    CFRelease(stringRef);
 }
 
 // Variant value must be released with NPReleaseVariantValue()
-void coerceValueToNPVariantStringType (KJS::ExecState *exec, const KJS::Value &value, NPVariant *result)
+void coerceValueToNPVariantStringType(ExecState *exec, ValueImp *value, NPVariant *result)
 {
-    UString ustring = value.toString(exec);
+    UString ustring = value->toString(exec);
     CString cstring = ustring.UTF8String();
     NPString string = { (const NPUTF8 *)cstring.c_str(), cstring.size() };
-    NPN_InitializeVariantWithStringCopy (result, &string);
+    NPN_InitializeVariantWithStringCopy(result, &string);
 }
 
 // Variant value must be released with NPReleaseVariantValue()
-void convertValueToNPVariant (KJS::ExecState *exec, const KJS::Value &value, NPVariant *result)
+void convertValueToNPVariant(ExecState *exec, ValueImp *value, NPVariant *result)
 {
-    Type type = value.type();
+    Type type = value->type();
     
     if (type == StringType) {
-        UString ustring = value.toString(exec);
+        UString ustring = value->toString(exec);
         CString cstring = ustring.UTF8String();
         NPString string = { (const NPUTF8 *)cstring.c_str(), cstring.size() };
-        NPN_InitializeVariantWithStringCopy (result, &string );
+        NPN_InitializeVariantWithStringCopy(result, &string );
     }
     else if (type == NumberType) {
-        NPN_InitializeVariantWithDouble (result, value.toNumber(exec));
+        NPN_InitializeVariantWithDouble(result, value->toNumber(exec));
     }
     else if (type == BooleanType) {
-        NPN_InitializeVariantWithBool (result, value.toBoolean(exec));
+        NPN_InitializeVariantWithBool(result, value->toBoolean(exec));
     }
     else if (type == UnspecifiedType) {
         NPN_InitializeVariantAsUndefined(result);
@@ -94,20 +94,20 @@ void convertValueToNPVariant (KJS::ExecState *exec, const KJS::Value &value, NPV
         NPN_InitializeVariantAsNull(result);
     }
     else if (type == ObjectType) {
-        KJS::ObjectImp *objectImp = static_cast<KJS::ObjectImp*>(value.imp());
-        if (objectImp->classInfo() == &KJS::RuntimeObjectImp::info) {
-            KJS::RuntimeObjectImp *imp = static_cast<KJS::RuntimeObjectImp *>(value.imp());
+        ObjectImp *objectImp = static_cast<ObjectImp*>(value);
+        if (objectImp->classInfo() == &RuntimeObjectImp::info) {
+            RuntimeObjectImp *imp = static_cast<RuntimeObjectImp *>(value);
             CInstance *instance = static_cast<CInstance*>(imp->getInternalInstance());
-            NPN_InitializeVariantWithObject (result, instance->getObject());
+            NPN_InitializeVariantWithObject(result, instance->getObject());
         }
        else {
 
-           KJS::Interpreter *originInterpreter = exec->interpreter();
+           Interpreter *originInterpreter = exec->interpreter();
             const Bindings::RootObject *originExecutionContext = rootForInterpreter(originInterpreter);
 
-           KJS::Interpreter *interpreter = 0;
+           Interpreter *interpreter = 0;
            if (originInterpreter->isGlobalObject(value)) {
-               interpreter = originInterpreter->interpreterForGlobalObject (value.imp());
+               interpreter = originInterpreter->interpreterForGlobalObject(value);
            }
 
            if (!interpreter)
@@ -115,29 +115,29 @@ void convertValueToNPVariant (KJS::ExecState *exec, const KJS::Value &value, NPV
                
             const Bindings::RootObject *executionContext = rootForInterpreter(interpreter);
             if (!executionContext) {
-                Bindings::RootObject *newExecutionContext = new KJS::Bindings::RootObject(0);
-                newExecutionContext->setInterpreter (interpreter);
+                Bindings::RootObject *newExecutionContext = new Bindings::RootObject(0);
+                newExecutionContext->setInterpreter(interpreter);
                 executionContext = newExecutionContext;
             }
     
-           NPObject *obj = (NPObject *)exec->interpreter()->createLanguageInstanceForValue (exec, Instance::CLanguage, value.toObject(exec), originExecutionContext, executionContext);
-           NPN_InitializeVariantWithObject (result, obj);
-           _NPN_ReleaseObject (obj);
+           NPObject *obj = (NPObject *)exec->interpreter()->createLanguageInstanceForValue(exec, Instance::CLanguage, value->toObject(exec), originExecutionContext, executionContext);
+           NPN_InitializeVariantWithObject(result, obj);
+           _NPN_ReleaseObject(obj);
        }
     }
     else
         NPN_InitializeVariantAsUndefined(result);
 }
 
-Value convertNPVariantToValue (KJS::ExecState *exec, const NPVariant *variant)
+ValueImp *convertNPVariantToValue(ExecState *exec, const NPVariant *variant)
 {
     NPVariantType type = variant->type;
 
     if (type == NPVariantType_Bool) {
         NPBool aBool;
-        if (NPN_VariantToBool (variant, &aBool))
-            return KJS::Boolean (aBool);
-        return KJS::Boolean (false);
+        if (NPN_VariantToBool(variant, &aBool))
+            return jsBoolean(aBool);
+        return jsBoolean(false);
     }
     else if (type == NPVariantType_Null) {
         return Null();
@@ -147,23 +147,23 @@ Value convertNPVariantToValue (KJS::ExecState *exec, const NPVariant *variant)
     }
     else if (type == NPVariantType_Int32) {
         int32_t anInt;
-        if (NPN_VariantToInt32 (variant, &anInt))
-            return Number (anInt);
-        return Number (0);
+        if (NPN_VariantToInt32(variant, &anInt))
+            return Number(anInt);
+        return Number(0);
     }
     else if (type == NPVariantType_Double) {
         double aDouble;
-        if (NPN_VariantToDouble (variant, &aDouble))
-            return Number (aDouble);
-        return Number (0);
+        if (NPN_VariantToDouble(variant, &aDouble))
+            return Number(aDouble);
+        return Number(0);
     }
     else if (type == NPVariantType_String) {
         NPUTF16 *stringValue;
         unsigned int UTF16Length;
-        convertNPStringToUTF16 (&variant->value.stringValue, &stringValue, &UTF16Length);    // requires free() of returned memory.
-        String resultString(UString((const UChar *)stringValue,UTF16Length));
-        free (stringValue);
-        return resultString;
+        convertNPStringToUTF16(&variant->value.stringValue, &stringValue, &UTF16Length);    // requires free() of returned memory.
+        UString resultString((const UChar *)stringValue,UTF16Length);
+        free(stringValue);
+        return jsString(resultString);
     }
     else if (type == NPVariantType_Object) {
         NPObject *obj = variant->value.objectValue;
@@ -171,7 +171,7 @@ Value convertNPVariantToValue (KJS::ExecState *exec, const NPVariant *variant)
         if (obj->_class == NPScriptObjectClass) {
             // Get ObjectImp from NP_JavaScriptObject.
             JavaScriptObject *o = (JavaScriptObject *)obj;
-            return Object(const_cast<ObjectImp*>(o->imp));
+            return const_cast<ObjectImp*>(o->imp);
         }
         else {
             //  Wrap NPObject in a CInstance.
index fb10b9c336c576edc40cf8b393b57a9984cdc68b..e757b97bb1a5002c4a5154b9eef72443f71bb6f2 100644 (file)
@@ -45,12 +45,11 @@ typedef enum
     NP_InvalidValueType
 } NP_ValueType;
 
-
-extern void convertNPStringToUTF16 (const NPString *string, NPUTF16 **UTF16Chars, unsigned int *UTF16Length);
-extern void convertUTF8ToUTF16 (const NPUTF8 *UTF8Chars, int UTF8Length, NPUTF16 **UTF16Chars, unsigned int *UTF16Length);
-extern void coerceValueToNPVariantStringType (KJS::ExecState *exec, const KJS::Value &value, NPVariant *result);
-extern void convertValueToNPVariant (KJS::ExecState *exec, const KJS::Value &value, NPVariant *result);
-extern KJS::Value convertNPVariantToValue (KJS::ExecState *exec, const NPVariant *variant);
+void convertNPStringToUTF16(const NPString *string, NPUTF16 **UTF16Chars, unsigned int *UTF16Length);
+void convertUTF8ToUTF16(const NPUTF8 *UTF8Chars, int UTF8Length, NPUTF16 **UTF16Chars, unsigned int *UTF16Length);
+void coerceValueToNPVariantStringType(KJS::ExecState *exec, KJS::ValueImp *value, NPVariant *result);
+void convertValueToNPVariant(KJS::ExecState *exec, KJS::ValueImp *value, NPVariant *result);
+KJS::ValueImp *convertNPVariantToValue(KJS::ExecState *exec, const NPVariant *variant);
 
 typedef struct 
 {
index fd3ab615eaf3ff72c14aed7088e1c36cecb2743c..650e5dd7712d512d8e0909e8d17c1997ea45534d 100644 (file)
@@ -81,36 +81,33 @@ Class *JavaInstance::getClass() const
     return _class;
 }
 
-KJS::Value JavaInstance::stringValue() const
+ValueImp *JavaInstance::stringValue() const
 {
     jstring stringValue = (jstring)callJNIObjectMethod (_instance->_instance, "toString", "()Ljava/lang/String;");
     JNIEnv *env = getJNIEnv();
-    const UChar *c = (const UChar *)getUCharactersFromJStringInEnv (env, stringValue);
-    UString u(c, (int)env->GetStringLength(stringValue));
-    String v(u);
-    releaseUCharactersForJStringInEnv (env, stringValue, (const jchar *)c);
-    return v;
+    const jchar *c = getUCharactersFromJStringInEnv(env, stringValue);
+    UString u((const UChar *)c, (int)env->GetStringLength(stringValue));
+    releaseUCharactersForJStringInEnv(env, stringValue, c);
+    return jsString(u);
 }
 
-KJS::Value JavaInstance::numberValue() const
+ValueImp *JavaInstance::numberValue() const
 {
     jdouble doubleValue = callJNIDoubleMethod (_instance->_instance, "doubleValue", "()D");
-    KJS::Number v(doubleValue);
-    return v;
+    return jsNumber(doubleValue);
 }
 
-KJS::Value JavaInstance::booleanValue() const
+ValueImp *JavaInstance::booleanValue() const
 {
     jboolean booleanValue = callJNIBooleanMethod (_instance->_instance, "booleanValue", "()Z");
-    KJS::Boolean v(booleanValue);
-    return v;
+    return jsBoolean(booleanValue);
 }
 
-Value JavaInstance::invokeMethod (KJS::ExecState *exec, const MethodList &methodList, const List &args)
+ValueImp *JavaInstance::invokeMethod (ExecState *exec, const MethodList &methodList, const List &args)
 {
     int i, count = args.size();
     jvalue *jArgs;
-    Value resultValue;
+    ValueImp *resultValue;
     Method *method = 0;
     unsigned int numMethods = methodList.length();
     
@@ -145,7 +142,7 @@ Value JavaInstance::invokeMethod (KJS::ExecState *exec, const MethodList &method
     for (i = 0; i < count; i++) {
         JavaParameter *aParameter = static_cast<JavaParameter *>(jMethod->parameterAt(i));
         jArgs[i] = convertValueToJValue (exec, args.at(i), aParameter->getJNIType(), aParameter->type());
-       JS_LOG("arg[%d] = %s\n", i, args.at(i).toString(exec).ascii());
+       JS_LOG("arg[%d] = %s\n", i, args.at(i)->toString(exec).ascii());
     }
         
 
@@ -158,12 +155,11 @@ Value JavaInstance::invokeMethod (KJS::ExecState *exec, const MethodList &method
     bool handled = false;
     if (execContext && execContext->nativeHandle()) {
         jobject obj = _instance->_instance;
-        Value exceptionDescription;
+        ValueImp *exceptionDescription;
         const char *callingURL = 0;  // FIXME, need to propagate calling URL to Java
         handled = dispatchJNICall (execContext->nativeHandle(), obj, jMethod->isStatic(), jMethod->JNIReturnType(), jMethod->methodID(obj), jArgs, result, callingURL, exceptionDescription);
-        if (!exceptionDescription.isNull()) {
-            Object error = Error::create(exec, GeneralError, exceptionDescription.toString(exec).UTF8String().c_str());
-            
+        if (exceptionDescription) {
+            ObjectImp *error = Error::create(exec, GeneralError, exceptionDescription->toString(exec).UTF8String().c_str());
             exec->setException(error);
             
             free (jArgs);
@@ -256,7 +252,7 @@ Value JavaInstance::invokeMethod (KJS::ExecState *exec, const MethodList &method
         break;
         
         case boolean_type: {
-            resultValue = KJS::Boolean(result.z);
+            resultValue = Boolean(result.z);
         }
         break;
         
@@ -307,13 +303,13 @@ Value JavaInstance::invokeMethod (KJS::ExecState *exec, const MethodList &method
     return resultValue;
 }
 
-KJS::Value JavaInstance::invokeDefaultMethod (KJS::ExecState *exec, const KJS::List &args)
+ValueImp *JavaInstance::invokeDefaultMethod (ExecState *exec, const List &args)
 {
     return Undefined();
 }
 
 
-KJS::Value JavaInstance::defaultValue (KJS::Type hint) const
+ValueImp *JavaInstance::defaultValue (Type hint) const
 {
     if (hint == StringType) {
         return stringValue();
@@ -340,7 +336,7 @@ KJS::Value JavaInstance::defaultValue (KJS::Type hint) const
     return valueOf();
 }
 
-KJS::Value JavaInstance::valueOf() const 
+ValueImp *JavaInstance::valueOf() const 
 {
     return stringValue();
 };
index 16c3e5c911e55bdfb3b137204990b1787235791e..21cd85497a99fb562cbb5c8a8ca93974d5a5a16f 100644 (file)
@@ -90,17 +90,17 @@ public:
     virtual void begin();
     virtual void end();
     
-    virtual Value valueOf() const;
-    virtual Value defaultValue (Type hint) const;
+    virtual ValueImp *valueOf() const;
+    virtual ValueImp *defaultValue (Type hint) const;
 
-    virtual Value invokeMethod (ExecState *exec, const MethodList &method, const List &args);
-    virtual Value invokeDefaultMethod (ExecState *exec, const List &args);
+    virtual ValueImp *invokeMethod (ExecState *exec, const MethodList &method, const List &args);
+    virtual ValueImp *invokeDefaultMethod (ExecState *exec, const List &args);
 
     jobject javaInstance() const { return _instance->_instance; }
     
-    Value stringValue() const;
-    Value numberValue() const;
-    Value booleanValue() const;
+    ValueImp *stringValue() const;
+    ValueImp *numberValue() const;
+    ValueImp *booleanValue() const;
         
 private:
     JObjectWrapper *_instance;
index 43c329e75f3bbe37fa33c19d2b3f704f001d1ff4..8f80ff5cec31b2805190cf082a39cbac2678d4b0 100644 (file)
@@ -77,7 +77,7 @@ jvalue JSObject::invoke (JSObjectCallContext *context)
             result.j = JSObject::createNative(nativeHandle);
         }
         else {
-            KJS::ObjectImp *imp = jlong_to_impptr(nativeHandle);
+            ObjectImp *imp = jlong_to_impptr(nativeHandle);
             if (!rootForImp(imp)) {
                 fprintf (stderr, "%s:%d:  Attempt to access JavaScript from destroyed applet, type %d.\n", __FILE__, __LINE__, context->type);
                 return result;
@@ -173,19 +173,19 @@ jobject JSObject::call(jstring methodName, jobjectArray args) const
     Interpreter::lock();
     
     Identifier identifier(JavaString(methodName).ustring());
-    Value func = _imp->get (exec, identifier);
+    ValueImp *func = _imp->get (exec, identifier);
     Interpreter::unlock();
-    if (func.isNull() || func.type() == UndefinedType) {
+    if (func->isUndefinedOrNull()) {
         // Maybe throw an exception here?
         return 0;
     }
 
     // Call the function object.
-    ObjectImp *funcImp = static_cast<ObjectImp*>(func.imp());
-    Object thisObj = Object(const_cast<ObjectImp*>(_imp));
+    ObjectImp *funcImp = static_cast<ObjectImp*>(func);
+    ObjectImp *thisObj = const_cast<ObjectImp*>(_imp);
     List argList = listFromJArray(args);
     Interpreter::lock();
-    Value result = funcImp->call (exec, thisObj, argList);
+    ValueImp *result = funcImp->call (exec, thisObj, argList);
     Interpreter::unlock();
 
     // Convert and return the result of the function call.
@@ -196,8 +196,8 @@ jobject JSObject::eval(jstring script) const
 {
     JS_LOG ("script = %s\n", JavaString(script).UTF8String());
 
-    Object thisObj = Object(const_cast<ObjectImp*>(_imp));
-    Value result;
+    ObjectImp *thisObj = const_cast<ObjectImp*>(_imp);
+    ValueImp *result;
     
     Interpreter::lock();
 
@@ -206,7 +206,7 @@ jobject JSObject::eval(jstring script) const
     
     if (type == Normal) {
         result = completion.value();
-        if (result.isNull()) {
+        if (!result) {
             result = Undefined();
         }
     }
@@ -225,7 +225,7 @@ jobject JSObject::getMember(jstring memberName) const
     ExecState *exec = _root->interpreter()->globalExec();
 
     Interpreter::lock();
-    Value result = _imp->get (exec, Identifier (JavaString(memberName).ustring()));
+    ValueImp *result = _imp->get (exec, Identifier (JavaString(memberName).ustring()));
     Interpreter::unlock();
 
     return convertValueToJObject (result);
@@ -258,7 +258,7 @@ jobject JSObject::getSlot(jint index) const
 
     ExecState *exec = _root->interpreter()->globalExec();
     Interpreter::lock();
-    Value result = _imp->get (exec, (unsigned)index);
+    ValueImp *result = _imp->get (exec, (unsigned)index);
     Interpreter::unlock();
 
     return convertValueToJObject (result);
@@ -281,7 +281,7 @@ jstring JSObject::toString() const
     JS_LOG ("\n");
 
     Interpreter::lock();
-    Object thisObj = Object(const_cast<ObjectImp*>(_imp));
+    ObjectImp *thisObj = const_cast<ObjectImp*>(_imp);
     ExecState *exec = _root->interpreter()->globalExec();
     
     jstring result = (jstring)convertValueToJValue (exec, thisObj, object_type, "java.lang.String").l;
@@ -328,7 +328,7 @@ jlong JSObject::createNative(jlong nativeHandle)
     return ptr_to_jlong(0);
 }
 
-jobject JSObject::convertValueToJObject (KJS::Value value) const
+jobject JSObject::convertValueToJObject (ValueImp *value) const
 {
     ExecState *exec = _root->interpreter()->globalExec();
     JNIEnv *env = getJNIEnv();
@@ -342,39 +342,39 @@ jobject JSObject::convertValueToJObject (KJS::Value value) const
     // Java instance -> Java instance
     // Everything else -> JSObject
     
-    KJS::Type type = value.type();
-    if (type == KJS::NumberType) {
+    Type type = value->type();
+    if (type == NumberType) {
         jclass JSObjectClass = env->FindClass ("java/lang/Double");
         jmethodID constructorID = env->GetMethodID (JSObjectClass, "<init>", "(D)V");
         if (constructorID != NULL) {
-            result = env->NewObject (JSObjectClass, constructorID, (jdouble)value.toNumber(exec));
+            result = env->NewObject (JSObjectClass, constructorID, (jdouble)value->toNumber(exec));
         }
     }
-    else if (type == KJS::StringType) {
-        KJS::UString stringValue = value.toString(exec);
+    else if (type == StringType) {
+        UString stringValue = value->toString(exec);
         JNIEnv *env = getJNIEnv();
         result = env->NewString ((const jchar *)stringValue.data(), stringValue.size());
     }
-    else if (type == KJS::BooleanType) {
+    else if (type == BooleanType) {
         jclass JSObjectClass = env->FindClass ("java/lang/Boolean");
         jmethodID constructorID = env->GetMethodID (JSObjectClass, "<init>", "(Z)V");
         if (constructorID != NULL) {
-            result = env->NewObject (JSObjectClass, constructorID, (jboolean)value.toBoolean(exec));
+            result = env->NewObject (JSObjectClass, constructorID, (jboolean)value->toBoolean(exec));
         }
     }
     else {
         // Create a JSObject.
         jlong nativeHandle;
         
-        if (type == KJS::ObjectType){
-            KJS::ObjectImp *imp = static_cast<KJS::ObjectImp*>(value.imp());
+        if (type == ObjectType){
+            ObjectImp *imp = static_cast<ObjectImp*>(value);
             
             // We either have a wrapper around a Java instance or a JavaScript
             // object.  If we have a wrapper around a Java instance, return that
             // instance, otherwise create a new Java JSObject with the ObjectImp*
             // as it's nativeHandle.
             if (imp->classInfo() && strcmp(imp->classInfo()->className, "RuntimeObject") == 0) {
-                KJS::RuntimeObjectImp *runtimeImp = static_cast<KJS::RuntimeObjectImp*>(value.imp());
+                RuntimeObjectImp *runtimeImp = static_cast<RuntimeObjectImp*>(value);
                 Bindings::JavaInstance *runtimeInstance = static_cast<Bindings::JavaInstance *>(runtimeImp->getInternalInstance());
                 return runtimeInstance->javaInstance();
             }
@@ -411,7 +411,7 @@ jobject JSObject::convertValueToJObject (KJS::Value value) const
     return result;
 }
 
-KJS::Value JSObject::convertJObjectToValue (jobject theObject) const
+ValueImp *JSObject::convertJObjectToValue (jobject theObject) const
 {
     // Instances of netscape.javascript.JSObject get converted back to
     // JavaScript objects.  All other objects are wrapped.  It's not
@@ -427,28 +427,28 @@ KJS::Value JSObject::convertJObjectToValue (jobject theObject) const
         JNIEnv *env = getJNIEnv();
         jfieldID fieldID = env->GetFieldID((jclass)classOfInstance, "nativeJSObject", "long");
         if (fieldID == NULL) {
-            return KJS::Undefined();
+            return Undefined();
         }
         jlong nativeHandle = env->GetLongField(theObject, fieldID);
         if (nativeHandle == UndefinedHandle) {
-            return KJS::Undefined();
+            return Undefined();
         }
-        KJS::ObjectImp *imp = static_cast<KJS::ObjectImp*>(jlong_to_impptr(nativeHandle));
-        return KJS::Object(const_cast<KJS::ObjectImp*>(imp));
+        ObjectImp *imp = static_cast<ObjectImp*>(jlong_to_impptr(nativeHandle));
+        return imp;
     }
 
     Interpreter::lock();
-    KJS::RuntimeObjectImp *newImp = new KJS::RuntimeObjectImp(new Bindings::JavaInstance (theObject, _root));
+    RuntimeObjectImp *newImp = new RuntimeObjectImp(new Bindings::JavaInstance (theObject, _root));
     Interpreter::unlock();
 
-    return KJS::Object(newImp);
+    return newImp;
 }
 
-KJS::List JSObject::listFromJArray(jobjectArray jArray) const
+List JSObject::listFromJArray(jobjectArray jArray) const
 {
     JNIEnv *env = getJNIEnv();
     long i, numObjects = jArray ? env->GetArrayLength (jArray) : 0;
-    KJS::List aList;
+    List aList;
     
     for (i = 0; i < numObjects; i++) {
         jobject anObject = env->GetObjectArrayElement ((jobjectArray)jArray, i);
index b6d7e1df5f8f9f0f2ce014f968620335bcd536b5..774c97c736148eed1cdf3b47f50b1f2687fa35e2 100644 (file)
@@ -88,13 +88,13 @@ public:
     
     static jvalue invoke (JSObjectCallContext *context);
 
-    jobject convertValueToJObject (KJS::Value value) const;
-    KJS::Value convertJObjectToValue (jobject theObject) const;
-    KJS::List listFromJArray(jobjectArray jArray) const;
+    jobject convertValueToJObject (ValueImp *value) const;
+    ValueImp *convertJObjectToValue (jobject theObject) const;
+    List listFromJArray(jobjectArray jArray) const;
     
 private:
-    const Bindings::RootObject *_root;
-    KJS::ObjectImp *_imp;
+    const RootObject *_root;
+    ObjectImp *_imp;
 };
 
 
@@ -116,6 +116,6 @@ jobject KJS_JSObject_JSObjectGetSlot (JNIEnv *env, jclass jsClass, jlong nativeJ
 void KJS_JSObject_JSObjectSetSlot (JNIEnv *env, jclass jsClass, jlong nativeJSObject, jstring jurl, jint jindex, jobject value, jboolean ctx);
 jstring KJS_JSObject_JSObjectToString (JNIEnv *env, jclass clazz, jlong nativeJSObject);
 
-} // namespace Bindings
+}
 
 #endif
\ No newline at end of file
index b9ad924662bb7cb6c7440a023e881cc6e4f31d0e..d0d20c40068f0e338c4c94ce446f9e84b4835d11 100644 (file)
@@ -43,7 +43,7 @@ using namespace KJS::Bindings;
 - (NSURL *)_webViewURL;
 @end
 
-bool KJS::Bindings::dispatchJNICall (const void *targetAppletView, jobject obj, bool isStatic, JNIType returnType, jmethodID methodID, jvalue *args, jvalue &result, const char *callingURL, Value &exceptionDescription)
+bool KJS::Bindings::dispatchJNICall (const void *targetAppletView, jobject obj, bool isStatic, JNIType returnType, jmethodID methodID, jvalue *args, jvalue &result, const char *callingURL, ValueImp *&exceptionDescription)
 {
     id view = (id)targetAppletView;
     
index 0f8fd310337af2e54a4271c2a8f3dd5c3c05bd40..986876e2bd818a260eec7a3cd29594937c86e515 100644 (file)
@@ -67,15 +67,15 @@ JavaField::JavaField (JNIEnv *env, jobject aField)
     _field = new JavaInstance(aField, 0);
 }
 
-KJS::Value JavaArray::convertJObjectToArray (KJS::ExecState *exec, jobject anObject, const char *type, const RootObject *r)
+ValueImp *JavaArray::convertJObjectToArray (ExecState *exec, jobject anObject, const char *type, const RootObject *r)
 {
     if (type[0] != '[')
         return Undefined();
 
-    return KJS::Object(new RuntimeArrayImp(exec, new JavaArray ((jobject)anObject, type, r)));
+    return new RuntimeArrayImp(exec, new JavaArray((jobject)anObject, type, r));
 }
 
-jvalue JavaField::dispatchValueFromInstance(KJS::ExecState *exec, const JavaInstance *instance, const char *name, const char *sig, JNIType returnType) const
+jvalue JavaField::dispatchValueFromInstance(ExecState *exec, const JavaInstance *instance, const char *name, const char *sig, JNIType returnType) const
 {
     jobject jinstance = instance->javaInstance();
     jobject fieldJInstance = _field->javaInstance();
@@ -90,13 +90,13 @@ jvalue JavaField::dispatchValueFromInstance(KJS::ExecState *exec, const JavaInst
        {
            const RootObject *execContext = instance->executionContext();
            if (execContext && execContext->nativeHandle()) {
-               Value exceptionDescription;
+               ValueImp *exceptionDescription;
                jvalue args[1];
                
                args[0].l = jinstance;
                dispatchJNICall (execContext->nativeHandle(), fieldJInstance, false, returnType, mid, args, result, 0, exceptionDescription);
-               if (!exceptionDescription.isNull()) {
-                   Object error = Error::create(exec, GeneralError, exceptionDescription.toString(exec).UTF8String().c_str());
+               if (exceptionDescription) {
+                   ObjectImp *error = Error::create(exec, GeneralError, exceptionDescription->toString(exec).UTF8String().c_str());
                    exec->setException(error);
                }
            }
@@ -105,11 +105,11 @@ jvalue JavaField::dispatchValueFromInstance(KJS::ExecState *exec, const JavaInst
     return result;
 }
 
-KJS::Value JavaField::valueFromInstance(KJS::ExecState *exec, const Instance *i) const 
+ValueImp *JavaField::valueFromInstance(ExecState *exec, const Instance *i) const 
 {
     const JavaInstance *instance = static_cast<const JavaInstance *>(i);
 
-    Value jsresult = Undefined();
+    ValueImp *jsresult = Undefined();
     
     switch (_JNIType) {
         case object_type: {
@@ -129,7 +129,7 @@ KJS::Value JavaField::valueFromInstance(KJS::ExecState *exec, const Instance *i)
         case boolean_type: {
            jvalue result = dispatchValueFromInstance (exec, instance, "getBoolean", "(Ljava/lang/Object;)Z", boolean_type);
            jboolean value = result.z;
-            jsresult = KJS::Boolean((bool)value);
+            jsresult = Boolean((bool)value);
         }
         break;
             
@@ -158,12 +158,12 @@ KJS::Value JavaField::valueFromInstance(KJS::ExecState *exec, const Instance *i)
         break;
     }
 
-    JS_LOG ("getting %s = %s\n", name(), jsresult.toString(exec).ascii());
+    JS_LOG ("getting %s = %s\n", name(), jsresult->toString(exec).ascii());
     
     return jsresult;
 }
 
-void JavaField::dispatchSetValueToInstance(KJS::ExecState *exec, const JavaInstance *instance, jvalue javaValue, const char *name, const char *sig) const
+void JavaField::dispatchSetValueToInstance(ExecState *exec, const JavaInstance *instance, jvalue javaValue, const char *name, const char *sig) const
 {
     jobject jinstance = instance->javaInstance();
     jobject fieldJInstance = _field->javaInstance();
@@ -176,15 +176,15 @@ void JavaField::dispatchSetValueToInstance(KJS::ExecState *exec, const JavaInsta
        {
            const RootObject *execContext = instance->executionContext();
            if (execContext && execContext->nativeHandle()) {
-               Value exceptionDescription;
+               ValueImp *exceptionDescription;
                jvalue args[2];
                jvalue result;
                
                args[0].l = jinstance;
                args[1] = javaValue;
                dispatchJNICall (execContext->nativeHandle(), fieldJInstance, false, void_type, mid, args, result, 0, exceptionDescription);
-               if (!exceptionDescription.isNull()) {
-                   Object error = Error::create(exec, GeneralError, exceptionDescription.toString(exec).UTF8String().c_str());
+               if (exceptionDescription) {
+                   ObjectImp *error = Error::create(exec, GeneralError, exceptionDescription->toString(exec).UTF8String().c_str());
                    exec->setException(error);
                }
            }
@@ -192,12 +192,12 @@ void JavaField::dispatchSetValueToInstance(KJS::ExecState *exec, const JavaInsta
     }
 }
 
-void JavaField::setValueToInstance(KJS::ExecState *exec, const Instance *i, const KJS::Value &aValue) const
+void JavaField::setValueToInstance(ExecState *exec, const Instance *i, ValueImp *aValue) const
 {
     const JavaInstance *instance = static_cast<const JavaInstance *>(i);
     jvalue javaValue = convertValueToJValue (exec, aValue, _JNIType, type());
 
-    JS_LOG ("setting value %s to %s\n", name(), aValue.toString(exec).ascii());
+    JS_LOG ("setting value %s to %s\n", name(), aValue->toString(exec).ascii());
 
     switch (_JNIType) {
         case object_type: {
@@ -394,7 +394,7 @@ JavaArray::JavaArray (const JavaArray &other) : Array()
     _type = strdup(other._type);
 };
 
-void JavaArray::setValueAt(KJS::ExecState *exec, unsigned int index, const KJS::Value &aValue) const
+void JavaArray::setValueAt(ExecState *exec, unsigned int index, ValueImp *aValue) const
 {
     JNIEnv *env = getJNIEnv();
     char *javaClassName = 0;
@@ -462,7 +462,7 @@ void JavaArray::setValueAt(KJS::ExecState *exec, unsigned int index, const KJS::
 }
 
 
-KJS::Value JavaArray::valueAt(KJS::ExecState *exec, unsigned int index) const
+ValueImp *JavaArray::valueAt(ExecState *exec, unsigned int index) const
 {
     JNIEnv *env = getJNIEnv();
     JNIType arrayType = JNITypeFromPrimitiveType(_type[1]);
@@ -489,7 +489,7 @@ KJS::Value JavaArray::valueAt(KJS::ExecState *exec, unsigned int index) const
             jbooleanArray booleanArray = (jbooleanArray)javaArray();
             jboolean aBoolean;
             env->GetBooleanArrayRegion(booleanArray, index, 1, &aBoolean);
-            return KJS::Boolean (aBoolean);
+            return Boolean (aBoolean);
         }
             
         case byte_type: {
index c9c7ddcace29ad2200141506059113dc0be5c625..0770646507739c2591a312b0f5396f06f7acaab5 100644 (file)
@@ -35,7 +35,6 @@
 
 namespace KJS
 {
-class Value;
 
 namespace Bindings
 {
@@ -68,7 +67,7 @@ public:
     }
     const jchar *uchars() const { return (const jchar *)_ustring.data(); }
     int length() const { return _ustring.size(); }
-    KJS::UString ustring() const { return _ustring; }
+    UString ustring() const { return _ustring; }
     
 private:
     UString _ustring;
@@ -182,8 +181,8 @@ public:
         return *this;
     }
     
-    virtual KJS::Value valueFromInstance(KJS::ExecState *exec, const Instance *instance) const;
-    virtual void setValueToInstance(KJS::ExecState *exec, const Instance *instance, const KJS::Value &aValue) const;
+    virtual ValueImp *valueFromInstance(ExecState *exec, const Instance *instance) const;
+    virtual void setValueToInstance(ExecState *exec, const Instance *instance, ValueImp *aValue) const;
     
     virtual const char *name() const { return _name.UTF8String(); }
     virtual RuntimeType type() const { return _type.UTF8String(); }
@@ -191,8 +190,8 @@ public:
     JNIType getJNIType() const { return _JNIType; }
     
 private:
-    void JavaField::dispatchSetValueToInstance(KJS::ExecState *exec, const JavaInstance *instance, jvalue javaValue, const char *name, const char *sig) const;
-    jvalue JavaField::dispatchValueFromInstance(KJS::ExecState *exec, const JavaInstance *instance, const char *name, const char *sig, JNIType returnType) const;
+    void JavaField::dispatchSetValueToInstance(ExecState *exec, const JavaInstance *instance, jvalue javaValue, const char *name, const char *sig) const;
+    jvalue JavaField::dispatchValueFromInstance(ExecState *exec, const JavaInstance *instance, const char *name, const char *sig, JNIType returnType) const;
 
     JavaString _name;
     JavaString _type;
@@ -261,7 +260,7 @@ private:
     JavaParameter *_parameters;
     long _numParameters;
     JavaString _name;
-    mutable KJS::UString *_signature;
+    mutable UString *_signature;
     JavaString _returnType;
     JNIType _JNIReturnType;
     mutable jmethodID _methodID;
@@ -291,15 +290,15 @@ public:
         return *this;
     };
 
-    virtual void setValueAt(KJS::ExecState *exec, unsigned int index, const KJS::Value &aValue) const;
-    virtual KJS::Value valueAt(KJS::ExecState *exec, unsigned int index) const;
+    virtual void setValueAt(ExecState *exec, unsigned int index, ValueImp *aValue) const;
+    virtual ValueImp *valueAt(ExecState *exec, unsigned int index) const;
     virtual unsigned int getLength() const;
     
     virtual ~JavaArray();
 
     jobject javaArray() const { return _array->_instance; }
 
-    static KJS::Value convertJObjectToArray (KJS::ExecState *exec, jobject anObject, const char *type, const RootObject *r);
+    static ValueImp *convertJObjectToArray (ExecState *exec, jobject anObject, const char *type, const RootObject *r);
 
     const RootObject *executionContext() const { return _root; }
     
index ec323bb86140158f83b9ae06d449306e522c1081..cd06a8c78cd28c19ebd8cfc2e65cbb7e4ee32c87 100644 (file)
 #include "runtime_array.h"
 #include "runtime_object.h"
 
-using namespace KJS::Bindings;
+namespace KJS {
+
+namespace Bindings {
 
 static JavaVM *jvm = 0;
 
-JavaVM *KJS::Bindings::getJavaVM()
+JavaVM *getJavaVM()
 {
     if (jvm)
         return jvm;
@@ -55,7 +57,7 @@ JavaVM *KJS::Bindings::getJavaVM()
     return jvm;
 }
 
-JNIEnv *KJS::Bindings::getJNIEnv()
+JNIEnv *getJNIEnv()
 {
     JNIEnv *env;
     jint jniError = 0;
@@ -270,7 +272,7 @@ static jvalue callJNIMethodA (JNIType type, jobject obj, const char *name, const
     return result;
 }
 
-jmethodID KJS::Bindings::getMethodID (jobject obj, const char *name, const char *sig)
+jmethodID getMethodID (jobject obj, const char *name, const char *sig)
 {
     JNIEnv *env = getJNIEnv();
     jmethodID mid = 0;
@@ -309,200 +311,200 @@ jmethodID KJS::Bindings::getMethodID (jobject obj, const char *name, const char
     \
     va_end (args);
 
-void KJS::Bindings::callJNIVoidMethod (jobject obj, const char *name, const char *sig, ... )
+void callJNIVoidMethod (jobject obj, const char *name, const char *sig, ... )
 {
     CALL_JNI_METHOD (void_type, obj, name, sig);
 }
 
-jobject KJS::Bindings::callJNIObjectMethod (jobject obj, const char *name, const char *sig, ... )
+jobject callJNIObjectMethod (jobject obj, const char *name, const char *sig, ... )
 {
     CALL_JNI_METHOD (object_type, obj, name, sig);
     return result.l;
 }
 
-jboolean KJS::Bindings::callJNIBooleanMethod( jobject obj, const char *name, const char *sig, ... )
+jboolean callJNIBooleanMethod( jobject obj, const char *name, const char *sig, ... )
 {
     CALL_JNI_METHOD (boolean_type, obj, name, sig);
     return result.z;
 }
 
-jboolean KJS::Bindings::callJNIStaticBooleanMethod (jclass cls, const char *name, const char *sig, ... )
+jboolean callJNIStaticBooleanMethod (jclass cls, const char *name, const char *sig, ... )
 {
     CALL_JNI_STATIC_METHOD (boolean_type, cls, name, sig);
     return result.z;
 }
 
-jbyte KJS::Bindings::callJNIByteMethod( jobject obj, const char *name, const char *sig, ... )
+jbyte callJNIByteMethod( jobject obj, const char *name, const char *sig, ... )
 {
     CALL_JNI_METHOD (byte_type, obj, name, sig);
     return result.b;
 }
 
-jchar KJS::Bindings::callJNICharMethod (jobject obj, const char *name, const char *sig, ... )
+jchar callJNICharMethod (jobject obj, const char *name, const char *sig, ... )
 {
     CALL_JNI_METHOD (char_type, obj, name, sig);
     return result.c;
 }
 
-jshort KJS::Bindings::callJNIShortMethod (jobject obj, const char *name, const char *sig, ... )
+jshort callJNIShortMethod (jobject obj, const char *name, const char *sig, ... )
 {
     CALL_JNI_METHOD (short_type, obj, name, sig);
     return result.s;
 }
 
-jint KJS::Bindings::callJNIIntMethod (jobject obj, const char *name, const char *sig, ... )
+jint callJNIIntMethod (jobject obj, const char *name, const char *sig, ... )
 {
     CALL_JNI_METHOD (int_type, obj, name, sig);
     return result.i;
 }
 
-jlong KJS::Bindings::callJNILongMethod (jobject obj, const char *name, const char *sig, ... )
+jlong callJNILongMethod (jobject obj, const char *name, const char *sig, ... )
 {
     CALL_JNI_METHOD (long_type, obj, name, sig);
     return result.j;
 }
 
-jfloat KJS::Bindings::callJNIFloatMethod (jobject obj, const char *name, const char *sig, ... )
+jfloat callJNIFloatMethod (jobject obj, const char *name, const char *sig, ... )
 {
     CALL_JNI_METHOD (float_type, obj, name, sig);
     return result.f;
 }
 
-jdouble KJS::Bindings::callJNIDoubleMethod (jobject obj, const char *name, const char *sig, ... )
+jdouble callJNIDoubleMethod (jobject obj, const char *name, const char *sig, ... )
 {
     CALL_JNI_METHOD (double_type, obj, name, sig);
     return result.d;
 }
 
-void KJS::Bindings::callJNIVoidMethodA (jobject obj, const char *name, const char *sig, jvalue *args)
+void callJNIVoidMethodA (jobject obj, const char *name, const char *sig, jvalue *args)
 {
     jvalue result = callJNIMethodA (void_type, obj, name, sig, args);
 }
 
-jobject KJS::Bindings::callJNIObjectMethodA (jobject obj, const char *name, const char *sig, jvalue *args)
+jobject callJNIObjectMethodA (jobject obj, const char *name, const char *sig, jvalue *args)
 {
     jvalue result = callJNIMethodA (object_type, obj, name, sig, args);
     return result.l;
 }
 
-jbyte KJS::Bindings::callJNIByteMethodA ( jobject obj, const char *name, const char *sig, jvalue *args)
+jbyte callJNIByteMethodA ( jobject obj, const char *name, const char *sig, jvalue *args)
 {
     jvalue result = callJNIMethodA (byte_type, obj, name, sig, args);
     return result.b;
 }
 
-jchar KJS::Bindings::callJNICharMethodA (jobject obj, const char *name, const char *sig, jvalue *args)
+jchar callJNICharMethodA (jobject obj, const char *name, const char *sig, jvalue *args)
 {
     jvalue result = callJNIMethodA (char_type, obj, name, sig, args);
     return result.c;
 }
 
-jshort KJS::Bindings::callJNIShortMethodA (jobject obj, const char *name, const char *sig, jvalue *args)
+jshort callJNIShortMethodA (jobject obj, const char *name, const char *sig, jvalue *args)
 {
     jvalue result = callJNIMethodA (short_type, obj, name, sig, args);
     return result.s;
 }
 
-jint KJS::Bindings::callJNIIntMethodA (jobject obj, const char *name, const char *sig, jvalue *args)
+jint callJNIIntMethodA (jobject obj, const char *name, const char *sig, jvalue *args)
 {
     jvalue result = callJNIMethodA (int_type, obj, name, sig, args);
     return result.i;
 }
 
-jlong KJS::Bindings::callJNILongMethodA (jobject obj, const char *name, const char *sig, jvalue *args)
+jlong callJNILongMethodA (jobject obj, const char *name, const char *sig, jvalue *args)
 {
     jvalue result = callJNIMethodA (long_type, obj, name, sig, args);
     return result.j;
 }
 
-jfloat KJS::Bindings::callJNIFloatMethodA (jobject obj, const char *name, const char *sig, jvalue *args)
+jfloat callJNIFloatMethodA (jobject obj, const char *name, const char *sig, jvalue *args)
 {
     jvalue result = callJNIMethodA  (float_type, obj, name, sig, args);
     return result.f;
 }
 
-jdouble KJS::Bindings::callJNIDoubleMethodA (jobject obj, const char *name, const char *sig, jvalue *args)
+jdouble callJNIDoubleMethodA (jobject obj, const char *name, const char *sig, jvalue *args)
 {
     jvalue result = callJNIMethodA (double_type, obj, name, sig, args);
     return result.d;
 }
 
-jboolean KJS::Bindings::callJNIBooleanMethodA (jobject obj, const char *name, const char *sig, jvalue *args)
+jboolean callJNIBooleanMethodA (jobject obj, const char *name, const char *sig, jvalue *args)
 {
     jvalue result = callJNIMethodA (boolean_type, obj, name, sig, args);
     return result.z;
 }
 
-void KJS::Bindings::callJNIVoidMethodIDA (jobject obj, jmethodID methodID, jvalue *args)
+void callJNIVoidMethodIDA (jobject obj, jmethodID methodID, jvalue *args)
 {
     jvalue result = callJNIMethodIDA (void_type, obj, methodID, args);
 }
 
-jobject KJS::Bindings::callJNIObjectMethodIDA (jobject obj, jmethodID methodID, jvalue *args)
+jobject callJNIObjectMethodIDA (jobject obj, jmethodID methodID, jvalue *args)
 {
     jvalue result = callJNIMethodIDA (object_type, obj, methodID, args);
     return result.l;
 }
 
-jbyte KJS::Bindings::callJNIByteMethodIDA ( jobject obj, jmethodID methodID, jvalue *args)
+jbyte callJNIByteMethodIDA ( jobject obj, jmethodID methodID, jvalue *args)
 {
     jvalue result = callJNIMethodIDA (byte_type, obj, methodID, args);
     return result.b;
 }
 
-jchar KJS::Bindings::callJNICharMethodIDA (jobject obj, jmethodID methodID, jvalue *args)
+jchar callJNICharMethodIDA (jobject obj, jmethodID methodID, jvalue *args)
 {
     jvalue result = callJNIMethodIDA (char_type, obj, methodID, args);
     return result.c;
 }
 
-jshort KJS::Bindings::callJNIShortMethodIDA (jobject obj, jmethodID methodID, jvalue *args)
+jshort callJNIShortMethodIDA (jobject obj, jmethodID methodID, jvalue *args)
 {
     jvalue result = callJNIMethodIDA (short_type, obj, methodID, args);
     return result.s;
 }
 
-jint KJS::Bindings::callJNIIntMethodIDA (jobject obj, jmethodID methodID, jvalue *args)
+jint callJNIIntMethodIDA (jobject obj, jmethodID methodID, jvalue *args)
 {
     jvalue result = callJNIMethodIDA (int_type, obj, methodID, args);
     return result.i;
 }
 
-jlong KJS::Bindings::callJNILongMethodIDA (jobject obj, jmethodID methodID, jvalue *args)
+jlong callJNILongMethodIDA (jobject obj, jmethodID methodID, jvalue *args)
 {
     jvalue result = callJNIMethodIDA (long_type, obj, methodID, args);
     return result.j;
 }
 
-jfloat KJS::Bindings::callJNIFloatMethodIDA (jobject obj, jmethodID methodID, jvalue *args)
+jfloat callJNIFloatMethodIDA (jobject obj, jmethodID methodID, jvalue *args)
 {
     jvalue result = callJNIMethodIDA  (float_type, obj, methodID, args);
     return result.f;
 }
 
-jdouble KJS::Bindings::callJNIDoubleMethodIDA (jobject obj, jmethodID methodID, jvalue *args)
+jdouble callJNIDoubleMethodIDA (jobject obj, jmethodID methodID, jvalue *args)
 {
     jvalue result = callJNIMethodIDA (double_type, obj, methodID, args);
     return result.d;
 }
 
-jboolean KJS::Bindings::callJNIBooleanMethodIDA (jobject obj, jmethodID methodID, jvalue *args)
+jboolean callJNIBooleanMethodIDA (jobject obj, jmethodID methodID, jvalue *args)
 {
     jvalue result = callJNIMethodIDA (boolean_type, obj, methodID, args);
     return result.z;
 }
 
-const char *KJS::Bindings::getCharactersFromJString (jstring aJString)
+const char *getCharactersFromJString (jstring aJString)
 {
     return getCharactersFromJStringInEnv (getJNIEnv(), aJString);
 }
 
-void KJS::Bindings::releaseCharactersForJString (jstring aJString, const char *s)
+void releaseCharactersForJString (jstring aJString, const char *s)
 {
     releaseCharactersForJStringInEnv (getJNIEnv(), aJString, s);
 }
 
-const char *KJS::Bindings::getCharactersFromJStringInEnv (JNIEnv *env, jstring aJString)
+const char *getCharactersFromJStringInEnv (JNIEnv *env, jstring aJString)
 {
     jboolean isCopy;
     const char *s = env->GetStringUTFChars((jstring)aJString, &isCopy);
@@ -514,12 +516,12 @@ const char *KJS::Bindings::getCharactersFromJStringInEnv (JNIEnv *env, jstring a
     return s;
 }
 
-void KJS::Bindings::releaseCharactersForJStringInEnv (JNIEnv *env, jstring aJString, const char *s)
+void releaseCharactersForJStringInEnv (JNIEnv *env, jstring aJString, const char *s)
 {
     env->ReleaseStringUTFChars (aJString, s);
 }
 
-const jchar *KJS::Bindings::getUCharactersFromJStringInEnv (JNIEnv *env, jstring aJString)
+const jchar *getUCharactersFromJStringInEnv (JNIEnv *env, jstring aJString)
 {
     jboolean isCopy;
     const jchar *s = env->GetStringChars((jstring)aJString, &isCopy);
@@ -531,12 +533,12 @@ const jchar *KJS::Bindings::getUCharactersFromJStringInEnv (JNIEnv *env, jstring
     return s;
 }
 
-void KJS::Bindings::releaseUCharactersForJStringInEnv (JNIEnv *env, jstring aJString, const jchar *s)
+void releaseUCharactersForJStringInEnv (JNIEnv *env, jstring aJString, const jchar *s)
 {
     env->ReleaseStringChars (aJString, s);
 }
 
-JNIType KJS::Bindings::JNITypeFromClassName(const char *name)
+JNIType JNITypeFromClassName(const char *name)
 {
     JNIType type;
     
@@ -564,7 +566,7 @@ JNIType KJS::Bindings::JNITypeFromClassName(const char *name)
     return type;
 }
 
-const char *KJS::Bindings::signatureFromPrimitiveType(JNIType type)
+const char *signatureFromPrimitiveType(JNIType type)
 {
     switch (type){
         case void_type: 
@@ -604,7 +606,7 @@ const char *KJS::Bindings::signatureFromPrimitiveType(JNIType type)
     return "";
 }
 
-JNIType KJS::Bindings::JNITypeFromPrimitiveType(char type)
+JNIType JNITypeFromPrimitiveType(char type)
 {
     switch (type){
         case 'V': 
@@ -644,7 +646,7 @@ JNIType KJS::Bindings::JNITypeFromPrimitiveType(char type)
     return invalid_type;
 }
 
-jvalue KJS::Bindings::getJNIField( jobject obj, JNIType type, const char *name, const char *signature)
+jvalue getJNIField( jobject obj, JNIType type, const char *name, const char *signature)
 {
     JavaVM *jvm = getJavaVM();
     JNIEnv *env = getJNIEnv();
@@ -706,7 +708,7 @@ jvalue KJS::Bindings::getJNIField( jobject obj, JNIType type, const char *name,
     return result;
 }
 
-jvalue KJS::Bindings::convertValueToJValue (KJS::ExecState *exec, KJS::Value value, JNIType _JNIType, const char *javaClassName)
+jvalue convertValueToJValue (ExecState *exec, ValueImp *value, JNIType _JNIType, const char *javaClassName)
 {
     jvalue result;
    
@@ -715,15 +717,15 @@ jvalue KJS::Bindings::convertValueToJValue (KJS::ExecState *exec, KJS::Value val
             result.l = (jobject)0;
             
             // First see if we have a Java instance.
-            if (value.type() == KJS::ObjectType){
-                KJS::ObjectImp *objectImp = static_cast<KJS::ObjectImp*>(value.imp());
-               if (objectImp->classInfo() == &KJS::RuntimeObjectImp::info) {
-                   KJS::RuntimeObjectImp *imp = static_cast<KJS::RuntimeObjectImp *>(value.imp());
+            if (value->isObject()){
+                ObjectImp *objectImp = static_cast<ObjectImp*>(value);
+               if (objectImp->classInfo() == &RuntimeObjectImp::info) {
+                   RuntimeObjectImp *imp = static_cast<RuntimeObjectImp *>(value);
                    JavaInstance *instance = static_cast<JavaInstance*>(imp->getInternalInstance());
                    result.l = instance->javaInstance();
                }
-               else if (objectImp->classInfo() == &KJS::RuntimeArrayImp::info) {
-                   KJS::RuntimeArrayImp *imp = static_cast<KJS::RuntimeArrayImp *>(value.imp());
+               else if (objectImp->classInfo() == &RuntimeArrayImp::info) {
+                   RuntimeArrayImp *imp = static_cast<RuntimeArrayImp *>(value);
                    JavaArray *array = static_cast<JavaArray*>(imp->getConcreteArray());
                    result.l = array->javaArray();
                }
@@ -733,7 +735,7 @@ jvalue KJS::Bindings::convertValueToJValue (KJS::ExecState *exec, KJS::Value val
             // converting from a Null.
             if (result.l == 0 && strcmp(javaClassName, "java.lang.String") == 0) {
 #if CONVERT_NULL_TO_EMPTY_STRING
-               if (value.type() == KJS::NullType) {
+               if (value->isNull()) {
                    JNIEnv *env = getJNIEnv();
                    jchar buf[2];
                    jobject javaString = env->functions->NewString (env, buf, 0);
@@ -741,10 +743,10 @@ jvalue KJS::Bindings::convertValueToJValue (KJS::ExecState *exec, KJS::Value val
                }
                else 
 #else
-               if (value.type() != KJS::NullType)
+               if (!value->isNull())
 #endif
                {
-                   KJS::UString stringValue = value.toString(exec);
+                   UString stringValue = value->toString(exec);
                    JNIEnv *env = getJNIEnv();
                    jobject javaString = env->functions->NewString (env, (const jchar *)stringValue.data(), stringValue.size());
                    result.l = javaString;
@@ -754,42 +756,42 @@ jvalue KJS::Bindings::convertValueToJValue (KJS::ExecState *exec, KJS::Value val
         break;
         
         case boolean_type: {
-            result.z = (jboolean)value.toNumber(exec);
+            result.z = (jboolean)value->toNumber(exec);
         }
         break;
             
         case byte_type: {
-            result.b = (jbyte)value.toNumber(exec);
+            result.b = (jbyte)value->toNumber(exec);
         }
         break;
         
         case char_type: {
-            result.c = (jchar)value.toNumber(exec);
+            result.c = (jchar)value->toNumber(exec);
         }
         break;
 
         case short_type: {
-            result.s = (jshort)value.toNumber(exec);
+            result.s = (jshort)value->toNumber(exec);
         }
         break;
 
         case int_type: {
-            result.i = (jint)value.toNumber(exec);
+            result.i = (jint)value->toNumber(exec);
         }
         break;
 
         case long_type: {
-            result.j = (jlong)value.toNumber(exec);
+            result.j = (jlong)value->toNumber(exec);
         }
         break;
 
         case float_type: {
-            result.f = (jfloat)value.toNumber(exec);
+            result.f = (jfloat)value->toNumber(exec);
         }
         break;
 
         case double_type: {
-            result.d = (jdouble)value.toNumber(exec);
+            result.d = (jdouble)value->toNumber(exec);
         }
         break;
             
@@ -805,3 +807,6 @@ jvalue KJS::Bindings::convertValueToJValue (KJS::ExecState *exec, KJS::Value val
     return result;
 }
 
+}
+
+}
index 58681f5f5aaa2edfe928b9b8a1a65455b711645e..04a0b5bb1dcc4f9ee58f38765dac1834f69508dd 100644 (file)
@@ -51,62 +51,62 @@ namespace Bindings
 {
 class JavaParameter;
 
-const char *getCharactersFromJString (jstring aJString);
-void releaseCharactersForJString (jstring aJString, const char *s);
+const char *getCharactersFromJString(jstring aJString);
+void releaseCharactersForJString(jstring aJString, const char *s);
 
-const char *getCharactersFromJStringInEnv (JNIEnv *env, jstring aJString);
-void releaseCharactersForJStringInEnv (JNIEnv *env, jstring aJString, const char *s);
-const jchar *getUCharactersFromJStringInEnv (JNIEnv *env, jstring aJString);
-void releaseUCharactersForJStringInEnv (JNIEnv *env, jstring aJString, const jchar *s);
+const char *getCharactersFromJStringInEnv(JNIEnv *env, jstring aJString);
+void releaseCharactersForJStringInEnv(JNIEnv *env, jstring aJString, const char *s);
+const jchar *getUCharactersFromJStringInEnv(JNIEnv *env, jstring aJString);
+void releaseUCharactersForJStringInEnv(JNIEnv *env, jstring aJString, const jchar *s);
 
 JNIType JNITypeFromClassName(const char *name);
 JNIType JNITypeFromPrimitiveType(char type);
 const char *signatureFromPrimitiveType(JNIType type);
 
-jvalue convertValueToJValue (KJS::ExecState *exec, KJS::Value value, JNIType _JNIType, const char *javaClassName);
-
-jvalue getJNIField (jobject obj, JNIType type, const char *name, const char *signature);
-
-jmethodID getMethodID (jobject obj, const char *name, const char *sig);
-
-jobject callJNIObjectMethod (jobject obj, const char *name, const char *sig, ... );
-void callJNIVoidMethod (jobject obj, const char *name, const char *sig, ... );
-jboolean callJNIBooleanMethod (jobject obj, const char *name, const char *sig, ... );
-jboolean callJNIStaticBooleanMethod (jclass cls, const char *name, const char *sig, ... );
-jbyte callJNIByteMethod (jobject obj, const char *name, const char *sig, ... );
-jchar callJNICharMethod (jobject obj, const char *name, const char *sig, ... );
-jshort callJNIShortMethod (jobject obj, const char *name, const char *sig, ... );
-jint callJNIIntMethod (jobject obj, const char *name, const char *sig, ... );
-jlong callJNILongMethod (jobject obj, const char *name, const char *sig, ... );
-jfloat callJNIFloatMethod (jobject obj, const char *name, const char *sig, ... );
-jdouble callJNIDoubleMethod (jobject obj, const char *name, const char *sig, ... );
-
-jobject callJNIObjectMethodA (jobject obj, const char *name, const char *sig, jvalue *args);
-void callJNIVoidMethodA (jobject obj, const char *name, const char *sig, jvalue *args);
-jboolean callJNIBooleanMethodA (jobject obj, const char *name, const char *sig, jvalue *args);
-jbyte callJNIByteMethodA (jobject obj, const char *name, const char *sig, jvalue *args);
-jchar callJNICharMethodA (jobject obj, const char *name, const char *sig, jvalue *args);
-jshort callJNIShortMethodA (jobject obj, const char *name, const char *sig, jvalue *args);
-jint callJNIIntMethodA (jobject obj, const char *name, const char *sig, jvalue *args);
-jlong callJNILongMethodA (jobject obj, const char *name, const char *sig, jvalue *args);
-jfloat callJNIFloatMethodA (jobject obj, const char *name, const char *sig, jvalue *args);
-jdouble callJNIDoubleMethodA (jobject obj, const char *name, const char *sig, jvalue *args);
-
-jobject callJNIObjectMethodIDA (jobject obj, jmethodID methodID, jvalue *args);
-void callJNIVoidMethodIDA (jobject obj, jmethodID methodID, jvalue *args);
-jboolean callJNIBooleanMethodIDA (jobject obj, jmethodID methodID, jvalue *args);
-jbyte callJNIByteMethodIDA (jobject obj, jmethodID methodID, jvalue *args);
-jchar callJNICharMethodIDA (jobject obj, jmethodID methodID, jvalue *args);
-jshort callJNIShortMethodIDA (jobject obj, jmethodID methodID, jvalue *args);
-jint callJNIIntMethodIDA (jobject obj, jmethodID methodID, jvalue *args);
-jlong callJNILongMethodIDA (jobject obj, jmethodID methodID, jvalue *args);
-jfloat callJNIFloatMethodIDA (jobject obj, jmethodID methodID, jvalue *args);
-jdouble callJNIDoubleMethodIDA (jobject obj, jmethodID methodID, jvalue *args);
+jvalue convertValueToJValue(ExecState *exec, ValueImp *value, JNIType _JNIType, const char *javaClassName);
+
+jvalue getJNIField(jobject obj, JNIType type, const char *name, const char *signature);
+
+jmethodID getMethodID(jobject obj, const char *name, const char *sig);
+
+jobject callJNIObjectMethod(jobject obj, const char *name, const char *sig, ... );
+void callJNIVoidMethod(jobject obj, const char *name, const char *sig, ... );
+jboolean callJNIBooleanMethod(jobject obj, const char *name, const char *sig, ... );
+jboolean callJNIStaticBooleanMethod(jclass cls, const char *name, const char *sig, ... );
+jbyte callJNIByteMethod(jobject obj, const char *name, const char *sig, ... );
+jchar callJNICharMethod(jobject obj, const char *name, const char *sig, ... );
+jshort callJNIShortMethod(jobject obj, const char *name, const char *sig, ... );
+jint callJNIIntMethod(jobject obj, const char *name, const char *sig, ... );
+jlong callJNILongMethod(jobject obj, const char *name, const char *sig, ... );
+jfloat callJNIFloatMethod(jobject obj, const char *name, const char *sig, ... );
+jdouble callJNIDoubleMethod(jobject obj, const char *name, const char *sig, ... );
+
+jobject callJNIObjectMethodA(jobject obj, const char *name, const char *sig, jvalue *args);
+void callJNIVoidMethodA(jobject obj, const char *name, const char *sig, jvalue *args);
+jboolean callJNIBooleanMethodA(jobject obj, const char *name, const char *sig, jvalue *args);
+jbyte callJNIByteMethodA(jobject obj, const char *name, const char *sig, jvalue *args);
+jchar callJNICharMethodA(jobject obj, const char *name, const char *sig, jvalue *args);
+jshort callJNIShortMethodA(jobject obj, const char *name, const char *sig, jvalue *args);
+jint callJNIIntMethodA(jobject obj, const char *name, const char *sig, jvalue *args);
+jlong callJNILongMethodA(jobject obj, const char *name, const char *sig, jvalue *args);
+jfloat callJNIFloatMethodA(jobject obj, const char *name, const char *sig, jvalue *args);
+jdouble callJNIDoubleMethodA(jobject obj, const char *name, const char *sig, jvalue *args);
+
+jobject callJNIObjectMethodIDA(jobject obj, jmethodID methodID, jvalue *args);
+void callJNIVoidMethodIDA(jobject obj, jmethodID methodID, jvalue *args);
+jboolean callJNIBooleanMethodIDA(jobject obj, jmethodID methodID, jvalue *args);
+jbyte callJNIByteMethodIDA(jobject obj, jmethodID methodID, jvalue *args);
+jchar callJNICharMethodIDA(jobject obj, jmethodID methodID, jvalue *args);
+jshort callJNIShortMethodIDA(jobject obj, jmethodID methodID, jvalue *args);
+jint callJNIIntMethodIDA(jobject obj, jmethodID methodID, jvalue *args);
+jlong callJNILongMethodIDA(jobject obj, jmethodID methodID, jvalue *args);
+jfloat callJNIFloatMethodIDA(jobject obj, jmethodID methodID, jvalue *args);
+jdouble callJNIDoubleMethodIDA(jobject obj, jmethodID methodID, jvalue *args);
 
 JavaVM *getJavaVM();
 JNIEnv *getJNIEnv();
 
-bool dispatchJNICall (const void *targetAppletView, jobject obj, bool isStatic, JNIType returnType, jmethodID methodID, jvalue *args, jvalue &result, const char *callingURL, Value &exceptionDescription);
+bool dispatchJNICall(const void *targetAppletView, jobject obj, bool isStatic, JNIType returnType, jmethodID methodID, jvalue *args, jvalue &result, const char *callingURL, ValueImp *&exceptionDescription);
 
 } // namespace Bindings
 
index 36b5e0db2c9c302719cd61e37a059ab95b6086bb..9f5e1e2ef1520cab4eff7d6033cde82e48fa829f 100644 (file)
@@ -49,7 +49,7 @@ using namespace KJS::Bindings;
 
 #define LOG_EXCEPTION(exec) \
     if (Interpreter::shouldPrintExceptions()) \
-        printf("%s:%d:[%d]  JavaScript exception:  %s\n", __FILE__, __LINE__, getpid(), exec->exception().toObject(exec).get(exec, messagePropertyName).toString(exec).ascii());
+        printf("%s:%d:[%d]  JavaScript exception:  %s\n", __FILE__, __LINE__, getpid(), exec->exception()->toObject(exec)->get(exec, messagePropertyName)->toString(exec).ascii());
 
 @implementation WebScriptObjectPrivate
 
@@ -62,10 +62,10 @@ static void _didExecute(WebScriptObject *obj)
     ExecState *exec = [obj _executionContext]->interpreter()->globalExec();
     KJSDidExecuteFunctionPtr func = Instance::didExecuteFunction();
     if (func)
-        func (exec, static_cast<KJS::ObjectImp*>([obj _executionContext]->rootObjectImp()));
+        func (exec, static_cast<ObjectImp*>([obj _executionContext]->rootObjectImp()));
 }
 
-- (void)_initializeWithObjectImp:(KJS::ObjectImp *)imp originExecutionContext:(const Bindings::RootObject *)originExecutionContext executionContext:(const Bindings::RootObject *)executionContext
+- (void)_initializeWithObjectImp:(ObjectImp *)imp originExecutionContext:(const Bindings::RootObject *)originExecutionContext executionContext:(const Bindings::RootObject *)executionContext
 {
     _private->imp = imp;
     _private->executionContext = executionContext;    
@@ -74,7 +74,7 @@ static void _didExecute(WebScriptObject *obj)
     addNativeReference (executionContext, imp);
 }
 
-- _initWithObjectImp:(KJS::ObjectImp *)imp originExecutionContext:(const Bindings::RootObject *)originExecutionContext executionContext:(const Bindings::RootObject *)executionContext
+- _initWithObjectImp:(ObjectImp *)imp originExecutionContext:(const Bindings::RootObject *)originExecutionContext executionContext:(const Bindings::RootObject *)executionContext
 {
     assert (imp != 0);
     //assert (root != 0);
@@ -88,7 +88,7 @@ static void _didExecute(WebScriptObject *obj)
     return self;
 }
 
-- (KJS::ObjectImp *)_imp
+- (ObjectImp *)_imp
 {
     if (!_private->imp && _private->isCreatedByDOMWrapper) {
         // Associate the WebScriptObject with the JS wrapper for the ObjC DOM
@@ -98,23 +98,23 @@ static void _didExecute(WebScriptObject *obj)
     return _private->imp;
 }
 
-- (const KJS::Bindings::RootObject *)_executionContext
+- (const RootObject *)_executionContext
 {
     return _private->executionContext;
 }
 
-- (void)_setExecutionContext:(const KJS::Bindings::RootObject *)context
+- (void)_setExecutionContext:(const RootObject *)context
 {
     _private->executionContext = context;
 }
 
 
-- (const KJS::Bindings::RootObject *)_originExecutionContext
+- (const RootObject *)_originExecutionContext
 {
     return _private->originExecutionContext;
 }
 
-- (void)_setOriginExecutionContext:(const KJS::Bindings::RootObject *)originExecutionContext
+- (void)_setOriginExecutionContext:(const RootObject *)originExecutionContext
 {
     _private->originExecutionContext = originExecutionContext;
 }
@@ -158,7 +158,7 @@ static void _didExecute(WebScriptObject *obj)
         ExecState *exec = interp->globalExec();
         // If the interpreter has a context, we set the exception.
         if (interp->context()) {
-            Object err = Error::create(exec, GeneralError, [exceptionMessage UTF8String]);
+            ObjectImp *err = Error::create(exec, GeneralError, [exceptionMessage UTF8String]);
             exec->setException (err);
             return YES;
         }
@@ -168,10 +168,10 @@ static void _didExecute(WebScriptObject *obj)
     return NO;
 }
 
-static KJS::List listFromNSArray(ExecState *exec, NSArray *array)
+static List listFromNSArray(ExecState *exec, NSArray *array)
 {
     long i, numObjects = array ? [array count] : 0;
-    KJS::List aList;
+    List aList;
     
     for (i = 0; i < numObjects; i++) {
         id anObject = [array objectAtIndex:i];
@@ -193,21 +193,21 @@ static KJS::List listFromNSArray(ExecState *exec, NSArray *array)
 
     Interpreter::lock();
     
-    Value v = convertObjcValueToValue(exec, &name, ObjcObjectType);
-    Identifier identifier(v.toString(exec));
-    Value func = [self _imp]->get (exec, identifier);
+    ValueImp *v = convertObjcValueToValue(exec, &name, ObjcObjectType);
+    Identifier identifier(v->toString(exec));
+    ValueImp *func = [self _imp]->get (exec, identifier);
     Interpreter::unlock();
-    if (func.isNull() || func.type() == UndefinedType) {
+    if (!func || func->isUndefined()) {
         // Maybe throw an exception here?
         return 0;
     }
 
     // Call the function object.    
     Interpreter::lock();
-    ObjectImp *funcImp = static_cast<ObjectImp*>(func.imp());
-    Object thisObj = Object(const_cast<ObjectImp*>([self _imp]));
+    ObjectImp *funcImp = static_cast<ObjectImp*>(func);
+    ObjectImp *thisObj = const_cast<ObjectImp*>([self _imp]);
     List argList = listFromNSArray(exec, args);
-    Value result = funcImp->call (exec, thisObj, argList);
+    ValueImp *result = funcImp->call (exec, thisObj, argList);
     Interpreter::unlock();
 
     if (exec->hadException()) {
@@ -233,18 +233,17 @@ static KJS::List listFromNSArray(ExecState *exec, NSArray *array)
 
     ExecState *exec = [self _executionContext]->interpreter()->globalExec();
 
-    Object thisObj = Object(const_cast<ObjectImp*>([self _imp]));
-    Value result;
+    ValueImp *result;
     
     Interpreter::lock();
     
-    Value v = convertObjcValueToValue(exec, &script, ObjcObjectType);
-    Completion completion = [self _executionContext]->interpreter()->evaluate(UString(), 0, v.toString(exec));
+    ValueImp *v = convertObjcValueToValue(exec, &script, ObjcObjectType);
+    Completion completion = [self _executionContext]->interpreter()->evaluate(UString(), 0, v->toString(exec));
     ComplType type = completion.complType();
     
     if (type == Normal) {
         result = completion.value();
-        if (result.isNull()) {
+        if (!result) {
             result = Undefined();
         }
     }
@@ -276,8 +275,8 @@ static KJS::List listFromNSArray(ExecState *exec, NSArray *array)
     ExecState *exec = [self _executionContext]->interpreter()->globalExec();
 
     Interpreter::lock();
-    Value v = convertObjcValueToValue(exec, &key, ObjcObjectType);
-    [self _imp]->put (exec, Identifier (v.toString(exec)), (convertObjcValueToValue(exec, &value, ObjcObjectType)));
+    ValueImp *v = convertObjcValueToValue(exec, &key, ObjcObjectType);
+    [self _imp]->put (exec, Identifier (v->toString(exec)), (convertObjcValueToValue(exec, &value, ObjcObjectType)));
     Interpreter::unlock();
 
     if (exec->hadException()) {
@@ -298,8 +297,8 @@ static KJS::List listFromNSArray(ExecState *exec, NSArray *array)
     ExecState *exec = [self _executionContext]->interpreter()->globalExec();
 
     Interpreter::lock();
-    Value v = convertObjcValueToValue(exec, &key, ObjcObjectType);
-    Value result = [self _imp]->get (exec, Identifier (v.toString(exec)));
+    ValueImp *v = convertObjcValueToValue(exec, &key, ObjcObjectType);
+    ValueImp *result = [self _imp]->get (exec, Identifier (v->toString(exec)));
     Interpreter::unlock();
     
     if (exec->hadException()) {
@@ -325,8 +324,8 @@ static KJS::List listFromNSArray(ExecState *exec, NSArray *array)
     ExecState *exec = [self _executionContext]->interpreter()->globalExec();
 
     Interpreter::lock();
-    Value v = convertObjcValueToValue(exec, &key, ObjcObjectType);
-    [self _imp]->deleteProperty (exec, Identifier (v.toString(exec)));
+    ValueImp *v = convertObjcValueToValue(exec, &key, ObjcObjectType);
+    [self _imp]->deleteProperty (exec, Identifier (v->toString(exec)));
     Interpreter::unlock();
 
     if (exec->hadException()) {
@@ -343,7 +342,7 @@ static KJS::List listFromNSArray(ExecState *exec, NSArray *array)
        return @"Undefined";
 
     Interpreter::lock();
-    Object thisObj = Object(const_cast<ObjectImp*>([self _imp]));
+    ObjectImp *thisObj = const_cast<ObjectImp*>([self _imp]);
     ExecState *exec = [self _executionContext]->interpreter()->globalExec();
     
     id result = convertValueToObjcValue(exec, thisObj, ObjcObjectType).objectValue;
@@ -367,7 +366,7 @@ static KJS::List listFromNSArray(ExecState *exec, NSArray *array)
 
     ExecState *exec = [self _executionContext]->interpreter()->globalExec();
     Interpreter::lock();
-    Value result = [self _imp]->get (exec, (unsigned)index);
+    ValueImp *result = [self _imp]->get (exec, (unsigned)index);
     Interpreter::unlock();
 
     if (exec->hadException()) {
@@ -408,30 +407,30 @@ static KJS::List listFromNSArray(ExecState *exec, NSArray *array)
         return;
 
     ExecState *exec = [self _executionContext]->interpreter()->globalExec();
-    Object err = Error::create(exec, GeneralError, [description UTF8String]);
+    ObjectImp *err = Error::create(exec, GeneralError, [description UTF8String]);
     exec->setException (err);
 }
 
-+ (id)_convertValueToObjcValue:(KJS::Value)value originExecutionContext:(const Bindings::RootObject *)originExecutionContext executionContext:(const Bindings::RootObject *)executionContext
++ (id)_convertValueToObjcValue:(ValueImp *)value originExecutionContext:(const RootObject *)originExecutionContext executionContext:(const Bindings::RootObject *)executionContext
 {
     id result = 0;
 
     // First see if we have a ObjC instance.
-    if (value.type() == KJS::ObjectType){
-        ObjectImp *objectImp = static_cast<ObjectImp*>(value.imp());
+    if (value->isObject()) {
+        ObjectImp *objectImp = static_cast<ObjectImp*>(value);
        Interpreter *intepreter = executionContext->interpreter();
        ExecState *exec = intepreter->globalExec();
         Interpreter::lock();
        
-        if (objectImp->classInfo() != &KJS::RuntimeObjectImp::info) {
-           Value runtimeObject = objectImp->get(exec, "__apple_runtime_object");
-           if (!runtimeObject.isNull() && runtimeObject.type() == KJS::ObjectType)
-               objectImp = static_cast<RuntimeObjectImp*>(runtimeObject.imp());
+        if (objectImp->classInfo() != &RuntimeObjectImp::info) {
+           ValueImp *runtimeObject = objectImp->get(exec, "__apple_runtime_object");
+           if (!runtimeObject && runtimeObject->isObject())
+               objectImp = static_cast<RuntimeObjectImp*>(runtimeObject);
        }
         
         Interpreter::unlock();
 
-        if (objectImp->classInfo() == &KJS::RuntimeObjectImp::info) {
+        if (objectImp->classInfo() == &RuntimeObjectImp::info) {
             RuntimeObjectImp *imp = static_cast<RuntimeObjectImp *>(objectImp);
             ObjcInstance *instance = static_cast<ObjcInstance*>(imp->getInternalInstance());
             if (instance)
@@ -439,13 +438,13 @@ static KJS::List listFromNSArray(ExecState *exec, NSArray *array)
         }
         // Convert to a WebScriptObject
         else {
-           result = (id)intepreter->createLanguageInstanceForValue (exec, Instance::ObjectiveCLanguage, value.toObject(exec), originExecutionContext, executionContext);
+           result = (id)intepreter->createLanguageInstanceForValue (exec, Instance::ObjectiveCLanguage, value->toObject(exec), originExecutionContext, executionContext);
         }
     }
     
     // Convert JavaScript String value to NSString?
-    else if (value.type() == KJS::StringType) {
-        StringImp *s = static_cast<KJS::StringImp*>(value.imp());
+    else if (value->isString()) {
+        StringImp *s = static_cast<StringImp*>(value);
         UString u = s->value();
         
         NSString *string = [NSString stringWithCharacters:(const unichar*)u.data() length:u.size()];
@@ -453,18 +452,17 @@ static KJS::List listFromNSArray(ExecState *exec, NSArray *array)
     }
     
     // Convert JavaScript Number value to NSNumber?
-    else if (value.type() == KJS::NumberType) {
-        Number n = Number::dynamicCast(value);
-        result = [NSNumber numberWithDouble:n.value()];
+    else if (value->isNumber()) {
+        result = [NSNumber numberWithDouble:value->getNumber()];
     }
     
-    else if (value.type() == KJS::BooleanType) {
-        KJS::BooleanImp *b = static_cast<KJS::BooleanImp*>(value.imp());
+    else if (value->isBoolean()) {
+        BooleanImp *b = static_cast<BooleanImp*>(value);
         result = [NSNumber numberWithBool:b->value()];
     }
     
     // Convert JavaScript Undefined types to WebUndefined
-    else if (value.type() == KJS::UndefinedType) {
+    else if (value->isUndefined()) {
         result = [WebUndefined undefined];
     }
     
index 50d9842a853a61b5914d7e4a12d31d61332e35a2..9409ec607c1ae2a2939ae0deb3acf3364e676ed8 100644 (file)
@@ -13,7 +13,7 @@
 #include <JavaScriptCore/value.h>
 
 @interface WebScriptObject (Private)
-+ (id)_convertValueToObjcValue:(KJS::Value)value originExecutionContext:(const KJS::Bindings::RootObject *)originExecutionContext executionContext:(const KJS::Bindings::RootObject *)executionContext;
++ (id)_convertValueToObjcValue:(KJS::ValueImp *)value originExecutionContext:(const KJS::Bindings::RootObject *)originExecutionContext executionContext:(const KJS::Bindings::RootObject *)executionContext;
 - _init;
 - _initWithObjectImp:(KJS::ObjectImp *)imp originExecutionContext:(const KJS::Bindings::RootObject *)originExecutionContext executionContext:(const KJS::Bindings::RootObject *)executionContext ;
 - (void)_initializeWithObjectImp:(KJS::ObjectImp *)imp originExecutionContext:(const KJS::Bindings::RootObject *)originExecutionContext executionContext:(const KJS::Bindings::RootObject *)executionContext ;
index 1272e1cb5d4a60d6ecf932d5f7ee2444d7790ff7..5c763458dc6ab11aba3f5f5936ae0a4d6bfd72cf 100644 (file)
@@ -77,7 +77,7 @@ public:
     
     virtual Field *fieldNamed(const char *name, Instance *instance) const;
 
-    virtual Value fallbackObject(ExecState *exec, Instance *instance, const Identifier &propertyName);
+    virtual ValueImp *fallbackObject(ExecState *exec, Instance *instance, const Identifier &propertyName);
     
     virtual Constructor *constructorAt(long i) const {
         return 0;
index 8c25171d65506d0603d40f530e9e9527b2a1ab39..fc99741ecd3512a3774b0ce5de52dd335ba97e3c 100644 (file)
@@ -30,7 +30,8 @@
 #include <objc_utility.h>
 #include <WebScriptObject.h>
 
-using namespace KJS::Bindings;
+namespace KJS {
+namespace Bindings {
 
 void ObjcClass::_commonDelete() {
     CFRelease (_fields);
@@ -232,7 +233,10 @@ Field *ObjcClass::fieldNamed(const char *name, Instance *instance) const
     return aField;
 }
 
-KJS::Value ObjcClass::fallbackObject (ExecState *exec, Instance *instance, const Identifier &propertyName)
+ValueImp *ObjcClass::fallbackObject (ExecState *exec, Instance *instance, const Identifier &propertyName)
 {
-    return Object (new ObjcFallbackObjectImp(static_cast<ObjcInstance*>(instance), propertyName));
+    return new ObjcFallbackObjectImp(static_cast<ObjcInstance*>(instance), propertyName);
+}
+
+}
 }
index 3172acdf93f5c68688bedb3476539fae2ebb23a2..92030c4dd58e1f41cc6da1475b31010c7e892cb4 100644 (file)
@@ -53,24 +53,24 @@ public:
     virtual void begin();
     virtual void end();
     
-    virtual Value valueOf() const;
-    virtual Value defaultValue (Type hint) const;
+    virtual ValueImp *valueOf() const;
+    virtual ValueImp *defaultValue (Type hint) const;
 
-    virtual Value invokeMethod (ExecState *exec, const MethodList &method, const List &args);
-    virtual Value invokeDefaultMethod (ExecState *exec, const List &args);
+    virtual ValueImp *invokeMethod (ExecState *exec, const MethodList &method, const List &args);
+    virtual ValueImp *invokeDefaultMethod (ExecState *exec, const List &args);
 
-    virtual void setValueOfField (ExecState *exec, const Field *aField, const Value &aValue) const;
+    virtual void setValueOfField (ExecState *exec, const Field *aField, ValueImp *aValue) const;
     virtual bool supportsSetValueOfUndefinedField ();
-    virtual void setValueOfUndefinedField (ExecState *exec, const Identifier &property, const Value &aValue);
+    virtual void setValueOfUndefinedField (ExecState *exec, const Identifier &property, ValueImp *aValue);
     
-    virtual Value ObjcInstance::getValueOfField (ExecState *exec, const Field *aField) const;
-    virtual Value getValueOfUndefinedField (ExecState *exec, const Identifier &property, Type hint) const;
+    virtual ValueImp *ObjcInstance::getValueOfField (ExecState *exec, const Field *aField) const;
+    virtual ValueImp *getValueOfUndefinedField (ExecState *exec, const Identifier &property, Type hint) const;
 
     ObjectStructPtr getObject() const { return _instance; }
     
-    Value stringValue() const;
-    Value numberValue() const;
-    Value booleanValue() const;
+    ValueImp *stringValue() const;
+    ValueImp *numberValue() const;
+    ValueImp *booleanValue() const;
     
 private:
     ObjectStructPtr _instance;
index 6ec2fcb0231b3cd10ffcccb0d46c301192cd7b03..e47d804a57023c13b8e06b161e3ccfe1e328a677 100644 (file)
@@ -122,9 +122,9 @@ Bindings::Class *ObjcInstance::getClass() const
     return static_cast<Bindings::Class*>(_class);
 }
 
-Value ObjcInstance::invokeMethod (KJS::ExecState *exec, const MethodList &methodList, const List &args)
+ValueImp *ObjcInstance::invokeMethod (ExecState *exec, const MethodList &methodList, const List &args)
 {
-    Value resultValue;
+    ValueImp *resultValue;
 
     // Overloading methods is not allowed in ObjectiveC.  Should only be one
     // name match for a particular method.
@@ -221,7 +221,7 @@ NS_DURING
     // type.
     assert (objcValueType != ObjcInvalidType);
     
-    // Get the return value and convert it to a KJS::Value.  Length
+    // Get the return value and convert it to a JavaScript value. Length
     // of return value will never exceed the size of largest scalar
     // or a pointer.
     char buffer[1024];
@@ -244,9 +244,9 @@ NS_ENDHANDLER
     return resultValue;
 }
 
-Value ObjcInstance::invokeDefaultMethod (KJS::ExecState *exec, const List &args)
+ValueImp *ObjcInstance::invokeDefaultMethod (ExecState *exec, const List &args)
 {
-    Value resultValue;
+    ValueImp *resultValue;
     
 NS_DURING
 
@@ -281,9 +281,9 @@ NS_DURING
     const char *type = [signature methodReturnType];
     ObjcValueType objcValueType = objcValueTypeForType (type);
     
-    // Get the return value and convert it to a KJS::Value.  Length
+    // Get the return value and convert it to a JavaScript value. Length
     // of return value will never exceed the size of a pointer, so we're
-    // OK we 32 here.
+    // OK with 32 here.
     char buffer[32];
     [invocation getReturnValue:buffer];
     resultValue = convertObjcValueToValue (exec, buffer, objcValueType);
@@ -297,7 +297,7 @@ NS_ENDHANDLER
     return resultValue;
 }
 
-void ObjcInstance::setValueOfField (KJS::ExecState *exec, const Field *aField, const KJS::Value &aValue) const
+void ObjcInstance::setValueOfField (ExecState *exec, const Field *aField, ValueImp *aValue) const
 {
     aField->setValueToInstance (exec, this, aValue);
 }
@@ -312,7 +312,7 @@ bool ObjcInstance::supportsSetValueOfUndefinedField ()
     return false;
 }
 
-void ObjcInstance::setValueOfUndefinedField (KJS::ExecState *exec, const KJS::Identifier &property, const KJS::Value &aValue)
+void ObjcInstance::setValueOfUndefinedField (ExecState *exec, const Identifier &property, ValueImp *aValue)
 {
     id targetObject = getObject();
     
@@ -335,13 +335,13 @@ void ObjcInstance::setValueOfUndefinedField (KJS::ExecState *exec, const KJS::Id
     }
 }
 
-Value ObjcInstance::getValueOfField (KJS::ExecState *exec, const Field *aField) const {  
+ValueImp *ObjcInstance::getValueOfField (ExecState *exec, const Field *aField) const {  
     return aField->valueFromInstance (exec, this);
 }
 
-KJS::Value ObjcInstance::getValueOfUndefinedField (KJS::ExecState *exec, const KJS::Identifier &property, KJS::Type hint) const
+ValueImp *ObjcInstance::getValueOfUndefinedField (ExecState *exec, const Identifier &property, Type hint) const
 {
-    Value result = Undefined();
+    ValueImp *volatile result = Undefined();
     
     id targetObject = getObject();
     
@@ -367,18 +367,18 @@ KJS::Value ObjcInstance::getValueOfUndefinedField (KJS::ExecState *exec, const K
     return result;
 }
 
-KJS::Value ObjcInstance::defaultValue (KJS::Type hint) const
+ValueImp *ObjcInstance::defaultValue (Type hint) const
 {
-    if (hint == KJS::StringType) {
+    if (hint == StringType) {
         return stringValue();
     }
-    else if (hint == KJS::NumberType) {
+    else if (hint == NumberType) {
         return numberValue();
     }
-    else if (hint == KJS::BooleanType) {
+    else if (hint == BooleanType) {
         return booleanValue();
     }
-    else if (hint == KJS::UnspecifiedType) {
+    else if (hint == UnspecifiedType) {
         if ([_instance isKindOfClass:[NSString class]]) {
             return stringValue();
         }
@@ -393,26 +393,24 @@ KJS::Value ObjcInstance::defaultValue (KJS::Type hint) const
     return valueOf();
 }
 
-KJS::Value ObjcInstance::stringValue() const
+ValueImp *ObjcInstance::stringValue() const
 {
     return convertNSStringToString ([getObject() description]);
 }
 
-KJS::Value ObjcInstance::numberValue() const
+ValueImp *ObjcInstance::numberValue() const
 {
     // FIXME:  Implement something sensible
-    KJS::Number v(0);
-    return v;
+    return jsNumber(0);
 }
 
-KJS::Value ObjcInstance::booleanValue() const
+ValueImp *ObjcInstance::booleanValue() const
 {
     // FIXME:  Implement something sensible
-    KJS::Boolean v((bool)0);
-    return v;
+    return jsBoolean(false);
 }
 
-KJS::Value ObjcInstance::valueOf() const 
+ValueImp *ObjcInstance::valueOf() const 
 {
     return stringValue();
 }
index 69a1ef88b4375ba4a30aed22b1d43173f0b18699..6cd987b614a07f4e2eb8bb9b6ef697e2f8cd9061 100644 (file)
@@ -34,7 +34,6 @@
 
 namespace KJS
 {
-class Value;
 
 namespace Bindings
 {
@@ -84,8 +83,8 @@ public:
         return *this;
     };
         
-    virtual KJS::Value valueFromInstance(KJS::ExecState *exec, const Instance *instance) const;
-    virtual void setValueToInstance(KJS::ExecState *exec, const Instance *instance, const KJS::Value &aValue) const;
+    virtual ValueImp *valueFromInstance(ExecState *exec, const Instance *instance) const;
+    virtual void setValueToInstance(ExecState *exec, const Instance *instance, ValueImp *aValue) const;
     
     virtual const char *name() const;
     virtual RuntimeType type() const;
@@ -147,41 +146,41 @@ public:
 
     ObjcArray &operator=(const ObjcArray &other);
     
-    virtual void setValueAt(KJS::ExecState *exec, unsigned int index, const KJS::Value &aValue) const;
-    virtual KJS::Value valueAt(KJS::ExecState *exec, unsigned int index) const;
+    virtual void setValueAt(ExecState *exec, unsigned int index, ValueImp *aValue) const;
+    virtual ValueImp *valueAt(ExecState *exec, unsigned int index) const;
     virtual unsigned int getLength() const;
     
     virtual ~ObjcArray();
 
     ObjectStructPtr getObjcArray() const { return _array; }
 
-    static KJS::Value convertObjcArrayToArray (KJS::ExecState *exec, ObjectStructPtr anObject);
+    static ValueImp *convertObjcArrayToArray (ExecState *exec, ObjectStructPtr anObject);
 
 private:
     ObjectStructPtr _array;
 };
 
-class ObjcFallbackObjectImp : public KJS::ObjectImp {
+class ObjcFallbackObjectImp : public ObjectImp {
 public:
     ObjcFallbackObjectImp(ObjectImp *proto);
         
-    ObjcFallbackObjectImp(ObjcInstance *i, const KJS::Identifier propertyName);
+    ObjcFallbackObjectImp(ObjcInstance *i, const Identifier propertyName);
 
     const ClassInfo *classInfo() const { return &info; }
 
     virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
 
     virtual void put(ExecState *exec, const Identifier &propertyName,
-                     const Value &value, int attr = None);
+                     ValueImp *value, int attr = None);
 
     virtual bool canPut(ExecState *exec, const Identifier &propertyName) const;
 
     virtual bool implementsCall() const;
-    virtual Value call(ExecState *exec, Object &thisObj, const List &args);
+    virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
 
     virtual bool deleteProperty(ExecState *exec, const Identifier &propertyName);
 
-    virtual Value defaultValue(ExecState *exec, Type hint) const;
+    virtual ValueImp *defaultValue(ExecState *exec, Type hint) const;
 
     virtual Type type() const;
     virtual bool toBoolean(ExecState *exec) const;
@@ -190,7 +189,7 @@ private:
     static const ClassInfo info;
 
     ObjcInstance *_instance;
-    KJS::Identifier _item;
+    Identifier _item;
 };
 
 } // namespace Bindings
index b36b00780bc8b1fe232dae9e082653bd8f8cbd38..8d9d7b876e222aefbec14f016807c6af38b05e20 100644 (file)
@@ -102,9 +102,9 @@ RuntimeType ObjcField::type() const
     return "";
 }
 
-Value ObjcField::valueFromInstance(KJS::ExecState *exec, const Instance *instance) const
+ValueImp *ObjcField::valueFromInstance(ExecState *exec, const Instance *instance) const
 {
-    Value aValue;
+    ValueImp *aValue;
     id targetObject = (static_cast<const ObjcInstance*>(instance))->getObject();
     id objcValue = nil;
 
@@ -115,7 +115,7 @@ Value ObjcField::valueFromInstance(KJS::ExecState *exec, const Instance *instanc
         
     NS_HANDLER
         
-        Value exceptionValue = Error::create(exec, GeneralError, [[localException reason] lossyCString]);
+        ValueImp *exceptionValue = Error::create(exec, GeneralError, [[localException reason] lossyCString]);
         exec->setException(exceptionValue);
         
     NS_ENDHANDLER
@@ -128,11 +128,11 @@ Value ObjcField::valueFromInstance(KJS::ExecState *exec, const Instance *instanc
     return aValue;
 }
 
-static id convertValueToObjcObject (KJS::ExecState *exec, const KJS::Value &value)
+static id convertValueToObjcObject (ExecState *exec, ValueImp *value)
 {
     const Bindings::RootObject *root = rootForInterpreter(exec->interpreter());
     if (!root) {
-        Bindings::RootObject *newRoot = new KJS::Bindings::RootObject(0);
+        Bindings::RootObject *newRoot = new Bindings::RootObject(0);
         newRoot->setInterpreter (exec->interpreter());
         root = newRoot;
     }
@@ -140,7 +140,7 @@ static id convertValueToObjcObject (KJS::ExecState *exec, const KJS::Value &valu
 }
 
 
-void ObjcField::setValueToInstance(KJS::ExecState *exec, const Instance *instance, const KJS::Value &aValue) const
+void ObjcField::setValueToInstance(ExecState *exec, const Instance *instance, ValueImp *aValue) const
 {
     id targetObject = (static_cast<const ObjcInstance*>(instance))->getObject();
     id value = convertValueToObjcObject(exec, aValue);
@@ -152,7 +152,7 @@ void ObjcField::setValueToInstance(KJS::ExecState *exec, const Instance *instanc
 
     NS_HANDLER
         
-        Value aValue = Error::create(exec, GeneralError, [[localException reason] lossyCString]);
+        ValueImp *aValue = Error::create(exec, GeneralError, [[localException reason] lossyCString]);
         exec->setException(aValue);
         
     NS_ENDHANDLER
@@ -186,16 +186,16 @@ ObjcArray &ObjcArray::operator=(const ObjcArray &other)
     return *this;
 }
 
-void ObjcArray::setValueAt(KJS::ExecState *exec, unsigned int index, const KJS::Value &aValue) const
+void ObjcArray::setValueAt(ExecState *exec, unsigned int index, ValueImp *aValue) const
 {
     if (![_array respondsToSelector:@selector(insertObject:atIndex:)]) {
-        Object error = Error::create(exec, TypeError, "Array is not mutable.");
+        ObjectImp *error = Error::create(exec, TypeError, "Array is not mutable.");
         exec->setException(error);
         return;
     }
 
     if (index > [_array count]) {
-        Object error = Error::create(exec, RangeError, "Index exceeds array size.");
+        ObjectImp *error = Error::create(exec, RangeError, "Index exceeds array size.");
         exec->setException(error);
         return;
     }
@@ -210,32 +210,32 @@ NS_DURING
 
 NS_HANDLER
     
-    Object error = Error::create(exec, GeneralError, "ObjectiveC exception.");
+    ObjectImp *error = Error::create(exec, GeneralError, "ObjectiveC exception.");
     exec->setException(error);
     
 NS_ENDHANDLER
 }
 
 
-KJS::Value ObjcArray::valueAt(KJS::ExecState *exec, unsigned int index) const
+ValueImp *ObjcArray::valueAt(ExecState *exec, unsigned int index) const
 {
-    ObjectStructPtr obj = 0;
-    Object error;
-    volatile bool haveError = false;
-    
     if (index > [_array count]) {
-        Object error = Error::create(exec, RangeError, "Index exceeds array size.");
+        ObjectImp *error = Error::create(exec, RangeError, "Index exceeds array size.");
         exec->setException(error);
         return error;
     }
     
+    ObjectStructPtr obj = 0;
+    ObjectImp * volatile error;
+    volatile bool haveError = false;
+
 NS_DURING
 
     obj = [_array objectAtIndex:index];
     
 NS_HANDLER
     
-    Object error = Error::create(exec, GeneralError, "ObjectiveC exception.");
+    error = Error::create(exec, GeneralError, "ObjectiveC exception.");
     exec->setException(error);
     haveError = true;
     
@@ -275,7 +275,7 @@ bool ObjcFallbackObjectImp::getOwnPropertySlot(ExecState *exec, const Identifier
 }
 
 void ObjcFallbackObjectImp::put(ExecState *exec, const Identifier &propertyName,
-                 const Value &value, int attr)
+                 ValueImp *value, int attr)
 {
 }
 
@@ -305,11 +305,11 @@ bool ObjcFallbackObjectImp::implementsCall() const
     return false;
 }
 
-Value ObjcFallbackObjectImp::call(ExecState *exec, Object &thisObj, const List &args)
+ValueImp *ObjcFallbackObjectImp::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
 {
-    Value result = Undefined();
+    ValueImp *result = Undefined();
     
-    RuntimeObjectImp *imp = static_cast<RuntimeObjectImp*>(thisObj.imp());
+    RuntimeObjectImp *imp = static_cast<RuntimeObjectImp*>(thisObj);
     if (imp) {
         Instance *instance = imp->getInternalInstance();
         
@@ -340,7 +340,7 @@ bool ObjcFallbackObjectImp::deleteProperty(ExecState *exec,
     return false;
 }
 
-Value ObjcFallbackObjectImp::defaultValue(ExecState *exec, Type hint) const
+ValueImp *ObjcFallbackObjectImp::defaultValue(ExecState *exec, Type hint) const
 {
     return _instance->getValueOfUndefinedField(exec, _item, hint);
 }
index 7cbfd386633d8c3abfb555be4856ece7727e3b23..9cb8f72becd5dc680cf343eb324fc2228f66cde7 100644 (file)
@@ -68,14 +68,14 @@ typedef enum {
 
 class RootObject;
 
-ObjcValue convertValueToObjcValue (KJS::ExecState *exec, const KJS::Value &value, ObjcValueType type);
-Value convertNSStringToString(NSString *nsstring);
-Value convertObjcValueToValue (KJS::ExecState *exec, void *buffer, ObjcValueType type);
-ObjcValueType objcValueTypeForType (const char *type);
+ObjcValue convertValueToObjcValue(ExecState *exec, ValueImp *value, ObjcValueType type);
+ValueImp *convertNSStringToString(NSString *nsstring);
+ValueImp *convertObjcValueToValue(ExecState *exec, void *buffer, ObjcValueType type);
+ObjcValueType objcValueTypeForType(const char *type);
 
 void JSMethodNameToObjCMethodName(const char *name, char *name, unsigned int length);
 
-void *createObjcInstanceForValue (const Object &value, const RootObject *origin, const RootObject *current);
+void *createObjcInstanceForValue(ObjectImp *value, const RootObject *origin, const RootObject *current);
 
 } // namespace Bindings
 
index e9af26524b074dfa864a44691a625db890605e1a..cee9a5fb32ca3c3799c16a9d4035572044785178 100644 (file)
@@ -50,7 +50,7 @@ using namespace KJS::Bindings;
         moveTo$_                moveTo$$$_
     @result Returns the name to be used to represent the specificed selector in the
 */
-void KJS::Bindings::JSMethodNameToObjCMethodName(const char *name, char *buffer, unsigned int len)
+void Bindings::JSMethodNameToObjCMethodName(const char *name, char *buffer, unsigned int len)
 {
     const char *np = name;
     char *bp;
@@ -87,22 +87,22 @@ void KJS::Bindings::JSMethodNameToObjCMethodName(const char *name, char *buffer,
     [], other       exception
 
 */
-ObjcValue KJS::Bindings::convertValueToObjcValue (KJS::ExecState *exec, const KJS::Value &value, ObjcValueType type)
+ObjcValue Bindings::convertValueToObjcValue (ExecState *exec, ValueImp *value, ObjcValueType type)
 {
     ObjcValue result;
     double d = 0;
-   
-    if (value.type() == NumberType || value.type() == StringType || value.type() == BooleanType)
-       d = value.toNumber(exec);
+
+    if (value->isNumber() || value->isString() || value->isBoolean())
+       d = value->toNumber(exec);
        
     switch (type){
         case ObjcObjectType: {
-           KJS::Interpreter *originInterpreter = exec->interpreter();
+           Interpreter *originInterpreter = exec->interpreter();
             const Bindings::RootObject *originExecutionContext = rootForInterpreter(originInterpreter);
 
-           KJS::Interpreter *interpreter = 0;
+           Interpreter *interpreter = 0;
            if (originInterpreter->isGlobalObject(value)) {
-               interpreter = originInterpreter->interpreterForGlobalObject (value.imp());
+               interpreter = originInterpreter->interpreterForGlobalObject (value);
            }
 
            if (!interpreter)
@@ -110,7 +110,7 @@ ObjcValue KJS::Bindings::convertValueToObjcValue (KJS::ExecState *exec, const KJ
                
             const Bindings::RootObject *executionContext = rootForInterpreter(interpreter);
             if (!executionContext) {
-                Bindings::RootObject *newExecutionContext = new KJS::Bindings::RootObject(0);
+                Bindings::RootObject *newExecutionContext = new Bindings::RootObject(0);
                 newExecutionContext->setInterpreter (interpreter);
                 executionContext = newExecutionContext;
             }
@@ -164,14 +164,14 @@ ObjcValue KJS::Bindings::convertValueToObjcValue (KJS::ExecState *exec, const KJ
     return result;
 }
 
-Value KJS::Bindings::convertNSStringToString(NSString *nsstring)
+ValueImp *Bindings::convertNSStringToString(NSString *nsstring)
 {
     unichar *chars;
     unsigned int length = [nsstring length];
     chars = (unichar *)malloc(sizeof(unichar)*length);
     [nsstring getCharacters:chars];
-    UString u((const KJS::UChar*)chars, length);
-    Value aValue = String (u);
+    UString u((const UChar*)chars, length);
+    ValueImp *aValue = String (u);
     free((void *)chars);
     return aValue;
 }
@@ -192,9 +192,9 @@ Value KJS::Bindings::convertNSStringToString(NSString *nsstring)
     other           should not happen
 
 */
-Value KJS::Bindings::convertObjcValueToValue (KJS::ExecState *exec, void *buffer, ObjcValueType type)
+ValueImp *Bindings::convertObjcValueToValue (ExecState *exec, void *buffer, ObjcValueType type)
 {
-    Value aValue;
+    ValueImp *aValue = NULL;
 
     switch (type) {
         case ObjcObjectType:
@@ -224,11 +224,11 @@ Value KJS::Bindings::convertObjcValueToValue (KJS::ExecState *exec, void *buffer
                     aValue = Number([*obj doubleValue]);
                 }
                 else if ([*obj isKindOfClass:[NSArray class]]) {
-                    aValue = Object(new RuntimeArrayImp(exec, new ObjcArray (*obj)));
+                    aValue = new RuntimeArrayImp(exec, new ObjcArray (*obj));
                 }
                 else if ([*obj isKindOfClass:[WebScriptObject class]]) {
                     WebScriptObject *jsobject = (WebScriptObject *)*obj;
-                    aValue = Object([jsobject _imp]);
+                    aValue = [jsobject _imp];
                 }
                 else if (*obj == 0) {
                     return Undefined();
@@ -286,7 +286,7 @@ Value KJS::Bindings::convertObjcValueToValue (KJS::ExecState *exec, void *buffer
 }
 
 
-ObjcValueType KJS::Bindings::objcValueTypeForType (const char *type)
+ObjcValueType Bindings::objcValueTypeForType (const char *type)
 {
     int typeLength = strlen(type);
     ObjcValueType objcValueType = ObjcInvalidType;
@@ -332,12 +332,12 @@ ObjcValueType KJS::Bindings::objcValueTypeForType (const char *type)
 }
 
 
-void *KJS::Bindings::createObjcInstanceForValue (const Object &value, const RootObject *origin, const RootObject *current)
+void *Bindings::createObjcInstanceForValue (ObjectImp *value, const RootObject *origin, const RootObject *current)
 {
-    if (value.type() != ObjectType)
+    if (!value->isObject())
        return 0;
 
-    ObjectImp *imp = static_cast<ObjectImp*>(value.imp());
+    ObjectImp *imp = static_cast<ObjectImp*>(value);
     
     return [[[WebScriptObject alloc] _initWithObjectImp:imp originExecutionContext:origin executionContext:current] autorelease];
 }
index 67c22697f6d1e857045eda658d42b22b0c8c3ccd..8628f4d832c96bf5b42aabcbd4e77a2e647700a8 100644 (file)
@@ -91,11 +91,11 @@ static KJSDidExecuteFunctionPtr _DidExecuteFunction;
 void Instance::setDidExecuteFunction (KJSDidExecuteFunctionPtr func) { _DidExecuteFunction = func; }
 KJSDidExecuteFunctionPtr Instance::didExecuteFunction () { return _DidExecuteFunction; }
 
-Value Instance::getValueOfField (KJS::ExecState *exec, const Field *aField) const {  
+ValueImp *Instance::getValueOfField (KJS::ExecState *exec, const Field *aField) const {  
     return aField->valueFromInstance (exec, this);
 }
 
-void Instance::setValueOfField (KJS::ExecState *exec, const Field *aField, const Value &aValue) const {  
+void Instance::setValueOfField (KJS::ExecState *exec, const Field *aField, ValueImp *aValue) const {  
     aField->setValueToInstance (exec, this, aValue);
 }
 
@@ -126,25 +126,25 @@ Instance *Instance::createBindingForLanguageInstance (BindingLanguage language,
     return newInstance;
 }
 
-Object Instance::createRuntimeObject (BindingLanguage language, void *nativeInstance, const RootObject *executionContext)
+ObjectImp *Instance::createRuntimeObject (BindingLanguage language, void *nativeInstance, const RootObject *executionContext)
 {
     Instance *interfaceObject = Instance::createBindingForLanguageInstance (language, (void *)nativeInstance, executionContext);
     
     Interpreter::lock();
-    Object theObject(new RuntimeObjectImp(interfaceObject,true));
+    ObjectImp *theObject(new RuntimeObjectImp(interfaceObject,true));
     Interpreter::unlock();
     
     return theObject;
 }
 
-void *Instance::createLanguageInstanceForValue (ExecState *exec, BindingLanguage language, const Object &value, const RootObject *origin, const RootObject *current)
+void *Instance::createLanguageInstanceForValue (ExecState *exec, BindingLanguage language, ObjectImp *value, const RootObject *origin, const RootObject *current)
 {
     void *result = 0;
     
-    if (value.type() != ObjectType)
+    if (!value->isObject())
        return 0;
 
-    ObjectImp *imp = static_cast<ObjectImp*>(value.imp());
+    ObjectImp *imp = static_cast<ObjectImp*>(value);
     
     switch (language) {
        case Instance::ObjectiveCLanguage: {
index a8ff2dda355e988851fc397ae0f71b9aa1e36f7d..60ee00addee4827a20b63a86258cb470d31a96da 100644 (file)
@@ -59,7 +59,7 @@ public:
     virtual Parameter *parameterAt(long i) const = 0;
     virtual long numParameters() const = 0;
 
-    virtual ~Constructor() {};
+    virtual ~Constructor() {}
 };
 
 class Field
@@ -68,25 +68,25 @@ public:
     virtual const char *name() const = 0;
     virtual RuntimeType type() const = 0;
 
-    virtual KJS::Value valueFromInstance(ExecState *exec, const Instance *instance) const = 0;
-    virtual void setValueToInstance(ExecState *exec, const Instance *instance, const Value &aValue) const = 0;
+    virtual ValueImp *valueFromInstance(ExecState *, const Instance *) const = 0;
+    virtual void setValueToInstance(ExecState *, const Instance *, ValueImp *) const = 0;
 
-    virtual ~Field() {};
+    virtual ~Field() {}
 };
 
 
 class MethodList
 {
 public:
-    MethodList() : _methods(0), _length(0) {};
+    MethodList() : _methods(0), _length(0) {}
     
-    void addMethod (Method *aMethod);
+    void addMethod(Method *aMethod);
     unsigned int length() const;
-    Method *methodAt (unsigned int index) const;
+    Method *methodAt(unsigned int index) const;
     
     ~MethodList();
     
-    MethodList (const MethodList &other);
+    MethodList(const MethodList &other);
     MethodList &operator=(const MethodList &other);
 
 private:
@@ -117,9 +117,9 @@ public:
     
     virtual Field *fieldNamed(const char *name, Instance *instance) const = 0;
 
-    virtual Value fallbackObject(ExecState *exec, Bindings::Instance *instance, const Identifier &propertyName) { return Undefined(); }
+    virtual ValueImp *fallbackObject(ExecState *, Instance *, const Identifier &) { return Undefined(); }
     
-    virtual ~Class() {};
+    virtual ~Class() {}
 };
 
 typedef void (*KJSDidExecuteFunctionPtr)(ExecState *exec, ObjectImp *rootObject);
@@ -133,16 +133,16 @@ public:
         CLanguage
     } BindingLanguage;
 
-    static void setDidExecuteFunction (KJSDidExecuteFunctionPtr func);
-    static KJSDidExecuteFunctionPtr didExecuteFunction ();
+    static void setDidExecuteFunction(KJSDidExecuteFunctionPtr func);
+    static KJSDidExecuteFunctionPtr didExecuteFunction();
     
-    static Instance *createBindingForLanguageInstance (BindingLanguage language, void *nativeInstance, const RootObject *r = 0);
-    static void *createLanguageInstanceForValue (ExecState *exec, BindingLanguage language, const Object &value, const RootObject *origin, const RootObject *current);
-    static Object createRuntimeObject (BindingLanguage language, void *nativeInstance, const RootObject *r = 0);
+    static Instance *createBindingForLanguageInstance(BindingLanguage language, void *nativeInstance, const RootObject *r = 0);
+    static void *createLanguageInstanceForValue(ExecState *exec, BindingLanguage language, ObjectImp *value, const RootObject *origin, const RootObject *current);
+    static ObjectImp *createRuntimeObject(BindingLanguage language, void *nativeInstance, const RootObject *r = 0);
 
-    Instance () : _executionContext(0) {};
+    Instance() : _executionContext(0) {};
     
-    Instance (const Instance &other);
+    Instance(const Instance &other);
 
     Instance &operator=(const Instance &other);
 
@@ -154,23 +154,23 @@ public:
     
     virtual Class *getClass() const = 0;
     
-    virtual Value getValueOfField (ExecState *exec, const Field *aField) const;
-    virtual Value getValueOfUndefinedField (ExecState *exec, const Identifier &property, Type hint) const { return Undefined(); };
-    virtual void setValueOfField (ExecState *exec, const Field *aField, const Value &aValue) const;
-    virtual bool supportsSetValueOfUndefinedField () { return false; };
-    virtual void setValueOfUndefinedField (ExecState *exec, const Identifier &property, const Value &aValue) {};
+    virtual ValueImp *getValueOfField(ExecState *exec, const Field *aField) const;
+    virtual ValueImp *getValueOfUndefinedField(ExecState *exec, const Identifier &property, Type hint) const { return Undefined(); };
+    virtual void setValueOfField(ExecState *exec, const Field *aField, ValueImp *aValue) const;
+    virtual bool supportsSetValueOfUndefinedField() { return false; };
+    virtual void setValueOfUndefinedField(ExecState *exec, const Identifier &property, ValueImp *aValue) {};
     
-    virtual Value invokeMethod (ExecState *exec, const MethodList &method, const List &args) = 0;
-    virtual Value invokeDefaultMethod (ExecState *exec, const List &args) = 0;
+    virtual ValueImp *invokeMethod(ExecState *exec, const MethodList &method, const List &args) = 0;
+    virtual ValueImp *invokeDefaultMethod(ExecState *exec, const List &args) = 0;
     
-    virtual Value defaultValue (Type hint) const = 0;
+    virtual ValueImp *defaultValue(Type hint) const = 0;
     
-    virtual Value valueOf() const { return String(getClass()->name()); };
+    virtual ValueImp *valueOf() const { return String(getClass()->name()); };
     
-    void setExecutionContext (const RootObject *r) { _executionContext = r; }
+    void setExecutionContext(const RootObject *r) { _executionContext = r; }
     const RootObject *executionContext() const { return _executionContext; }
     
-    virtual ~Instance() {};
+    virtual ~Instance() {}
 
 protected:
     const RootObject *_executionContext;
@@ -179,13 +179,13 @@ protected:
 class Array
 {
 public:
-    virtual void setValueAt(ExecState *exec, unsigned int index, const Value &aValue) const = 0;
-    virtual Value valueAt(ExecState *exec, unsigned int index) const = 0;
+    virtual void setValueAt(ExecState *, unsigned index, ValueImp *) const = 0;
+    virtual ValueImp *valueAt(ExecState *, unsigned index) const = 0;
     virtual unsigned int getLength() const = 0;
-    virtual ~Array() {};
+    virtual ~Array() {}
 };
 
-const char *signatureForParameters(const KJS::List &aList);
+const char *signatureForParameters(const List &aList);
 
 } // namespace Bindings
 
index f86fdc18f7e9567cbd384bc418865cca4dc96783..f3be7e85d318541f4c605b8f8c44d5b48aa4195d 100644 (file)
@@ -32,7 +32,7 @@ using namespace KJS;
 const ClassInfo RuntimeArrayImp::info = {"RuntimeArray", &ArrayInstanceImp::info, 0, 0};
 
 RuntimeArrayImp::RuntimeArrayImp(ExecState *exec, Bindings::Array *a)
-    : ArrayInstanceImp (exec->lexicalInterpreter()->builtinArrayPrototype().imp(), a->getLength())
+    : ArrayInstanceImp(exec->lexicalInterpreter()->builtinArrayPrototype(), a->getLength())
 {
     // Always takes ownership of concrete array.
     _array = a;
@@ -43,13 +43,13 @@ RuntimeArrayImp::~RuntimeArrayImp()
     delete _array;
 }
 
-Value RuntimeArrayImp::lengthGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+ValueImp *RuntimeArrayImp::lengthGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
 {
     RuntimeArrayImp *thisObj = static_cast<RuntimeArrayImp *>(slot.slotBase());
     return Number(thisObj->getLength());
 }
 
-Value RuntimeArrayImp::indexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+ValueImp *RuntimeArrayImp::indexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
 {
     RuntimeArrayImp *thisObj = static_cast<RuntimeArrayImp *>(slot.slotBase());
     return thisObj->getConcreteArray()->valueAt(exec, slot.index());
@@ -84,10 +84,10 @@ bool RuntimeArrayImp::getOwnPropertySlot(ExecState *exec, unsigned index, Proper
     return ArrayInstanceImp::getOwnPropertySlot(exec, index, slot);
 }
 
-void RuntimeArrayImp::put(ExecState *exec, const Identifier &propertyName, const Value &value, int attr)
+void RuntimeArrayImp::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
 {
     if (propertyName == lengthPropertyName) {
-        Object err = Error::create(exec,RangeError);
+        ObjectImp *err = Error::create(exec,RangeError);
         exec->setException(err);
         return;
     }
@@ -102,10 +102,10 @@ void RuntimeArrayImp::put(ExecState *exec, const Identifier &propertyName, const
     ObjectImp::put(exec, propertyName, value, attr);
 }
 
-void RuntimeArrayImp::put(ExecState *exec, unsigned index, const Value &value, int attr)
+void RuntimeArrayImp::put(ExecState *exec, unsigned index, ValueImp *value, int attr)
 {
     if (index >= getLength()) {
-        Object err = Error::create(exec,RangeError);
+        ObjectImp *err = Error::create(exec,RangeError);
         exec->setException(err);
         return;
     }
index 2224ff4e70cb82c13e270419cc764fae003a6c51..b45c965113d569249db38d15d060930b9a317907 100644 (file)
@@ -39,8 +39,8 @@ public:
     
     virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
     virtual bool getOwnPropertySlot(ExecState *, unsigned, PropertySlot&);
-    virtual void put(ExecState *exec, const Identifier &propertyName, const Value &value, int attr = None);
-    virtual void put(ExecState *exec, unsigned propertyName, const Value &value, int attr = None);
+    virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
+    virtual void put(ExecState *exec, unsigned propertyName, ValueImp *value, int attr = None);
     
     virtual bool deleteProperty(ExecState *exec, const Identifier &propertyName);
     virtual bool deleteProperty(ExecState *exec, unsigned propertyName);
@@ -54,8 +54,8 @@ public:
     static const ClassInfo info;
 
 private:
-    static Value lengthGetter(ExecState *, const Identifier&, const PropertySlot&);
-    static Value indexGetter(ExecState *, const Identifier&, const PropertySlot&);
+    static ValueImp *lengthGetter(ExecState *, const Identifier&, const PropertySlot&);
+    static ValueImp *indexGetter(ExecState *, const Identifier&, const PropertySlot&);
 
     Bindings::Array *_array;
 };
index 7161e43b919842aa52adc7caa288009b360dff2c..9fce9d476b20392fbd9ec0394c305ac2e0d8dca0 100644 (file)
@@ -40,7 +40,7 @@ RuntimeMethodImp::~RuntimeMethodImp()
 {
 }
 
-Value RuntimeMethodImp::lengthGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+ValueImp *RuntimeMethodImp::lengthGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
 {
     RuntimeMethodImp *thisObj = static_cast<RuntimeMethodImp *>(slot.slotBase());
 
@@ -68,26 +68,26 @@ bool RuntimeMethodImp::implementsCall() const
     return true;
 }
 
-Value RuntimeMethodImp::call(ExecState *exec, Object &thisObj, const List &args)
+ValueImp *RuntimeMethodImp::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
 {
     if (_methodList.length() > 0) {
        RuntimeObjectImp *imp;
        
        // If thisObj is the DOM object for a plugin, get the corresponding
        // runtime object from the DOM object.
-       if (thisObj.classInfo() != &KJS::RuntimeObjectImp::info) {
-           Value runtimeObject = thisObj.get(exec, "__apple_runtime_object");
-           imp = static_cast<RuntimeObjectImp*>(runtimeObject.imp());
+       if (thisObj->classInfo() != &KJS::RuntimeObjectImp::info) {
+           ValueImp *runtimeObject = thisObj->get(exec, "__apple_runtime_object");
+           imp = static_cast<RuntimeObjectImp*>(runtimeObject);
        }
        else {
-           imp = static_cast<RuntimeObjectImp*>(thisObj.imp());
+           imp = static_cast<RuntimeObjectImp*>(thisObj);
        }
         if (imp) {
             Instance *instance = imp->getInternalInstance();
             
             instance->begin();
             
-            Value aValue = instance->invokeMethod(exec, _methodList, args);
+            ValueImp *aValue = instance->invokeMethod(exec, _methodList, args);
             
             instance->end();
             
index 99f7f2711506ab9ee32f0c3806725d7592940929..75858d7ee17121839f139a953d86159f61420152 100644 (file)
@@ -41,14 +41,14 @@ public:
     virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
 
     virtual bool implementsCall() const;
-    virtual Value call(ExecState *exec, Object &thisObj, const List &args);
+    virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
 
     virtual CodeType codeType() const;
     
     virtual Completion execute(ExecState *exec);
 
 private:
-    static Value lengthGetter(ExecState *, const Identifier&, const PropertySlot&);
+    static ValueImp *lengthGetter(ExecState *, const Identifier&, const PropertySlot&);
 
     Bindings::MethodList _methodList;
 };
index 64595d75d27656e88750c8a016a12b08d4bf3baa..70eec0d8eb1bad07af3c298be30777bed98890e3 100644 (file)
@@ -60,7 +60,7 @@ RuntimeObjectImp::RuntimeObjectImp(Bindings::Instance *i, bool oi)
     instance = i;
 }
 
-Value RuntimeObjectImp::fallbackObjectGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+ValueImp *RuntimeObjectImp::fallbackObjectGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
 {
     RuntimeObjectImp *thisObj = static_cast<RuntimeObjectImp *>(slot.slotBase());
     Bindings::Instance *instance = thisObj->instance;
@@ -68,14 +68,14 @@ Value RuntimeObjectImp::fallbackObjectGetter(ExecState *exec, const Identifier&
     instance->begin();
 
     Class *aClass = instance->getClass();
-    Value result = aClass->fallbackObject(exec, instance, propertyName);
+    ValueImp *result = aClass->fallbackObject(exec, instance, propertyName);
 
     instance->end();
             
     return result;
 }
 
-Value RuntimeObjectImp::fieldGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+ValueImp *RuntimeObjectImp::fieldGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
 {
     RuntimeObjectImp *thisObj = static_cast<RuntimeObjectImp *>(slot.slotBase());
     Bindings::Instance *instance = thisObj->instance;
@@ -84,14 +84,14 @@ Value RuntimeObjectImp::fieldGetter(ExecState *exec, const Identifier& propertyN
 
     Class *aClass = instance->getClass();
     Field *aField = aClass->fieldNamed(propertyName.ascii(), instance);
-    Value result = instance->getValueOfField(exec, aField); 
+    ValueImp *result = instance->getValueOfField(exec, aField); 
     
     instance->end();
             
     return result;
 }
 
-Value RuntimeObjectImp::methodGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+ValueImp *RuntimeObjectImp::methodGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
 {
     RuntimeObjectImp *thisObj = static_cast<RuntimeObjectImp *>(slot.slotBase());
     Bindings::Instance *instance = thisObj->instance;
@@ -100,7 +100,7 @@ Value RuntimeObjectImp::methodGetter(ExecState *exec, const Identifier& property
 
     Class *aClass = instance->getClass();
     MethodList methodList = aClass->methodsNamed(propertyName.ascii(), instance);
-    Value result = Object(new RuntimeMethodImp(exec, propertyName, methodList));
+    ValueImp *result = new RuntimeMethodImp(exec, propertyName, methodList);
 
     instance->end();
             
@@ -132,7 +132,7 @@ bool RuntimeObjectImp::getOwnPropertySlot(ExecState *exec, const Identifier& pro
         }
        
         // Try a fallback object.
-        if (!aClass->fallbackObject(exec, instance, propertyName).type() != UndefinedType) {
+        if (!aClass->fallbackObject(exec, instance, propertyName)->isUndefined()) {
             slot.setCustom(this, fallbackObjectGetter);
             instance->end();
             return true;
@@ -146,7 +146,7 @@ bool RuntimeObjectImp::getOwnPropertySlot(ExecState *exec, const Identifier& pro
 }
 
 void RuntimeObjectImp::put(ExecState *exec, const Identifier &propertyName,
-                    const Value &value, int attr)
+                    ValueImp *value, int attr)
 {
     instance->begin();
 
@@ -187,9 +187,9 @@ bool RuntimeObjectImp::deleteProperty(ExecState *exec,
     return false;
 }
 
-Value RuntimeObjectImp::defaultValue(ExecState *exec, Type hint) const
+ValueImp *RuntimeObjectImp::defaultValue(ExecState *exec, Type hint) const
 {
-    Value result;
+    ValueImp *result;
     
     instance->begin();
 
@@ -206,11 +206,11 @@ bool RuntimeObjectImp::implementsCall() const
     return true;
 }
 
-Value RuntimeObjectImp::call(ExecState *exec, Object &thisObj, const List &args)
+ValueImp *RuntimeObjectImp::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
 {
     instance->begin();
 
-    Value aValue = getInternalInstance()->invokeDefaultMethod(exec, args);
+    ValueImp *aValue = getInternalInstance()->invokeDefaultMethod(exec, args);
     
     instance->end();
     
index 7be49e0d7d0a855c2ee8dbb39fec627e7e71a682..47e79341fbaf2e7946161f95c152131bda94c0fd 100644 (file)
@@ -44,27 +44,27 @@ public:
     virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
 
     virtual void put(ExecState *exec, const Identifier &propertyName,
-                     const Value &value, int attr = None);
+                     ValueImp *value, int attr = None);
 
     virtual bool canPut(ExecState *exec, const Identifier &propertyName) const;
 
     virtual bool deleteProperty(ExecState *exec,
                                 const Identifier &propertyName);
 
-    virtual Value defaultValue(ExecState *exec, Type hint) const;
+    virtual ValueImp *defaultValue(ExecState *exec, Type hint) const;
 
     void setInternalInstance (Bindings::Instance *i) { instance = i; }
     Bindings::Instance *getInternalInstance() const { return instance; }
 
     virtual bool implementsCall() const;
-    virtual Value call(ExecState *exec, Object &thisObj, const List &args);
+    virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
     
     static const ClassInfo info;
 
 private:
-    static Value fallbackObjectGetter(ExecState *, const Identifier&, const PropertySlot&);
-    static Value fieldGetter(ExecState *, const Identifier&, const PropertySlot&);
-    static Value methodGetter(ExecState *, const Identifier&, const PropertySlot&);
+    static ValueImp *fallbackObjectGetter(ExecState *, const Identifier&, const PropertySlot&);
+    static ValueImp *fieldGetter(ExecState *, const Identifier&, const PropertySlot&);
+    static ValueImp *methodGetter(ExecState *, const Identifier&, const PropertySlot&);
 
     Bindings::Instance *instance;
     bool ownsInstance;
index b185d39e7fae1d186c53a55d32dc3cd2a347f7bb..afdeb5666d9ae96c554c3f2a315f81297fd53f05 100644 (file)
@@ -35,8 +35,8 @@ namespace KJS {
 
     virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
     virtual bool getOwnPropertySlot(ExecState *, unsigned, PropertySlot&);
-    virtual void put(ExecState *exec, const Identifier &propertyName, const Value &value, int attr = None);
-    virtual void put(ExecState *exec, unsigned propertyName, const Value &value, int attr = None);
+    virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
+    virtual void put(ExecState *exec, unsigned propertyName, ValueImp *value, int attr = None);
     virtual bool deleteProperty(ExecState *exec, const Identifier &propertyName);
     virtual bool deleteProperty(ExecState *exec, unsigned propertyName);
     virtual ReferenceList propList(ExecState *exec, bool recursive);
@@ -49,10 +49,10 @@ namespace KJS {
     unsigned getLength() const { return length; }
     
     void sort(ExecState *exec);
-    void sort(ExecState *exec, Object &compareFunction);
+    void sort(ExecState *exec, ObjectImp *compareFunction);
     
   private:
-    static Value lengthGetter(ExecState *, const Identifier&, const PropertySlot&);
+    static ValueImp *lengthGetter(ExecState *, const Identifier&, const PropertySlot&);
 
     void setLength(unsigned newLength, ExecState *exec);
     
index 50b783c27ce554928d166a9aa1c341e910c58e3f..184480b274279cef8b8916b5e8ebf5c7610bf337 100644 (file)
  *
  */
 
-#include "value.h"
-#include "object.h"
-#include "types.h"
-#include "interpreter.h"
-#include "operations.h"
 #include "array_object.h"
-#include "internal.h"
+
 #include "error_object.h"
+#include "internal.h"
+#include "interpreter.h"
+#include "object.h"
+#include "operations.h"
+#include "reference_list.h"
+#include "types.h"
+#include "value.h"
 
 #include "array_object.lut.h"
 
@@ -61,7 +63,7 @@ ArrayInstanceImp::ArrayInstanceImp(ObjectImp *proto, const List &list)
   ListIterator it = list.begin();
   unsigned l = length;
   for (unsigned i = 0; i < l; ++i) {
-    storage[i] = (it++).imp();
+    storage[i] = it++;
   }
 }
 
@@ -70,7 +72,7 @@ ArrayInstanceImp::~ArrayInstanceImp()
   free(storage);
 }
 
-Value ArrayInstanceImp::lengthGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+ValueImp *ArrayInstanceImp::lengthGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
 {
   return Number(static_cast<ArrayInstanceImp *>(slot.slotBase())->length);
 }
@@ -89,9 +91,8 @@ bool ArrayInstanceImp::getOwnPropertySlot(ExecState *exec, const Identifier& pro
       return false;
     if (index < storageLength) {
       ValueImp *v = storage[index];
-      if (!v || v == UndefinedImp::staticUndefined)
-        return false;
-      
+      if (!v || v->isUndefined())
+        return false;      
       slot.setValueSlot(this, &storage[index]);
       return true;
     }
@@ -106,9 +107,8 @@ bool ArrayInstanceImp::getOwnPropertySlot(ExecState *exec, unsigned index, Prope
     return false;
   if (index < storageLength) {
     ValueImp *v = storage[index];
-    if (!v || v == UndefinedImp::staticUndefined)
+    if (!v || v->isUndefined())
       return false;
-    
     slot.setValueSlot(this, &storage[index]);
     return true;
   }
@@ -117,10 +117,10 @@ bool ArrayInstanceImp::getOwnPropertySlot(ExecState *exec, unsigned index, Prope
 }
 
 // Special implementation of [[Put]] - see ECMA 15.4.5.1
-void ArrayInstanceImp::put(ExecState *exec, const Identifier &propertyName, const Value &value, int attr)
+void ArrayInstanceImp::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
 {
   if (propertyName == lengthPropertyName) {
-    setLength(value.toUInt32(exec), exec);
+    setLength(value->toUInt32(exec), exec);
     return;
   }
   
@@ -134,7 +134,7 @@ void ArrayInstanceImp::put(ExecState *exec, const Identifier &propertyName, cons
   ObjectImp::put(exec, propertyName, value, attr);
 }
 
-void ArrayInstanceImp::put(ExecState *exec, unsigned index, const Value &value, int attr)
+void ArrayInstanceImp::put(ExecState *exec, unsigned index, ValueImp *value, int attr)
 {
   if (index < sparseArrayCutoff && index >= storageLength) {
     resizeStorage(index + 1);
@@ -145,7 +145,7 @@ void ArrayInstanceImp::put(ExecState *exec, unsigned index, const Value &value,
   }
 
   if (index < storageLength) {
-    storage[index] = value.imp();
+    storage[index] = value;
     return;
   }
   
@@ -189,7 +189,7 @@ ReferenceList ArrayInstanceImp::propList(ExecState *exec, bool recursive)
   ReferenceList properties = ObjectImp::propList(exec,recursive);
 
   // avoid fetching this every time through the loop
-  ValueImp *undefined = UndefinedImp::staticUndefined;
+  ValueImp *undefined = jsUndefined();
 
   for (unsigned i = 0; i < storageLength; ++i) {
     ValueImp *imp = storage[i];
@@ -231,7 +231,7 @@ void ArrayInstanceImp::setLength(unsigned newLength, ExecState *exec)
   if (newLength < length) {
     ReferenceList sparseProperties;
     
-    _prop.addSparseArrayPropertiesToReferenceList(sparseProperties, Object(this));
+    _prop.addSparseArrayPropertiesToReferenceList(sparseProperties, this);
     
     ReferenceListIterator it = sparseProperties.begin();
     while (it != sparseProperties.end()) {
@@ -265,13 +265,13 @@ static int compareByStringForQSort(const void *a, const void *b)
     ExecState *exec = execForCompareByStringForQSort;
     ValueImp *va = *(ValueImp **)a;
     ValueImp *vb = *(ValueImp **)b;
-    if (va->dispatchType() == UndefinedType) {
-        return vb->dispatchType() == UndefinedType ? 0 : 1;
+    if (va->isUndefined()) {
+        return vb->isUndefined() ? 0 : 1;
     }
-    if (vb->dispatchType() == UndefinedType) {
+    if (vb->isUndefined()) {
         return -1;
     }
-    return compare(va->dispatchToString(exec), vb->dispatchToString(exec));
+    return compare(va->toString(exec), vb->toString(exec));
 }
 
 void ArrayInstanceImp::sort(ExecState *exec)
@@ -296,7 +296,7 @@ struct CompareWithCompareFunctionArguments {
     ExecState *exec;
     ObjectImp *compareFunction;
     List arguments;
-    Object globalObject;
+    ObjectImp *globalObject;
 };
 
 static CompareWithCompareFunctionArguments *compareWithCompareFunctionArguments;
@@ -307,10 +307,10 @@ static int compareWithCompareFunctionForQSort(const void *a, const void *b)
 
     ValueImp *va = *(ValueImp **)a;
     ValueImp *vb = *(ValueImp **)b;
-    if (va->dispatchType() == UndefinedType) {
-        return vb->dispatchType() == UndefinedType ? 0 : 1;
+    if (va->isUndefined()) {
+        return vb->isUndefined() ? 0 : 1;
     }
-    if (vb->dispatchType() == UndefinedType) {
+    if (vb->isUndefined()) {
         return -1;
     }
 
@@ -318,15 +318,15 @@ static int compareWithCompareFunctionForQSort(const void *a, const void *b)
     args->arguments.append(va);
     args->arguments.append(vb);
     double compareResult = args->compareFunction->call
-        (args->exec, args->globalObject, args->arguments).toNumber(args->exec);
+        (args->exec, args->globalObject, args->arguments)->toNumber(args->exec);
     return compareResult < 0 ? -1 : compareResult > 0 ? 1 : 0;
 }
 
-void ArrayInstanceImp::sort(ExecState *exec, Object &compareFunction)
+void ArrayInstanceImp::sort(ExecState *exec, ObjectImp *compareFunction)
 {
     int lengthNotIncludingUndefined = pushUndefinedObjectsToEnd(exec);
     
-    CompareWithCompareFunctionArguments args(exec, compareFunction.imp());
+    CompareWithCompareFunctionArguments args(exec, compareFunction);
     compareWithCompareFunctionArguments = &args;
     qsort(storage, lengthNotIncludingUndefined, sizeof(ValueImp *), compareWithCompareFunctionForQSort);
     compareWithCompareFunctionArguments = 0;
@@ -334,7 +334,7 @@ void ArrayInstanceImp::sort(ExecState *exec, Object &compareFunction)
 
 unsigned ArrayInstanceImp::pushUndefinedObjectsToEnd(ExecState *exec)
 {
-    ValueImp *undefined = UndefinedImp::staticUndefined;
+    ValueImp *undefined = jsUndefined();
 
     unsigned o = 0;
     
@@ -348,7 +348,7 @@ unsigned ArrayInstanceImp::pushUndefinedObjectsToEnd(ExecState *exec)
     }
     
     ReferenceList sparseProperties;
-    _prop.addSparseArrayPropertiesToReferenceList(sparseProperties, Object(this));
+    _prop.addSparseArrayPropertiesToReferenceList(sparseProperties, this);
     unsigned newLength = o + sparseProperties.length();
 
     if (newLength > storageLength) {
@@ -358,7 +358,7 @@ unsigned ArrayInstanceImp::pushUndefinedObjectsToEnd(ExecState *exec)
     ReferenceListIterator it = sparseProperties.begin();
     while (it != sparseProperties.end()) {
       Reference ref = it++;
-      storage[o] = ref.getValue(exec).imp();
+      storage[o] = ref.getValue(exec);
       ObjectImp::deleteProperty(exec, ref.getPropertyName(exec));
       o++;
     }
@@ -398,7 +398,6 @@ ArrayPrototypeImp::ArrayPrototypeImp(ExecState *exec,
                                      ObjectPrototypeImp *objProto)
   : ArrayInstanceImp(objProto, 0)
 {
-  Value protect(this);
   setInternalValue(Null());
 }
 
@@ -411,10 +410,9 @@ bool ArrayPrototypeImp::getOwnPropertySlot(ExecState *exec, const Identifier& pr
 
 ArrayProtoFuncImp::ArrayProtoFuncImp(ExecState *exec, int i, int len)
   : InternalFunctionImp(
-    static_cast<FunctionPrototypeImp*>(exec->lexicalInterpreter()->builtinFunctionPrototype().imp())
+    static_cast<FunctionPrototypeImp*>(exec->lexicalInterpreter()->builtinFunctionPrototype())
     ), id(i)
 {
-  Value protect(this);
   put(exec,lengthPropertyName,Number(len),DontDelete|ReadOnly|DontEnum);
 }
 
@@ -424,19 +422,18 @@ bool ArrayProtoFuncImp::implementsCall() const
 }
 
 // ECMA 15.4.4
-Value ArrayProtoFuncImp::call(ExecState *exec, Object &thisObj, const List &args)
+ValueImp *ArrayProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
 {
-  unsigned int length = thisObj.get(exec,lengthPropertyName).toUInt32(exec);
-  ObjectImp *thisImp = thisObj.imp();
+  unsigned length = thisObj->get(exec,lengthPropertyName)->toUInt32(exec);
 
-  Value result;
+  ValueImp *result;
   
   switch (id) {
   case ToLocaleString:
   case ToString:
 
-    if (!thisObj.inherits(&ArrayInstanceImp::info)) {
-      Object err = Error::create(exec,TypeError);
+    if (!thisObj->inherits(&ArrayInstanceImp::info)) {
+      ObjectImp *err = Error::create(exec,TypeError);
       exec->setException(err);
       return err;
     }
@@ -446,24 +443,22 @@ Value ArrayProtoFuncImp::call(ExecState *exec, Object &thisObj, const List &args
     UString separator = ",";
     UString str = "";
 
-    if (args[0].type() != UndefinedType)
-      separator = args[0].toString(exec);
+    if (!args[0]->isUndefined())
+      separator = args[0]->toString(exec);
     for (unsigned int k = 0; k < length; k++) {
       if (k >= 1)
         str += separator;
       
-      Value element = thisObj.get(exec, k);
-      if (element.type() == UndefinedType || element.type() == NullType)
+      ValueImp *element = thisObj->get(exec, k);
+      if (element->isUndefinedOrNull())
         continue;
 
       bool fallback = false;
       if (id == ToLocaleString) {
-        Object o = element.toObject(exec);
-        Object conversionFunction =
-          Object::dynamicCast(o.get(exec, toLocaleStringPropertyName));
-        if (conversionFunction.isValid() &&
-            conversionFunction.implementsCall()) {
-          str += conversionFunction.call(exec, o, List()).toString(exec);
+        ObjectImp *o = element->toObject(exec);
+        ValueImp *conversionFunction = o->get(exec, toLocaleStringPropertyName);
+        if (conversionFunction->isObject() && static_cast<ObjectImp *>(conversionFunction)->implementsCall()) {
+          str += static_cast<ObjectImp *>(conversionFunction)->call(exec, o, List())->toString(exec);
         } else {
           // try toString() fallback
           fallback = true;
@@ -471,23 +466,19 @@ Value ArrayProtoFuncImp::call(ExecState *exec, Object &thisObj, const List &args
       }
 
       if (id == ToString || id == Join || fallback) {
-        if (element.type() == ObjectType) {
-          Object o = Object::dynamicCast(element);
-          Object conversionFunction =
-            Object::dynamicCast(o.get(exec, toStringPropertyName));
-          if (conversionFunction.isValid() &&
-              conversionFunction.implementsCall()) {
-            str += conversionFunction.call(exec, o, List()).toString(exec);
+        if (element->isObject()) {
+          ObjectImp *o = static_cast<ObjectImp *>(element);
+          ValueImp *conversionFunction = o->get(exec, toStringPropertyName);
+          if (conversionFunction->isObject() && static_cast<ObjectImp *>(conversionFunction)->implementsCall()) {
+            str += static_cast<ObjectImp *>(conversionFunction)->call(exec, o, List())->toString(exec);
           } else {
-            UString msg = "Can't convert " + o.className() +
-              " object to string";
-            Object error = Error::create(exec, RangeError,
-                msg.cstring().c_str());
+            UString msg = "Can't convert " + o->className() + " object to string";
+            ObjectImp *error = Error::create(exec, RangeError, msg.cstring().c_str());
             exec->setException(error);
             return error;
           }
         } else {
-          str += element.toString(exec);
+          str += element->toString(exec);
         }
       }
 
@@ -498,54 +489,54 @@ Value ArrayProtoFuncImp::call(ExecState *exec, Object &thisObj, const List &args
     break;
   }
   case Concat: {
-    Object arr = Object::dynamicCast(exec->lexicalInterpreter()->builtinArray().construct(exec,List::empty()));
+    ObjectImp *arr = static_cast<ObjectImp *>(exec->lexicalInterpreter()->builtinArray()->construct(exec,List::empty()));
     int n = 0;
-    Value curArg = thisObj;
-    Object curObj = Object::dynamicCast(thisObj);
+    ValueImp *curArg = thisObj;
+    ObjectImp *curObj = static_cast<ObjectImp *>(thisObj);
     ListIterator it = args.begin();
     for (;;) {
-      if (curArg.type() == ObjectType &&
-          curObj.inherits(&ArrayInstanceImp::info)) {
+      if (curArg->isObject() &&
+          curObj->inherits(&ArrayInstanceImp::info)) {
         unsigned int k = 0;
         // Older versions tried to optimize out getting the length of thisObj
         // by checking for n != 0, but that doesn't work if thisObj is an empty array.
-        length = curObj.get(exec,lengthPropertyName).toUInt32(exec);
+        length = curObj->get(exec,lengthPropertyName)->toUInt32(exec);
         while (k < length) {
-          Value v;
-          if (curObj.imp()->getProperty(exec, k, v))
-            arr.put(exec, n, v);
+          ValueImp *v;
+          if (curObj->getProperty(exec, k, v))
+            arr->put(exec, n, v);
           n++;
           k++;
         }
       } else {
-        arr.put(exec, n, curArg);
+        arr->put(exec, n, curArg);
         n++;
       }
       if (it == args.end())
         break;
       curArg = *it;
-      curObj = Object::dynamicCast(it++); // may be 0
+      curObj = static_cast<ObjectImp *>(it++); // may be 0
     }
-    arr.put(exec,lengthPropertyName, Number(n), DontEnum | DontDelete);
+    arr->put(exec,lengthPropertyName, Number(n), DontEnum | DontDelete);
 
     result = arr;
     break;
   }
   case Pop:{
     if (length == 0) {
-      thisObj.put(exec, lengthPropertyName, Number(length), DontEnum | DontDelete);
+      thisObj->put(exec, lengthPropertyName, Number(length), DontEnum | DontDelete);
       result = Undefined();
     } else {
-      result = thisObj.get(exec, length - 1);
-      thisObj.put(exec, lengthPropertyName, Number(length - 1), DontEnum | DontDelete);
+      result = thisObj->get(exec, length - 1);
+      thisObj->put(exec, lengthPropertyName, Number(length - 1), DontEnum | DontDelete);
     }
     break;
   }
   case Push: {
     for (int n = 0; n < args.size(); n++)
-      thisObj.put(exec, length + n, args[n]);
+      thisObj->put(exec, length + n, args[n]);
     length += args.size();
-    thisObj.put(exec,lengthPropertyName, Number(length), DontEnum | DontDelete);
+    thisObj->put(exec,lengthPropertyName, Number(length), DontEnum | DontDelete);
     result = Number(length);
     break;
   }
@@ -555,39 +546,39 @@ Value ArrayProtoFuncImp::call(ExecState *exec, Object &thisObj, const List &args
 
     for (unsigned int k = 0; k < middle; k++) {
       unsigned lk1 = length - k - 1;
-      Value obj;
-      Value obj2;
-      bool has2 = thisImp->getProperty(exec, lk1, obj2);
-      bool has1 = thisImp->getProperty(exec, k, obj);
+      ValueImp *obj;
+      ValueImp *obj2;
+      bool has2 = thisObj->getProperty(exec, lk1, obj2);
+      bool has1 = thisObj->getProperty(exec, k, obj);
 
       if (has2) 
-        thisObj.put(exec, k, obj2);
+        thisObj->put(exec, k, obj2);
       else
-        thisObj.deleteProperty(exec, k);
+        thisObj->deleteProperty(exec, k);
 
       if (has1)
-        thisObj.put(exec, lk1, obj);
+        thisObj->put(exec, lk1, obj);
       else
-        thisObj.deleteProperty(exec, lk1);
+        thisObj->deleteProperty(exec, lk1);
     }
     result = thisObj;
     break;
   }
   case Shift: {
     if (length == 0) {
-      thisObj.put(exec, lengthPropertyName, Number(length), DontEnum | DontDelete);
+      thisObj->put(exec, lengthPropertyName, Number(length), DontEnum | DontDelete);
       result = Undefined();
     } else {
-      result = thisObj.get(exec, 0);
+      result = thisObj->get(exec, 0);
       for(unsigned int k = 1; k < length; k++) {
-        Value obj;
-        if (thisImp->getProperty(exec, k, obj))
-          thisObj.put(exec, k-1, obj);
+        ValueImp *obj;
+        if (thisObj->getProperty(exec, k, obj))
+          thisObj->put(exec, k-1, obj);
         else
-          thisObj.deleteProperty(exec, k-1);
+          thisObj->deleteProperty(exec, k-1);
       }
-      thisObj.deleteProperty(exec, length - 1);
-      thisObj.put(exec, lengthPropertyName, Number(length - 1), DontEnum | DontDelete);
+      thisObj->deleteProperty(exec, length - 1);
+      thisObj->put(exec, lengthPropertyName, Number(length - 1), DontEnum | DontDelete);
     }
     break;
   }
@@ -595,11 +586,11 @@ Value ArrayProtoFuncImp::call(ExecState *exec, Object &thisObj, const List &args
     // http://developer.netscape.com/docs/manuals/js/client/jsref/array.htm#1193713 or 15.4.4.10
 
     // We return a new array
-    Object resObj = Object::dynamicCast(exec->lexicalInterpreter()->builtinArray().construct(exec,List::empty()));
+    ObjectImp *resObj = static_cast<ObjectImp *>(exec->lexicalInterpreter()->builtinArray()->construct(exec,List::empty()));
     result = resObj;
     double begin = 0;
-    if (args[0].type() != UndefinedType) {
-        begin = args[0].toInteger(exec);
+    if (!args[0]->isUndefined()) {
+        begin = args[0]->toInteger(exec);
         if (begin >= 0) { // false for NaN
             if (begin > length)
                 begin = length;
@@ -610,8 +601,8 @@ Value ArrayProtoFuncImp::call(ExecState *exec, Object &thisObj, const List &args
         }
     }
     double end = length;
-    if (args[1].type() != UndefinedType) {
-      end = args[1].toInteger(exec);
+    if (!args[1]->isUndefined()) {
+      end = args[1]->toInteger(exec);
       if (end < 0) { // false for NaN
         end += length;
         if (end < 0)
@@ -627,39 +618,38 @@ Value ArrayProtoFuncImp::call(ExecState *exec, Object &thisObj, const List &args
     int b = static_cast<int>(begin);
     int e = static_cast<int>(end);
     for(int k = b; k < e; k++, n++) {
-      Value obj;
-      if (thisImp->getProperty(exec, k, obj))
-        resObj.put(exec, n, obj);
+      ValueImp *obj;
+      if (thisObj->getProperty(exec, k, obj))
+        resObj->put(exec, n, obj);
     }
-    resObj.put(exec, lengthPropertyName, Number(n), DontEnum | DontDelete);
+    resObj->put(exec, lengthPropertyName, Number(n), DontEnum | DontDelete);
     break;
   }
   case Sort:{
 #if 0
     printf("KJS Array::Sort length=%d\n", length);
     for ( unsigned int i = 0 ; i<length ; ++i )
-      printf("KJS Array::Sort: %d: %s\n", i, thisObj.get(exec, i).toString(exec).ascii() );
+      printf("KJS Array::Sort: %d: %s\n", i, thisObj->get(exec, i)->toString(exec).ascii() );
 #endif
-    Object sortFunction;
-    bool useSortFunction = (args[0].type() != UndefinedType);
-    if (useSortFunction)
+    ObjectImp *sortFunction = NULL;
+    if (!args[0]->isUndefined())
       {
-        sortFunction = args[0].toObject(exec);
-        if (!sortFunction.implementsCall())
-          useSortFunction = false;
+        sortFunction = args[0]->toObject(exec);
+        if (!sortFunction->implementsCall())
+          sortFunction = NULL;
       }
     
-    if (thisImp->classInfo() == &ArrayInstanceImp::info) {
-      if (useSortFunction)
-        ((ArrayInstanceImp *)thisImp)->sort(exec, sortFunction);
+    if (thisObj->classInfo() == &ArrayInstanceImp::info) {
+      if (sortFunction)
+        ((ArrayInstanceImp *)thisObj)->sort(exec, sortFunction);
       else
-        ((ArrayInstanceImp *)thisImp)->sort(exec);
+        ((ArrayInstanceImp *)thisObj)->sort(exec);
       result = thisObj;
       break;
     }
 
     if (length == 0) {
-      thisObj.put(exec, lengthPropertyName, Number(0), DontEnum | DontDelete);
+      thisObj->put(exec, lengthPropertyName, Number(0), DontEnum | DontDelete);
       result = thisObj;
       break;
     }
@@ -668,24 +658,24 @@ Value ArrayProtoFuncImp::call(ExecState *exec, Object &thisObj, const List &args
     // or quicksort, and much less swapping than bubblesort/insertionsort.
     for ( unsigned int i = 0 ; i<length-1 ; ++i )
       {
-        Value iObj = thisObj.get(exec,i);
+        ValueImp *iObj = thisObj->get(exec,i);
         unsigned int themin = i;
-        Value minObj = iObj;
+        ValueImp *minObj = iObj;
         for ( unsigned int j = i+1 ; j<length ; ++j )
           {
-            Value jObj = thisObj.get(exec,j);
+            ValueImp *jObj = thisObj->get(exec,j);
             double cmp;
-            if (jObj.type() == UndefinedType) {
+            if (jObj->isUndefined()) {
               cmp = 1; // don't check minObj because there's no need to differentiate == (0) from > (1)
-            } else if (minObj.type() == UndefinedType) {
+            } else if (minObj->isUndefined()) {
               cmp = -1;
-            } else if (useSortFunction) {
+            } else if (sortFunction) {
                 List l;
                 l.append(jObj);
                 l.append(minObj);
-                cmp = sortFunction.call(exec, exec->dynamicInterpreter()->globalObject(), l).toNumber(exec);
+                cmp = sortFunction->call(exec, exec->dynamicInterpreter()->globalObject(), l)->toNumber(exec);
             } else {
-              cmp = (jObj.toString(exec) < minObj.toString(exec)) ? -1 : 1;
+              cmp = (jObj->toString(exec) < minObj->toString(exec)) ? -1 : 1;
             }
             if ( cmp < 0 )
               {
@@ -697,36 +687,36 @@ Value ArrayProtoFuncImp::call(ExecState *exec, Object &thisObj, const List &args
         if ( themin > i )
           {
             //printf("KJS Array::Sort: swapping %d and %d\n", i, themin );
-            thisObj.put( exec, i, minObj );
-            thisObj.put( exec, themin, iObj );
+            thisObj->put( exec, i, minObj );
+            thisObj->put( exec, themin, iObj );
           }
       }
 #if 0
     printf("KJS Array::Sort -- Resulting array:\n");
     for ( unsigned int i = 0 ; i<length ; ++i )
-      printf("KJS Array::Sort: %d: %s\n", i, thisObj.get(exec, i).toString(exec).ascii() );
+      printf("KJS Array::Sort: %d: %s\n", i, thisObj->get(exec, i)->toString(exec).ascii() );
 #endif
     result = thisObj;
     break;
   }
   case Splice: {
     // 15.4.4.12 - oh boy this is huge
-    Object resObj = Object::dynamicCast(exec->lexicalInterpreter()->builtinArray().construct(exec,List::empty()));
+    ObjectImp *resObj = static_cast<ObjectImp *>(exec->lexicalInterpreter()->builtinArray()->construct(exec,List::empty()));
     result = resObj;
-    int begin = args[0].toUInt32(exec);
+    int begin = args[0]->toUInt32(exec);
     if ( begin < 0 )
       begin = maxInt( begin + length, 0 );
     else
       begin = minInt( begin, length );
-    unsigned int deleteCount = minInt( maxInt( args[1].toUInt32(exec), 0 ), length - begin );
+    unsigned int deleteCount = minInt( maxInt( args[1]->toUInt32(exec), 0 ), length - begin );
 
     //printf( "Splicing from %d, deleteCount=%d \n", begin, deleteCount );
     for(unsigned int k = 0; k < deleteCount; k++) {
-      Value obj;
-      if (thisImp->getProperty(exec, k+begin, obj))
-        resObj.put(exec, k, obj);
+      ValueImp *obj;
+      if (thisObj->getProperty(exec, k+begin, obj))
+        resObj->put(exec, k, obj);
     }
-    resObj.put(exec, lengthPropertyName, Number(deleteCount), DontEnum | DontDelete);
+    resObj->put(exec, lengthPropertyName, Number(deleteCount), DontEnum | DontDelete);
 
     unsigned int additionalArgs = maxInt( args.size() - 2, 0 );
     if ( additionalArgs != deleteCount )
@@ -735,48 +725,48 @@ Value ArrayProtoFuncImp::call(ExecState *exec, Object &thisObj, const List &args
       {
         for ( unsigned int k = begin; k < length - deleteCount; ++k )
         {
-          Value obj;
-          if (thisImp->getProperty(exec, k+deleteCount, obj))
-            thisObj.put(exec, k+additionalArgs, obj);
+          ValueImp *obj;
+          if (thisObj->getProperty(exec, k+deleteCount, obj))
+            thisObj->put(exec, k+additionalArgs, obj);
           else
-            thisObj.deleteProperty(exec, k+additionalArgs);
+            thisObj->deleteProperty(exec, k+additionalArgs);
         }
         for ( unsigned int k = length ; k > length - deleteCount + additionalArgs; --k )
-          thisObj.deleteProperty(exec, k-1);
+          thisObj->deleteProperty(exec, k-1);
       }
       else
       {
         for ( unsigned int k = length - deleteCount; (int)k > begin; --k )
         {
-          Value obj;
-          if (thisImp->getProperty(exec, k + deleteCount - 1, obj))
-            thisObj.put(exec, k + additionalArgs - 1, obj);
+          ValueImp *obj;
+          if (thisObj->getProperty(exec, k + deleteCount - 1, obj))
+            thisObj->put(exec, k + additionalArgs - 1, obj);
           else
-            thisObj.deleteProperty(exec, k+additionalArgs-1);
+            thisObj->deleteProperty(exec, k+additionalArgs-1);
         }
       }
     }
     for ( unsigned int k = 0; k < additionalArgs; ++k )
     {
-      thisObj.put(exec, k+begin, args[k+2]);
+      thisObj->put(exec, k+begin, args[k+2]);
     }
-    thisObj.put(exec, lengthPropertyName, Number(length - deleteCount + additionalArgs), DontEnum | DontDelete);
+    thisObj->put(exec, lengthPropertyName, Number(length - deleteCount + additionalArgs), DontEnum | DontDelete);
     break;
   }
   case UnShift: { // 15.4.4.13
     unsigned int nrArgs = args.size();
     for ( unsigned int k = length; k > 0; --k )
     {
-      Value obj;
-      if (thisImp->getProperty(exec, k - 1, obj))
-        thisObj.put(exec, k+nrArgs-1, obj);
+      ValueImp *obj;
+      if (thisObj->getProperty(exec, k - 1, obj))
+        thisObj->put(exec, k+nrArgs-1, obj);
       else
-        thisObj.deleteProperty(exec, k+nrArgs-1);
+        thisObj->deleteProperty(exec, k+nrArgs-1);
     }
     for ( unsigned int k = 0; k < nrArgs; ++k )
-      thisObj.put(exec, k, args[k]);
+      thisObj->put(exec, k, args[k]);
     result = Number(length + nrArgs);
-    thisObj.put(exec, lengthPropertyName, result, DontEnum | DontDelete);
+    thisObj->put(exec, lengthPropertyName, result, DontEnum | DontDelete);
     break;
   }
   case Every:
@@ -787,15 +777,15 @@ Value ArrayProtoFuncImp::call(ExecState *exec, Object &thisObj, const List &args
     //http://developer-test.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:Array:forEach
     //http://developer-test.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:Array:some
     
-    Object eachFunction = args[0].toObject(exec);
+    ObjectImp *eachFunction = args[0]->toObject(exec);
     
-    if (!eachFunction.implementsCall()) {
-      Object err = Error::create(exec,TypeError);
+    if (!eachFunction->implementsCall()) {
+      ObjectImp *err = Error::create(exec,TypeError);
       exec->setException(err);
       return err;
     }
     
-    Object applyThis = args[1].imp()->isUndefinedOrNull() ? exec->dynamicInterpreter()->globalObject() :  args[1].toObject(exec);
+    ObjectImp *applyThis = args[1]->isUndefinedOrNull() ? exec->dynamicInterpreter()->globalObject() :  args[1]->toObject(exec);
     
     if (id == Some || id == Every)
       result = Boolean(id == Every);
@@ -806,11 +796,11 @@ Value ArrayProtoFuncImp::call(ExecState *exec, Object &thisObj, const List &args
       
       List eachArguments;
       
-      eachArguments.append(thisObj.get(exec, k));
+      eachArguments.append(thisObj->get(exec, k));
       eachArguments.append(Number(k));
       eachArguments.append(thisObj);
       
-      bool predicateResult = eachFunction.call(exec, applyThis, eachArguments).toBoolean(exec);
+      bool predicateResult = eachFunction->call(exec, applyThis, eachArguments)->toBoolean(exec);
       
       if (id == Every && !predicateResult) {
         result = Boolean(false);
@@ -826,6 +816,7 @@ Value ArrayProtoFuncImp::call(ExecState *exec, Object &thisObj, const List &args
     
   default:
     assert(0);
+    result = 0;
     break;
   }
   return result;
@@ -838,9 +829,8 @@ ArrayObjectImp::ArrayObjectImp(ExecState *exec,
                                ArrayPrototypeImp *arrayProto)
   : InternalFunctionImp(funcProto)
 {
-  Value protect(this);
   // ECMA 15.4.3.1 Array.prototype
-  put(exec,prototypePropertyName, Object(arrayProto), DontEnum|DontDelete|ReadOnly);
+  put(exec,prototypePropertyName, arrayProto, DontEnum|DontDelete|ReadOnly);
 
   // no. of arguments for constructor
   put(exec,lengthPropertyName, Number(1), ReadOnly|DontDelete|DontEnum);
@@ -852,21 +842,21 @@ bool ArrayObjectImp::implementsConstruct() const
 }
 
 // ECMA 15.4.2
-Object ArrayObjectImp::construct(ExecState *exec, const List &args)
+ObjectImp *ArrayObjectImp::construct(ExecState *exec, const List &args)
 {
   // a single numeric argument denotes the array size (!)
-  if (args.size() == 1 && args[0].type() == NumberType) {
-    uint32_t n = args[0].toUInt32(exec);
-    if (n != args[0].toNumber(exec)) {
-      Object error = Error::create(exec, RangeError, "Array size is not a small enough positive integer.");
+  if (args.size() == 1 && args[0]->isNumber()) {
+    uint32_t n = args[0]->toUInt32(exec);
+    if (n != args[0]->toNumber(exec)) {
+      ObjectImp *error = Error::create(exec, RangeError, "Array size is not a small enough positive integer.");
       exec->setException(error);
       return error;
     }
-    return Object(new ArrayInstanceImp(exec->lexicalInterpreter()->builtinArrayPrototype().imp(), n));
+    return new ArrayInstanceImp(exec->lexicalInterpreter()->builtinArrayPrototype(), n);
   }
 
   // otherwise the array is constructed with the arguments in it
-  return Object(new ArrayInstanceImp(exec->lexicalInterpreter()->builtinArrayPrototype().imp(), args));
+  return new ArrayInstanceImp(exec->lexicalInterpreter()->builtinArrayPrototype(), args);
 }
 
 bool ArrayObjectImp::implementsCall() const
@@ -875,7 +865,7 @@ bool ArrayObjectImp::implementsCall() const
 }
 
 // ECMA 15.6.1
-Value ArrayObjectImp::call(ExecState *exec, Object &/*thisObj*/, const List &args)
+ValueImp *ArrayObjectImp::callAsFunction(ExecState *exec, ObjectImp */*thisObj*/, const List &args)
 {
   // equivalent to 'new Array(....)'
   return construct(exec,args);
index a54db94a9448493d610dc23e6b44e2efa1a45305..802e913f98c95644ff9d2f271340230f4ba45f15 100644 (file)
@@ -41,7 +41,7 @@ namespace KJS {
     ArrayProtoFuncImp(ExecState *exec, int i, int len);
 
     virtual bool implementsCall() const;
-    virtual Value call(ExecState *exec, Object &thisObj, const List &args);
+    virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
 
     enum { ToString, ToLocaleString, Concat, Join, Pop, Push,
           Reverse, Shift, Slice, Sort, Splice, UnShift, 
@@ -57,9 +57,9 @@ namespace KJS {
                    ArrayPrototypeImp *arrayProto);
 
     virtual bool implementsConstruct() const;
-    virtual Object construct(ExecState *exec, const List &args);
+    virtual ObjectImp *construct(ExecState *exec, const List &args);
     virtual bool implementsCall() const;
-    virtual Value call(ExecState *exec, Object &thisObj, const List &args);
+    virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
 
   };
 
index 1cfe7a883afd5ebe6ea94a88fa14d3ba59a2fea9..908bc72874663ada4d9dbe47caa09a52851c19ce 100644 (file)
@@ -50,7 +50,6 @@ BooleanPrototypeImp::BooleanPrototypeImp(ExecState *exec,
                                          FunctionPrototypeImp *funcProto)
   : BooleanInstanceImp(objectProto)
 {
-  Value protect(this);
   // The constructor will be added later by InterpreterImp::InterpreterImp()
 
   putDirect(toStringPropertyName, new BooleanProtoFuncImp(exec,funcProto,BooleanProtoFuncImp::ToString,0), DontEnum);
@@ -65,7 +64,6 @@ BooleanProtoFuncImp::BooleanProtoFuncImp(ExecState *exec,
                                          FunctionPrototypeImp *funcProto, int i, int len)
   : InternalFunctionImp(funcProto), id(i)
 {
-  Value protect(this);
   putDirect(lengthPropertyName, len, DontDelete|ReadOnly|DontEnum);
 }
 
@@ -77,23 +75,23 @@ bool BooleanProtoFuncImp::implementsCall() const
 
 
 // ECMA 15.6.4.2 + 15.6.4.3
-Value BooleanProtoFuncImp::call(ExecState *exec, Object &thisObj, const List &/*args*/)
+ValueImp *BooleanProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &/*args*/)
 {
   // no generic function. "this" has to be a Boolean object
-  if (!thisObj.inherits(&BooleanInstanceImp::info)) {
-    Object err = Error::create(exec,TypeError);
+  if (!thisObj->inherits(&BooleanInstanceImp::info)) {
+    ObjectImp *err = Error::create(exec,TypeError);
     exec->setException(err);
     return err;
   }
 
   // execute "toString()" or "valueOf()", respectively
 
-  Value v = thisObj.internalValue();
-  assert(!v.isNull());
+  ValueImp *v = thisObj->internalValue();
+  assert(v);
 
   if (id == ToString)
-    return String(v.toString(exec));
-  return Boolean(v.toBoolean(exec)); /* TODO: optimize for bool case */
+    return String(v->toString(exec));
+  return Boolean(v->toBoolean(exec)); /* TODO: optimize for bool case */
 }
 
 // ------------------------------ BooleanObjectImp -----------------------------
@@ -103,11 +101,10 @@ BooleanObjectImp::BooleanObjectImp(ExecState *exec, FunctionPrototypeImp *funcPr
                                    BooleanPrototypeImp *booleanProto)
   : InternalFunctionImp(funcProto)
 {
-  Value protect(this);
   putDirect(prototypePropertyName, booleanProto, DontEnum|DontDelete|ReadOnly);
 
   // no. of arguments for constructor
-  putDirect(lengthPropertyName, NumberImp::one(), ReadOnly|DontDelete|DontEnum);
+  putDirect(lengthPropertyName, jsOne(), ReadOnly|DontDelete|DontEnum);
 }
 
 
@@ -117,17 +114,17 @@ bool BooleanObjectImp::implementsConstruct() const
 }
 
 // ECMA 15.6.2
-Object BooleanObjectImp::construct(ExecState *exec, const List &args)
+ObjectImp *BooleanObjectImp::construct(ExecState *exec, const List &args)
 {
-  Object obj(new BooleanInstanceImp(exec->lexicalInterpreter()->builtinBooleanPrototype().imp()));
+  ObjectImp *obj(new BooleanInstanceImp(exec->lexicalInterpreter()->builtinBooleanPrototype()));
 
-  Boolean b;
+  bool b;
   if (args.size() > 0)
-    b = args.begin()->dispatchToBoolean(exec);
+    b = args.begin()->toBoolean(exec);
   else
-    b = Boolean(false);
+    b = false;
 
-  obj.setInternalValue(b);
+  obj->setInternalValue(jsBoolean(b));
 
   return obj;
 }
@@ -138,11 +135,11 @@ bool BooleanObjectImp::implementsCall() const
 }
 
 // ECMA 15.6.1
-Value BooleanObjectImp::call(ExecState *exec, Object &/*thisObj*/, const List &args)
+ValueImp *BooleanObjectImp::callAsFunction(ExecState *exec, ObjectImp */*thisObj*/, const List &args)
 {
   if (args.isEmpty())
     return Boolean(false);
   else
-    return Boolean(args[0].toBoolean(exec)); /* TODO: optimize for bool case */
+    return Boolean(args[0]->toBoolean(exec)); /* TODO: optimize for bool case */
 }
 
index f32aef3dd20ab1f2497be1fb1640414f8da3345e..bda471fa500b7ab82ffa52b0c78ce25cc74d2b3f 100644 (file)
@@ -60,7 +60,7 @@ namespace KJS {
                         FunctionPrototypeImp *funcProto, int i, int len);
 
     virtual bool implementsCall() const;
-    virtual Value call(ExecState *exec, Object &thisObj, const List &args);
+    virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
 
     enum { ToString, ValueOf };
   private:
@@ -79,10 +79,10 @@ namespace KJS {
                      BooleanPrototypeImp *booleanProto);
 
     virtual bool implementsConstruct() const;
-    virtual Object construct(ExecState *exec, const List &args);
+    virtual ObjectImp *construct(ExecState *exec, const List &args);
 
     virtual bool implementsCall() const;
-    virtual Value call(ExecState *exec, Object &thisObj, const List &args);
+    virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
   };
 
 } // namespace
index 23a37dbfd0af71ce360157877b9202ff43899e98..fbdeba72234897dee70e8aa73ea9ff03c9eb30d0 100644 (file)
@@ -251,7 +251,7 @@ void Collector::markStackObjectsConservatively(void *start, void *end)
       }
       
       if (good && ((CollectorCell *)x)->u.freeCell.zeroIfFree != 0) {
-       ValueImp *imp = (ValueImp *)x;
+       AllocatedValueImp *imp = (AllocatedValueImp *)x;
        if (!imp->marked())
          imp->mark();
       }
@@ -370,14 +370,14 @@ bool Collector::collect()
       }
 
       CollectorCell *cell = curBlock->cells + i;
-      ValueImp *imp = reinterpret_cast<ValueImp *>(cell);
+      AllocatedValueImp *imp = reinterpret_cast<AllocatedValueImp *>(cell);
 
       if (cell->u.freeCell.zeroIfFree != 0) {
-       if (!imp->_marked)
+       if (!imp->m_marked)
        {
-         //fprintf(stderr, "Collector::deleting ValueImp %p (%s)\n", imp, className(imp));
+         //fprintf(stderr, "Collector::deleting AllocatedValueImp %p (%s)\n", imp, className(imp));
          // emulate destructing part of 'operator delete()'
-         imp->~ValueImp();
+         imp->~AllocatedValueImp();
          curBlock->usedCells--;
          numLiveObjects--;
          deleted = true;
@@ -388,7 +388,7 @@ bool Collector::collect()
          curBlock->freeList = cell;
 
        } else {
-         imp->_marked = false;
+         imp->m_marked = false;
        }
       } else {
        minimumCellsToProcess++;
@@ -422,10 +422,10 @@ bool Collector::collect()
   
   int cell = 0;
   while (cell < heap.usedOversizeCells) {
-    ValueImp *imp = (ValueImp *)heap.oversizeCells[cell];
+    AllocatedValueImp *imp = (AllocatedValueImp *)heap.oversizeCells[cell];
     
-    if (!imp->_marked) {
-      imp->~ValueImp();
+    if (!imp->m_marked) {
+      imp->~AllocatedValueImp();
 #if DEBUG_COLLECTOR
       heap.oversizeCells[cell]->u.freeCell.zeroIfFree = 0;
 #else
@@ -445,7 +445,7 @@ bool Collector::collect()
       }
 
     } else {
-      imp->_marked = false;
+      imp->m_marked = false;
       cell++;
     }
   }
@@ -508,7 +508,7 @@ int Collector::numReferencedObjects()
 static const char *className(ValueImp *val)
 {
   const char *name = "???";
-  switch (val->dispatchType()) {
+  switch (val->type()) {
     case UnspecifiedType:
       break;
     case UndefinedType:
index f4bfe99e28fe92735fc1730a485e50fb7146c386..38560049ef692c968aae5c67077263c34aca473c 100644 (file)
@@ -47,17 +47,16 @@ namespace KJS {
    */
   class Completion {
   public:
-    Completion(ComplType c = Normal, const Value& v = Value(),
-               const Identifier &t = Identifier::null())
+    Completion(ComplType c = Normal, ValueImp *v = NULL, const Identifier &t = Identifier::null())
         : comp(c), val(v), tar(t) { }
 
     ComplType complType() const { return comp; }
-    Value value() const { return val; }
+    ValueImp *value() const { return val; }
     Identifier target() const { return tar; }
-    bool isValueCompletion() const { return !val.isNull(); }
+    bool isValueCompletion() const { return val; }
   private:
     ComplType comp;
-    Value val;
+    ValueImp *val;
     Identifier tar;
   };
 
index b45f11d7eaf466dc0c35de34c7bc23d1c60366a7..c99b3beb597087d2f261155b3d7893aab9510094 100644 (file)
@@ -35,21 +35,21 @@ namespace KJS  {
    */
   class ContextImp {
   public:
-    ContextImp(Object &glob, InterpreterImp *, Object &thisV, CodeType type = GlobalCode,
+    ContextImp(ObjectImp *glob, InterpreterImp *, ObjectImp *thisV, CodeType type = GlobalCode,
                ContextImp *callingContext = 0, FunctionImp *functiion = 0, const List *args = 0);
     ~ContextImp();
 
     const ScopeChain &scopeChain() const { return scope; }
     CodeType codeType() { return m_codeType; }
-    Object variableObject() const { return variable; }
-    void setVariableObject(const Object &v) { variable = v; }
-    Object thisValue() const { return thisVal; }
+    ObjectImp *variableObject() const { return variable; }
+    void setVariableObject(ObjectImp *v) { variable = v; }
+    ObjectImp *thisValue() const { return thisVal; }
     ContextImp *callingContext() { return _callingContext; }
-    ObjectImp *activationObject() { return activation.imp(); }
+    ObjectImp *activationObject() { return activation; }
     FunctionImp *function() const { return _function; }
     const List *arguments() const { return _arguments; }
 
-    void pushScope(const Object &s) { scope.push(s.imp()); }
+    void pushScope(ObjectImp *s) { scope.push(s); }
     void popScope() { scope.pop(); }
     LabelStack *seenLabels() { return &ls; }
     
@@ -63,11 +63,11 @@ namespace KJS  {
     // because ContextImp is always allocated on the stack,
     // there is no need to protect various pointers from conservative
     // GC since they will be caught by the conservative sweep anyway!
-    Object activation;
+    ObjectImp *activation;
     
     ScopeChain scope;
-    Object variable;
-    Object thisVal;
+    ObjectImp *variable;
+    ObjectImp *thisVal;
 
     LabelStack ls;
     CodeType m_codeType;
index 454cd93c611aa7a6c2fee337845f87489c724ee4..cf0a4f11402a69bb9ab827be79ede6be1b722207 100644 (file)
@@ -269,12 +269,12 @@ static UString formatLocaleDate(KJS::ExecState *exec, double time, bool includeD
     UString    arg1String;
     bool       useCustomFormat = false;
     UString    customFormatString;
-    arg0String = args[0].toString(exec);
+    arg0String = args[0]->toString(exec);
     if ((arg0String == "custom") && (argCount >= 2)) {
        useCustomFormat = true;
-       customFormatString = args[1].toString(exec);
+       customFormatString = args[1]->toString(exec);
     } else if (includeDate && includeTime && (argCount >= 2)) {
-       arg1String = args[1].toString(exec);
+       arg1String = args[1]->toString(exec);
        dateStyle = styleFromArgString(arg0String,dateStyle);
        timeStyle = styleFromArgString(arg1String,timeStyle);
     } else if (includeDate && (argCount >= 1)) {
@@ -308,7 +308,7 @@ static UString formatLocaleDate(KJS::ExecState *exec, double time, bool includeD
 
 #endif // APPLE_CHANGES
 
-using namespace KJS;
+namespace KJS {
 
 static int day(double t)
 {
@@ -399,17 +399,17 @@ static double timeFromArgs(ExecState *exec, const List &args, int maxArgs, doubl
     // hours
     if (maxArgs >= 4 && idx < numArgs) {
         t->tm_hour = 0;
-        result = args[idx++].toInt32(exec) * msPerHour;
+        result = args[idx++]->toInt32(exec) * msPerHour;
     }
     // minutes
     if (maxArgs >= 3 && idx < numArgs) {
         t->tm_min = 0;
-        result += args[idx++].toInt32(exec) * msPerMinute;
+        result += args[idx++]->toInt32(exec) * msPerMinute;
     }
     // seconds
     if (maxArgs >= 2 && idx < numArgs) {
         t->tm_sec = 0;
-        result += args[idx++].toInt32(exec) * msPerSecond;
+        result += args[idx++]->toInt32(exec) * msPerSecond;
     }
     // read ms from args if present or add the old value
     result += idx < numArgs ? roundValue(exec, args[idx]) : ms;
@@ -485,8 +485,7 @@ DatePrototypeImp::DatePrototypeImp(ExecState *,
                                    ObjectPrototypeImp *objectProto)
   : DateInstanceImp(objectProto)
 {
-  Value protect(this);
-  setInternalValue(NumberImp::create(NaN));
+  setInternalValue(jsNaN());
   // The constructor will be added later, after DateObjectImp has been built
 }
 
@@ -499,11 +498,10 @@ bool DatePrototypeImp::getOwnPropertySlot(ExecState *exec, const Identifier& pro
 
 DateProtoFuncImp::DateProtoFuncImp(ExecState *exec, int i, int len)
   : InternalFunctionImp(
-    static_cast<FunctionPrototypeImp*>(exec->lexicalInterpreter()->builtinFunctionPrototype().imp())
+    static_cast<FunctionPrototypeImp*>(exec->lexicalInterpreter()->builtinFunctionPrototype())
     ), id(abs(i)), utc(i<0)
   // We use a negative ID to denote the "UTC" variant.
 {
-  Value protect(this);
   putDirect(lengthPropertyName, len, DontDelete|ReadOnly|DontEnum);
 }
 
@@ -512,21 +510,21 @@ bool DateProtoFuncImp::implementsCall() const
   return true;
 }
 
-Value DateProtoFuncImp::call(ExecState *exec, Object &thisObj, const List &args)
+ValueImp *DateProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
 {
   if ((id == ToString || id == ValueOf || id == GetTime || id == SetTime) &&
-      !thisObj.inherits(&DateInstanceImp::info)) {
+      !thisObj->inherits(&DateInstanceImp::info)) {
     // non-generic function called on non-date object
 
     // ToString and ValueOf are generic according to the spec, but the mozilla
     // tests suggest otherwise...
-    Object err = Error::create(exec,TypeError);
+    ObjectImp *err = Error::create(exec,TypeError);
     exec->setException(err);
     return err;
   }
 
 
-  Value result;
+  ValueImp *result = NULL;
   UString s;
 #if !APPLE_CHANGES
   const int bufsize=100;
@@ -535,8 +533,8 @@ Value DateProtoFuncImp::call(ExecState *exec, Object &thisObj, const List &args)
   if (!oldlocale.c_str())
     oldlocale = setlocale(LC_ALL, NULL);
 #endif
-  Value v = thisObj.internalValue();
-  double milli = v.toNumber(exec);
+  ValueImp *v = thisObj->internalValue();
+  double milli = v->toNumber(exec);
   
   if (isNaN(milli)) {
     switch (id) {
@@ -561,7 +559,7 @@ Value DateProtoFuncImp::call(ExecState *exec, Object &thisObj, const List &args)
       case GetSeconds:
       case GetMilliSeconds:
       case GetTimezoneOffset:
-        return Number(NaN);
+        return jsNaN();
     }
   }
   
@@ -707,7 +705,7 @@ Value DateProtoFuncImp::call(ExecState *exec, Object &thisObj, const List &args)
   case SetTime:
     milli = roundValue(exec, args[0]);
     result = Number(milli);
-    thisObj.setInternalValue(result);
+    thisObj->setInternalValue(result);
     break;
   case SetMilliSeconds:
     ms = roundValue(exec, args[0]);
@@ -723,22 +721,22 @@ Value DateProtoFuncImp::call(ExecState *exec, Object &thisObj, const List &args)
     break;
   case SetDate:
       t->tm_mday = 0;
-      ms += args[0].toInt32(exec) * msPerDay;
+      ms += args[0]->toInt32(exec) * msPerDay;
       break;
   case SetMonth:
-    t->tm_mon = args[0].toInt32(exec);
+    t->tm_mon = args[0]->toInt32(exec);
     if (args.size() >= 2)
-      t->tm_mday = args[1].toInt32(exec);
+      t->tm_mday = args[1]->toInt32(exec);
     break;
   case SetFullYear:
-    t->tm_year = args[0].toInt32(exec) - 1900;
+    t->tm_year = args[0]->toInt32(exec) - 1900;
     if (args.size() >= 2)
-      t->tm_mon = args[1].toInt32(exec);
+      t->tm_mon = args[1]->toInt32(exec);
     if (args.size() >= 3)
-      t->tm_mday = args[2].toInt32(exec);
+      t->tm_mday = args[2]->toInt32(exec);
     break;
   case SetYear:
-    t->tm_year = args[0].toInt32(exec) >= 1900 ? args[0].toInt32(exec) - 1900 : args[0].toInt32(exec);
+    t->tm_year = args[0]->toInt32(exec) >= 1900 ? args[0]->toInt32(exec) - 1900 : args[0]->toInt32(exec);
     break;
   }
 
@@ -746,7 +744,7 @@ Value DateProtoFuncImp::call(ExecState *exec, Object &thisObj, const List &args)
       id == SetMinutes || id == SetHours || id == SetDate ||
       id == SetMonth || id == SetFullYear ) {
     result = Number(makeTime(t, ms, utc));
-    thisObj.setInternalValue(result);
+    thisObj->setInternalValue(result);
   }
   
   return result;
@@ -761,8 +759,6 @@ DateObjectImp::DateObjectImp(ExecState *exec,
                              DatePrototypeImp *dateProto)
   : InternalFunctionImp(funcProto)
 {
-  Value protect(this);
-  
   // ECMA 15.9.4.1 Date.prototype
   putDirect(prototypePropertyName, dateProto, DontEnum|DontDelete|ReadOnly);
 
@@ -781,7 +777,7 @@ bool DateObjectImp::implementsConstruct() const
 }
 
 // ECMA 15.9.3
-Object DateObjectImp::construct(ExecState *exec, const List &args)
+ObjectImp *DateObjectImp::construct(ExecState *exec, const List &args)
 {
   int numArgs = args.size();
 
@@ -807,38 +803,37 @@ Object DateObjectImp::construct(ExecState *exec, const List &args)
 #endif
     value = utc;
   } else if (numArgs == 1) {
-      if (args[0].type() == StringType)
-          value = parseDate(args[0].toString(exec));
+      if (args[0]->isString())
+          value = parseDate(args[0]->toString(exec));
       else
-          value = args[0].toPrimitive(exec).toNumber(exec);
+          value = args[0]->toPrimitive(exec)->toNumber(exec);
   } else {
     struct tm t;
     memset(&t, 0, sizeof(t));
-    if (isNaN(args[0].toNumber(exec))
-        || isNaN(args[1].toNumber(exec))
-        || (numArgs >= 3 && isNaN(args[2].toNumber(exec)))
-        || (numArgs >= 4 && isNaN(args[3].toNumber(exec)))
-        || (numArgs >= 5 && isNaN(args[4].toNumber(exec)))
-        || (numArgs >= 6 && isNaN(args[5].toNumber(exec)))
-        || (numArgs >= 7 && isNaN(args[6].toNumber(exec)))) {
+    if (isNaN(args[0]->toNumber(exec))
+        || isNaN(args[1]->toNumber(exec))
+        || (numArgs >= 3 && isNaN(args[2]->toNumber(exec)))
+        || (numArgs >= 4 && isNaN(args[3]->toNumber(exec)))
+        || (numArgs >= 5 && isNaN(args[4]->toNumber(exec)))
+        || (numArgs >= 6 && isNaN(args[5]->toNumber(exec)))
+        || (numArgs >= 7 && isNaN(args[6]->toNumber(exec)))) {
       value = NaN;
     } else {
-      int year = args[0].toInt32(exec);
+      int year = args[0]->toInt32(exec);
       t.tm_year = (year >= 0 && year <= 99) ? year : year - 1900;
-      t.tm_mon = args[1].toInt32(exec);
-      t.tm_mday = (numArgs >= 3) ? args[2].toInt32(exec) : 1;
-      t.tm_hour = (numArgs >= 4) ? args[3].toInt32(exec) : 0;
-      t.tm_min = (numArgs >= 5) ? args[4].toInt32(exec) : 0;
-      t.tm_sec = (numArgs >= 6) ? args[5].toInt32(exec) : 0;
+      t.tm_mon = args[1]->toInt32(exec);
+      t.tm_mday = (numArgs >= 3) ? args[2]->toInt32(exec) : 1;
+      t.tm_hour = (numArgs >= 4) ? args[3]->toInt32(exec) : 0;
+      t.tm_min = (numArgs >= 5) ? args[4]->toInt32(exec) : 0;
+      t.tm_sec = (numArgs >= 6) ? args[5]->toInt32(exec) : 0;
       t.tm_isdst = -1;
       double ms = (numArgs >= 7) ? roundValue(exec, args[6]) : 0;
       value = makeTime(&t, ms, false);
     }
   }
   
-  Object proto = exec->lexicalInterpreter()->builtinDatePrototype();
-  Object ret(new DateInstanceImp(proto.imp()));
-  ret.setInternalValue(Number(timeClip(value)));
+  DateInstanceImp *ret = new DateInstanceImp(exec->lexicalInterpreter()->builtinDatePrototype());
+  ret->setInternalValue(Number(timeClip(value)));
   return ret;
 }
 
@@ -848,11 +843,8 @@ bool DateObjectImp::implementsCall() const
 }
 
 // ECMA 15.9.2
-Value DateObjectImp::call(ExecState */*exec*/, Object &/*thisObj*/, const List &/*args*/)
+ValueImp *DateObjectImp::callAsFunction(ExecState */*exec*/, ObjectImp */*thisObj*/, const List &/*args*/)
 {
-#ifdef KJS_VERBOSE
-  fprintf(stderr,"DateObjectImp::call - current time\n");
-#endif
   time_t t = time(0L);
 #if APPLE_CHANGES
   struct tm *tm = localtime(&t);
@@ -871,7 +863,6 @@ DateObjectFuncImp::DateObjectFuncImp(ExecState *exec, FunctionPrototypeImp *func
                                      int i, int len)
   : InternalFunctionImp(funcProto), id(i)
 {
-  Value protect(this);
   putDirect(lengthPropertyName, len, DontDelete|ReadOnly|DontEnum);
 }
 
@@ -881,31 +872,31 @@ bool DateObjectFuncImp::implementsCall() const
 }
 
 // ECMA 15.9.4.2 - 3
-Value DateObjectFuncImp::call(ExecState *exec, Object &/*thisObj*/, const List &args)
+ValueImp *DateObjectFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
 {
   if (id == Parse) {
-    return Number(parseDate(args[0].toString(exec)));
+    return Number(parseDate(args[0]->toString(exec)));
   }
   else { // UTC
     struct tm t;
     memset(&t, 0, sizeof(t));
     int n = args.size();
-    if (isNaN(args[0].toNumber(exec))
-        || isNaN(args[1].toNumber(exec))
-        || (n >= 3 && isNaN(args[2].toNumber(exec)))
-        || (n >= 4 && isNaN(args[3].toNumber(exec)))
-        || (n >= 5 && isNaN(args[4].toNumber(exec)))
-        || (n >= 6 && isNaN(args[5].toNumber(exec)))
-        || (n >= 7 && isNaN(args[6].toNumber(exec)))) {
+    if (isNaN(args[0]->toNumber(exec))
+        || isNaN(args[1]->toNumber(exec))
+        || (n >= 3 && isNaN(args[2]->toNumber(exec)))
+        || (n >= 4 && isNaN(args[3]->toNumber(exec)))
+        || (n >= 5 && isNaN(args[4]->toNumber(exec)))
+        || (n >= 6 && isNaN(args[5]->toNumber(exec)))
+        || (n >= 7 && isNaN(args[6]->toNumber(exec)))) {
       return Number(NaN);
     }
-    int year = args[0].toInt32(exec);
+    int year = args[0]->toInt32(exec);
     t.tm_year = (year >= 0 && year <= 99) ? year : year - 1900;
-    t.tm_mon = args[1].toInt32(exec);
-    t.tm_mday = (n >= 3) ? args[2].toInt32(exec) : 1;
-    t.tm_hour = (n >= 4) ? args[3].toInt32(exec) : 0;
-    t.tm_min = (n >= 5) ? args[4].toInt32(exec) : 0;
-    t.tm_sec = (n >= 6) ? args[5].toInt32(exec) : 0;
+    t.tm_mon = args[1]->toInt32(exec);
+    t.tm_mday = (n >= 3) ? args[2]->toInt32(exec) : 1;
+    t.tm_hour = (n >= 4) ? args[3]->toInt32(exec) : 0;
+    t.tm_min = (n >= 5) ? args[4]->toInt32(exec) : 0;
+    t.tm_sec = (n >= 6) ? args[5]->toInt32(exec) : 0;
     double ms = (n >= 7) ? roundValue(exec, args[6]) : 0;
     return Number(makeTime(&t, ms, true));
   }
@@ -914,7 +905,7 @@ Value DateObjectFuncImp::call(ExecState *exec, Object &/*thisObj*/, const List &
 // -----------------------------------------------------------------------------
 
 
-double KJS::parseDate(const UString &u)
+double parseDate(const UString &u)
 {
 #ifdef KJS_VERBOSE
   fprintf(stderr,"KJS::parseDate %s\n",u.ascii());
@@ -1027,7 +1018,7 @@ static int findMonth(const char *monthStr)
   return -1;
 }
 
-double KJS::KRFCDate_parseDate(const UString &_date)
+double KRFCDate_parseDate(const UString &_date)
 {
      // This parse a date in the form:
      //     Tuesday, 09-Nov-99 23:12:40 GMT
@@ -1344,7 +1335,7 @@ double KJS::KRFCDate_parseDate(const UString &_date)
 }
 
 
-double KJS::timeClip(double t)
+double timeClip(double t)
 {
     if (!isfinite(t))
         return NaN;
@@ -1353,3 +1344,5 @@ double KJS::timeClip(double t)
         return NaN;
     return copysign(floor(at), t);
 }
+
+}
index dfe8a7802f6e0e63357a6359f43b4772acea5469..6058cd95ebfdc4136ce1a411157f461e98816a28 100644 (file)
@@ -62,7 +62,7 @@ namespace KJS {
     DateProtoFuncImp(ExecState *exec, int i, int len);
 
     virtual bool implementsCall() const;
-    virtual Value call(ExecState *exec, Object &thisObj, const List &args);
+    virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
 
 
     Completion execute(const List &);
@@ -91,12 +91,12 @@ namespace KJS {
                   DatePrototypeImp *dateProto);
 
     virtual bool implementsConstruct() const;
-    virtual Object construct(ExecState *exec, const List &args);
+    virtual ObjectImp *construct(ExecState *exec, const List &args);
     virtual bool implementsCall() const;
-    virtual Value call(ExecState *exec, Object &thisObj, const List &args);
+    virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
 
     Completion execute(const List &);
-    Object construct(const List &);
+    ObjectImp *construct(const List &);
   };
 
   /**
@@ -111,7 +111,7 @@ namespace KJS {
                       int i, int len);
 
     virtual bool implementsCall() const;
-    virtual Value call(ExecState *exec, Object &thisObj, const List &args);
+    virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
 
     enum { Parse, UTC };
   private:
index b18da3758d2d14972cb81d1b75d562e4d46f9bbf..89e467ff00ba6399512a967971a80c4ef579c440 100644 (file)
@@ -99,7 +99,7 @@ bool Debugger::sourceUnused(ExecState */*exec*/, int /*sourceId*/)
 }
 
 bool Debugger::exception(ExecState */*exec*/, int /*sourceId*/, int /*lineno*/,
-                         Object &/*exceptionObj*/)
+                         ObjectImp */*exceptionObj*/)
 {
   return true;
 }
@@ -111,13 +111,13 @@ bool Debugger::atStatement(ExecState */*exec*/, int /*sourceId*/, int /*firstLin
 }
 
 bool Debugger::callEvent(ExecState */*exec*/, int /*sourceId*/, int /*lineno*/,
-                         Object &/*function*/, const List &/*args*/)
+                         ObjectImp */*function*/, const List &/*args*/)
 {
   return true;
 }
 
 bool Debugger::returnEvent(ExecState */*exec*/, int /*sourceId*/, int /*lineno*/,
-                           Object &/*function*/)
+                           ObjectImp */*function*/)
 {
   return true;
 }
index 2992bd3c45d72ad74c47c7cdddf359846ec59043..04d89b0f917aabd100459a23eae0f9d5f470108f 100644 (file)
@@ -28,7 +28,7 @@ namespace KJS {
   class DebuggerImp;
   class Interpreter;
   class ExecState;
-  class Object;
+  class ObjectImp;
   class UString;
   class List;
 
@@ -141,7 +141,7 @@ namespace KJS {
      * be aborted
      */
     virtual bool exception(ExecState *exec, int sourceId, int lineno,
-                           Object &exceptionObj);
+                           ObjectImp *exceptionObj);
 
     /**
      * Called when a line of the script is reached (before it is executed)
@@ -181,7 +181,7 @@ namespace KJS {
      * be aborted
      */
     virtual bool callEvent(ExecState *exec, int sourceId, int lineno,
-                          Object &function, const List &args);
+                          ObjectImp *function, const List &args);
 
     /**
      * Called on each function exit. The function being returned from is that
@@ -202,7 +202,7 @@ namespace KJS {
      * be aborted
      */
     virtual bool returnEvent(ExecState *exec, int sourceId, int lineno,
-                             Object &function);
+                             ObjectImp *function);
 
   private:
     DebuggerImp *rep;
index a77e523daf8260f52f0b01b18a894a6dd915ebe0..377db2daec5af738c9e32b4fa93509f6457a8af3 100644 (file)
@@ -47,7 +47,6 @@ ErrorPrototypeImp::ErrorPrototypeImp(ExecState *exec,
                                      FunctionPrototypeImp *funcProto)
   : ObjectImp(objectProto)
 {
-  Value protect(this);
   setInternalValue(Undefined());
   // The constructor will be added later in ErrorObjectImp's constructor
 
@@ -61,8 +60,7 @@ ErrorPrototypeImp::ErrorPrototypeImp(ExecState *exec,
 ErrorProtoFuncImp::ErrorProtoFuncImp(ExecState *exec, FunctionPrototypeImp *funcProto)
   : InternalFunctionImp(funcProto)
 {
-  Value protect(this);
-  putDirect(lengthPropertyName, NumberImp::zero(), DontDelete|ReadOnly|DontEnum);
+  putDirect(lengthPropertyName, jsZero(), DontDelete|ReadOnly|DontEnum);
 }
 
 bool ErrorProtoFuncImp::implementsCall() const
@@ -70,19 +68,19 @@ bool ErrorProtoFuncImp::implementsCall() const
   return true;
 }
 
-Value ErrorProtoFuncImp::call(ExecState *exec, Object &thisObj, const List &/*args*/)
+ValueImp *ErrorProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &/*args*/)
 {
   // toString()
   UString s = "Error";
 
-  Value v = thisObj.get(exec, namePropertyName);
-  if (v.type() != UndefinedType) {
-    s = v.toString(exec);
+  ValueImp *v = thisObj->get(exec, namePropertyName);
+  if (!v->isUndefined()) {
+    s = v->toString(exec);
   }
 
-  v = thisObj.get(exec, messagePropertyName);
-  if (v.type() != UndefinedType) {
-    s += ": " + v.toString(exec); // Mozilla compatible format
+  v = thisObj->get(exec, messagePropertyName);
+  if (!v->isUndefined()) {
+    s += ": " + v->toString(exec); // Mozilla compatible format
   }
 
   return String(s);
@@ -94,10 +92,9 @@ ErrorObjectImp::ErrorObjectImp(ExecState *exec, FunctionPrototypeImp *funcProto,
                                ErrorPrototypeImp *errorProto)
   : InternalFunctionImp(funcProto)
 {
-  Value protect(this);
   // ECMA 15.11.3.1 Error.prototype
   putDirect(prototypePropertyName, errorProto, DontEnum|DontDelete|ReadOnly);
-  putDirect(lengthPropertyName, NumberImp::one(), DontDelete|ReadOnly|DontEnum);
+  putDirect(lengthPropertyName, jsOne(), DontDelete|ReadOnly|DontEnum);
   //putDirect(namePropertyName, String(n));
 }
 
@@ -107,15 +104,14 @@ bool ErrorObjectImp::implementsConstruct() const
 }
 
 // ECMA 15.9.3
-Object ErrorObjectImp::construct(ExecState *exec, const List &args)
+ObjectImp *ErrorObjectImp::construct(ExecState *exec, const List &args)
 {
-  Object proto = Object::dynamicCast(exec->lexicalInterpreter()->builtinErrorPrototype());
-  ObjectImp *imp = new ErrorInstanceImp(proto.imp());
-  Object obj(imp);
+  ObjectImp *proto = static_cast<ObjectImp *>(exec->lexicalInterpreter()->builtinErrorPrototype());
+  ObjectImp *imp = new ErrorInstanceImp(proto);
+  ObjectImp *obj(imp);
 
-  if (!args.isEmpty() && args[0].type() != UndefinedType) {
-    imp->putDirect(messagePropertyName, new StringImp(args[0].toString(exec)));
-  }
+  if (!args[0]->isUndefined())
+    imp->putDirect(messagePropertyName, jsString(args[0]->toString(exec)));
 
   return obj;
 }
@@ -126,7 +122,7 @@ bool ErrorObjectImp::implementsCall() const
 }
 
 // ECMA 15.9.2
-Value ErrorObjectImp::call(ExecState *exec, Object &/*thisObj*/, const List &args)
+ValueImp *ErrorObjectImp::callAsFunction(ExecState *exec, ObjectImp */*thisObj*/, const List &args)
 {
   // "Error()" gives the sames result as "new Error()"
   return construct(exec,args);
@@ -138,10 +134,9 @@ NativeErrorPrototypeImp::NativeErrorPrototypeImp(ExecState *exec, ErrorPrototype
                                                  ErrorType et, UString name, UString message)
   : ObjectImp(errorProto)
 {
-  Value protect(this);
   errType = et;
-  putDirect(namePropertyName, new StringImp(name), 0);
-  putDirect(messagePropertyName, new StringImp(message), 0);
+  putDirect(namePropertyName, jsString(name), 0);
+  putDirect(messagePropertyName, jsString(message), 0);
 }
 
 // ------------------------------ NativeErrorImp -------------------------------
@@ -149,13 +144,12 @@ NativeErrorPrototypeImp::NativeErrorPrototypeImp(ExecState *exec, ErrorPrototype
 const ClassInfo NativeErrorImp::info = {"Function", &InternalFunctionImp::info, 0, 0};
 
 NativeErrorImp::NativeErrorImp(ExecState *exec, FunctionPrototypeImp *funcProto,
-                               const Object &prot)
+                               ObjectImp *prot)
   : InternalFunctionImp(funcProto), proto(0)
 {
-  Value protect(this);
-  proto = static_cast<ObjectImp*>(prot.imp());
+  proto = static_cast<ObjectImp*>(prot);
 
-  putDirect(lengthPropertyName, NumberImp::one(), DontDelete|ReadOnly|DontEnum); // ECMA 15.11.7.5
+  putDirect(lengthPropertyName, jsOne(), DontDelete|ReadOnly|DontEnum); // ECMA 15.11.7.5
   putDirect(prototypePropertyName, proto, DontDelete|ReadOnly|DontEnum);
 }
 
@@ -164,12 +158,12 @@ bool NativeErrorImp::implementsConstruct() const
   return true;
 }
 
-Object NativeErrorImp::construct(ExecState *exec, const List &args)
+ObjectImp *NativeErrorImp::construct(ExecState *exec, const List &args)
 {
   ObjectImp *imp = new ErrorInstanceImp(proto);
-  Object obj(imp);
-  if (args[0].type() != UndefinedType)
-    imp->putDirect(messagePropertyName, new StringImp(args[0].toString(exec)));
+  ObjectImp *obj(imp);
+  if (!args[0]->isUndefined())
+    imp->putDirect(messagePropertyName, jsString(args[0]->toString(exec)));
   return obj;
 }
 
@@ -178,7 +172,7 @@ bool NativeErrorImp::implementsCall() const
   return true;
 }
 
-Value NativeErrorImp::call(ExecState *exec, Object &/*thisObj*/, const List &args)
+ValueImp *NativeErrorImp::callAsFunction(ExecState *exec, ObjectImp */*thisObj*/, const List &args)
 {
   return construct(exec,args);
 }
index ca1cab0814d9b9a9f15676cc352997b47963e3c1..973603e10dd7a8dd74f433f19b67f3b346d18b84 100644 (file)
@@ -46,7 +46,7 @@ namespace KJS {
   public:
     ErrorProtoFuncImp(ExecState *exec, FunctionPrototypeImp *funcProto);
     virtual bool implementsCall() const;
-    virtual Value call(ExecState *exec, Object &thisObj, const List &args);
+    virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
   };
 
   class ErrorObjectImp : public InternalFunctionImp {
@@ -55,10 +55,10 @@ namespace KJS {
                    ErrorPrototypeImp *errorProto);
 
     virtual bool implementsConstruct() const;
-    virtual Object construct(ExecState *exec, const List &args);
+    virtual ObjectImp *construct(ExecState *exec, const List &args);
 
     virtual bool implementsCall() const;
-    virtual Value call(ExecState *exec, Object &thisObj, const List &args);
+    virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
   };
 
   class NativeErrorPrototypeImp : public ObjectImp {
@@ -72,12 +72,12 @@ namespace KJS {
   class NativeErrorImp : public InternalFunctionImp {
   public:
     NativeErrorImp(ExecState *exec, FunctionPrototypeImp *funcProto,
-                   const Object &prot);
+                   ObjectImp *prot);
 
     virtual bool implementsConstruct() const;
-    virtual Object construct(ExecState *exec, const List &args);
+    virtual ObjectImp *construct(ExecState *exec, const List &args);
     virtual bool implementsCall() const;
-    virtual Value call(ExecState *exec, Object &thisObj, const List &args);
+    virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
 
     virtual void mark();
 
index 007587111f4e3052bbbed4647465148ae898c28d..e4e44278e3a02e838281a5ac1332fe8da737f95b 100644 (file)
@@ -58,7 +58,7 @@ const ClassInfo FunctionImp::info = {"Function", &InternalFunctionImp::info, 0,
 
 FunctionImp::FunctionImp(ExecState *exec, const Identifier &n)
   : InternalFunctionImp(
-      static_cast<FunctionPrototypeImp*>(exec->lexicalInterpreter()->builtinFunctionPrototype().imp())
+      static_cast<FunctionPrototypeImp*>(exec->lexicalInterpreter()->builtinFunctionPrototype())
       ), param(0L), ident(n)
 {
 }
@@ -73,9 +73,9 @@ bool FunctionImp::implementsCall() const
   return true;
 }
 
-Value FunctionImp::call(ExecState *exec, Object &thisObj, const List &args)
+ValueImp *FunctionImp::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
 {
-  Object &globalObj = exec->dynamicInterpreter()->globalObject();
+  ObjectImp *globalObj = exec->dynamicInterpreter()->globalObject();
 
   // enter a new execution context
   ContextImp ctx(globalObj, exec->dynamicInterpreter()->imp(), thisObj, codeType(),
@@ -97,8 +97,7 @@ Value FunctionImp::call(ExecState *exec, Object &thisObj, const List &args)
       lineno = static_cast<DeclaredFunctionImp*>(this)->body->firstLine();
     }
 
-    Object func(this);
-    bool cont = dbg->callEvent(&newExec,sid,lineno,func,args);
+    bool cont = dbg->callEvent(&newExec,sid,lineno,this,args);
     if (!cont) {
       dbg->imp()->abort();
       return Undefined();
@@ -127,8 +126,7 @@ Value FunctionImp::call(ExecState *exec, Object &thisObj, const List &args)
     if (comp.complType() == Throw)
         newExec.setException(comp.value());
 
-    Object func(this);
-    int cont = dbg->returnEvent(&newExec,sid,lineno,func);
+    int cont = dbg->returnEvent(&newExec,sid,lineno,this);
     if (!cont) {
       dbg->imp()->abort();
       return Undefined();
@@ -172,7 +170,7 @@ UString FunctionImp::parameterString() const
 // ECMA 10.1.3q
 void FunctionImp::processParameters(ExecState *exec, const List &args)
 {
-  Object variable = exec->context().imp()->variableObject();
+  ObjectImp *variable = exec->context().imp()->variableObject();
 
 #ifdef KJS_VERBOSE
   fprintf(stderr, "---------------------------------------------------\n"
@@ -189,10 +187,10 @@ void FunctionImp::processParameters(ExecState *exec, const List &args)
        fprintf(stderr, "setting parameter %s ", p->name.ascii());
        printInfo(exec,"to", *it);
 #endif
-       variable.put(exec, p->name, *it);
+       variable->put(exec, p->name, *it);
        it++;
       } else
-       variable.put(exec, p->name, Undefined());
+       variable->put(exec, p->name, Undefined());
       p = p->next;
     }
   }
@@ -208,7 +206,7 @@ void FunctionImp::processVarDecls(ExecState */*exec*/)
 {
 }
 
-Value FunctionImp::argumentsGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+ValueImp *FunctionImp::argumentsGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
 {
   FunctionImp *thisObj = static_cast<FunctionImp *>(slot.slotBase());
   ContextImp *context = exec->_context;
@@ -221,7 +219,7 @@ Value FunctionImp::argumentsGetter(ExecState *exec, const Identifier& propertyNa
   return Null();
 }
 
-Value FunctionImp::lengthGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+ValueImp *FunctionImp::lengthGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
 {
   FunctionImp *thisObj = static_cast<FunctionImp *>(slot.slotBase());
   const Parameter *p = thisObj->param;
@@ -250,7 +248,7 @@ bool FunctionImp::getOwnPropertySlot(ExecState *exec, const Identifier& property
     return InternalFunctionImp::getOwnPropertySlot(exec, propertyName, slot);
 }
 
-void FunctionImp::put(ExecState *exec, const Identifier &propertyName, const Value &value, int attr)
+void FunctionImp::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
 {
     if (propertyName == exec->dynamicInterpreter()->argumentsIdentifier() || propertyName == lengthPropertyName)
         return;
@@ -305,7 +303,6 @@ DeclaredFunctionImp::DeclaredFunctionImp(ExecState *exec, const Identifier &n,
                                         FunctionBodyNode *b, const ScopeChain &sc)
   : FunctionImp(exec,n), body(b)
 {
-  Value protect(this);
   body->ref();
   setScope(sc);
 }
@@ -322,21 +319,21 @@ bool DeclaredFunctionImp::implementsConstruct() const
 }
 
 // ECMA 13.2.2 [[Construct]]
-Object DeclaredFunctionImp::construct(ExecState *exec, const List &args)
+ObjectImp *DeclaredFunctionImp::construct(ExecState *exec, const List &args)
 {
-  Object proto;
-  Value p = get(exec,prototypePropertyName);
-  if (p.type() == ObjectType)
-    proto = Object(static_cast<ObjectImp*>(p.imp()));
+  ObjectImp *proto;
+  ValueImp *p = get(exec,prototypePropertyName);
+  if (p->isObject())
+    proto = static_cast<ObjectImp*>(p);
   else
     proto = exec->lexicalInterpreter()->builtinObjectPrototype();
 
-  Object obj(new ObjectImp(proto));
+  ObjectImp *obj(new ObjectImp(proto));
 
-  Value res = call(exec,obj,args);
+  ValueImp *res = call(exec,obj,args);
 
-  if (res.type() == ObjectType)
-    return Object::dynamicCast(res);
+  if (res->isObject())
+    return static_cast<ObjectImp *>(res);
   else
     return obj;
 }
@@ -433,7 +430,6 @@ ArgumentsImp::ArgumentsImp(ExecState *exec, FunctionImp *func, const List &args,
 _activationObject(act),
 indexToNameMap(func, args)
 {
-  Value protect(this);
   putDirect(calleePropertyName, func, DontEnum);
   putDirect(lengthPropertyName, args.size(), DontEnum);
   
@@ -453,7 +449,7 @@ void ArgumentsImp::mark()
     _activationObject->mark();
 }
 
-Value ArgumentsImp::mappedIndexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+ValueImp *ArgumentsImp::mappedIndexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
 {
   ArgumentsImp *thisObj = static_cast<ArgumentsImp *>(slot.slotBase());
   return thisObj->_activationObject->get(exec, thisObj->indexToNameMap[propertyName]);
@@ -469,7 +465,7 @@ bool ArgumentsImp::getOwnPropertySlot(ExecState *exec, const Identifier& propert
   return ObjectImp::getOwnPropertySlot(exec, propertyName, slot);
 }
 
-void ArgumentsImp::put(ExecState *exec, const Identifier &propertyName, const Value &value, int attr)
+void ArgumentsImp::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
 {
   if (indexToNameMap.isMapped(propertyName)) {
     _activationObject->put(exec, indexToNameMap[propertyName], value, attr);
@@ -500,7 +496,7 @@ ActivationImp::ActivationImp(FunctionImp *function, const List &arguments)
   // FIXME: Do we need to support enumerating the arguments property?
 }
 
-Value ActivationImp::argumentsGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
+ValueImp *ActivationImp::argumentsGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
 {
   ActivationImp *thisObj = static_cast<ActivationImp *>(slot.slotBase());
 
@@ -508,7 +504,7 @@ Value ActivationImp::argumentsGetter(ExecState *exec, const Identifier& property
   if (!thisObj->_argumentsObject)
     thisObj->createArgumentsObject(exec);
   
-  return Value(thisObj->_argumentsObject);
+  return thisObj->_argumentsObject;
 }
 
 PropertySlot::GetValueFunc ActivationImp::getArgumentsGetter()
@@ -558,7 +554,6 @@ void ActivationImp::createArgumentsObject(ExecState *exec) const
 GlobalFuncImp::GlobalFuncImp(ExecState *exec, FunctionPrototypeImp *funcProto, int i, int len)
   : InternalFunctionImp(funcProto), id(i)
 {
-  Value protect(this);
   putDirect(lengthPropertyName, len, DontDelete|ReadOnly|DontEnum);
 }
 
@@ -572,9 +567,9 @@ bool GlobalFuncImp::implementsCall() const
   return true;
 }
 
-static Value encode(ExecState *exec, const List &args, const char *do_not_escape)
+static ValueImp *encode(ExecState *exec, const List &args, const char *do_not_escape)
 {
-  UString r = "", s, str = args[0].toString(exec);
+  UString r = "", s, str = args[0]->toString(exec);
   CString cstr = str.UTF8String();
   const char *p = cstr.c_str();
   for (int k = 0; k < cstr.size(); k++, p++) {
@@ -590,9 +585,9 @@ static Value encode(ExecState *exec, const List &args, const char *do_not_escape
   return String(r);
 }
 
-static Value decode(ExecState *exec, const List &args, const char *do_not_unescape, bool strict)
+static ValueImp *decode(ExecState *exec, const List &args, const char *do_not_unescape, bool strict)
 {
-  UString s = "", str = args[0].toString(exec);
+  UString s = "", str = args[0]->toString(exec);
   int k = 0, len = str.size();
   const UChar *d = str.data();
   UChar u;
@@ -634,7 +629,7 @@ static Value decode(ExecState *exec, const List &args, const char *do_not_unesca
       }
       if (charLen == 0) {
         if (strict) {
-         Object error = Error::create(exec, URIError);
+         ObjectImp *error = Error::create(exec, URIError);
           exec->setException(error);
           return error;
         }
@@ -767,9 +762,9 @@ static double parseFloat(const UString &s)
     return s.toDouble( true /*tolerant*/, false /* NaN for empty string */ );
 }
 
-Value GlobalFuncImp::call(ExecState *exec, Object &/*thisObj*/, const List &args)
+ValueImp *GlobalFuncImp::callAsFunction(ExecState *exec, ObjectImp */*thisObj*/, const List &args)
 {
-  Value res;
+  ValueImp *res = jsUndefined();
 
   static const char do_not_escape[] =
     "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
@@ -792,11 +787,11 @@ Value GlobalFuncImp::call(ExecState *exec, Object &/*thisObj*/, const List &args
 
   switch (id) {
     case Eval: { // eval()
-      Value x = args[0];
-      if (x.type() != StringType)
+      ValueImp *x = args[0];
+      if (!x->isString())
         return x;
       else {
-        UString s = x.toString(exec);
+        UString s = x->toString(exec);
         
         int sid;
         int errLine;
@@ -812,8 +807,8 @@ Value GlobalFuncImp::call(ExecState *exec, Object &/*thisObj*/, const List &args
 
         // no program node means a syntax occurred
         if (!progNode) {
-          Object err = Error::create(exec,SyntaxError,errMsg.ascii(),errLine);
-          err.put(exec,"sid",Number(sid));
+          ObjectImp *err = Error::create(exec,SyntaxError,errMsg.ascii(),errLine);
+          err->put(exec,"sid",Number(sid));
           exec->setException(err);
           return err;
         }
@@ -821,7 +816,7 @@ Value GlobalFuncImp::call(ExecState *exec, Object &/*thisObj*/, const List &args
         progNode->ref();
         
         // enter a new execution context
-        Object thisVal(Object::dynamicCast(exec->context().thisValue()));
+        ObjectImp *thisVal = static_cast<ObjectImp *>(exec->context().thisValue());
         ContextImp ctx(exec->dynamicInterpreter()->globalObject(),
                        exec->dynamicInterpreter()->imp(),
                        thisVal,
@@ -851,16 +846,16 @@ Value GlobalFuncImp::call(ExecState *exec, Object &/*thisObj*/, const List &args
       break;
     }
   case ParseInt:
-    res = Number(parseInt(args[0].toString(exec), args[1].toInt32(exec)));
+    res = Number(parseInt(args[0]->toString(exec), args[1]->toInt32(exec)));
     break;
   case ParseFloat:
-    res = Number(parseFloat(args[0].toString(exec)));
+    res = Number(parseFloat(args[0]->toString(exec)));
     break;
   case IsNaN:
-    res = Boolean(isNaN(args[0].toNumber(exec)));
+    res = Boolean(isNaN(args[0]->toNumber(exec)));
     break;
   case IsFinite: {
-    double n = args[0].toNumber(exec);
+    double n = args[0]->toNumber(exec);
     res = Boolean(!isNaN(n) && !isInf(n));
     break;
   }
@@ -878,7 +873,7 @@ Value GlobalFuncImp::call(ExecState *exec, Object &/*thisObj*/, const List &args
     break;
   case Escape:
     {
-      UString r = "", s, str = args[0].toString(exec);
+      UString r = "", s, str = args[0]->toString(exec);
       const UChar *c = str.data();
       for (int k = 0; k < str.size(); k++, c++) {
         int u = c->uc;
@@ -900,7 +895,7 @@ Value GlobalFuncImp::call(ExecState *exec, Object &/*thisObj*/, const List &args
     }
   case UnEscape:
     {
-      UString s = "", str = args[0].toString(exec);
+      UString s = "", str = args[0]->toString(exec);
       int k = 0, len = str.size();
       while (k < len) {
         const UChar *c = str.data() + k;
@@ -927,7 +922,7 @@ Value GlobalFuncImp::call(ExecState *exec, Object &/*thisObj*/, const List &args
     }
 #ifndef NDEBUG
   case KJSPrint:
-    puts(args[0].toString(exec).ascii());
+    puts(args[0]->toString(exec).ascii());
     break;
 #endif
   }
index 299c4b2e5a24888ea4cfe6741e6c6bcbd7c83f1d..2e84c871e73299ecf435f7ba740472f08de62325 100644 (file)
@@ -43,11 +43,11 @@ namespace KJS {
     virtual ~FunctionImp();
 
     virtual bool getOwnPropertySlot(ExecState *, const Identifier &, PropertySlot&);
-    virtual void put(ExecState *exec, const Identifier &propertyName, const Value &value, int attr = None);
+    virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
     virtual bool deleteProperty(ExecState *exec, const Identifier &propertyName);
 
     virtual bool implementsCall() const;
-    virtual Value call(ExecState *exec, Object &thisObj, const List &args);
+    virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
 
     void addParameter(const Identifier &n);
     Identifier getParameterName(int index);
@@ -65,8 +65,8 @@ namespace KJS {
     Identifier ident;
 
   private:
-    static Value argumentsGetter(ExecState *, const Identifier &, const PropertySlot&);
-    static Value lengthGetter(ExecState *, const Identifier &, const PropertySlot&);
+    static ValueImp *argumentsGetter(ExecState *, const Identifier &, const PropertySlot&);
+    static ValueImp *lengthGetter(ExecState *, const Identifier &, const PropertySlot&);
 
     void processParameters(ExecState *exec, const List &);
     virtual void processVarDecls(ExecState *exec);
@@ -79,7 +79,7 @@ namespace KJS {
     ~DeclaredFunctionImp();
 
     bool implementsConstruct() const;
-    Object construct(ExecState *exec, const List &args);
+    ObjectImp *construct(ExecState *exec, const List &args);
 
     virtual Completion execute(ExecState *exec);
     CodeType codeType() const { return FunctionCode; }
@@ -112,13 +112,12 @@ namespace KJS {
     ArgumentsImp(ExecState *exec, FunctionImp *func, const List &args, ActivationImp *act);
     virtual void mark();
     virtual bool getOwnPropertySlot(ExecState *, const Identifier &, PropertySlot&);
-    virtual void put(ExecState *exec, const Identifier &propertyName,
-                     const Value &value, int attr = None);
+    virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
     virtual bool deleteProperty(ExecState *exec, const Identifier &propertyName);
     virtual const ClassInfo *classInfo() const { return &info; }
     static const ClassInfo info;
   private:
-    static Value mappedIndexGetter(ExecState *exec, const Identifier &, const PropertySlot& slot);
+    static ValueImp *mappedIndexGetter(ExecState *exec, const Identifier &, const PropertySlot& slot);
 
     ActivationImp *_activationObject; 
     mutable IndexToNameMap indexToNameMap;
@@ -138,7 +137,7 @@ namespace KJS {
 
   private:
     static PropertySlot::GetValueFunc getArgumentsGetter();
-    static Value argumentsGetter(ExecState *exec, const Identifier &, const PropertySlot& slot);
+    static ValueImp *argumentsGetter(ExecState *exec, const Identifier &, const PropertySlot& slot);
     void createArgumentsObject(ExecState *exec) const;
     
     FunctionImp *_function;
@@ -150,7 +149,7 @@ namespace KJS {
   public:
     GlobalFuncImp(ExecState *exec, FunctionPrototypeImp *funcProto, int i, int len);
     virtual bool implementsCall() const;
-    virtual Value call(ExecState *exec, Object &thisObj, const List &args);
+    virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
     virtual CodeType codeType() const;
     enum { Eval, ParseInt, ParseFloat, IsNaN, IsFinite, Escape, UnEscape,
            DecodeURI, DecodeURIComponent, EncodeURI, EncodeURIComponent
index d25ac9f718815fd84b7e501e2d87d40c6dced8d3..231ea29ce221306533623e92eb30fa1779df2109 100644 (file)
@@ -40,8 +40,7 @@ using namespace KJS;
 FunctionPrototypeImp::FunctionPrototypeImp(ExecState *exec)
   : InternalFunctionImp(0)
 {
-  Value protect(this);
-  putDirect(lengthPropertyName,   NumberImp::zero(),                                                       DontDelete|ReadOnly|DontEnum);
+  putDirect(lengthPropertyName,   jsZero(),                                                       DontDelete|ReadOnly|DontEnum);
   putDirect(toStringPropertyName, new FunctionProtoFuncImp(exec, this, FunctionProtoFuncImp::ToString, 0), DontEnum);
   static const Identifier applyPropertyName("apply");
   putDirect(applyPropertyName,    new FunctionProtoFuncImp(exec, this, FunctionProtoFuncImp::Apply,    2), DontEnum);
@@ -59,7 +58,7 @@ bool FunctionPrototypeImp::implementsCall() const
 }
 
 // ECMA 15.3.4
-Value FunctionPrototypeImp::call(ExecState */*exec*/, Object &/*thisObj*/, const List &/*args*/)
+ValueImp *FunctionPrototypeImp::callAsFunction(ExecState */*exec*/, ObjectImp */*thisObj*/, const List &/*args*/)
 {
   return Undefined();
 }
@@ -70,7 +69,6 @@ FunctionProtoFuncImp::FunctionProtoFuncImp(ExecState *exec,
                                          FunctionPrototypeImp *funcProto, int i, int len)
   : InternalFunctionImp(funcProto), id(i)
 {
-  Value protect(this);
   putDirect(lengthPropertyName, len, DontDelete|ReadOnly|DontEnum);
 }
 
@@ -80,29 +78,29 @@ bool FunctionProtoFuncImp::implementsCall() const
   return true;
 }
 
-Value FunctionProtoFuncImp::call(ExecState *exec, Object &thisObj, const List &args)
+ValueImp *FunctionProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
 {
-  Value result;
+  ValueImp *result = NULL;
 
   switch (id) {
   case ToString: {
     // ### also make this work for internal functions
-    if (thisObj.isNull() || !thisObj.inherits(&InternalFunctionImp::info)) {
+    if (!thisObj || !thisObj->inherits(&InternalFunctionImp::info)) {
 #ifndef NDEBUG
       fprintf(stderr,"attempted toString() call on null or non-function object\n");
 #endif
-      Object err = Error::create(exec,TypeError);
+      ObjectImp *err = Error::create(exec,TypeError);
       exec->setException(err);
       return err;
     }
-    if (thisObj.inherits(&DeclaredFunctionImp::info)) {
+    if (thisObj->inherits(&DeclaredFunctionImp::info)) {
        DeclaredFunctionImp *fi = static_cast<DeclaredFunctionImp*>
-                                 (thisObj.imp());
+                                 (thisObj);
        return String("function " + fi->name().ustring() + "(" +
          fi->parameterString() + ") " + fi->body->toString());
-    } else if (thisObj.inherits(&FunctionImp::info) &&
-        !static_cast<FunctionImp*>(thisObj.imp())->name().isNull()) {
-      result = String("function " + static_cast<FunctionImp*>(thisObj.imp())->name().ustring() + "()");
+    } else if (thisObj->inherits(&FunctionImp::info) &&
+        !static_cast<FunctionImp*>(thisObj)->name().isNull()) {
+      result = String("function " + static_cast<FunctionImp*>(thisObj)->name().ustring() + "()");
     }
     else {
       result = String("(Internal Function)");
@@ -110,59 +108,59 @@ Value FunctionProtoFuncImp::call(ExecState *exec, Object &thisObj, const List &a
     }
     break;
   case Apply: {
-    Value thisArg = args[0];
-    Value argArray = args[1];
-    Object func = thisObj;
+    ValueImp *thisArg = args[0];
+    ValueImp *argArray = args[1];
+    ObjectImp *func = thisObj;
 
-    if (!func.implementsCall()) {
-      Object err = Error::create(exec,TypeError);
+    if (!func->implementsCall()) {
+      ObjectImp *err = Error::create(exec,TypeError);
       exec->setException(err);
       return err;
     }
 
-    Object applyThis;
-    if (thisArg.isA(NullType) || thisArg.isA(UndefinedType))
+    ObjectImp *applyThis;
+    if (thisArg->isUndefinedOrNull())
       applyThis = exec->dynamicInterpreter()->globalObject();
     else
-      applyThis = thisArg.toObject(exec);
+      applyThis = thisArg->toObject(exec);
 
     List applyArgs;
-    if (!argArray.isA(NullType) && !argArray.isA(UndefinedType)) {
-      if (argArray.isA(ObjectType) &&
-           (Object::dynamicCast(argArray).inherits(&ArrayInstanceImp::info) ||
-            Object::dynamicCast(argArray).inherits(&ArgumentsImp::info))) {
+    if (!argArray->isUndefinedOrNull()) {
+      if (argArray->isObject() &&
+           (static_cast<ObjectImp *>(argArray)->inherits(&ArrayInstanceImp::info) ||
+            static_cast<ObjectImp *>(argArray)->inherits(&ArgumentsImp::info))) {
 
-        Object argArrayObj = Object::dynamicCast(argArray);
-        unsigned int length = argArrayObj.get(exec,lengthPropertyName).toUInt32(exec);
+        ObjectImp *argArrayObj = static_cast<ObjectImp *>(argArray);
+        unsigned int length = argArrayObj->get(exec,lengthPropertyName)->toUInt32(exec);
         for (unsigned int i = 0; i < length; i++)
-          applyArgs.append(argArrayObj.get(exec,i));
+          applyArgs.append(argArrayObj->get(exec,i));
       }
       else {
-        Object err = Error::create(exec,TypeError);
+        ObjectImp *err = Error::create(exec,TypeError);
         exec->setException(err);
         return err;
       }
     }
-    result = func.call(exec,applyThis,applyArgs);
+    result = func->call(exec,applyThis,applyArgs);
     }
     break;
   case Call: {
-    Value thisArg = args[0];
-    Object func = thisObj;
+    ValueImp *thisArg = args[0];
+    ObjectImp *func = thisObj;
 
-    if (!func.implementsCall()) {
-      Object err = Error::create(exec,TypeError);
+    if (!func->implementsCall()) {
+      ObjectImp *err = Error::create(exec,TypeError);
       exec->setException(err);
       return err;
     }
 
-    Object callThis;
-    if (thisArg.isA(NullType) || thisArg.isA(UndefinedType))
+    ObjectImp&