summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/JavaScriptCore/runtime/JSByteArray.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2009-06-15 09:06:43 (GMT)
committerSimon Hausmann <simon.hausmann@nokia.com>2009-06-15 09:31:31 (GMT)
commitc411f16870f112c3407c28c22b617f613a82cff4 (patch)
tree29a1bcd590c8b31af2aab445bfe8a978dc5bf582 /src/3rdparty/webkit/JavaScriptCore/runtime/JSByteArray.h
parent3d77b56b32a0c53ec0bbfaa07236fedb900ff336 (diff)
downloadQt-c411f16870f112c3407c28c22b617f613a82cff4.zip
Qt-c411f16870f112c3407c28c22b617f613a82cff4.tar.gz
Qt-c411f16870f112c3407c28c22b617f613a82cff4.tar.bz2
Updated WebKit from /home/shausman/src/webkit/trunk to qtwebkit-4.6-snapshot-15062009 ( 65232bf00dc494ebfd978f998c88f58d18ecce1e )
Diffstat (limited to 'src/3rdparty/webkit/JavaScriptCore/runtime/JSByteArray.h')
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/JSByteArray.h36
1 files changed, 20 insertions, 16 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/JSByteArray.h b/src/3rdparty/webkit/JavaScriptCore/runtime/JSByteArray.h
index 895200b..57374e0 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/JSByteArray.h
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/JSByteArray.h
@@ -26,19 +26,20 @@
#ifndef JSByteArray_h
#define JSByteArray_h
-#include "ByteArray.h"
#include "JSObject.h"
+#include <wtf/ByteArray.h>
+
namespace JSC {
class JSByteArray : public JSObject {
- friend class Interpreter;
+ friend class VPtrSet;
public:
bool canAccessIndex(unsigned i) { return i < m_storage->length(); }
- JSValuePtr getIndex(unsigned i)
+ JSValue getIndex(ExecState* exec, unsigned i)
{
ASSERT(canAccessIndex(i));
- return JSImmediate::from(m_storage->data()[i]);
+ return jsNumber(exec, m_storage->data()[i]);
}
void setIndex(unsigned i, int value)
@@ -63,22 +64,22 @@ namespace JSC {
m_storage->data()[i] = static_cast<unsigned char>(value + 0.5);
}
- void setIndex(ExecState* exec, unsigned i, JSValuePtr value)
+ void setIndex(ExecState* exec, unsigned i, JSValue value)
{
- double byteValue = value->toNumber(exec);
+ double byteValue = value.toNumber(exec);
if (exec->hadException())
return;
if (canAccessIndex(i))
setIndex(i, byteValue);
}
- JSByteArray(ExecState* exec, PassRefPtr<Structure>, ByteArray* storage, const JSC::ClassInfo* = &s_defaultInfo);
- static PassRefPtr<Structure> createStructure(JSValuePtr prototype);
+ JSByteArray(ExecState* exec, PassRefPtr<Structure>, WTF::ByteArray* storage, const JSC::ClassInfo* = &s_defaultInfo);
+ static PassRefPtr<Structure> createStructure(JSValue prototype);
virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
virtual bool getOwnPropertySlot(JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);
- virtual void put(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValuePtr, JSC::PutPropertySlot&);
- virtual void put(JSC::ExecState*, unsigned propertyName, JSC::JSValuePtr);
+ virtual void put(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, JSC::PutPropertySlot&);
+ virtual void put(JSC::ExecState*, unsigned propertyName, JSC::JSValue);
virtual void getPropertyNames(JSC::ExecState*, JSC::PropertyNameArray&);
@@ -87,7 +88,7 @@ namespace JSC {
size_t length() const { return m_storage->length(); }
- ByteArray* storage() const { return m_storage.get(); }
+ WTF::ByteArray* storage() const { return m_storage.get(); }
private:
enum VPtrStealingHackType { VPtrStealingHack };
@@ -97,15 +98,18 @@ namespace JSC {
{
}
- RefPtr<ByteArray> m_storage;
+ RefPtr<WTF::ByteArray> m_storage;
const ClassInfo* m_classInfo;
};
- JSByteArray* asByteArray(JSValuePtr value);
- inline JSByteArray* asByteArray(JSValuePtr value)
+ JSByteArray* asByteArray(JSValue value);
+ inline JSByteArray* asByteArray(JSValue value)
{
return static_cast<JSByteArray*>(asCell(value));
}
-}
-#endif
+ inline bool isJSByteArray(JSGlobalData* globalData, JSValue v) { return v.isCell() && v.asCell()->vptr() == globalData->jsByteArrayVPtr; }
+
+} // namespace JSC
+
+#endif // JSByteArray_h