Reviewers: rossberg,
Description:
Remove unused JSReceiver::SetElement method
This method seems to have been created to handle dispatching SetElement
appropriately to either JSProxy or JSObject, but it doesn't seem to ever
be called. Once gone, JSProxy::SetElementWithHandler is also no longer
called (we instead always call JSProxy::SetProperty to set both string and
indexed properties).
[email protected]
Please review this at https://chromiumcodereview.appspot.com/11314005/
SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/objects.h
M src/objects.cc
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index
792b6d9843e6166799278518f99c4adde22c61b7..ac1db44cb2497a3a9ea7afff29c4fd74952702af
100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -264,17 +264,6 @@ MaybeObject* JSProxy::GetElementWithHandler(Object*
receiver,
}
-MaybeObject* JSProxy::SetElementWithHandler(JSReceiver* receiver,
- uint32_t index,
- Object* value,
- StrictModeFlag strict_mode) {
- String* name;
- MaybeObject* maybe = GetHeap()->Uint32ToString(index);
- if (!maybe->To<String>(&name)) return maybe;
- return SetPropertyWithHandler(receiver, name, value, NONE, strict_mode);
-}
-
-
bool JSProxy::HasElementWithHandler(uint32_t index) {
String* name;
MaybeObject* maybe = GetHeap()->Uint32ToString(index);
@@ -9856,21 +9845,6 @@ MUST_USE_RESULT MaybeObject*
JSObject::SetFastDoubleElement(
}
-MaybeObject* JSReceiver::SetElement(uint32_t index,
- Object* value,
- PropertyAttributes attributes,
- StrictModeFlag strict_mode,
- bool check_proto) {
- if (IsJSProxy()) {
- return JSProxy::cast(this)->SetElementWithHandler(
- this, index, value, strict_mode);
- } else {
- return JSObject::cast(this)->SetElement(
- index, value, attributes, strict_mode, check_proto);
- }
-}
-
-
Handle<Object> JSObject::SetOwnElement(Handle<JSObject> object,
uint32_t index,
Handle<Object> value,
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index
0d1a69cb9882985fa282c4e2f3dc4a5fa98c9523..7e62e12b5ba5119445766921199a085e54647648
100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -1439,14 +1439,6 @@ class JSReceiver: public HeapObject {
MUST_USE_RESULT MaybeObject* DeleteProperty(String* name, DeleteMode
mode);
MUST_USE_RESULT MaybeObject* DeleteElement(uint32_t index, DeleteMode
mode);
- // Set the index'th array element.
- // Can cause GC, or return failure if GC is required.
- MUST_USE_RESULT MaybeObject* SetElement(uint32_t index,
- Object* value,
- PropertyAttributes attributes,
- StrictModeFlag strict_mode,
- bool check_prototype);
-
// Tests for the fast common case for property enumeration.
bool IsSimpleEnum();
@@ -8048,11 +8040,6 @@ class JSProxy: public JSReceiver {
Object* value,
PropertyAttributes attributes,
StrictModeFlag strict_mode);
- MUST_USE_RESULT MaybeObject* SetElementWithHandler(
- JSReceiver* receiver,
- uint32_t index,
- Object* value,
- StrictModeFlag strict_mode);
// If the handler defines an accessor property with a setter, invoke it.
// If it defines an accessor property without a setter, or a data
property
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev