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

Unified Diff: src/objects-debug.cc

Issue 661133002: TransitionArray now uses <is_data_property, name, attributes> tuple as a key, which allows to have … (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments 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 353cfdaa44bb686aa658df166bd5ea9841c467a2..ca649c723168f85d5582ece7e3ff8d7a10b995cb 100644
--- a/src/objects-debug.cc
+++ b/src/objects-debug.cc
@@ -1164,15 +1164,13 @@ bool DescriptorArray::IsSortedNoDuplicates(int valid_entries) {
for (int i = 0; i < number_of_descriptors(); i++) {
Name* key = GetSortedKey(i);
if (key == current_key) {
- OFStream os(stdout);
- PrintDescriptors(os);
+ Print();
return false;
}
current_key = key;
uint32_t hash = GetSortedKey(i)->Hash();
if (hash < current) {
- OFStream os(stdout);
- PrintDescriptors(os);
+ Print();
return false;
}
current = hash;
@@ -1183,23 +1181,36 @@ bool DescriptorArray::IsSortedNoDuplicates(int valid_entries) {
bool TransitionArray::IsSortedNoDuplicates(int valid_entries) {
DCHECK(valid_entries == -1);
- Name* current_key = NULL;
- uint32_t current = 0;
+ Name* prev_key = NULL;
+ bool prev_is_data_property = false;
+ PropertyAttributes prev_attributes = NONE;
+ uint32_t prev_hash = 0;
for (int i = 0; i < number_of_transitions(); i++) {
Name* key = GetSortedKey(i);
- if (key == current_key) {
- OFStream os(stdout);
- PrintTransitions(os);
- return false;
+ uint32_t hash = key->Hash();
+ bool is_data_property = false;
+ PropertyAttributes attributes = NONE;
+ if (!IsSpecialTransition(key)) {
+ Map* target = GetTarget(i);
+ PropertyDetails details = GetTargetDetails(key, target);
+ is_data_property = details.type() == FIELD || details.type() == CONSTANT;
+ attributes = details.attributes();
+ } else {
+ // Duplicate entries are not allowed for non-property transitions.
+ CHECK_NE(prev_key, key);
}
- current_key = key;
- uint32_t hash = GetSortedKey(i)->Hash();
- if (hash < current) {
- OFStream os(stdout);
- PrintTransitions(os);
+
+ int cmp =
+ CompareKeys(prev_key, prev_hash, prev_is_data_property, prev_attributes,
+ key, hash, is_data_property, attributes);
+ if (cmp >= 0) {
+ Print();
return false;
}
- current = hash;
+ prev_key = key;
+ prev_hash = hash;
+ prev_attributes = attributes;
+ prev_is_data_property = is_data_property;
}
return true;
}
« 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