summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/runtime/JSCell.cpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2016-04-10 09:28:39 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2016-04-10 09:28:39 +0000
commit32761a6cee1d0dee366b885b7b9c777e67885688 (patch)
treed6bec92bebfb216f4126356e55518842c2f476a1 /Source/JavaScriptCore/runtime/JSCell.cpp
parenta4e969f4965059196ca948db781e52f7cfebf19e (diff)
downloadWebKitGtk-tarball-32761a6cee1d0dee366b885b7b9c777e67885688.tar.gz
webkitgtk-2.4.11webkitgtk-2.4.11
Diffstat (limited to 'Source/JavaScriptCore/runtime/JSCell.cpp')
-rw-r--r--Source/JavaScriptCore/runtime/JSCell.cpp61
1 files changed, 8 insertions, 53 deletions
diff --git a/Source/JavaScriptCore/runtime/JSCell.cpp b/Source/JavaScriptCore/runtime/JSCell.cpp
index 09af32bf9..f472a9679 100644
--- a/Source/JavaScriptCore/runtime/JSCell.cpp
+++ b/Source/JavaScriptCore/runtime/JSCell.cpp
@@ -28,12 +28,11 @@
#include "JSString.h"
#include "JSObject.h"
#include "NumberObject.h"
-#include "JSCInlines.h"
+#include "Operations.h"
#include <wtf/MathExtras.h>
namespace JSC {
-COMPILE_ASSERT(sizeof(JSCell) == sizeof(uint64_t), jscell_is_eight_bytes);
STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(JSCell);
void JSCell::destroy(JSCell* cell)
@@ -41,26 +40,6 @@ void JSCell::destroy(JSCell* cell)
cell->JSCell::~JSCell();
}
-void JSCell::dump(PrintStream& out) const
-{
- methodTable()->dumpToStream(this, out);
-}
-
-void JSCell::dumpToStream(const JSCell* cell, PrintStream& out)
-{
- out.printf("<%p, %s>", cell, cell->className());
-}
-
-size_t JSCell::estimatedSizeInBytes() const
-{
- return methodTable()->estimatedSize(const_cast<JSCell*>(this));
-}
-
-size_t JSCell::estimatedSize(JSCell* cell)
-{
- return MarkedBlock::blockFor(cell)->cellSize();
-}
-
void JSCell::copyBackingStore(JSCell*, CopyVisitor&, CopyToken)
{
}
@@ -106,35 +85,35 @@ ConstructType JSCell::getConstructData(JSCell*, ConstructData& constructData)
void JSCell::put(JSCell* cell, ExecState* exec, PropertyName identifier, JSValue value, PutPropertySlot& slot)
{
- if (cell->isString() || cell->isSymbol()) {
+ if (cell->isString()) {
JSValue(cell).putToPrimitive(exec, identifier, value, slot);
return;
}
JSObject* thisObject = cell->toObject(exec, exec->lexicalGlobalObject());
- thisObject->methodTable(exec->vm())->put(thisObject, exec, identifier, value, slot);
+ thisObject->methodTable()->put(thisObject, exec, identifier, value, slot);
}
void JSCell::putByIndex(JSCell* cell, ExecState* exec, unsigned identifier, JSValue value, bool shouldThrow)
{
- if (cell->isString() || cell->isSymbol()) {
+ if (cell->isString()) {
PutPropertySlot slot(cell, shouldThrow);
JSValue(cell).putToPrimitive(exec, Identifier::from(exec, identifier), value, slot);
return;
}
JSObject* thisObject = cell->toObject(exec, exec->lexicalGlobalObject());
- thisObject->methodTable(exec->vm())->putByIndex(thisObject, exec, identifier, value, shouldThrow);
+ thisObject->methodTable()->putByIndex(thisObject, exec, identifier, value, shouldThrow);
}
bool JSCell::deleteProperty(JSCell* cell, ExecState* exec, PropertyName identifier)
{
JSObject* thisObject = cell->toObject(exec, exec->lexicalGlobalObject());
- return thisObject->methodTable(exec->vm())->deleteProperty(thisObject, exec, identifier);
+ return thisObject->methodTable()->deleteProperty(thisObject, exec, identifier);
}
bool JSCell::deletePropertyByIndex(JSCell* cell, ExecState* exec, unsigned identifier)
{
JSObject* thisObject = cell->toObject(exec, exec->lexicalGlobalObject());
- return thisObject->methodTable(exec->vm())->deletePropertyByIndex(thisObject, exec, identifier);
+ return thisObject->methodTable()->deletePropertyByIndex(thisObject, exec, identifier);
}
JSValue JSCell::toThis(JSCell* cell, ExecState* exec, ECMAMode ecmaMode)
@@ -148,8 +127,6 @@ JSValue JSCell::toPrimitive(ExecState* exec, PreferredPrimitiveType preferredTyp
{
if (isString())
return static_cast<const JSString*>(this)->toPrimitive(exec, preferredType);
- if (isSymbol())
- return static_cast<const Symbol*>(this)->toPrimitive(exec, preferredType);
return static_cast<const JSObject*>(this)->toPrimitive(exec, preferredType);
}
@@ -157,8 +134,6 @@ bool JSCell::getPrimitiveNumber(ExecState* exec, double& number, JSValue& value)
{
if (isString())
return static_cast<const JSString*>(this)->getPrimitiveNumber(exec, number, value);
- if (isSymbol())
- return static_cast<const Symbol*>(this)->getPrimitiveNumber(exec, number, value);
return static_cast<const JSObject*>(this)->getPrimitiveNumber(exec, number, value);
}
@@ -166,8 +141,6 @@ double JSCell::toNumber(ExecState* exec) const
{
if (isString())
return static_cast<const JSString*>(this)->toNumber(exec);
- if (isSymbol())
- return static_cast<const Symbol*>(this)->toNumber(exec);
return static_cast<const JSObject*>(this)->toNumber(exec);
}
@@ -175,8 +148,6 @@ JSObject* JSCell::toObject(ExecState* exec, JSGlobalObject* globalObject) const
{
if (isString())
return static_cast<const JSString*>(this)->toObject(exec, globalObject);
- if (isSymbol())
- return static_cast<const Symbol*>(this)->toObject(exec, globalObject);
ASSERT(isObject());
return jsCast<JSObject*>(const_cast<JSCell*>(this));
}
@@ -220,7 +191,7 @@ String JSCell::className(const JSObject*)
return String();
}
-const char* JSCell::className() const
+const char* JSCell::className()
{
return classInfo()->className;
}
@@ -254,20 +225,4 @@ PassRefPtr<ArrayBufferView> JSCell::getTypedArrayImpl(JSArrayBufferView*)
return 0;
}
-uint32_t JSCell::getEnumerableLength(ExecState*, JSObject*)
-{
- RELEASE_ASSERT_NOT_REACHED();
- return 0;
-}
-
-void JSCell::getStructurePropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode)
-{
- RELEASE_ASSERT_NOT_REACHED();
-}
-
-void JSCell::getGenericPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode)
-{
- RELEASE_ASSERT_NOT_REACHED();
-}
-
} // namespace JSC