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

Unified Diff: src/objects-inl.h

Issue 167303005: Track field types. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index ffc22703203d3aacae36d7e2c16efb95c6ccd321..519e0244b7a31c7926a2ddab5afdd429f96edeeb 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -286,6 +286,7 @@ bool Object::IsExternalTwoByteString() {
String::cast(this)->IsTwoByteRepresentation();
}
+
bool Object::HasValidElements() {
// Dictionary is covered under FixedArray.
return IsFixedArray() || IsFixedDoubleArray() || IsExternalArray() ||
@@ -2696,14 +2697,6 @@ void DescriptorArray::SetRepresentation(int descriptor_index,
}
-void DescriptorArray::InitializeRepresentations(Representation representation) {
- int length = number_of_descriptors();
- for (int i = 0; i < length; i++) {
- SetRepresentation(i, representation);
- }
-}
-
-
Object** DescriptorArray::GetValueSlot(int descriptor_number) {
ASSERT(descriptor_number < number_of_descriptors());
return RawFieldOfElementAt(ToValueIndex(descriptor_number));
@@ -2716,6 +2709,11 @@ Object* DescriptorArray::GetValue(int descriptor_number) {
}
+void DescriptorArray::SetValue(int descriptor_index, Object* value) {
+ set(ToValueIndex(descriptor_index), value);
+}
+
+
PropertyDetails DescriptorArray::GetDetails(int descriptor_number) {
ASSERT(descriptor_number < number_of_descriptors());
Object* details = get(ToDetailsIndex(descriptor_number));
@@ -2734,6 +2732,12 @@ int DescriptorArray::GetFieldIndex(int descriptor_number) {
}
+HeapType* DescriptorArray::GetFieldType(int descriptor_number) {
+ ASSERT(GetDetails(descriptor_number).type() == FIELD);
+ return HeapType::cast(GetValue(descriptor_number));
+}
+
+
Object* DescriptorArray::GetConstant(int descriptor_number) {
return GetValue(descriptor_number);
}

Powered by Google App Engine
This is Rietveld 408576698