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

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: Created 6 years, 5 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-debug.cc
diff --git a/src/objects-debug.cc b/src/objects-debug.cc
index e465cb1db40d5a536f4d371851aa2aba7215bc48..092f15389f1b27910bbdd4f1ad2d66392f7d5fe4 100644
--- a/src/objects-debug.cc
+++ b/src/objects-debug.cc
@@ -263,6 +263,7 @@ void JSObject::JSObjectVerify() {
if (descriptors->GetDetails(i).type() == FIELD) {
Representation r = descriptors->GetDetails(i).representation();
FieldIndex index = FieldIndex::ForDescriptor(map(), i);
+ if (map()->IsUnboxedDoubleField(index)) continue;
Toon Verwaest 2014/07/29 15:02:08 Assert that r.IsDouble()
Igor Sheludko 2014/10/30 14:23:43 Done.
Object* value = RawFastPropertyAt(index);
if (r.IsDouble()) ASSERT(value->IsMutableHeapNumber());
if (value->IsUninitialized()) continue;
@@ -304,6 +305,8 @@ void Map::MapVerify() {
SLOW_ASSERT(transitions()->IsSortedNoDuplicates());
SLOW_ASSERT(transitions()->IsConsistentWithBackPointers(this));
}
+ ASSERT(!FLAG_unbox_double_fields ||
Toon Verwaest 2014/07/29 15:02:08 SLOW_ASSERT?
Igor Sheludko 2014/10/30 14:23:43 Done.
+ layout_descriptor()->IsConsistentWithMap(this));
}
@@ -313,8 +316,7 @@ void Map::SharedMapVerify() {
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());
}
@@ -1157,6 +1159,27 @@ bool DescriptorArray::IsSortedNoDuplicates(int valid_entries) {
}
+bool LayoutDescriptor::IsConsistentWithMap(Map* map) {
+ 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) {
+ FieldIndex field_index = FieldIndex::ForDescriptor(map, i);
+ if (!field_index.is_inobject()) continue;
+ bool tagged_expected =
+ !FLAG_unbox_double_fields || !details.representation().IsDouble();
+ for (int bit = 0; bit < details.field_width_in_words(); bit++) {
+ bool tagged_actual = IsTagged(details.field_index() + bit);
+ ASSERT_EQ(tagged_expected, tagged_actual);
+ if (tagged_actual != tagged_expected) return false;
+ }
+ }
+ }
+ return true;
+}
+
+
bool TransitionArray::IsSortedNoDuplicates(int valid_entries) {
ASSERT(valid_entries == -1);
Name* current_key = NULL;

Powered by Google App Engine
This is Rietveld 408576698