Index: src/elements.h |
diff --git a/src/elements.h b/src/elements.h |
index c6d2d4b3bb340a18d3f3da1101859125ebfc7e59..3ce2d096d2b19c59341e2a99a24b4dba5d878f53 100644 |
--- a/src/elements.h |
+++ b/src/elements.h |
@@ -42,17 +42,32 @@ class ElementsAccessor { |
virtual const char* name() const { return name_; } |
- virtual MaybeObject* Get(FixedArrayBase* backing_store, |
- uint32_t key, |
+ // Returns true if a holder contains an element with the specified key |
+ // without iterating up the prototype chain. The caller can optionally pass |
+ // in the backing store to use for the check, which must be compatible with |
+ // the ElementsKind of the ElementsAccessor. If backing_store is NULL, the |
+ // holder->elements() is used as the backing store. |
+ virtual bool HasElement(Object* receiver, |
+ JSObject* holder, |
+ uint32_t key, |
+ FixedArrayBase* backing_store = NULL) = 0; |
+ |
+ // Returns the element with the specified key or undefined if there is no such |
+ // element. This method doesn't iterate up the prototype chain. The caller |
+ // can optionally pass in the backing store to use for the check, which must |
+ // be compatible with the ElementsKind of the ElementsAccessor. If |
+ // backing_store is NULL, the holder->elements() is used as the backing store. |
+ virtual MaybeObject* Get(Object* receiver, |
JSObject* holder, |
- Object* receiver) = 0; |
+ uint32_t key, |
+ FixedArrayBase* backing_store = NULL) = 0; |
// Modifies the length data property as specified for JSArrays and resizes the |
// underlying backing store accordingly. The method honors the semantics of |
// changing array sizes as defined in EcmaScript 5.1 15.4.5.2, i.e. array that |
// have non-deletable elements can only be shrunk to the size of highest |
// element that is non-deletable. |
- virtual MaybeObject* SetLength(JSObject* holder, |
+ virtual MaybeObject* SetLength(JSArray* holder, |
Object* new_length) = 0; |
// Modifies both the length and capacity of a JSArray, resizing the underlying |
@@ -65,19 +80,15 @@ class ElementsAccessor { |
int capacity, |
int length) = 0; |
+ // Deleted an element in an object, returning a new elements backing store. |
Jakob Kummerow
2012/03/06 11:57:43
s/Deleted/Deletes/
danno
2012/03/06 12:21:54
Done.
|
virtual MaybeObject* Delete(JSObject* holder, |
uint32_t key, |
JSReceiver::DeleteMode mode) = 0; |
- virtual bool HasElement(FixedArrayBase* backing_store, |
- uint32_t key, |
- JSObject* holder, |
- Object* receiver) = 0; |
- |
- virtual MaybeObject* AddElementsToFixedArray(FixedArrayBase* from, |
- FixedArray* to, |
+ virtual MaybeObject* AddElementsToFixedArray(Object* receiver, |
JSObject* holder, |
- Object* receiver) = 0; |
+ FixedArray* to, |
+ FixedArrayBase* from = NULL) = 0; |
// Returns a shared ElementsAccessor for the specified ElementsKind. |
static ElementsAccessor* ForKind(ElementsKind elements_kind) { |