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

Unified Diff: src/heap.h

Issue 253293003: Replace heap object access macros with functions and move them to the heap class (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Switched to V8_INLINE, rebase 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 | « no previous file | src/heap-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.h
diff --git a/src/heap.h b/src/heap.h
index 77c0984fa23e69c0f3262e3362015f5701900fb6..4c62fe3e863cefc95b1cadeedbbaa7198179d31a 100644
--- a/src/heap.h
+++ b/src/heap.h
@@ -682,6 +682,68 @@ class Heap {
return old_data_space_->allocation_limit_address();
}
+ // Heap access methods.
+ INLINE(static Object* read_field(HeapObject* p, int offset));
+ INLINE(static intptr_t read_intptr_field(HeapObject* p, int offset));
+ INLINE(static int read_int_field(HeapObject* p, int offset));
+ INLINE(static int32_t read_int32_field(HeapObject* p, int offset));
+ INLINE(static uint32_t read_uint32_field(HeapObject* p, int offset));
+ INLINE(static int64_t read_int64_field(HeapObject* p, int offset));
+ INLINE(static int16_t read_short_field(HeapObject* p, int offset));
+ INLINE(static byte read_byte_field(HeapObject* p, int offset));
+ INLINE(static double read_double_field(HeapObject* p, int offset));
+
+
+ INLINE(static void write_intptr_field(HeapObject* p,
+ int offset,
+ intptr_t value));
+ INLINE(static void write_int_field(HeapObject* p,
+ int offset,
+ int value));
+ INLINE(static void write_int32_field(HeapObject* p,
+ int offset,
+ int32_t value));
+ INLINE(static void write_uint32_field(HeapObject* p,
+ int offset,
+ uint32_t value));
+ INLINE(static void write_int64_field(HeapObject* p,
+ int offset,
+ int64_t value));
+ INLINE(static void write_short_field(HeapObject* p,
+ int offset,
+ int16_t value));
+ INLINE(static void write_byte_field(HeapObject* p,
+ int offset,
+ byte value));
+ INLINE(static void write_double_field(HeapObject* p,
+ int offset,
+ double value));
+
+ // TODO(jarin) expose the barrier reason here
+ INLINE(static void write_field(HeapObject* p,
+ int offset,
+ Object* value,
+ WriteBarrierMode mode));
+
+ // TODO(jarin) replace this with variants that do not expose
+ // internal pointers.
+ INLINE(static Address get_field_address(HeapObject* p, int offset));
+
+ // TODO(jarin) synchronized flavors of the field accesses should be
+ // wrapped so that we do not expose the sync.
+ INLINE(static Object* acquire_read_field(HeapObject* p, int offset));
+ INLINE(static Object* nobarrier_read_field(HeapObject* p, int offset));
+ INLINE(static void release_write_field(HeapObject* p,
+ int offset,
+ Object* value));
+ INLINE(static void nobarrier_write_field(HeapObject* p,
+ int offset,
+ Object* value));
+ INLINE(static byte nobarrier_read_byte_field(HeapObject* p, int offset));
+ INLINE(static void nobarrier_write_byte_field(HeapObject* p,
+ int offset,
+ byte value));
+
// Returns a deep copy of the JavaScript object.
// Properties and elements are copied too.
// Returns failure if allocation failed.
@@ -1015,7 +1077,6 @@ class Heap {
// necessary, the object might be promoted to an old space. The caller must
// ensure the precondition that the object is (a) a heap object and (b) in
// the heap's from space.
- static inline void ScavengePointer(HeapObject** p);
static inline void ScavengeObject(HeapObject** p, HeapObject* object);
enum ScratchpadSlotMode {
« no previous file with comments | « no previous file | src/heap-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698