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

Unified Diff: src/objects.h

Issue 227713003: Further ElementsAccessor handlification (Get(), AddElementsToFixedArray() and HasElement()). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressing review notes Created 6 years, 8 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/elements.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 888117cb7da297e24377cf726e48cc807a6d7e7c..71362c2d1aabca5b0bf573aba011641270b7d468 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -2791,6 +2791,13 @@ class JSObject: public JSReceiver {
Handle<Name> name,
PropertyAttributes* attributes);
+ MUST_USE_RESULT static Handle<Object> GetElementWithCallback(
+ Handle<JSObject> object,
+ Handle<Object> receiver,
+ Handle<Object> structure,
+ uint32_t index,
+ Handle<Object> holder);
+
MUST_USE_RESULT MaybeObject* GetElementWithCallback(Object* receiver,
Object* structure,
uint32_t index,
@@ -3036,6 +3043,7 @@ class FixedArray: public FixedArrayBase {
public:
// Setter and getter for elements.
inline Object* get(int index);
+ static inline Handle<Object> get(Handle<FixedArray> array, int index);
// Setter that uses write barrier.
inline void set(int index, Object* value);
inline bool is_the_hole(int index);
@@ -3152,8 +3160,7 @@ class FixedDoubleArray: public FixedArrayBase {
inline double get_scalar(int index);
inline int64_t get_representation(int index);
MUST_USE_RESULT inline MaybeObject* get(int index);
- // TODO(ishell): Rename as get() once all usages handlified.
- inline Handle<Object> get_as_handle(int index);
+ static inline Handle<Object> get(Handle<FixedDoubleArray> array, int index);
inline void set(int index, double value);
inline void set_the_hole(int index);
@@ -4892,7 +4899,9 @@ class ExternalUint8ClampedArray: public ExternalArray {
// Setter and getter.
inline uint8_t get_scalar(int index);
- MUST_USE_RESULT inline MaybeObject* get(int index);
+ MUST_USE_RESULT inline Object* get(int index);
+ static inline Handle<Object> get(Handle<ExternalUint8ClampedArray> array,
+ int index);
inline void set(int index, uint8_t value);
// This accessor applies the correct conversion from Smi, HeapNumber and
@@ -4919,7 +4928,8 @@ class ExternalInt8Array: public ExternalArray {
public:
// Setter and getter.
inline int8_t get_scalar(int index);
- MUST_USE_RESULT inline MaybeObject* get(int index);
+ MUST_USE_RESULT inline Object* get(int index);
+ static inline Handle<Object> get(Handle<ExternalInt8Array> array, int index);
inline void set(int index, int8_t value);
static Handle<Object> SetValue(Handle<ExternalInt8Array> array,
@@ -4946,7 +4956,8 @@ class ExternalUint8Array: public ExternalArray {
public:
// Setter and getter.
inline uint8_t get_scalar(int index);
- MUST_USE_RESULT inline MaybeObject* get(int index);
+ MUST_USE_RESULT inline Object* get(int index);
+ static inline Handle<Object> get(Handle<ExternalUint8Array> array, int index);
inline void set(int index, uint8_t value);
static Handle<Object> SetValue(Handle<ExternalUint8Array> array,
@@ -4973,7 +4984,8 @@ class ExternalInt16Array: public ExternalArray {
public:
// Setter and getter.
inline int16_t get_scalar(int index);
- MUST_USE_RESULT inline MaybeObject* get(int index);
+ MUST_USE_RESULT inline Object* get(int index);
+ static inline Handle<Object> get(Handle<ExternalInt16Array> array, int index);
inline void set(int index, int16_t value);
static Handle<Object> SetValue(Handle<ExternalInt16Array> array,
@@ -5000,7 +5012,9 @@ class ExternalUint16Array: public ExternalArray {
public:
// Setter and getter.
inline uint16_t get_scalar(int index);
- MUST_USE_RESULT inline MaybeObject* get(int index);
+ MUST_USE_RESULT inline Object* get(int index);
+ static inline Handle<Object> get(Handle<ExternalUint16Array> array,
+ int index);
inline void set(int index, uint16_t value);
static Handle<Object> SetValue(Handle<ExternalUint16Array> array,
@@ -5028,6 +5042,7 @@ class ExternalInt32Array: public ExternalArray {
// Setter and getter.
inline int32_t get_scalar(int index);
MUST_USE_RESULT inline MaybeObject* get(int index);
+ static inline Handle<Object> get(Handle<ExternalInt32Array> array, int index);
inline void set(int index, int32_t value);
static Handle<Object> SetValue(Handle<ExternalInt32Array> array,
@@ -5055,6 +5070,8 @@ class ExternalUint32Array: public ExternalArray {
// Setter and getter.
inline uint32_t get_scalar(int index);
MUST_USE_RESULT inline MaybeObject* get(int index);
+ static inline Handle<Object> get(Handle<ExternalUint32Array> array,
+ int index);
inline void set(int index, uint32_t value);
static Handle<Object> SetValue(Handle<ExternalUint32Array> array,
@@ -5082,6 +5099,8 @@ class ExternalFloat32Array: public ExternalArray {
// Setter and getter.
inline float get_scalar(int index);
MUST_USE_RESULT inline MaybeObject* get(int index);
+ static inline Handle<Object> get(Handle<ExternalFloat32Array> array,
+ int index);
inline void set(int index, float value);
static Handle<Object> SetValue(Handle<ExternalFloat32Array> array,
@@ -5109,6 +5128,8 @@ class ExternalFloat64Array: public ExternalArray {
// Setter and getter.
inline double get_scalar(int index);
MUST_USE_RESULT inline MaybeObject* get(int index);
+ static inline Handle<Object> get(Handle<ExternalFloat64Array> array,
+ int index);
inline void set(int index, double value);
static Handle<Object> SetValue(Handle<ExternalFloat64Array> array,
@@ -5169,6 +5190,7 @@ class FixedTypedArray: public FixedTypedArrayBase {
inline ElementType get_scalar(int index);
MUST_USE_RESULT inline MaybeObject* get(int index);
+ static inline Handle<Object> get(Handle<FixedTypedArray> array, int index);
inline void set(int index, ElementType value);
static inline ElementType from_int(int value);
@@ -5196,6 +5218,8 @@ class FixedTypedArray: public FixedTypedArrayBase {
static const InstanceType kInstanceType = FIXED_##TYPE##_ARRAY_TYPE; \
static const char* Designator() { return #type " array"; } \
static inline MaybeObject* ToObject(Heap* heap, elementType scalar); \
+ static inline Handle<Object> ToHandle(Isolate* isolate, \
+ elementType scalar); \
static inline elementType defaultValue(); \
}; \
\
« no previous file with comments | « src/elements.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698