diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-27 21:51:42 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-27 21:51:42 +0200 |
commit | be01689f43cf6882cf670d33df49ead1f570c53a (patch) | |
tree | 4bb2161d8983b38e3e7ed37b4a50303bfd5e2e85 /Source/JavaScriptCore/runtime | |
parent | a89b2ebb8e192c5e8cea21079bda2ee2c0c7dddd (diff) | |
download | qtwebkit-be01689f43cf6882cf670d33df49ead1f570c53a.tar.gz |
Imported WebKit commit 8d6c5efc74f0222dfc7bcce8d845d4a2707ed9e6 (http://svn.webkit.org/repository/webkit/trunk@118629)
Diffstat (limited to 'Source/JavaScriptCore/runtime')
-rw-r--r-- | Source/JavaScriptCore/runtime/Arguments.cpp | 2 | ||||
-rw-r--r-- | Source/JavaScriptCore/runtime/DateInstance.cpp | 2 | ||||
-rw-r--r-- | Source/JavaScriptCore/runtime/Error.cpp | 2 | ||||
-rw-r--r-- | Source/JavaScriptCore/runtime/Executable.cpp | 12 | ||||
-rw-r--r-- | Source/JavaScriptCore/runtime/JSGlobalObject.cpp | 2 | ||||
-rw-r--r-- | Source/JavaScriptCore/runtime/JSPropertyNameIterator.cpp | 2 | ||||
-rw-r--r-- | Source/JavaScriptCore/runtime/JSStaticScopeObject.cpp | 2 | ||||
-rw-r--r-- | Source/JavaScriptCore/runtime/JSString.cpp | 2 | ||||
-rw-r--r-- | Source/JavaScriptCore/runtime/JSValue.h | 2 | ||||
-rw-r--r-- | Source/JavaScriptCore/runtime/JSVariableObject.cpp | 2 | ||||
-rw-r--r-- | Source/JavaScriptCore/runtime/NameInstance.cpp | 2 | ||||
-rw-r--r-- | Source/JavaScriptCore/runtime/RegExp.cpp | 2 | ||||
-rw-r--r-- | Source/JavaScriptCore/runtime/RegExpConstructor.cpp | 2 | ||||
-rw-r--r-- | Source/JavaScriptCore/runtime/Structure.cpp | 2 | ||||
-rw-r--r-- | Source/JavaScriptCore/runtime/Structure.h | 7 | ||||
-rw-r--r-- | Source/JavaScriptCore/runtime/StructureChain.cpp | 2 |
16 files changed, 28 insertions, 19 deletions
diff --git a/Source/JavaScriptCore/runtime/Arguments.cpp b/Source/JavaScriptCore/runtime/Arguments.cpp index 4628cec8d..96791c326 100644 --- a/Source/JavaScriptCore/runtime/Arguments.cpp +++ b/Source/JavaScriptCore/runtime/Arguments.cpp @@ -54,7 +54,7 @@ void Arguments::visitChildren(JSCell* cell, SlotVisitor& visitor) void Arguments::destroy(JSCell* cell) { - jsCast<Arguments*>(cell)->Arguments::~Arguments(); + static_cast<Arguments*>(cell)->Arguments::~Arguments(); } void Arguments::copyToArguments(ExecState* exec, CallFrame* callFrame, uint32_t length) diff --git a/Source/JavaScriptCore/runtime/DateInstance.cpp b/Source/JavaScriptCore/runtime/DateInstance.cpp index a502770c8..47a19df47 100644 --- a/Source/JavaScriptCore/runtime/DateInstance.cpp +++ b/Source/JavaScriptCore/runtime/DateInstance.cpp @@ -55,7 +55,7 @@ void DateInstance::finishCreation(JSGlobalData& globalData, double time) void DateInstance::destroy(JSCell* cell) { - jsCast<DateInstance*>(cell)->DateInstance::~DateInstance(); + static_cast<DateInstance*>(cell)->DateInstance::~DateInstance(); } const GregorianDateTime* DateInstance::calculateGregorianDateTime(ExecState* exec) const diff --git a/Source/JavaScriptCore/runtime/Error.cpp b/Source/JavaScriptCore/runtime/Error.cpp index bae07448b..a3a990d59 100644 --- a/Source/JavaScriptCore/runtime/Error.cpp +++ b/Source/JavaScriptCore/runtime/Error.cpp @@ -183,7 +183,7 @@ const ClassInfo StrictModeTypeErrorFunction::s_info = { "Function", &Base::s_inf void StrictModeTypeErrorFunction::destroy(JSCell* cell) { - jsCast<StrictModeTypeErrorFunction*>(cell)->StrictModeTypeErrorFunction::~StrictModeTypeErrorFunction(); + static_cast<StrictModeTypeErrorFunction*>(cell)->StrictModeTypeErrorFunction::~StrictModeTypeErrorFunction(); } } // namespace JSC diff --git a/Source/JavaScriptCore/runtime/Executable.cpp b/Source/JavaScriptCore/runtime/Executable.cpp index 0a6425a59..0ada2cb0f 100644 --- a/Source/JavaScriptCore/runtime/Executable.cpp +++ b/Source/JavaScriptCore/runtime/Executable.cpp @@ -43,7 +43,7 @@ const ClassInfo ExecutableBase::s_info = { "Executable", 0, 0, 0, CREATE_METHOD_ #if ENABLE(JIT) void ExecutableBase::destroy(JSCell* cell) { - jsCast<ExecutableBase*>(cell)->ExecutableBase::~ExecutableBase(); + static_cast<ExecutableBase*>(cell)->ExecutableBase::~ExecutableBase(); } #endif @@ -73,7 +73,7 @@ const ClassInfo NativeExecutable::s_info = { "NativeExecutable", &ExecutableBase #if ENABLE(JIT) void NativeExecutable::destroy(JSCell* cell) { - jsCast<NativeExecutable*>(cell)->NativeExecutable::~NativeExecutable(); + static_cast<NativeExecutable*>(cell)->NativeExecutable::~NativeExecutable(); } #endif @@ -108,7 +108,7 @@ const ClassInfo ScriptExecutable::s_info = { "ScriptExecutable", &ExecutableBase #if ENABLE(JIT) void ScriptExecutable::destroy(JSCell* cell) { - jsCast<ScriptExecutable*>(cell)->ScriptExecutable::~ScriptExecutable(); + static_cast<ScriptExecutable*>(cell)->ScriptExecutable::~ScriptExecutable(); } #endif @@ -121,7 +121,7 @@ EvalExecutable::EvalExecutable(ExecState* exec, const SourceCode& source, bool i void EvalExecutable::destroy(JSCell* cell) { - jsCast<EvalExecutable*>(cell)->EvalExecutable::~EvalExecutable(); + static_cast<EvalExecutable*>(cell)->EvalExecutable::~EvalExecutable(); } const ClassInfo ProgramExecutable::s_info = { "ProgramExecutable", &ScriptExecutable::s_info, 0, 0, CREATE_METHOD_TABLE(ProgramExecutable) }; @@ -133,7 +133,7 @@ ProgramExecutable::ProgramExecutable(ExecState* exec, const SourceCode& source) void ProgramExecutable::destroy(JSCell* cell) { - jsCast<ProgramExecutable*>(cell)->ProgramExecutable::~ProgramExecutable(); + static_cast<ProgramExecutable*>(cell)->ProgramExecutable::~ProgramExecutable(); } const ClassInfo FunctionExecutable::s_info = { "FunctionExecutable", &ScriptExecutable::s_info, 0, 0, CREATE_METHOD_TABLE(FunctionExecutable) }; @@ -166,7 +166,7 @@ FunctionExecutable::FunctionExecutable(ExecState* exec, const Identifier& name, void FunctionExecutable::destroy(JSCell* cell) { - jsCast<FunctionExecutable*>(cell)->FunctionExecutable::~FunctionExecutable(); + static_cast<FunctionExecutable*>(cell)->FunctionExecutable::~FunctionExecutable(); } JSObject* EvalExecutable::compileOptimized(ExecState* exec, ScopeChainNode* scopeChainNode) diff --git a/Source/JavaScriptCore/runtime/JSGlobalObject.cpp b/Source/JavaScriptCore/runtime/JSGlobalObject.cpp index 2a4231537..8c8aa9079 100644 --- a/Source/JavaScriptCore/runtime/JSGlobalObject.cpp +++ b/Source/JavaScriptCore/runtime/JSGlobalObject.cpp @@ -127,7 +127,7 @@ JSGlobalObject::~JSGlobalObject() void JSGlobalObject::destroy(JSCell* cell) { - jsCast<JSGlobalObject*>(cell)->JSGlobalObject::~JSGlobalObject(); + static_cast<JSGlobalObject*>(cell)->JSGlobalObject::~JSGlobalObject(); } void JSGlobalObject::init(JSObject* thisValue) diff --git a/Source/JavaScriptCore/runtime/JSPropertyNameIterator.cpp b/Source/JavaScriptCore/runtime/JSPropertyNameIterator.cpp index 6fd8b770b..6ceb3c411 100644 --- a/Source/JavaScriptCore/runtime/JSPropertyNameIterator.cpp +++ b/Source/JavaScriptCore/runtime/JSPropertyNameIterator.cpp @@ -83,7 +83,7 @@ JSPropertyNameIterator* JSPropertyNameIterator::create(ExecState* exec, JSObject void JSPropertyNameIterator::destroy(JSCell* cell) { - jsCast<JSPropertyNameIterator*>(cell)->JSPropertyNameIterator::~JSPropertyNameIterator(); + static_cast<JSPropertyNameIterator*>(cell)->JSPropertyNameIterator::~JSPropertyNameIterator(); } JSValue JSPropertyNameIterator::get(ExecState* exec, JSObject* base, size_t i) diff --git a/Source/JavaScriptCore/runtime/JSStaticScopeObject.cpp b/Source/JavaScriptCore/runtime/JSStaticScopeObject.cpp index fc4c27bab..e5e65673c 100644 --- a/Source/JavaScriptCore/runtime/JSStaticScopeObject.cpp +++ b/Source/JavaScriptCore/runtime/JSStaticScopeObject.cpp @@ -36,7 +36,7 @@ const ClassInfo JSStaticScopeObject::s_info = { "Object", &Base::s_info, 0, 0, C void JSStaticScopeObject::destroy(JSCell* cell) { - jsCast<JSStaticScopeObject*>(cell)->JSStaticScopeObject::~JSStaticScopeObject(); + static_cast<JSStaticScopeObject*>(cell)->JSStaticScopeObject::~JSStaticScopeObject(); } void JSStaticScopeObject::visitChildren(JSCell* cell, SlotVisitor& visitor) diff --git a/Source/JavaScriptCore/runtime/JSString.cpp b/Source/JavaScriptCore/runtime/JSString.cpp index ad6bd3812..180c64b8b 100644 --- a/Source/JavaScriptCore/runtime/JSString.cpp +++ b/Source/JavaScriptCore/runtime/JSString.cpp @@ -47,7 +47,7 @@ void JSRopeString::RopeBuilder::expand() void JSString::destroy(JSCell* cell) { - JSString* thisObject = jsCast<JSString*>(cell); + JSString* thisObject = static_cast<JSString*>(cell); thisObject->JSString::~JSString(); } diff --git a/Source/JavaScriptCore/runtime/JSValue.h b/Source/JavaScriptCore/runtime/JSValue.h index 27046097c..f74bfad90 100644 --- a/Source/JavaScriptCore/runtime/JSValue.h +++ b/Source/JavaScriptCore/runtime/JSValue.h @@ -239,6 +239,8 @@ namespace JSC { bool isCell() const; JSCell* asCell() const; JS_EXPORT_PRIVATE bool isValidCallee(); + + JSValue structureOrUndefined() const; char* description() const; diff --git a/Source/JavaScriptCore/runtime/JSVariableObject.cpp b/Source/JavaScriptCore/runtime/JSVariableObject.cpp index eb9dfd4be..9dcbead34 100644 --- a/Source/JavaScriptCore/runtime/JSVariableObject.cpp +++ b/Source/JavaScriptCore/runtime/JSVariableObject.cpp @@ -39,7 +39,7 @@ namespace JSC { void JSVariableObject::destroy(JSCell* cell) { - jsCast<JSVariableObject*>(cell)->JSVariableObject::~JSVariableObject(); + static_cast<JSVariableObject*>(cell)->JSVariableObject::~JSVariableObject(); } bool JSVariableObject::deleteProperty(JSCell* cell, ExecState* exec, PropertyName propertyName) diff --git a/Source/JavaScriptCore/runtime/NameInstance.cpp b/Source/JavaScriptCore/runtime/NameInstance.cpp index aae290cb2..410fe62e7 100644 --- a/Source/JavaScriptCore/runtime/NameInstance.cpp +++ b/Source/JavaScriptCore/runtime/NameInstance.cpp @@ -38,7 +38,7 @@ NameInstance::NameInstance(JSGlobalData& globalData, Structure* structure, JSStr void NameInstance::destroy(JSCell* cell) { - jsCast<NameInstance*>(cell)->NameInstance::~NameInstance(); + static_cast<NameInstance*>(cell)->NameInstance::~NameInstance(); } } // namespace JSC diff --git a/Source/JavaScriptCore/runtime/RegExp.cpp b/Source/JavaScriptCore/runtime/RegExp.cpp index b0f67607e..64e553be1 100644 --- a/Source/JavaScriptCore/runtime/RegExp.cpp +++ b/Source/JavaScriptCore/runtime/RegExp.cpp @@ -243,7 +243,7 @@ void RegExp::finishCreation(JSGlobalData& globalData) void RegExp::destroy(JSCell* cell) { - RegExp* thisObject = jsCast<RegExp*>(cell); + RegExp* thisObject = static_cast<RegExp*>(cell); #if REGEXP_FUNC_TEST_DATA_GEN RegExpFunctionalTestCollector::get()->clearRegExp(this); #endif diff --git a/Source/JavaScriptCore/runtime/RegExpConstructor.cpp b/Source/JavaScriptCore/runtime/RegExpConstructor.cpp index 2c0f0c000..0f2091c27 100644 --- a/Source/JavaScriptCore/runtime/RegExpConstructor.cpp +++ b/Source/JavaScriptCore/runtime/RegExpConstructor.cpp @@ -104,7 +104,7 @@ void RegExpConstructor::finishCreation(ExecState* exec, RegExpPrototype* regExpP void RegExpConstructor::destroy(JSCell* cell) { - jsCast<RegExpConstructor*>(cell)->RegExpConstructor::~RegExpConstructor(); + static_cast<RegExpConstructor*>(cell)->RegExpConstructor::~RegExpConstructor(); } void RegExpConstructor::visitChildren(JSCell* cell, SlotVisitor& visitor) diff --git a/Source/JavaScriptCore/runtime/Structure.cpp b/Source/JavaScriptCore/runtime/Structure.cpp index b22deb0fa..dc4239799 100644 --- a/Source/JavaScriptCore/runtime/Structure.cpp +++ b/Source/JavaScriptCore/runtime/Structure.cpp @@ -216,7 +216,7 @@ Structure::Structure(JSGlobalData& globalData, const Structure* previous) void Structure::destroy(JSCell* cell) { - jsCast<Structure*>(cell)->Structure::~Structure(); + static_cast<Structure*>(cell)->Structure::~Structure(); } void Structure::materializePropertyMap(JSGlobalData& globalData) diff --git a/Source/JavaScriptCore/runtime/Structure.h b/Source/JavaScriptCore/runtime/Structure.h index 74336a288..f67c4e7f7 100644 --- a/Source/JavaScriptCore/runtime/Structure.h +++ b/Source/JavaScriptCore/runtime/Structure.h @@ -332,6 +332,13 @@ namespace JSC { return entry ? entry->offset : notFound; } + inline JSValue JSValue::structureOrUndefined() const + { + if (isCell()) + return JSValue(asCell()->structure()); + return jsUndefined(); + } + inline bool JSCell::isObject() const { return m_structure->isObject(); diff --git a/Source/JavaScriptCore/runtime/StructureChain.cpp b/Source/JavaScriptCore/runtime/StructureChain.cpp index afb2d9501..a1c97340e 100644 --- a/Source/JavaScriptCore/runtime/StructureChain.cpp +++ b/Source/JavaScriptCore/runtime/StructureChain.cpp @@ -41,7 +41,7 @@ StructureChain::StructureChain(JSGlobalData& globalData, Structure* structure) void StructureChain::destroy(JSCell* cell) { - jsCast<StructureChain*>(cell)->StructureChain::~StructureChain(); + static_cast<StructureChain*>(cell)->StructureChain::~StructureChain(); } void StructureChain::visitChildren(JSCell* cell, SlotVisitor& visitor) |