Commit 4f33efea authored by mhahnenberg@apple.com's avatar mhahnenberg@apple.com

Rename static put to putByIndex

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

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Renaming versions of deleteProperty that use an unsigned as the property
name to "deletePropertyByIndex" in preparation for adding them to the
MethodTable, which requires unique names for each method.

* dfg/DFGOperations.cpp:
(JSC::DFG::putByVal):
* jit/JITStubs.cpp:
(JSC::DEFINE_STUB_FUNCTION):
* runtime/Arguments.cpp:
(JSC::Arguments::putVirtual):
(JSC::Arguments::putByIndex):
* runtime/Arguments.h:
* runtime/ArrayPrototype.cpp:
(JSC::arrayProtoFuncMap):
* runtime/JSArray.cpp:
(JSC::JSArray::put):
(JSC::JSArray::putVirtual):
(JSC::JSArray::putByIndex):
* runtime/JSArray.h:
* runtime/JSByteArray.cpp:
(JSC::JSByteArray::putVirtual):
(JSC::JSByteArray::putByIndex):
* runtime/JSByteArray.h:
* runtime/JSCell.cpp:
(JSC::JSCell::putVirtual):
(JSC::JSCell::putByIndex):
* runtime/JSCell.h:
* runtime/JSNotAnObject.cpp:
(JSC::JSNotAnObject::putVirtual):
(JSC::JSNotAnObject::putByIndex):
* runtime/JSNotAnObject.h:
* runtime/JSObject.cpp:
(JSC::JSObject::putVirtual):
(JSC::JSObject::putByIndex):
* runtime/JSObject.h:
* runtime/RegExpConstructor.cpp:
(JSC::RegExpMatchesArray::fillArrayInstance):
* runtime/RegExpMatchesArray.h:
(JSC::RegExpMatchesArray::putVirtual):
(JSC::RegExpMatchesArray::putByIndex):

Source/WebCore:

No new tests.

