Commit 989a6f84 authored by darin@apple.com's avatar darin@apple.com

JavaScriptCore:

2008-10-19  Darin Adler  <darin@apple.com>

        Reviewed by Oliver Hunt.

        - next step of https://bugs.webkit.org/show_bug.cgi?id=21732
          improve performance by eliminating JSValue as a base class for JSCell

        Remove most uses of JSValue, which will be removed in a future patch.

        * VM/Machine.cpp:
        (JSC::fastToUInt32): Call toUInt32SlowCase function; no longer a member
        of JSValue.
        * kjs/JSNumberCell.h:
        (JSC::JSNumberCell::toInt32): Ditto.
        (JSC::JSNumberCell::toUInt32): Ditto.

        * kjs/JSValue.cpp:
        (JSC::toInt32SlowCase): Made a non-member function.
        (JSC::JSValue::toInt32SlowCase): Changed to call non-member function.
        (JSC::toUInt32SlowCase): More of the same.
        (JSC::JSValue::toUInt32SlowCase): Ditto.

        * kjs/JSValue.h: Moved static member function so they are no longer
        member functions at all.

        * VM/CTI.h: Removed forward declaration of JSValue.
        * VM/ExceptionHelpers.h: Ditto.
        * kjs/CallData.h: Ditto.
        * kjs/ConstructData.h: Ditto.
        * kjs/JSGlobalObjectFunctions.h: Ditto.
        * kjs/PropertyMap.h: Ditto.
        * kjs/StructureID.h: Ditto.
        * kjs/collector.h: Ditto.
        * kjs/completion.h: Ditto.

        * kjs/grammar.y:
        (JSC::makeBitwiseNotNode): Call new non-member toInt32 function.
        (JSC::makeLeftShiftNode): More of the same.
        (JSC::makeRightShiftNode): Ditto.

        * kjs/protect.h: Added a specialization for ProtectedPtr<JSValuePtr>
        so this can be used with JSValuePtr.

JavaScriptGlue:

2008-10-19  Darin Adler  <darin@apple.com>

        Reviewed by Oliver Hunt.

        - next step of https://bugs.webkit.org/show_bug.cgi?id=21732
          improve performance by eliminating JSValue as a base class for JSCell

        Remove most uses of JSValue, which will be removed in a future patch.

        * JSValueWrapper.h: Use JSValuePtr instead of JSValue*.

WebCore:

2008-10-19  Darin Adler  <darin@apple.com>

        Reviewed by Oliver Hunt.

        - next step of https://bugs.webkit.org/show_bug.cgi?id=21732
          improve performance by eliminating JSValue as a base class for JSCell

        Remove most uses of JSValue, which will be removed in a future patch.

        * bindings/js/JSCustomXPathNSResolver.h: Removed declaration of JSValue
        and used JSValuePtr instead.
        * bindings/js/JSEventTarget.h: Ditto.
        * bindings/js/JSNodeFilterCondition.h: Ditto.
        * bindings/js/ScheduledAction.h: Ditto.
        * bindings/js/ScriptController.h: Ditto.
        * bindings/objc/WebScriptObjectPrivate.h: Ditto.
        * bridge/c/c_utility.h: Ditto.
        * bridge/jni/jni_jsobject.h: Ditto.
        * bridge/jni/jni_utility.h: Ditto.
        * bridge/objc/WebScriptObject.h: Ditto.
        * dom/Traversal.h: Ditto.
        * inspector/InspectorController.cpp: Ditto.
        * inspector/JavaScriptProfile.h: Ditto.
        * inspector/JavaScriptProfileNode.h: Ditto.
        * loader/FrameLoader.h: Ditto.
        * page/Console.h: Ditto.
        * plugins/MimeTypeArray.h: Ditto.
        * plugins/Plugin.h: Ditto.
        * plugins/PluginArray.h: Ditto.
        * plugins/PluginView.cpp:
        (WebCore::getString): Ditto.
        (WebCore::PluginView::performRequest): Ditto.
        * plugins/gtk/PluginViewGtk.cpp: Ditto.
        * plugins/qt/PluginViewQt.cpp: Ditto.
        * plugins/win/PluginViewWin.cpp: Ditto.

        * bridge/qt/qt_class.cpp:
        (JSC::Bindings::QtClass::fallbackObject): Use JSValuePtr and JSObject*
        instead of JSValue*.
        * bridge/qt/qt_class.h: Ditto.
        * bridge/qt/qt_instance.cpp:
        (JSC::Bindings::QtInstance::mark): Ditto.
        (JSC::Bindings::QtInstance::invokeMethod): Ditto.
        (JSC::Bindings::QtInstance::defaultValue): Ditto.
        (JSC::Bindings::QtInstance::stringValue): Ditto.
        (JSC::Bindings::QtInstance::numberValue): Ditto.
        (JSC::Bindings::QtInstance::booleanValue): Ditto.
        (JSC::Bindings::QtInstance::valueOf): Ditto.
        (JSC::Bindings::QtField::valueFromInstance): Ditto.
        (JSC::Bindings::QtField::setValueToInstance): Ditto.
        * bridge/qt/qt_instance.h: Ditto.
        * bridge/qt/qt_runtime.cpp: Ditto.
        (JSC::Bindings::valueRealType): Ditto.
        (JSC::Bindings::convertValueToQVariant): Ditto.
        (JSC::Bindings::convertQVariantToValue): Ditto.
        (JSC::Bindings::findMethodIndex): Ditto.
        (JSC::Bindings::QtRuntimeMetaMethod::call): Ditto.
        (JSC::Bindings::QtRuntimeMetaMethod::lengthGetter): Ditto.
        (JSC::Bindings::QtRuntimeMetaMethod::connectGetter): Ditto.
        (JSC::Bindings::QtRuntimeMetaMethod::disconnectGetter): Ditto.
        (JSC::Bindings::QtRuntimeConnectionMethod::call): Ditto.
        (JSC::Bindings::QtRuntimeConnectionMethod::lengthGetter): Ditto.
        (JSC::Bindings::QtArray::setValueAt): Ditto.
        (JSC::Bindings::QtArray::valueAt): Ditto.
        * bridge/qt/qt_runtime.h: Ditto.

        * bridge/testqtbindings.cpp:
        (main): Use JSValuePtr.

WebKit/mac:

