Commit 39512785 authored by mhahnenberg@apple.com's avatar mhahnenberg@apple.com

Remove putVirtual

https://bugs.webkit.org/show_bug.cgi?id=70740

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Removed all declarations and definitions of putVirtual.
Also replaced all call sites to putVirtual with a
corresponding lookup in the MethodTable.

* API/JSCallbackObject.h:
* API/JSCallbackObjectFunctions.h:
* API/JSObjectRef.cpp:
(JSObjectSetProperty):
(JSObjectSetPropertyAtIndex):
* JavaScriptCore.exp:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
* debugger/DebuggerActivation.cpp:
(JSC::DebuggerActivation::put):
* debugger/DebuggerActivation.h:
* dfg/DFGOperations.cpp:
* interpreter/Interpreter.cpp:
(JSC::Interpreter::execute):
(JSC::Interpreter::privateExecute):
* jsc.cpp:
(GlobalObject::finishCreation):
* runtime/Arguments.cpp:
* runtime/Arguments.h:
* runtime/ArrayPrototype.cpp:
(JSC::putProperty):
(JSC::arrayProtoFuncConcat):
(JSC::arrayProtoFuncPush):
(JSC::arrayProtoFuncReverse):
(JSC::arrayProtoFuncShift):
(JSC::arrayProtoFuncSlice):
(JSC::arrayProtoFuncSort):
(JSC::arrayProtoFuncSplice):
(JSC::arrayProtoFuncUnShift):
(JSC::arrayProtoFuncFilter):
(JSC::arrayProtoFuncMap):
* runtime/JSActivation.cpp:
* runtime/JSActivation.h:
* runtime/JSArray.cpp:
(JSC::JSArray::putSlowCase):
(JSC::JSArray::push):
(JSC::JSArray::shiftCount):
(JSC::JSArray::unshiftCount):
* runtime/JSArray.h:
* runtime/JSByteArray.cpp:
* runtime/JSByteArray.h:
* runtime/JSCell.cpp:
(JSC::JSCell::put):
(JSC::JSCell::putByIndex):
* runtime/JSCell.h:
* runtime/JSFunction.cpp:
* runtime/JSFunction.h:
* runtime/JSGlobalObject.cpp:
* runtime/JSGlobalObject.h:
* runtime/JSNotAnObject.cpp:
* runtime/JSNotAnObject.h:
* runtime/JSONObject.cpp:
(JSC::Walker::walk):
* runtime/JSObject.cpp:
(JSC::JSObject::putByIndex):
(JSC::JSObject::defineOwnProperty):
* runtime/JSObject.h:
(JSC::JSValue::put):
* runtime/JSStaticScopeObject.cpp:
* runtime/JSStaticScopeObject.h:
* runtime/ObjectPrototype.cpp:
* runtime/ObjectPrototype.h:
* runtime/RegExpConstructor.cpp:
* runtime/RegExpConstructor.h:
* runtime/RegExpMatchesArray.h:
* runtime/RegExpObject.cpp:
* runtime/RegExpObject.h:
* runtime/StringObject.cpp:
* runtime/StringObject.h:
* runtime/StringPrototype.cpp:
(JSC::stringProtoFuncSplit):

Source/JavaScriptGlue:

Removed all declarations and definitions of putVirtual.
Also replaced all call sites to putVirtual with a
corresponding lookup in the MethodTable.

* JSValueWrapper.cpp:
(JSValueWrapper::JSObjectSetProperty):
* UserObjectImp.cpp:
* UserObjectImp.h:

Source/WebCore:

No new tests.

Removed all declarations and definitions of putVirtual.
Also replaced all call sites to putVirtual with a
corresponding lookup in the MethodTable.

* WebCore.exp.in:
* bindings/js/JSDOMWindowCustom.cpp:
* bindings/js/JSDOMWindowShell.cpp:
(WebCore::JSDOMWindowShell::put):
* bindings/js/JSDOMWindowShell.h:
* bindings/js/JSPluginElementFunctions.cpp:
(WebCore::runtimeObjectCustomPut):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::putProperty):
* bindings/objc/WebScriptObject.mm:
(-[WebScriptObject setValue:forKey:]):
(-[WebScriptObject setWebScriptValueAtIndex:value:]):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateImplementation):
* bridge/NP_jsobject.cpp:
(_NPN_SetProperty):
* bridge/jni/jni_jsobject.mm:
(JavaJSObject::setMember):
(JavaJSObject::setSlot):
* bridge/objc/objc_runtime.h:
* bridge/objc/objc_runtime.mm:
* bridge/qt/qt_runtime.cpp:
(JSC::Bindings::convertQVariantToValue):
* bridge/runtime_array.cpp:
* bridge/runtime_array.h:
* bridge/runtime_object.cpp:
* bridge/runtime_object.h:
* bridge/testqtbindings.cpp:
(main):

