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

Unified Diff: src/elements.h

Issue 1159433003: Use GetProperty for getting elements. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments Created 5 years, 7 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 | « src/compiler/js-typed-lowering.cc ('k') | 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 f4d15fc828b751ab8f4c488e85f1586d4c001fa6..1065b1f73df63aa492a766cefa3e309dbbf2bb64 100644
--- a/src/elements.h
+++ b/src/elements.h
@@ -48,17 +48,11 @@ class ElementsAccessor {
// 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.
- MUST_USE_RESULT virtual MaybeHandle<Object> Get(
- Handle<Object> receiver,
- Handle<JSObject> holder,
- uint32_t key,
- Handle<FixedArrayBase> backing_store) = 0;
+ virtual Handle<Object> Get(Handle<JSObject> holder, uint32_t key,
+ Handle<FixedArrayBase> backing_store) = 0;
- MUST_USE_RESULT inline MaybeHandle<Object> Get(
- Handle<Object> receiver,
- Handle<JSObject> holder,
- uint32_t key) {
- return Get(receiver, holder, key, handle(holder->elements()));
+ inline Handle<Object> Get(Handle<JSObject> holder, uint32_t key) {
+ return Get(holder, key, handle(holder->elements()));
}
// Returns an element's attributes, or ABSENT if there is no such
@@ -66,15 +60,12 @@ class ElementsAccessor {
// 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.
- MUST_USE_RESULT virtual PropertyAttributes GetAttributes(
- Handle<JSObject> holder,
- uint32_t key,
- Handle<FixedArrayBase> backing_store) = 0;
+ virtual PropertyAttributes GetAttributes(JSObject* holder, uint32_t key,
+ FixedArrayBase* backing_store) = 0;
- MUST_USE_RESULT inline PropertyAttributes GetAttributes(
- Handle<JSObject> holder,
- uint32_t key) {
- return GetAttributes(holder, key, handle(holder->elements()));
+ inline PropertyAttributes GetAttributes(Handle<JSObject> holder,
+ uint32_t key) {
+ return GetAttributes(*holder, key, holder->elements());
}
// Returns an element's accessors, or NULL if the element does not exist or
@@ -82,14 +73,12 @@ class ElementsAccessor {
// 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.
- MUST_USE_RESULT virtual MaybeHandle<AccessorPair> GetAccessorPair(
- Handle<JSObject> holder,
- uint32_t key,
+ virtual MaybeHandle<AccessorPair> GetAccessorPair(
+ Handle<JSObject> holder, uint32_t key,
Handle<FixedArrayBase> backing_store) = 0;
- MUST_USE_RESULT inline MaybeHandle<AccessorPair> GetAccessorPair(
- Handle<JSObject> holder,
- uint32_t key) {
+ inline MaybeHandle<AccessorPair> GetAccessorPair(Handle<JSObject> holder,
+ uint32_t key) {
return GetAccessorPair(holder, key, handle(holder->elements()));
}
@@ -158,7 +147,7 @@ class ElementsAccessor {
*from_holder, 0, from_kind, to, 0, kCopyToEndAndInitializeToHole);
}
- MUST_USE_RESULT virtual MaybeHandle<FixedArray> AddElementsToFixedArray(
+ virtual Handle<FixedArray> AddElementsToFixedArray(
Handle<JSObject> receiver, Handle<FixedArray> to,
FixedArray::KeyFilter filter) = 0;
@@ -196,6 +185,7 @@ class ElementsAccessor {
uint32_t key) = 0;
virtual PropertyDetails GetDetails(FixedArrayBase* backing_store,
uint32_t index) = 0;
+ virtual bool HasIndex(FixedArrayBase* backing_store, uint32_t key) = 0;
private:
static ElementsAccessor** elements_accessors_;
« no previous file with comments | « src/compiler/js-typed-lowering.cc ('k') | src/elements.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698