2008-10-19  Darin Adler  <darin@apple.com>

        Reviewed by Oliver Hunt.

        - next step of https://bugs.webkit.org/show_bug.cgi?id=21732
          improve performance by eliminating JSValue as a base class for JSCell

        Remove most uses of JSValue, which will be removed in a future patch.

        * WebView/WebFrame.mm:
        (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
        Use JSValuePtr instead of JSValue.
        * WebView/WebScriptDebugger.h: Removed declaration of JSValue.

WebKit/qt:

2008-10-19  Darin Adler  <darin@apple.com>

        Reviewed by Oliver Hunt.

        - next step of https://bugs.webkit.org/show_bug.cgi?id=21732
          improve performance by eliminating JSValue as a base class for JSCell

        Remove most uses of JSValue, which will be removed in a future patch.

        * Api/qwebframe.cpp:
        (QWebFrame::evaluateJavaScript): Use JSValuePtr.

WebKit/win:

2008-10-19  Darin Adler  <darin@apple.com>

        Reviewed by Oliver Hunt.

        - next step of https://bugs.webkit.org/show_bug.cgi?id=21732
          improve performance by eliminating JSValue as a base class for JSCell

        Remove most uses of JSValue, which will be removed in a future patch.

        * WebScriptCallFrame.cpp:
        (WebScriptCallFrame::jsValueToString): Use JSValuePtr.
        (WebScriptCallFrame::stringByEvaluatingJavaScriptFromString): Ditto.
        (WebScriptCallFrame::valueForVariable): Put more code inside and ifdef.
        (WebScriptCallFrame::valueByEvaluatingJavaScriptFromString): Ditto.
        * WebScriptCallFrame.h: Use JSValuePtr.

        * WebView.cpp:
        (WebView::stringByEvaluatingJavaScriptFromString): Use JSValuePtr.

WebKit/wx:

2008-10-19  Darin Adler  <darin@apple.com>

        Reviewed by Oliver Hunt.

        - next step of https://bugs.webkit.org/show_bug.cgi?id=21732
          improve performance by eliminating JSValue as a base class for JSCell

        Remove most uses of JSValue, which will be removed in a future patch.

        * WebFrame.cpp:
        (wxWebFrame::RunScript): Use JSValuePtr.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37706 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 5c465b09
2008-10-19 Darin Adler <darin@apple.com>
Reviewed by Oliver Hunt.
- next step of https://bugs.webkit.org/show_bug.cgi?id=21732
improve performance by eliminating JSValue as a base class for JSCell
Remove most uses of JSValue, which will be removed in a future patch.
* VM/Machine.cpp:
(JSC::fastToUInt32): Call toUInt32SlowCase function; no longer a member
of JSValue.
* kjs/JSNumberCell.h:
(JSC::JSNumberCell::toInt32): Ditto.
(JSC::JSNumberCell::toUInt32): Ditto.
* kjs/JSValue.cpp:
(JSC::toInt32SlowCase): Made a non-member function.
(JSC::JSValue::toInt32SlowCase): Changed to call non-member function.
(JSC::toUInt32SlowCase): More of the same.
(JSC::JSValue::toUInt32SlowCase): Ditto.
* kjs/JSValue.h: Moved static member function so they are no longer
member functions at all.
* VM/CTI.h: Removed forward declaration of JSValue.
* VM/ExceptionHelpers.h: Ditto.
* kjs/CallData.h: Ditto.
* kjs/ConstructData.h: Ditto.
* kjs/JSGlobalObjectFunctions.h: Ditto.
* kjs/PropertyMap.h: Ditto.
* kjs/StructureID.h: Ditto.
* kjs/collector.h: Ditto.
* kjs/completion.h: Ditto.
* kjs/grammar.y:
(JSC::makeBitwiseNotNode): Call new non-member toInt32 function.
(JSC::makeLeftShiftNode): More of the same.
(JSC::makeRightShiftNode): Ditto.
* kjs/protect.h: Added a specialization for ProtectedPtr<JSValuePtr>
so this can be used with JSValuePtr.
2008-10-18 Darin Adler <darin@apple.com>
Reviewed by Oliver Hunt.
......
......@@ -86,7 +86,6 @@ namespace JSC {
class CodeBlock;
class JSPropertyNameIterator;
class JSValue;
class Machine;
class Register;
class RegisterFile;
......
......@@ -40,7 +40,6 @@ namespace JSC {
class JSGlobalData;
class JSNotAnObjectErrorStub;
class JSObject;
class JSValue;
class Node;
JSValuePtr createInterruptedExecutionException(JSGlobalData*);
......
......@@ -157,7 +157,7 @@ static ALWAYS_INLINE bool fastToUInt32(JSValuePtr value, uint32_t& arg)
if (JSImmediate::getTruncatedUInt32(value, arg))
return true;
bool scratch;
arg = JSValue::toUInt32SlowCase(JSImmediate::getTruncatedInt32(value), scratch);
arg = toUInt32SlowCase(JSImmediate::getTruncatedInt32(value), scratch);
return true;
} else if (!JSImmediate::isImmediate(value) && Heap::isNumber(asCell(value)))
arg = asNumberCell(value)->toUInt32();
......
......@@ -37,7 +37,6 @@ namespace JSC {
class ExecState;
class FunctionBodyNode;
class JSObject;
class JSValue;
class ScopeChainNode;
enum CallType {
......
......@@ -37,7 +37,6 @@ namespace JSC {
class ExecState;
class FunctionBodyNode;
class JSObject;
class JSValue;
class ScopeChainNode;
enum ConstructType {
......
......@@ -31,7 +31,6 @@ namespace JSC {
class ArgList;
class ExecState;
class JSObject;
class JSValue;
// FIXME: These functions should really be in JSGlobalObject.cpp, but putting them there
// is a 0.5% reduction.
......
......@@ -241,7 +241,7 @@ namespace JSC {
if (m_value >= -2147483648.0 && m_value < 2147483648.0)
return static_cast<int32_t>(m_value);
bool scratch;
return JSValue::toInt32SlowCase(m_value, scratch);
return JSC::toInt32SlowCase(m_value, scratch);
}
inline uint32_t JSNumberCell::toUInt32() const
......@@ -249,7 +249,7 @@ namespace JSC {
if (m_value >= 0.0 && m_value < 4294967296.0)
return static_cast<uint32_t>(m_value);
bool scratch;
return JSValue::toUInt32SlowCase(m_value, scratch);
return JSC::toUInt32SlowCase(m_value, scratch);
}
ALWAYS_INLINE JSValuePtr JSValue::toJSNumber(ExecState* exec) const
......
......@@ -48,7 +48,7 @@ double JSValue::toIntegerPreserveNaN(ExecState* exec) const
return trunc(toNumber(exec));
}
int32_t JSValue::toInt32SlowCase(double d, bool& ok)
int32_t toInt32SlowCase(double d, bool& ok)
{
ok = true;
......@@ -70,10 +70,10 @@ int32_t JSValue::toInt32SlowCase(double d, bool& ok)
int32_t JSValue::toInt32SlowCase(ExecState* exec, bool& ok) const
{
return JSValue::toInt32SlowCase(toNumber(exec), ok);
return JSC::toInt32SlowCase(toNumber(exec), ok);
}
uint32_t JSValue::toUInt32SlowCase(double d, bool& ok)
uint32_t toUInt32SlowCase(double d, bool& ok)
{
ok = true;
......@@ -93,7 +93,7 @@ uint32_t JSValue::toUInt32SlowCase(double d, bool& ok)
uint32_t JSValue::toUInt32SlowCase(ExecState* exec, bool& ok) const
{
return JSValue::toUInt32SlowCase(toNumber(exec), ok);
return JSC::toUInt32SlowCase(toNumber(exec), ok);
}
float JSValue::toFloat(ExecState* exec) const
......
......@@ -115,10 +115,6 @@ namespace JSC {
uint32_t toUInt32(ExecState*) const;
uint32_t toUInt32(ExecState*, bool& ok) const;
// These are identical logic to above, and faster than jsNumber(number)->toInt32(exec)
static int32_t toInt32(double);
static uint32_t toUInt32(double);
// Floating point conversions.
float toFloat(ExecState*) const;
......@@ -126,9 +122,6 @@ namespace JSC {
void mark();
bool marked() const;
static int32_t toInt32SlowCase(double, bool& ok);
static uint32_t toUInt32SlowCase(double, bool& ok);
// Object operations, with the toObject operation included.
JSValuePtr get(ExecState*, const Identifier& propertyName) const;
JSValuePtr get(ExecState*, const Identifier& propertyName, PropertySlot&) const;
......@@ -157,6 +150,12 @@ namespace JSC {
uint32_t toUInt32SlowCase(ExecState*, bool& ok) const;
};
// These are identical logic to the JSValue functions above, and faster than jsNumber(number)->toInt32().
int32_t toInt32(double);
uint32_t toUInt32(double);
int32_t toInt32SlowCase(double, bool& ok);
uint32_t toUInt32SlowCase(double, bool& ok);
inline JSValue::JSValue()
{
}
......@@ -223,7 +222,7 @@ namespace JSC {
return toUInt32SlowCase(exec, ok);
}
inline int32_t JSValue::toInt32(double val)
inline int32_t toInt32(double val)
{
if (!(val >= -2147483648.0 && val < 2147483648.0)) {
bool ignored;
......@@ -232,7 +231,7 @@ namespace JSC {
return static_cast<int32_t>(val);
}
inline uint32_t JSValue::toUInt32(double val)
inline uint32_t toUInt32(double val)
{
if (!(val >= 0.0 && val < 4294967296.0)) {
bool ignored;
......
......@@ -35,7 +35,6 @@
namespace JSC {
class JSObject;
class JSValue;
class PropertyNameArray;
typedef JSValuePtr* PropertyStorage;
......
......@@ -42,7 +42,6 @@
namespace JSC {
class JSValue;
class PropertyNameArray;
class PropertyNameArrayData;
class StructureIDChain;
......
......@@ -43,7 +43,6 @@ namespace JSC {
class CollectorBlock;
class JSCell;
class JSGlobalData;
class JSValue;
enum OperationInProgress { NoOperation, Allocation, Collection };
enum HeapType { PrimaryHeap, NumberHeap };
......
......@@ -27,8 +27,6 @@
namespace JSC {
class JSValue;
enum ComplType { Normal, Break, Continue, ReturnValue, Throw, Interrupted };
/*
......
......@@ -1418,7 +1418,7 @@ static NumberNode* makeNumberNode(void* globalPtr, double d)
static ExpressionNode* makeBitwiseNotNode(void* globalPtr, ExpressionNode* expr)
{
if (expr->isNumber())
return makeNumberNode(globalPtr, ~JSValue::toInt32(static_cast<NumberNode*>(expr)->value()));
return makeNumberNode(globalPtr, ~toInt32(static_cast<NumberNode*>(expr)->value()));
return new BitwiseNotNode(GLOBAL_DATA, expr);
}
......@@ -1469,14 +1469,14 @@ static ExpressionNode* makeSubNode(void* globalPtr, ExpressionNode* expr1, Expre
static ExpressionNode* makeLeftShiftNode(void* globalPtr, ExpressionNode* expr1, ExpressionNode* expr2, bool rightHasAssignments)
{
if (expr1->isNumber() && expr2->isNumber())
return makeNumberNode(globalPtr, JSValue::toInt32(static_cast<NumberNode*>(expr1)->value()) << (JSValue::toUInt32(static_cast<NumberNode*>(expr2)->value()) & 0x1f));
return makeNumberNode(globalPtr, toInt32(static_cast<NumberNode*>(expr1)->value()) << (toUInt32(static_cast<NumberNode*>(expr2)->value()) & 0x1f));
return new LeftShiftNode(GLOBAL_DATA, expr1, expr2, rightHasAssignments);
}
static ExpressionNode* makeRightShiftNode(void* globalPtr, ExpressionNode* expr1, ExpressionNode* expr2, bool rightHasAssignments)
{
if (expr1->isNumber() && expr2->isNumber())
return makeNumberNode(globalPtr, JSValue::toInt32(static_cast<NumberNode*>(expr1)->value()) >> (JSValue::toUInt32(static_cast<NumberNode*>(expr2)->value()) & 0x1f));
return makeNumberNode(globalPtr, toInt32(static_cast<NumberNode*>(expr1)->value()) >> (toUInt32(static_cast<NumberNode*>(expr2)->value()) & 0x1f));
return new RightShiftNode(GLOBAL_DATA, expr1, expr2, rightHasAssignments);
}
......
......@@ -68,7 +68,7 @@ namespace JSC {
operator T*() const { return m_ptr; }
T* operator->() const { return m_ptr; }
bool operator!() const { return m_ptr == NULL; }
bool operator!() const { return !m_ptr; }
ProtectedPtr& operator=(const ProtectedPtr&);
ProtectedPtr& operator=(T*);
......@@ -77,6 +77,23 @@ namespace JSC {
T* m_ptr;
};
template <> class ProtectedPtr<JSValuePtr> {
public:
ProtectedPtr() { }
ProtectedPtr(JSValuePtr ptr) : m_ptr(ptr) { }
template <class U> ProtectedPtr(const ProtectedPtr<U>& ptr) : m_ptr(ptr) { }
JSValuePtr get() const { return m_ptr; }
operator JSValuePtr() const { return m_ptr; }
JSValue* operator->() const { return m_ptr; }
bool operator!() const { return !m_ptr; }
private:
ProtectedPtr<JSValue> m_ptr;
};
template <class T> ProtectedPtr<T>::ProtectedPtr(T* ptr)
: m_ptr(ptr)
{
......
2008-10-19 Darin Adler <darin@apple.com>
Reviewed by Oliver Hunt.
- next step of https://bugs.webkit.org/show_bug.cgi?id=21732
improve performance by eliminating JSValue as a base class for JSCell
Remove most uses of JSValue, which will be removed in a future patch.
* JSValueWrapper.h: Use JSValuePtr instead of JSValue*.
2008-10-18 Darin Adler <darin@apple.com>
Reviewed by Oliver Hunt.
......
......@@ -35,15 +35,15 @@
class JSValueWrapper {
public:
JSValueWrapper(JSValue *inValue);
JSValueWrapper(JSValuePtr);
virtual ~JSValueWrapper();
static void GetJSObectCallBacks(JSObjectCallBacks& callBacks);
JSValue *GetValue();
JSValuePtr GetValue();
private:
ProtectedPtr<JSValue> fValue;
ProtectedPtr<JSValuePtr> fValue;
static void JSObjectDispose(void *data);
static CFArrayRef JSObjectCopyPropertyNames(void *data);
......
2008-10-19 Darin Adler <darin@apple.com>
Reviewed by Oliver Hunt.
- next step of https://bugs.webkit.org/show_bug.cgi?id=21732
improve performance by eliminating JSValue as a base class for JSCell
Remove most uses of JSValue, which will be removed in a future patch.
* bindings/js/JSCustomXPathNSResolver.h: Removed declaration of JSValue
and used JSValuePtr instead.
* bindings/js/JSEventTarget.h: Ditto.
* bindings/js/JSNodeFilterCondition.h: Ditto.
* bindings/js/ScheduledAction.h: Ditto.
* bindings/js/ScriptController.h: Ditto.
* bindings/objc/WebScriptObjectPrivate.h: Ditto.
* bridge/c/c_utility.h: Ditto.
* bridge/jni/jni_jsobject.h: Ditto.
* bridge/jni/jni_utility.h: Ditto.
* bridge/objc/WebScriptObject.h: Ditto.
* dom/Traversal.h: Ditto.
* inspector/InspectorController.cpp: Ditto.
* inspector/JavaScriptProfile.h: Ditto.
* inspector/JavaScriptProfileNode.h: Ditto.
* loader/FrameLoader.h: Ditto.
* page/Console.h: Ditto.
* plugins/MimeTypeArray.h: Ditto.
* plugins/Plugin.h: Ditto.
* plugins/PluginArray.h: Ditto.
* plugins/PluginView.cpp:
(WebCore::getString): Ditto.
(WebCore::PluginView::performRequest): Ditto.
* plugins/gtk/PluginViewGtk.cpp: Ditto.
* plugins/qt/PluginViewQt.cpp: Ditto.
* plugins/win/PluginViewWin.cpp: Ditto.
* bridge/qt/qt_class.cpp:
(JSC::Bindings::QtClass::fallbackObject): Use JSValuePtr and JSObject*
instead of JSValue*.
* bridge/qt/qt_class.h: Ditto.
* bridge/qt/qt_instance.cpp:
(JSC::Bindings::QtInstance::mark): Ditto.
(JSC::Bindings::QtInstance::invokeMethod): Ditto.
(JSC::Bindings::QtInstance::defaultValue): Ditto.
(JSC::Bindings::QtInstance::stringValue): Ditto.
(JSC::Bindings::QtInstance::numberValue): Ditto.
(JSC::Bindings::QtInstance::booleanValue): Ditto.
(JSC::Bindings::QtInstance::valueOf): Ditto.
(JSC::Bindings::QtField::valueFromInstance): Ditto.
(JSC::Bindings::QtField::setValueToInstance): Ditto.
* bridge/qt/qt_instance.h: Ditto.
* bridge/qt/qt_runtime.cpp: Ditto.
(JSC::Bindings::valueRealType): Ditto.
(JSC::Bindings::convertValueToQVariant): Ditto.
(JSC::Bindings::convertQVariantToValue): Ditto.
(JSC::Bindings::findMethodIndex): Ditto.
(JSC::Bindings::QtRuntimeMetaMethod::call): Ditto.
(JSC::Bindings::QtRuntimeMetaMethod::lengthGetter): Ditto.
(JSC::Bindings::QtRuntimeMetaMethod::connectGetter): Ditto.
(JSC::Bindings::QtRuntimeMetaMethod::disconnectGetter): Ditto.
(JSC::Bindings::QtRuntimeConnectionMethod::call): Ditto.
(JSC::Bindings::QtRuntimeConnectionMethod::lengthGetter): Ditto.
(JSC::Bindings::QtArray::setValueAt): Ditto.
(JSC::Bindings::QtArray::valueAt): Ditto.
* bridge/qt/qt_runtime.h: Ditto.
* bridge/testqtbindings.cpp:
(main): Use JSValuePtr.
2008-10-18 Darin Adler <darin@apple.com>
Reviewed by Oliver Hunt.
......
......@@ -29,13 +29,13 @@
#if ENABLE(XPATH)
#include "XPathNSResolver.h"
#include <kjs/JSValue.h>
#include <wtf/Forward.h>
#include <wtf/RefPtr.h>
namespace JSC {
class ExecState;
class JSObject;
class JSValue;
}
namespace WebCore {
......@@ -44,7 +44,7 @@ namespace WebCore {
class JSCustomXPathNSResolver : public XPathNSResolver {
public:
static PassRefPtr<JSCustomXPathNSResolver> create(JSC::ExecState*, JSC::JSValue*);
static PassRefPtr<JSCustomXPathNSResolver> create(JSC::ExecState*, JSC::JSValuePtr);
virtual ~JSCustomXPathNSResolver();
......
......@@ -26,8 +26,9 @@
#ifndef JSEventTarget_h
#define JSEventTarget_h
#include <kjs/JSValue.h>
namespace JSC {
class JSValue;
class ExecState;
}
......@@ -35,7 +36,7 @@ namespace WebCore {
class EventTarget;
JSC::JSValue* toJS(JSC::ExecState*, EventTarget*);
JSC::JSValuePtr toJS(JSC::ExecState*, EventTarget*);
} // namespace WebCore
......
......@@ -21,30 +21,27 @@
#define JSNodeFilterCondition_h
#include "NodeFilterCondition.h"
#include <kjs/JSValue.h>
#include <wtf/PassRefPtr.h>
namespace JSC {
class JSValue;
}
namespace WebCore {
class Node;
class JSNodeFilterCondition : public NodeFilterCondition {
public:
static PassRefPtr<JSNodeFilterCondition> create(JSC::JSValue* filter)
static PassRefPtr<JSNodeFilterCondition> create(JSC::JSValuePtr filter)
{
return adoptRef(new JSNodeFilterCondition(filter));
}
private:
JSNodeFilterCondition(JSC::JSValue* filter);
JSNodeFilterCondition(JSC::JSValuePtr filter);
virtual short acceptNode(JSC::ExecState*, Node*) const;
virtual void mark();
JSC::JSValue* m_filter;
JSC::JSValuePtr m_filter;
};
} // namespace WebCore
......
......@@ -43,8 +43,8 @@ namespace WebCore {
void execute(JSDOMWindowShell*);
private:
JSC::ProtectedPtr<JSC::JSValue> m_function;
Vector<JSC::ProtectedPtr<JSC::JSValue> > m_args;
JSC::ProtectedPtr<JSC::JSValuePtr> m_function;
Vector<JSC::ProtectedPtr<JSC::JSValuePtr> > m_args;
String m_code;
};
......
......@@ -40,7 +40,6 @@ struct NPObject;
namespace JSC {
class JSGlobalObject;
class JSValue;
namespace Bindings {
class Instance;
......
......@@ -27,13 +27,12 @@
#define _WEB_SCRIPT_OBJECT_PRIVATE_H_
#import "WebScriptObject.h"
#import <kjs/JSValue.h>
#import <wtf/PassRefPtr.h>
namespace JSC {
class JSObject;
class JSValue;
namespace Bindings {
class RootObject;
......@@ -47,7 +46,7 @@ namespace WebCore {
}
@interface WebScriptObject (Private)
+ (id)_convertValueToObjcValue:(JSC::JSValue*)value originRootObject:(JSC::Bindings::RootObject*)originRootObject rootObject:(JSC::Bindings::RootObject*)rootObject;
+ (id)_convertValueToObjcValue:(JSC::JSValuePtr)value originRootObject:(JSC::Bindings::RootObject*)originRootObject rootObject:(JSC::Bindings::RootObject*)rootObject;
+ (id)scriptObjectForJSObject:(JSObjectRef)jsObject originRootObject:(JSC::Bindings::RootObject*)originRootObject rootObject:(JSC::Bindings::RootObject*)rootObject;
- (id)_init;
- (id)_initWithJSObject:(JSC::JSObject*)imp originRootObject:(PassRefPtr<JSC::Bindings::RootObject>)originRootObject rootObject:(PassRefPtr<JSC::Bindings::RootObject>)rootObject;
......
......@@ -29,6 +29,7 @@
#if ENABLE(NETSCAPE_PLUGIN_API)
#include "npruntime_internal.h"
#include <kjs/JSValue.h>
namespace WebCore {
class String;
......@@ -38,7 +39,6 @@ namespace JSC {
class ExecState;
class Identifier;
class JSValue;
namespace Bindings {
......@@ -57,8 +57,8 @@ enum NP_ValueType {
};
WebCore::String convertNPStringToUTF16(const NPString *string);
void convertValueToNPVariant(ExecState*, JSValue*, NPVariant* result);
JSValue* convertNPVariantToValue(ExecState*, const NPVariant*, RootObject*);
void convertValueToNPVariant(ExecState*, JSValuePtr, NPVariant* result);
JSValuePtr convertNPVariantToValue(ExecState*, const NPVariant*, RootObject*);
Identifier identifierFromNPIdentifier(const NPUTF8* name);
struct PrivateIdentifier {
......
......@@ -29,8 +29,8 @@
#if ENABLE(MAC_JAVA_BRIDGE)
#include <CoreFoundation/CoreFoundation.h>
#include <JavaVM/jni.h>
#include <kjs/JSValue.h>
#include <wtf/RefPtr.h>
#define jlong_to_ptr(a) ((void*)(uintptr_t)(a))
......@@ -42,7 +42,6 @@ namespace JSC {
class ArgList;
class ExecState;
class JSObject;
class JSValue;
namespace Bindings {
......@@ -91,8 +90,8 @@ public:
static jvalue invoke(JSObjectCallContext*);
jobject convertValueToJObject(JSValue*) const;
JSValue* convertJObjectToValue(ExecState*, jobject) const;
jobject convertValueToJObject(JSValuePtr) const;
JSValuePtr convertJObjectToValue(ExecState*, jobject) const;
void getListFromJArray(ExecState*, jobjectArray, ArgList&) const;
RootObject* rootObject() const;
......
......@@ -28,6 +28,7 @@
#if ENABLE(MAC_JAVA_BRIDGE)
#include <kjs/JSValue.h>
#include <JavaVM/jni.h>
// The order of these items can not be modified as they are tightly
......@@ -54,7 +55,6 @@ namespace JSC {
class ExecState;
class JSObject;
class JSValue;
namespace Bindings {
......@@ -72,7 +72,7 @@ JNIType JNITypeFromClassName(const char *name);
JNIType JNITypeFromPrimitiveType(char type);
const char *signatureFromPrimitiveType(JNIType type);
jvalue convertValueToJValue(ExecState *exec, JSValue *value, JNIType _JNIType, const char *javaClassName);
jvalue convertValueToJValue(ExecState*, JSValuePtr, JNIType, const char* javaClassName);
jvalue getJNIField(jobject obj, JNIType type, const char *name, const char *signature);
......@@ -277,7 +277,7 @@ T callJNIStaticMethod(jclass cls, const char* methodName, const char* methodSign
return result;
}
bool dispatchJNICall(ExecState*, const void* targetAppletView, jobject obj, bool isStatic, JNIType returnType, jmethodID methodID, jvalue* args, jvalue& result, const char* callingURL, JSValue*& exceptionDescription);
bool dispatchJNICall(ExecState*, const void* targetAppletView, jobject obj, bool isStatic, JNIType returnType, jmethodID methodID, jvalue* args, jvalue& result, const char* callingURL, JSValuePtr& exceptionDescription);
} // namespace Bindings
......
/*
* Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
* Copyright (C) 2006 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
......@@ -24,8 +24,7 @@
*/
#import <Foundation/Foundation.h>