Source/WebKit/efl:

Removed all declarations and definitions of putVirtual.
Also replaced all call sites to putVirtual with a
corresponding lookup in the MethodTable.

* ewk/ewk_view.cpp:
(ewk_view_js_object_add):

Source/WebKit/mac:

Removed all declarations and definitions of putVirtual.
Also replaced all call sites to putVirtual with a
corresponding lookup in the MethodTable.

* Plugins/Hosted/NetscapePluginInstanceProxy.mm:
(WebKit::NetscapePluginInstanceProxy::setProperty):

Source/WebKit/qt:

Removed all declarations and definitions of putVirtual.
Also replaced all call sites to putVirtual with a
corresponding lookup in the MethodTable.

* Api/qwebframe.cpp:
(QWebFrame::addToJavaScriptWindowObject):

Source/WebKit2:

Removed all declarations and definitions of putVirtual.
Also replaced all call sites to putVirtual with a
corresponding lookup in the MethodTable.

* WebProcess/Plugins/Netscape/JSNPObject.cpp:
* WebProcess/Plugins/Netscape/JSNPObject.h:
* WebProcess/Plugins/Netscape/NPJSObject.cpp:
(WebKit::NPJSObject::setProperty):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@98415 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 62996af2
......@@ -182,7 +182,6 @@ private:
static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
virtual void putVirtual(ExecState*, const Identifier&, JSValue, PutPropertySlot&);
static void put(JSCell*, ExecState*, const Identifier&, JSValue, PutPropertySlot&);
virtual bool deletePropertyVirtual(ExecState*, const Identifier&);
......
......@@ -207,12 +207,6 @@ bool JSCallbackObject<Parent>::getOwnPropertyDescriptor(ExecState* exec, const I
return Parent::getOwnPropertyDescriptor(exec, propertyName, descriptor);
}
template <class Parent>
void JSCallbackObject<Parent>::putVirtual(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
{
put(this, exec, propertyName, value, slot);
}
template <class Parent>
void JSCallbackObject<Parent>::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
{
......
......@@ -277,7 +277,7 @@ void JSObjectSetProperty(JSContextRef ctx, JSObjectRef object, JSStringRef prope
jsObject->putWithAttributes(exec, name, jsValue, attributes);
else {
PutPropertySlot slot;
jsObject->putVirtual(exec, name, jsValue, slot);
jsObject->methodTable()->put(jsObject, exec, name, jsValue, slot);
}
if (exec->hadException()) {
......@@ -312,7 +312,7 @@ void JSObjectSetPropertyAtIndex(JSContextRef ctx, JSObjectRef object, unsigned p
JSObject* jsObject = toJS(object);
JSValue jsValue = toJS(exec, value);
jsObject->putVirtual(exec, propertyIndex, jsValue);
jsObject->methodTable()->putByIndex(jsObject, exec, propertyIndex, jsValue);
if (exec->hadException()) {
if (exception)
*exception = toRef(exec, exec->exception());
......
2011-10-25 Mark Hahnenberg <mhahnenberg@apple.com>
Remove putVirtual
https://bugs.webkit.org/show_bug.cgi?id=70740
Reviewed by Geoffrey Garen.
Removed all declarations and definitions of putVirtual.
Also replaced all call sites to putVirtual with a
corresponding lookup in the MethodTable.
* API/JSCallbackObject.h:
* API/JSCallbackObjectFunctions.h:
* API/JSObjectRef.cpp:
(JSObjectSetProperty):
(JSObjectSetPropertyAtIndex):
* JavaScriptCore.exp:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
* debugger/DebuggerActivation.cpp:
(JSC::DebuggerActivation::put):
* debugger/DebuggerActivation.h:
* dfg/DFGOperations.cpp:
* interpreter/Interpreter.cpp:
(JSC::Interpreter::execute):
(JSC::Interpreter::privateExecute):
* jsc.cpp:
(GlobalObject::finishCreation):
* runtime/Arguments.cpp:
* runtime/Arguments.h:
* runtime/ArrayPrototype.cpp:
(JSC::putProperty):
(JSC::arrayProtoFuncConcat):
(JSC::arrayProtoFuncPush):
(JSC::arrayProtoFuncReverse):
(JSC::arrayProtoFuncShift):
(JSC::arrayProtoFuncSlice):
(JSC::arrayProtoFuncSort):
(JSC::arrayProtoFuncSplice):
(JSC::arrayProtoFuncUnShift):
(JSC::arrayProtoFuncFilter):
(JSC::arrayProtoFuncMap):
* runtime/JSActivation.cpp:
* runtime/JSActivation.h:
* runtime/JSArray.cpp:
(JSC::JSArray::putSlowCase):
(JSC::JSArray::push):
(JSC::JSArray::shiftCount):
(JSC::JSArray::unshiftCount):
* runtime/JSArray.h:
* runtime/JSByteArray.cpp:
* runtime/JSByteArray.h:
* runtime/JSCell.cpp:
(JSC::JSCell::put):
(JSC::JSCell::putByIndex):
* runtime/JSCell.h:
* runtime/JSFunction.cpp:
* runtime/JSFunction.h:
* runtime/JSGlobalObject.cpp:
* runtime/JSGlobalObject.h:
* runtime/JSNotAnObject.cpp:
* runtime/JSNotAnObject.h:
* runtime/JSONObject.cpp:
(JSC::Walker::walk):
* runtime/JSObject.cpp:
(JSC::JSObject::putByIndex):
(JSC::JSObject::defineOwnProperty):
* runtime/JSObject.h:
(JSC::JSValue::put):
* runtime/JSStaticScopeObject.cpp:
* runtime/JSStaticScopeObject.h:
* runtime/ObjectPrototype.cpp:
* runtime/ObjectPrototype.h:
* runtime/RegExpConstructor.cpp:
* runtime/RegExpConstructor.h:
* runtime/RegExpMatchesArray.h:
* runtime/RegExpObject.cpp:
* runtime/RegExpObject.h:
* runtime/StringObject.cpp:
* runtime/StringObject.h:
* runtime/StringPrototype.cpp:
(JSC::stringProtoFuncSplit):
2011-10-25 Gavin Barraclough <barraclough@apple.com>
Separate out function linking & exception check data structures.
......@@ -161,7 +161,6 @@ __ZN3JSC13SamplingFlags5startEv
__ZN3JSC13SamplingFlags7s_flagsE
__ZN3JSC13StatementNode6setLocEii
__ZN3JSC14JSGlobalObject10globalExecEv
__ZN3JSC14JSGlobalObject10putVirtualEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE
__ZN3JSC14JSGlobalObject12defineGetterEPNS_9ExecStateERKNS_10IdentifierEPNS_8JSObjectEj
__ZN3JSC14JSGlobalObject12defineSetterEPNS_9ExecStateERKNS_10IdentifierEPNS_8JSObjectEj
__ZN3JSC14JSGlobalObject13clearRareDataEPNS_6JSCellE
......@@ -260,8 +259,6 @@ __ZN3JSC4Yarr11YarrPatternC1ERKNS_7UStringEbbPPKc
__ZN3JSC4Yarr11byteCompileERNS0_11YarrPatternEPN3WTF20BumpPointerAllocatorE
__ZN3JSC4Yarr9interpretEPNS0_15BytecodePatternERKNS_7UStringEjjPi
__ZN3JSC4callEPNS_9ExecStateENS_7JSValueENS_8CallTypeERKNS_8CallDataES2_RKNS_7ArgListE
__ZN3JSC6JSCell10putVirtualEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE
__ZN3JSC6JSCell10putVirtualEPNS_9ExecStateEjNS_7JSValueE
__ZN3JSC6JSCell11getCallDataEPS0_RNS_8CallDataE
__ZN3JSC6JSCell16getConstructDataEPS0_RNS_13ConstructDataE
__ZN3JSC6JSCell21deletePropertyVirtualEPNS_9ExecStateERKNS_10IdentifierE
......@@ -309,8 +306,6 @@ __ZN3JSC8Debugger6attachEPNS_14JSGlobalObjectE
__ZN3JSC8Debugger6detachEPNS_14JSGlobalObjectE
__ZN3JSC8DebuggerD2Ev
__ZN3JSC8JSObject10putByIndexEPNS_6JSCellEPNS_9ExecStateEjNS_7JSValueE
__ZN3JSC8JSObject10putVirtualEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE
__ZN3JSC8JSObject10putVirtualEPNS_9ExecStateEjNS_7JSValueE
__ZN3JSC8JSObject11hasInstanceEPNS_9ExecStateENS_7JSValueES3_
__ZN3JSC8JSObject12defineGetterEPNS_9ExecStateERKNS_10IdentifierEPS0_j
__ZN3JSC8JSObject12defineSetterEPNS_9ExecStateERKNS_10IdentifierEPS0_j
......
......@@ -280,11 +280,6 @@ EXPORTS
?putByIndex@JSByteArray@JSC@@SAXPAVJSCell@2@PAVExecState@2@IVJSValue@2@@Z
?putByIndex@JSObject@JSC@@SAXPAVJSCell@2@PAVExecState@2@IVJSValue@2@@Z
?putDirectInternal@JSObject@JSC@@AAE_NAAVJSGlobalData@2@ABVIdentifier@2@VJSValue@2@I_NAAVPutPropertySlot@2@PAVJSCell@2@@Z
?putVirtual@JSCell@JSC@@UAEXPAVExecState@2@ABVIdentifier@2@VJSValue@2@AAVPutPropertySlot@2@@Z
?putVirtual@JSCell@JSC@@UAEXPAVExecState@2@IVJSValue@2@@Z
?putVirtual@JSGlobalObject@JSC@@UAEXPAVExecState@2@ABVIdentifier@2@VJSValue@2@AAVPutPropertySlot@2@@Z
?putVirtual@JSObject@JSC@@UAEXPAVExecState@2@ABVIdentifier@2@VJSValue@2@AAVPutPropertySlot@2@@Z
?putVirtual@JSObject@JSC@@UAEXPAVExecState@2@IVJSValue@2@@Z
?putWithAttributes@JSGlobalObject@JSC@@UAEXPAVExecState@2@ABVIdentifier@2@VJSValue@2@I@Z
?putWithAttributes@JSObject@JSC@@UAEXPAVExecState@2@ABVIdentifier@2@VJSValue@2@I@Z
?putWithAttributes@JSObject@JSC@@UAEXPAVExecState@2@ABVIdentifier@2@VJSValue@2@I_NAAVPutPropertySlot@2@@Z
......
......@@ -70,14 +70,10 @@ bool DebuggerActivation::getOwnPropertySlot(JSCell* cell, ExecState* exec, const
return static_cast<DebuggerActivation*>(cell)->m_activation->getOwnPropertySlotVirtual(exec, propertyName, slot);
}
void DebuggerActivation::putVirtual(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
{
put(this, exec, propertyName, value, slot);
}
void DebuggerActivation::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
{
static_cast<DebuggerActivation*>(cell)->m_activation->putVirtual(exec, propertyName, value, slot);
DebuggerActivation* thisObject = static_cast<DebuggerActivation*>(cell);
thisObject->m_activation->methodTable()->put(thisObject->m_activation.get(), exec, propertyName, value, slot);
}
void DebuggerActivation::putWithAttributes(ExecState* exec, const Identifier& propertyName, JSValue value, unsigned attributes)
......
......@@ -45,7 +45,6 @@ namespace JSC {
virtual UString className() const;
virtual bool getOwnPropertySlotVirtual(ExecState*, const Identifier& propertyName, PropertySlot&);
static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&);
virtual void putVirtual(ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
static void put(JSCell*, ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
virtual void putWithAttributes(ExecState*, const Identifier& propertyName, JSValue, unsigned attributes);
virtual bool deletePropertyVirtual(ExecState*, const Identifier& propertyName);
......
......@@ -374,13 +374,13 @@ EncodedJSValue DFG_OPERATION operationArrayPop(ExecState*, JSArray* array)
void DFG_OPERATION operationPutByIdStrict(ExecState* exec, EncodedJSValue encodedValue, JSCell* base, Identifier* propertyName)
{
PutPropertySlot slot(true);
base->putVirtual(exec, *propertyName, JSValue::decode(encodedValue), slot);
base->methodTable()->put(base, exec, *propertyName, JSValue::decode(encodedValue), slot);
}
void DFG_OPERATION operationPutByIdNonStrict(ExecState* exec, EncodedJSValue encodedValue, JSCell* base, Identifier* propertyName)
{
PutPropertySlot slot(false);
base->putVirtual(exec, *propertyName, JSValue::decode(encodedValue), slot);
base->methodTable()->put(base, exec, *propertyName, JSValue::decode(encodedValue), slot);
}
void DFG_OPERATION operationPutByIdDirectStrict(ExecState* exec, EncodedJSValue encodedValue, JSCell* base, Identifier* propertyName)
......
......@@ -791,7 +791,7 @@ JSValue Interpreter::execute(ProgramExecutable* program, CallFrame* callFrame, S
if (JSONPPath.size() == 1 && JSONPPath[0].m_type == LiteralParser::JSONPPathEntryTypeDeclare) {
if (globalObject->hasProperty(callFrame, JSONPPath[0].m_pathEntryName)) {
PutPropertySlot slot;
globalObject->putVirtual(callFrame, JSONPPath[0].m_pathEntryName, JSONPValue, slot);
globalObject->methodTable()->put(globalObject, callFrame, JSONPPath[0].m_pathEntryName, JSONPValue, slot);
} else
globalObject->putWithAttributes(callFrame, JSONPPath[0].m_pathEntryName, JSONPValue, DontEnum | DontDelete);
// var declarations return undefined
......@@ -1251,14 +1251,14 @@ JSValue Interpreter::execute(EvalExecutable* eval, CallFrame* callFrame, JSValue
const Identifier& ident = codeBlock->variable(i);
if (!variableObject->hasProperty(callFrame, ident)) {
PutPropertySlot slot;
variableObject->putVirtual(callFrame, ident, jsUndefined(), slot);
variableObject->methodTable()->put(variableObject, callFrame, ident, jsUndefined(), slot);
}
}
for (int i = 0; i < numFunctions; ++i) {
FunctionExecutable* function = codeBlock->functionDecl(i);
PutPropertySlot slot;
variableObject->putVirtual(callFrame, function->name(), function->make(callFrame, scopeChain), slot);
variableObject->methodTable()->put(variableObject, callFrame, function->name(), function->make(callFrame, scopeChain), slot);
}
}
......@@ -3503,7 +3503,7 @@ skip_id_custom_self:
if (jsArray->canSetIndex(i))
jsArray->setIndex(*globalData, i, callFrame->r(value).jsValue());
else
jsArray->JSArray::putVirtual(callFrame, i, callFrame->r(value).jsValue());
jsArray->JSArray::putByIndex(jsArray, callFrame, i, callFrame->r(value).jsValue());
} else if (isJSByteArray(globalData, baseValue) && asByteArray(baseValue)->canAccessIndex(i)) {
JSByteArray* jsByteArray = asByteArray(baseValue);
JSValue jsValue = callFrame->r(value).jsValue();
......
......@@ -182,7 +182,7 @@ protected:
JSObject* array = constructEmptyArray(globalExec());
for (size_t i = 0; i < arguments.size(); ++i)
array->putVirtual(globalExec(), i, jsString(globalExec(), arguments[i]));
array->methodTable()->putByIndex(array, globalExec(), i, jsString(globalExec(), arguments[i]));
putDirect(globalData, Identifier(globalExec(), "arguments"), array);
}
......
......@@ -269,11 +269,6 @@ void Arguments::getOwnPropertyNames(ExecState* exec, PropertyNameArray& property
JSObject::getOwnPropertyNames(exec, propertyNames, mode);
}
void Arguments::putVirtual(ExecState* exec, unsigned i, JSValue value)
{
putByIndex(this, exec, i, value);
}
void Arguments::putByIndex(JSCell* cell, ExecState* exec, unsigned i, JSValue value)
{
Arguments* thisObject = static_cast<Arguments*>(cell);
......@@ -289,11 +284,6 @@ void Arguments::putByIndex(JSCell* cell, ExecState* exec, unsigned i, JSValue va
JSObject::put(thisObject, exec, Identifier(exec, UString::number(i)), value, slot);
}
void Arguments::putVirtual(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
{
put(this, exec, propertyName, value, slot);
}
void Arguments::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
{
Arguments* thisObject = static_cast<Arguments*>(cell);
......
......@@ -141,9 +141,7 @@ namespace JSC {
static bool getOwnPropertySlotByIndex(JSCell*, ExecState*, unsigned propertyName, PropertySlot&);
virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties);
virtual void putVirtual(ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
static void put(JSCell*, ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
virtual void putVirtual(ExecState*, unsigned propertyName, JSValue);
static void putByIndex(JSCell*, ExecState*, unsigned propertyName, JSValue);
virtual bool deletePropertyVirtual(ExecState*, const Identifier& propertyName);
static bool deleteProperty(JSCell*, ExecState*, const Identifier& propertyName);
......
......@@ -154,7 +154,7 @@ static JSValue getProperty(ExecState* exec, JSObject* obj, unsigned index)
static void putProperty(ExecState* exec, JSObject* obj, const Identifier& propertyName, JSValue value)
{
PutPropertySlot slot;
obj->putVirtual(exec, propertyName, value, slot);
obj->methodTable()->put(obj, exec, propertyName, value, slot);
}
static unsigned argumentClampedIndexFromStartOrEnd(ExecState* exec, int argument, unsigned length, unsigned undefinedValue = 0)
......@@ -354,11 +354,11 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncConcat(ExecState* exec)
if (exec->hadException())
return JSValue::encode(jsUndefined());
if (v)
arr->putVirtual(exec, n, v);
arr->methodTable()->putByIndex(arr, exec, n, v);
n++;
}
} else {
arr->putVirtual(exec, n, curArg);
arr->methodTable()->putByIndex(arr, exec, n, curArg);
n++;
}
if (i == argCount)
......@@ -412,11 +412,11 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncPush(ExecState* exec)
for (unsigned n = 0; n < exec->argumentCount(); n++) {
// Check for integer overflow; where safe we can do a fast put by index.
if (length + n >= length)
thisObj->putVirtual(exec, length + n, exec->argument(n));
thisObj->methodTable()->putByIndex(thisObj, exec, length + n, exec->argument(n));
else {
PutPropertySlot slot;
Identifier propertyName(exec, JSValue(static_cast<int64_t>(length) + static_cast<int64_t>(n)).toString(exec));
thisObj->putVirtual(exec, propertyName, exec->argument(n), slot);
thisObj->methodTable()->put(thisObj, exec, propertyName, exec->argument(n), slot);
}
}
JSValue newLength(static_cast<int64_t>(length) + static_cast<int64_t>(exec->argumentCount()));
......@@ -442,12 +442,12 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncReverse(ExecState* exec)
return JSValue::encode(jsUndefined());
if (obj2)
thisObj->putVirtual(exec, k, obj2);
thisObj->methodTable()->putByIndex(thisObj, exec, k, obj2);
else
thisObj->deletePropertyVirtual(exec, k);
if (obj)
thisObj->putVirtual(exec, lk1, obj);
thisObj->methodTable()->putByIndex(thisObj, exec, lk1, obj);
else
thisObj->deletePropertyVirtual(exec, lk1);
}
......@@ -475,7 +475,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncShift(ExecState* exec)
if (exec->hadException())
return JSValue::encode(jsUndefined());
if (obj)
thisObj->putVirtual(exec, k - 1, obj);
thisObj->methodTable()->putByIndex(thisObj, exec, k - 1, obj);
else
thisObj->deletePropertyVirtual(exec, k - 1);
}
......@@ -507,7 +507,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncSlice(ExecState* exec)
if (exec->hadException())
return JSValue::encode(jsUndefined());
if (v)
resObj->putVirtual(exec, n, v);
resObj->methodTable()->putByIndex(resObj, exec, n, v);
}
resObj->setLength(n);
return JSValue::encode(result);
......@@ -566,8 +566,8 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncSort(ExecState* exec)
}
// Swap themin and i
if (themin > i) {
thisObj->putVirtual(exec, i, minObj);
thisObj->putVirtual(exec, themin, iObj);
thisObj->methodTable()->putByIndex(thisObj, exec, i, minObj);
thisObj->methodTable()->putByIndex(thisObj, exec, themin, iObj);
}
}
return JSValue::encode(thisObj);
......@@ -621,7 +621,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncSplice(ExecState* exec)
if (exec->hadException())
return JSValue::encode(jsUndefined());
if (v)
thisObj->putVirtual(exec, k + additionalArgs, v);
thisObj->methodTable()->putByIndex(thisObj, exec, k + additionalArgs, v);
else
thisObj->deletePropertyVirtual(exec, k + additionalArgs);
}
......@@ -637,7 +637,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncSplice(ExecState* exec)
if (exec->hadException())
return JSValue::encode(jsUndefined());
if (obj)
thisObj->putVirtual(exec, k + additionalArgs - 1, obj);
thisObj->methodTable()->putByIndex(thisObj, exec, k + additionalArgs - 1, obj);
else
thisObj->deletePropertyVirtual(exec, k + additionalArgs - 1);
}
......@@ -645,7 +645,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncSplice(ExecState* exec)
}
}
for (unsigned k = 0; k < additionalArgs; ++k)
thisObj->putVirtual(exec, k + begin, exec->argument(k + 2));
thisObj->methodTable()->putByIndex(thisObj, exec, k + begin, exec->argument(k + 2));
putProperty(exec, thisObj, exec->propertyNames().length, jsNumber(length - deleteCount + additionalArgs));
return JSValue::encode(result);
......@@ -670,14 +670,14 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncUnShift(ExecState* exec)
if (exec->hadException())
return JSValue::encode(jsUndefined());
if (v)
thisObj->putVirtual(exec, k + nrArgs - 1, v);
thisObj->methodTable()->putByIndex(thisObj, exec, k + nrArgs - 1, v);
else
thisObj->deletePropertyVirtual(exec, k + nrArgs - 1);
}
}
}
for (unsigned k = 0; k < nrArgs; ++k)
thisObj->putVirtual(exec, k, exec->argument(k));
thisObj->methodTable()->putByIndex(thisObj, exec, k, exec->argument(k));
JSValue result = jsNumber(length + nrArgs);
putProperty(exec, thisObj, exec->propertyNames().length, result);
return JSValue::encode(result);
......@@ -716,7 +716,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncFilter(ExecState* exec)
JSValue result = cachedCall.call();
if (result.toBoolean(exec))
resultArray->putVirtual(exec, filterIndex++, v);
resultArray->methodTable()->putByIndex(resultArray, exec, filterIndex++, v);
}
if (k == length)
return JSValue::encode(resultArray);
......@@ -737,7 +737,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncFilter(ExecState* exec)
JSValue result = call(exec, function, callType, callData, applyThis, eachArguments);
if (result.toBoolean(exec))
resultArray->putVirtual(exec, filterIndex++, v);
resultArray->methodTable()->putByIndex(resultArray, exec, filterIndex++, v);
}
return JSValue::encode(resultArray);
}
......@@ -793,7 +793,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncMap(ExecState* exec)
return JSValue::encode(jsUndefined());
JSValue result = call(exec, function, callType, callData, applyThis, eachArguments);
resultArray->putVirtual(exec, k, result);
resultArray->methodTable()->putByIndex(resultArray, exec, k, result);
}
return JSValue::encode(resultArray);
......
......@@ -169,11 +169,6 @@ bool JSActivation::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Ident
return false;
}
void JSActivation::putVirtual(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
{
put(this, exec, propertyName, value, slot);
}
void JSActivation::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
{
JSActivation* thisObject = static_cast<JSActivation*>(cell);
......
......@@ -65,7 +65,6 @@ namespace JSC {
static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode);
virtual void putVirtual(ExecState*, const Identifier&, JSValue, PutPropertySlot&);
static void put(JSCell*, ExecState*, const Identifier&, JSValue, PutPropertySlot&);
virtual void putWithAttributes(ExecState*, const Identifier&, JSValue, unsigned attributes);
......
......@@ -334,11 +334,6 @@ bool JSArray::getOwnPropertyDescriptor(ExecState* exec, const Identifier& proper
return JSObject::getOwnPropertyDescriptor(exec, propertyName, descriptor);
}
void JSArray::putVirtual(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
{
put(this, exec, propertyName, value, slot);
}
// ECMA 15.4.5.1
void JSArray::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
{
......@@ -363,11 +358,6 @@ void JSArray::put(JSCell* cell, ExecState* exec, const Identifier& propertyName,
JSObject::put(thisObject, exec, propertyName, value, slot);
}
void JSArray::putVirtual(ExecState* exec, unsigned i, JSValue value)
{
putByIndex(this, exec, i, value);
}
void JSArray::putByIndex(JSCell* cell, ExecState* exec, unsigned i, JSValue value)
{
JSArray* thisObject = static_cast<JSArray*>(cell);
......@@ -406,7 +396,7 @@ NEVER_INLINE void JSArray::putSlowCase(ExecState* exec, unsigned i, JSValue valu
if (i >= MIN_SPARSE_ARRAY_INDEX) {
if (i > MAX_ARRAY_INDEX) {
PutPropertySlot slot;
putVirtual(exec, Identifier::from(exec, i), value, slot);
methodTable()->put(this, exec, Identifier::from(exec, i), value, slot);
return;
}
......@@ -781,7 +771,7 @@ void JSArray::push(ExecState* exec, JSValue value)
ArrayStorage* storage = m_storage;
if (UNLIKELY(storage->m_length == 0xFFFFFFFFu)) {
putVirtual(exec, storage->m_length, value);
methodTable()->putByIndex(this, exec, storage->m_length, value);
throwError(exec, createRangeError(exec, "Invalid array length"));
return;
}
......@@ -835,7 +825,7 @@ void JSArray::shiftCount(ExecState* exec, int count)
PropertySlot slot(this);
JSValue p = prototype();
if ((!p.isNull()) && (asObject(p)->getPropertySlot(exec, i, slot)))
putVirtual(exec, i, slot.getValue(exec, i));
methodTable()->putByIndex(this, exec, i, slot.getValue(exec, i));
}
}
......@@ -884,7 +874,7 @@ void JSArray::unshiftCount(ExecState* exec, int count)
PropertySlot slot(this);
JSValue p = prototype();
if ((!p.isNull()) && (asObject(p)->getPropertySlot(exec, i, slot)))
putVirtual(exec, i, slot.getValue(exec, i));
methodTable()->putByIndex(this, exec, i, slot.getValue(exec, i));
}
}
}
......
......@@ -99,7 +99,6 @@ namespace JSC {
virtual bool getOwnPropertySlotVirtual(ExecState*, unsigned propertyName, PropertySlot&);
static bool getOwnPropertySlotByIndex(JSCell*, ExecState*, unsigned propertyName, PropertySlot&);
virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
virtual void putVirtual(ExecState*, unsigned propertyName, JSValue); // FIXME: Make protected and add setItem.
static void putByIndex(JSCell*, ExecState*, unsigned propertyName, JSValue);
static JS_EXPORTDATA const ClassInfo s_info;
......@@ -171,7 +170,6 @@ namespace JSC {
protected:
static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesVisitChildren | OverridesGetPropertyNames | JSObject::StructureFlags;
virtual void putVirtual(ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
static void put(JSCell*, ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
virtual bool deletePropertyVirtual(ExecState*, const Identifier& propertyName);
......
......@@ -97,11 +97,6 @@ bool JSByteArray::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsig
return JSObject::getOwnPropertySlot(thisObject, exec, Identifier::from(exec, propertyName), slot);
}
void JSByteArray::putVirtual(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
{
put(this, exec, propertyName, value, slot);
}
void JSByteArray::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
{
JSByteArray* thisObject = static_cast<JSByteArray*>(cell);
......@@ -114,11 +109,6 @@ void JSByteArray::put(JSCell* cell, ExecState* exec, const Identifier& propertyN
JSObject::put(thisObject, exec, propertyName, value, slot);
}
void JSByteArray::putVirtual(ExecState* exec, unsigned propertyName, JSValue value)
{
putByIndex(this, exec, propertyName, value);
}
void JSByteArray::putByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, JSValue value)
{
static_cast<JSByteArray*>(cell)->setIndex(exec, propertyName, value);
......
......@@ -93,9 +93,7 @@ namespace JSC {
virtual bool getOwnPropertySlotVirtual(JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);
static bool getOwnPropertySlotByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);
virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
virtual void putVirtual(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, JSC::PutPropertySlot&);
static void put(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, JSC::PutPropertySlot&);
virtual void putVirtual(JSC::ExecState*, unsigned propertyName, JSC::JSValue);
static void putByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::JSValue);
virtual void getOwnPropertyNames(JSC::ExecState*, JSC::PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties);
......
......@@ -98,24 +98,16 @@ bool JSCell::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned i
return true;
}
void JSCell::putVirtual(ExecState* exec, const Identifier& identifier, JSValue value, PutPropertySlot& slot)
{
put(this, exec, identifier, value, slot);
}