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

Unified Diff: src/objects.h

Issue 203583007: Support weak heap references in the ConstantPool to support IsWeakObjectInOptimizedCode objects. (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 | « src/heap.cc ('k') | src/objects.cc » ('j') | src/objects-visiting-inl.h » ('J')
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 27bcfba6a603be1ac5612499ead10949075ca76d..67ff5418339a58b63c91f7e326ae5d2d443b7c85 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -3178,25 +3178,31 @@ class FixedDoubleArray: public FixedArrayBase {
// [2]: Field holding the first index which is a int32 entry
// [3] ... [first_code_ptr_index() - 1] : 64 bit entries
// [first_code_ptr_index()] ... [first_heap_ptr_index() - 1] : code pointers
-// [first_heap_ptr_index()] ... [first_int32_index() - 1] : heap pointers
+// [first_heap_ptr_index()] ... [first_weak_ptr_index() - 1] : heap pointers
+// [first_weak_ptr_index()] ... [first_int32_index() - 1] : weak pointers
// [first_int32_index()] ... [length - 1] : 32 bit entries
class ConstantPoolArray: public FixedArrayBase {
public:
// Getters for the field storing the first index for different type entries.
+ inline int first_ptr_index();
inline int first_code_ptr_index();
inline int first_heap_ptr_index();
+ inline int first_weak_ptr_index();
inline int first_int64_index();
inline int first_int32_index();
// Getters for counts of different type entries.
+ inline int count_of_ptr_entries();
inline int count_of_code_ptr_entries();
inline int count_of_heap_ptr_entries();
+ inline int count_of_weak_ptr_entries();
inline int count_of_int64_entries();
inline int count_of_int32_entries();
// Setter and getter for pool elements.
inline Address get_code_ptr_entry(int index);
inline Object* get_heap_ptr_entry(int index);
+ inline Object* get_weak_ptr_entry(int index);
inline int64_t get_int64_entry(int index);
inline int32_t get_int32_entry(int index);
inline double get_int64_entry_as_double(int index);
@@ -3211,6 +3217,7 @@ class ConstantPoolArray: public FixedArrayBase {
inline void SetEntryCounts(int number_of_int64_entries,
int number_of_code_ptr_entries,
int number_of_heap_ptr_entries,
+ int number_of_weak_ptr_entries,
int number_of_int32_entries);
// Copy operations
@@ -3218,12 +3225,10 @@ class ConstantPoolArray: public FixedArrayBase {
// Garbage collection support.
inline static int SizeFor(int number_of_int64_entries,
- int number_of_code_ptr_entries,
- int number_of_heap_ptr_entries,
+ int number_of_ptr_entries,
int number_of_int32_entries) {
return RoundUp(OffsetAt(number_of_int64_entries,
- number_of_code_ptr_entries,
- number_of_heap_ptr_entries,
+ number_of_ptr_entries,
number_of_int32_entries),
kPointerSize);
}
@@ -3232,16 +3237,12 @@ class ConstantPoolArray: public FixedArrayBase {
inline int OffsetOfElementAt(int index) {
ASSERT(index < length());
if (index >= first_int32_index()) {
- return OffsetAt(count_of_int64_entries(), count_of_code_ptr_entries(),
- count_of_heap_ptr_entries(), index - first_int32_index());
- } else if (index >= first_heap_ptr_index()) {
- return OffsetAt(count_of_int64_entries(), count_of_code_ptr_entries(),
- index - first_heap_ptr_index(), 0);
- } else if (index >= first_code_ptr_index()) {
- return OffsetAt(count_of_int64_entries(), index - first_code_ptr_index(),
- 0, 0);
+ return OffsetAt(count_of_int64_entries(), count_of_ptr_entries(),
+ index - first_int32_index());
+ } else if (index >= first_ptr_index()) {
+ return OffsetAt(count_of_int64_entries(), index - first_ptr_index(), 0);
} else {
- return OffsetAt(index, 0, 0, 0);
+ return OffsetAt(index, 0, 0);
}
}
@@ -3257,8 +3258,10 @@ class ConstantPoolArray: public FixedArrayBase {
static const int kFirstCodePointerIndexOffset = FixedArray::kHeaderSize;
static const int kFirstHeapPointerIndexOffset =
kFirstCodePointerIndexOffset + kPointerSize;
- static const int kFirstInt32IndexOffset =
+ static const int kFirstWeakPointerIndexOffset =
kFirstHeapPointerIndexOffset + kPointerSize;
+ static const int kFirstInt32IndexOffset =
+ kFirstWeakPointerIndexOffset + kPointerSize;
static const int kFirstOffset = kFirstInt32IndexOffset + kPointerSize;
// Dispatched behavior.
@@ -3270,16 +3273,15 @@ class ConstantPoolArray: public FixedArrayBase {
private:
inline void set_first_code_ptr_index(int value);
inline void set_first_heap_ptr_index(int value);
+ inline void set_first_weak_ptr_index(int value);
inline void set_first_int32_index(int value);
inline static int OffsetAt(int number_of_int64_entries,
- int number_of_code_ptr_entries,
- int number_of_heap_ptr_entries,
+ int number_of_ptr_entries,
int number_of_int32_entries) {
return kFirstOffset
+ (number_of_int64_entries * kInt64Size)
- + (number_of_code_ptr_entries * kPointerSize)
- + (number_of_heap_ptr_entries * kPointerSize)
+ + (number_of_ptr_entries * kPointerSize)
+ (number_of_int32_entries * kInt32Size);
}
@@ -5549,7 +5551,7 @@ class Code: public HeapObject {
return is_optimized_code() && IsWeakObjectInOptimizedCode(object);
}
- inline bool IsWeakObjectInOptimizedCode(Object* object);
+ static inline bool IsWeakObjectInOptimizedCode(Object* object);
// Max loop nesting marker used to postpose OSR. We don't take loop
// nesting that is deeper than 5 levels into account.
« no previous file with comments | « src/heap.cc ('k') | src/objects.cc » ('j') | src/objects-visiting-inl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698