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

Unified Diff: src/objects-debug.cc

Issue 391693002: In-object double fields unboxing (for 64-bit only). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebasing Created 6 years, 1 month 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/objects.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-debug.cc
diff --git a/src/objects-debug.cc b/src/objects-debug.cc
index ca649c723168f85d5582ece7e3ff8d7a10b995cb..94957206548ec3d3ab63ee251526abcf96a042f5 100644
--- a/src/objects-debug.cc
+++ b/src/objects-debug.cc
@@ -275,6 +275,10 @@ void JSObject::JSObjectVerify() {
if (descriptors->GetDetails(i).type() == FIELD) {
Representation r = descriptors->GetDetails(i).representation();
FieldIndex index = FieldIndex::ForDescriptor(map(), i);
+ if (IsUnboxedDoubleField(index)) {
+ DCHECK(r.IsDouble());
+ continue;
+ }
Object* value = RawFastPropertyAt(index);
if (r.IsDouble()) DCHECK(value->IsMutableHeapNumber());
if (value->IsUninitialized()) continue;
@@ -316,6 +320,8 @@ void Map::MapVerify() {
SLOW_DCHECK(transitions()->IsSortedNoDuplicates());
SLOW_DCHECK(transitions()->IsConsistentWithBackPointers(this));
}
+ SLOW_DCHECK(!FLAG_unbox_double_fields ||
+ layout_descriptor()->IsConsistentWithMap(this));
}
@@ -325,8 +331,7 @@ void Map::DictionaryMapVerify() {
CHECK(instance_descriptors()->IsEmpty());
CHECK_EQ(0, pre_allocated_property_fields());
CHECK_EQ(0, unused_property_fields());
- CHECK_EQ(StaticVisitorBase::GetVisitorId(instance_type(), instance_size()),
- visitor_id());
+ CHECK_EQ(StaticVisitorBase::GetVisitorId(this), visitor_id());
}
@@ -1179,6 +1184,27 @@ bool DescriptorArray::IsSortedNoDuplicates(int valid_entries) {
}
+bool LayoutDescriptor::IsConsistentWithMap(Map* map) {
+ if (FLAG_unbox_double_fields) {
+ DescriptorArray* descriptors = map->instance_descriptors();
+ int nof_descriptors = map->NumberOfOwnDescriptors();
+ for (int i = 0; i < nof_descriptors; i++) {
+ PropertyDetails details = descriptors->GetDetails(i);
+ if (details.type() != FIELD) continue;
+ FieldIndex field_index = FieldIndex::ForDescriptor(map, i);
+ bool tagged_expected =
+ !field_index.is_inobject() || !details.representation().IsDouble();
+ for (int bit = 0; bit < details.field_width_in_words(); bit++) {
+ bool tagged_actual = IsTagged(details.field_index() + bit);
+ DCHECK_EQ(tagged_expected, tagged_actual);
+ if (tagged_actual != tagged_expected) return false;
+ }
+ }
+ }
+ return true;
+}
+
+
bool TransitionArray::IsSortedNoDuplicates(int valid_entries) {
DCHECK(valid_entries == -1);
Name* prev_key = NULL;
« no previous file with comments | « src/objects.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698