Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(208)

Unified Diff: src/elements.h

Issue 225933002: ElementsAccessor's public interface handlification. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/elements.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/elements.h
diff --git a/src/elements.h b/src/elements.h
index 1292a3cbac1f64b19de41946bdaebfb808733aaf..ef2089882e919ffef7ff196c64bf23a2b1f4d249 100644
--- a/src/elements.h
+++ b/src/elements.h
@@ -79,16 +79,12 @@ class ElementsAccessor {
uint32_t key,
Handle<FixedArrayBase> backing_store) = 0;
- MUST_USE_RESULT virtual Handle<Object> Get(
+ MUST_USE_RESULT inline Handle<Object> Get(
Handle<Object> receiver,
Handle<JSObject> holder,
- uint32_t key) = 0;
-
- MUST_USE_RESULT virtual MaybeObject* Get(
- Object* receiver,
- JSObject* holder,
- uint32_t key,
- FixedArrayBase* backing_store = NULL) = 0;
+ uint32_t key) {
+ return Get(receiver, holder, key, handle(holder->elements()));
+ }
// Returns an element's attributes, or ABSENT if there is no such
// element. This method doesn't iterate up the prototype chain. The caller
@@ -96,10 +92,17 @@ class ElementsAccessor {
// be compatible with the ElementsKind of the ElementsAccessor. If
// backing_store is NULL, the holder->elements() is used as the backing store.
MUST_USE_RESULT virtual PropertyAttributes GetAttributes(
- Object* receiver,
- JSObject* holder,
+ Handle<Object> receiver,
+ Handle<JSObject> holder,
uint32_t key,
- FixedArrayBase* backing_store = NULL) = 0;
+ Handle<FixedArrayBase> backing_store) = 0;
+
+ MUST_USE_RESULT inline PropertyAttributes GetAttributes(
+ Handle<Object> receiver,
+ Handle<JSObject> holder,
+ uint32_t key) {
+ return GetAttributes(receiver, holder, key, handle(holder->elements()));
+ }
// Returns an element's type, or NONEXISTENT if there is no such
// element. This method doesn't iterate up the prototype chain. The caller
@@ -107,10 +110,17 @@ class ElementsAccessor {
// be compatible with the ElementsKind of the ElementsAccessor. If
// backing_store is NULL, the holder->elements() is used as the backing store.
MUST_USE_RESULT virtual PropertyType GetType(
- Object* receiver,
- JSObject* holder,
+ Handle<Object> receiver,
+ Handle<JSObject> holder,
uint32_t key,
- FixedArrayBase* backing_store = NULL) = 0;
+ Handle<FixedArrayBase> backing_store) = 0;
+
+ MUST_USE_RESULT inline PropertyType GetType(
+ Handle<Object> receiver,
+ Handle<JSObject> holder,
+ uint32_t key) {
+ return GetType(receiver, holder, key, handle(holder->elements()));
+ }
// Returns an element's accessors, or NULL if the element does not exist or
// is plain. This method doesn't iterate up the prototype chain. The caller
@@ -234,6 +244,26 @@ class ElementsAccessor {
virtual uint32_t GetKeyForIndex(Handle<FixedArrayBase> backing_store,
uint32_t index) = 0;
+ // TODO(ishell): Non-handlified versions, used only by accessors'
+ // implementations. To be removed once elements.cc is handlified.
+ MUST_USE_RESULT virtual MaybeObject* Get(
+ Object* receiver,
+ JSObject* holder,
+ uint32_t key,
+ FixedArrayBase* backing_store) = 0;
+
+ MUST_USE_RESULT virtual PropertyAttributes GetAttributes(
+ Object* receiver,
+ JSObject* holder,
+ uint32_t key,
+ FixedArrayBase* backing_store) = 0;
+
+ MUST_USE_RESULT virtual PropertyType GetType(
+ Object* receiver,
+ JSObject* holder,
+ uint32_t key,
+ FixedArrayBase* backing_store) = 0;
+
private:
static ElementsAccessor** elements_accessors_;
const char* name_;
« no previous file with comments | « no previous file | src/elements.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698