Renaming versions of deleteProperty that use an unsigned as the property
name to "deletePropertyByIndex" in preparation for adding them to the
MethodTable, which requires unique names for each method.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateImplementation):
* bridge/runtime_array.cpp:
(JSC::RuntimeArray::putVirtual):
(JSC::RuntimeArray::putByIndex):
* bridge/runtime_array.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@97817 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent ba93fbe8
2011-10-18 Mark Hahnenberg <mhahnenberg@apple.com>
Rename static put to putByIndex
https://bugs.webkit.org/show_bug.cgi?id=70281
Reviewed by Geoffrey Garen.
Renaming versions of deleteProperty that use an unsigned as the property
name to "deletePropertyByIndex" in preparation for adding them to the
MethodTable, which requires unique names for each method.
* dfg/DFGOperations.cpp:
(JSC::DFG::putByVal):
* jit/JITStubs.cpp:
(JSC::DEFINE_STUB_FUNCTION):
* runtime/Arguments.cpp:
(JSC::Arguments::putVirtual):
(JSC::Arguments::putByIndex):
* runtime/Arguments.h:
* runtime/ArrayPrototype.cpp:
(JSC::arrayProtoFuncMap):
* runtime/JSArray.cpp:
(JSC::JSArray::put):
(JSC::JSArray::putVirtual):
(JSC::JSArray::putByIndex):
* runtime/JSArray.h:
* runtime/JSByteArray.cpp:
(JSC::JSByteArray::putVirtual):
(JSC::JSByteArray::putByIndex):
* runtime/JSByteArray.h:
* runtime/JSCell.cpp:
(JSC::JSCell::putVirtual):
(JSC::JSCell::putByIndex):
* runtime/JSCell.h:
* runtime/JSNotAnObject.cpp:
(JSC::JSNotAnObject::putVirtual):
(JSC::JSNotAnObject::putByIndex):
* runtime/JSNotAnObject.h:
* runtime/JSObject.cpp:
(JSC::JSObject::putVirtual):
(JSC::JSObject::putByIndex):
* runtime/JSObject.h:
* runtime/RegExpConstructor.cpp:
(JSC::RegExpMatchesArray::fillArrayInstance):
* runtime/RegExpMatchesArray.h:
(JSC::RegExpMatchesArray::putVirtual):
(JSC::RegExpMatchesArray::putByIndex):
2011-10-18 Gavin Barraclough <barraclough@apple.com>
Array.prototype methods missing exception checks
......@@ -96,7 +96,7 @@ static inline void putByVal(ExecState* exec, JSValue baseValue, uint32_t index,
return;
}
JSArray::put(array, exec, index, value);
JSArray::putByIndex(array, exec, index, value);
return;
}
......@@ -357,7 +357,7 @@ void DFG_OPERATION operationPutByValBeyondArrayBounds(ExecState* exec, JSArray*
{
// We should only get here if index is outside the existing vector.
ASSERT(!array->canSetIndex(index));
JSArray::put(array, exec, index, JSValue::decode(encodedValue));
JSArray::putByIndex(array, exec, index, JSValue::decode(encodedValue));
}
EncodedJSValue DFG_OPERATION operationArrayPush(ExecState* exec, EncodedJSValue encodedValue, JSArray* array)
......
......@@ -2610,7 +2610,7 @@ DEFINE_STUB_FUNCTION(void, op_put_by_val)
if (jsArray->canSetIndex(i))
jsArray->setIndex(*globalData, i, value);
else
JSArray::put(jsArray, callFrame, i, value);
JSArray::putByIndex(jsArray, callFrame, i, value);
} else if (isJSByteArray(globalData, baseValue) && asByteArray(baseValue)->canAccessIndex(i)) {
JSByteArray* jsByteArray = asByteArray(baseValue);
ctiPatchCallByReturnAddress(callFrame->codeBlock(), STUB_RETURN_ADDRESS, FunctionPtr(cti_op_put_by_val_byte_array));
......
......@@ -271,10 +271,10 @@ void Arguments::getOwnPropertyNames(ExecState* exec, PropertyNameArray& property
void Arguments::putVirtual(ExecState* exec, unsigned i, JSValue value)
{
put(this, exec, i, value);
putByIndex(this, exec, i, value);
}
void Arguments::put(JSCell* cell, ExecState* exec, unsigned i, JSValue value)
void Arguments::putByIndex(JSCell* cell, ExecState* exec, unsigned i, JSValue value)
{
Arguments* thisObject = static_cast<Arguments*>(cell);
if (i < thisObject->d->numArguments && (!thisObject->d->deletedArguments || !thisObject->d->deletedArguments[i])) {
......
......@@ -144,7 +144,7 @@ namespace JSC {
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 put(JSCell*, 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);
virtual bool deletePropertyVirtual(ExecState*, unsigned propertyName);
......
......@@ -772,7 +772,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncMap(ExecState* exec)
cachedCall.setArgument(1, jsNumber(k));
cachedCall.setArgument(2, thisObj);
JSArray::put(resultArray, exec, k, cachedCall.call());
JSArray::putByIndex(resultArray, exec, k, cachedCall.call());
}
}
for (; k < length && !exec->hadException(); ++k) {
......
......@@ -346,7 +346,7 @@ void JSArray::put(JSCell* cell, ExecState* exec, const Identifier& propertyName,
bool isArrayIndex;
unsigned i = propertyName.toArrayIndex(isArrayIndex);
if (isArrayIndex) {
put(thisObject, exec, i, value);
putByIndex(thisObject, exec, i, value);
return;
}
......@@ -365,10 +365,10 @@ void JSArray::put(JSCell* cell, ExecState* exec, const Identifier& propertyName,
void JSArray::putVirtual(ExecState* exec, unsigned i, JSValue value)
{
put(this, exec, i, value);
putByIndex(this, exec, i, value);
}
void JSArray::put(JSCell* cell, ExecState* exec, unsigned i, JSValue value)
void JSArray::putByIndex(JSCell* cell, ExecState* exec, unsigned i, JSValue value)
{
JSArray* thisObject = static_cast<JSArray*>(cell);
thisObject->checkConsistency();
......
......@@ -100,7 +100,7 @@ namespace JSC {
static bool getOwnPropertySlot(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 put(JSCell*, ExecState*, unsigned propertyName, JSValue);
static void putByIndex(JSCell*, ExecState*, unsigned propertyName, JSValue);
static JS_EXPORTDATA const ClassInfo s_info;
......
......@@ -116,10 +116,10 @@ void JSByteArray::put(JSCell* cell, ExecState* exec, const Identifier& propertyN
void JSByteArray::putVirtual(ExecState* exec, unsigned propertyName, JSValue value)
{
put(this, exec, propertyName, value);
putByIndex(this, exec, propertyName, value);
}
void JSByteArray::put(JSCell* cell, ExecState* exec, unsigned propertyName, JSValue value)
void JSByteArray::putByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, JSValue value)
{
static_cast<JSByteArray*>(cell)->setIndex(exec, propertyName, value);
}
......
......@@ -96,7 +96,7 @@ namespace JSC {
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 put(JSC::JSCell*, 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);
......
......@@ -115,10 +115,10 @@ void JSCell::put(JSCell* cell, ExecState* exec, const Identifier& identifier, JS
void JSCell::putVirtual(ExecState* exec, unsigned identifier, JSValue value)
{
put(this, exec, identifier, value);
putByIndex(this, exec, identifier, value);
}
void JSCell::put(JSCell* cell, ExecState* exec, unsigned identifier, JSValue value)
void JSCell::putByIndex(JSCell* cell, ExecState* exec, unsigned identifier, JSValue value)
{
cell->toObject(exec, exec->lexicalGlobalObject())->putVirtual(exec, identifier, value);
}
......
......@@ -93,7 +93,7 @@ namespace JSC {
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 put(JSCell*, 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);
......
......@@ -86,10 +86,10 @@ void JSNotAnObject::put(JSCell*, ExecState* exec, const Identifier& , JSValue, P
void JSNotAnObject::putVirtual(ExecState* exec, unsigned i, JSValue value)
{
put(this, exec, i, value);
putByIndex(this, exec, i, value);
}
void JSNotAnObject::put(JSCell*, ExecState* exec, unsigned, JSValue)
void JSNotAnObject::putByIndex(JSCell*, ExecState* exec, unsigned, JSValue)
{
ASSERT_UNUSED(exec, exec->hadException());
}
......
......@@ -78,7 +78,7 @@ namespace JSC {
static void put(JSCell*, ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
virtual void putVirtual(ExecState*, unsigned propertyName, JSValue);
static void put(JSCell*, 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);
......
......@@ -198,10 +198,10 @@ void JSObject::put(JSCell* cell, ExecState* exec, const Identifier& propertyName
void JSObject::putVirtual(ExecState* exec, unsigned propertyName, JSValue value)
{
put(this, exec, propertyName, value);
putByIndex(this, exec, propertyName, value);
}
void JSObject::put(JSCell* cell, ExecState* exec, unsigned propertyName, JSValue value)
void JSObject::putByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, JSValue value)
{
PutPropertySlot slot;
static_cast<JSObject*>(cell)->putVirtual(exec, Identifier::from(exec, propertyName), value, slot);
......
......@@ -109,7 +109,7 @@ namespace JSC {
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 put(JSCell*, ExecState*, unsigned propertyName, JSValue);
static void putByIndex(JSCell*, ExecState*, unsigned propertyName, JSValue);
virtual void putWithAttributes(JSGlobalData*, const Identifier& propertyName, JSValue value, unsigned attributes, bool checkReadOnly, PutPropertySlot& slot);
virtual void putWithAttributes(JSGlobalData*, const Identifier& propertyName, JSValue value, unsigned attributes);
......
......@@ -148,9 +148,9 @@ void RegExpMatchesArray::fillArrayInstance(ExecState* exec)
for (unsigned i = 0; i <= lastNumSubpatterns; ++i) {
int start = d->lastOvector()[2 * i];
if (start >= 0)
JSArray::put(this, exec, i, jsSubstring(exec, d->lastInput, start, d->lastOvector()[2 * i + 1] - start));
JSArray::putByIndex(this, exec, i, jsSubstring(exec, d->lastInput, start, d->lastOvector()[2 * i + 1] - start));
else
JSArray::put(this, exec, i, jsUndefined());
JSArray::putByIndex(this, exec, i, jsUndefined());
}
PutPropertySlot slot;
......
......@@ -91,15 +91,15 @@ namespace JSC {
virtual void putVirtual(ExecState* exec, unsigned propertyName, JSValue v)
{
put(this, exec, propertyName, v);
putByIndex(this, exec, propertyName, v);
}
static void put(JSCell* cell, ExecState* exec, unsigned propertyName, JSValue v)
static void putByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, JSValue v)
{
RegExpMatchesArray* thisObject = static_cast<RegExpMatchesArray*>(cell);
if (thisObject->subclassData())
thisObject->fillArrayInstance(exec);
JSArray::put(thisObject, exec, propertyName, v);
JSArray::putByIndex(thisObject, exec, propertyName, v);
}
virtual bool deletePropertyVirtual(ExecState* exec, const Identifier& propertyName)
......
2011-10-18 Mark Hahnenberg <mhahnenberg@apple.com>
Rename static put to putByIndex
https://bugs.webkit.org/show_bug.cgi?id=70281
Reviewed by Geoffrey Garen.
No new tests.
Renaming versions of deleteProperty that use an unsigned as the property
name to "deletePropertyByIndex" in preparation for adding them to the
MethodTable, which requires unique names for each method.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateImplementation):
* bridge/runtime_array.cpp:
(JSC::RuntimeArray::putVirtual):
(JSC::RuntimeArray::putByIndex):
* bridge/runtime_array.h:
2011-10-18 Sam Weinig <sam@webkit.org>
Fix the build.
......@@ -798,7 +798,7 @@ sub GenerateHeader
push(@headerContent, " virtual void putVirtual(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, JSC::PutPropertySlot&);\n");
push(@headerContent, " static void put(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, JSC::PutPropertySlot&);\n");
push(@headerContent, " virtual void putVirtual(JSC::ExecState*, unsigned propertyName, JSC::JSValue);\n") if $dataNode->extendedAttributes->{"HasCustomIndexSetter"};
push(@headerContent, " static void put(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::JSValue);\n") if $dataNode->extendedAttributes->{"HasCustomIndexSetter"};
push(@headerContent, " static void putByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::JSValue);\n") if $dataNode->extendedAttributes->{"HasCustomIndexSetter"};
push(@headerContent, " bool putDelegate(JSC::ExecState*, const JSC::Identifier&, JSC::JSValue, JSC::PutPropertySlot&);\n") if $dataNode->extendedAttributes->{"DelegatingPutFunction"};
}
......@@ -1796,9 +1796,9 @@ sub GenerateImplementation
if ($dataNode->extendedAttributes->{"HasCustomIndexSetter"}) {
push(@implContent, "void ${className}::putVirtual(ExecState* exec, unsigned propertyName, JSValue value)\n");
push(@implContent, "{\n");
push(@implContent, " put(this, exec, propertyName, value);\n");
push(@implContent, " putByIndex(this, exec, propertyName, value);\n");
push(@implContent, "}\n\n");
push(@implContent, "void ${className}::put(JSCell* cell, ExecState* exec, unsigned propertyName, JSValue value)\n");
push(@implContent, "void ${className}::putByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, JSValue value)\n");
push(@implContent, "{\n");
push(@implContent, " ${className}* thisObject = static_cast<${className}*>(cell);\n");
push(@implContent, " ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);\n");
......
......@@ -167,10 +167,10 @@ void RuntimeArray::put(JSCell* cell, ExecState* exec, const Identifier& property
void RuntimeArray::putVirtual(ExecState* exec, unsigned index, JSValue value)
{
put(this, exec, index, value);
putByIndex(this, exec, index, value);
}
void RuntimeArray::put(JSCell* cell, ExecState* exec, unsigned index, JSValue value)
void RuntimeArray::putByIndex(JSCell* cell, ExecState* exec, unsigned index, JSValue value)
{
RuntimeArray* thisObject = static_cast<RuntimeArray*>(cell);
if (index >= thisObject->getLength()) {
......
......@@ -58,7 +58,7 @@ public:
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 put(JSCell*, 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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment