| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/disasm.h" | 7 #include "src/disasm.h" |
| 8 #include "src/disassembler.h" | 8 #include "src/disassembler.h" |
| 9 #include "src/jsregexp.h" | 9 #include "src/jsregexp.h" |
| 10 #include "src/macro-assembler.h" | 10 #include "src/macro-assembler.h" |
| (...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1133 } | 1133 } |
| 1134 | 1134 |
| 1135 | 1135 |
| 1136 bool DescriptorArray::IsSortedNoDuplicates(int valid_entries) { | 1136 bool DescriptorArray::IsSortedNoDuplicates(int valid_entries) { |
| 1137 if (valid_entries == -1) valid_entries = number_of_descriptors(); | 1137 if (valid_entries == -1) valid_entries = number_of_descriptors(); |
| 1138 Name* current_key = NULL; | 1138 Name* current_key = NULL; |
| 1139 uint32_t current = 0; | 1139 uint32_t current = 0; |
| 1140 for (int i = 0; i < number_of_descriptors(); i++) { | 1140 for (int i = 0; i < number_of_descriptors(); i++) { |
| 1141 Name* key = GetSortedKey(i); | 1141 Name* key = GetSortedKey(i); |
| 1142 if (key == current_key) { | 1142 if (key == current_key) { |
| 1143 PrintDescriptors(); | 1143 OFStream os(stdout); |
| 1144 PrintDescriptors(os); |
| 1144 return false; | 1145 return false; |
| 1145 } | 1146 } |
| 1146 current_key = key; | 1147 current_key = key; |
| 1147 uint32_t hash = GetSortedKey(i)->Hash(); | 1148 uint32_t hash = GetSortedKey(i)->Hash(); |
| 1148 if (hash < current) { | 1149 if (hash < current) { |
| 1149 PrintDescriptors(); | 1150 OFStream os(stdout); |
| 1151 PrintDescriptors(os); |
| 1150 return false; | 1152 return false; |
| 1151 } | 1153 } |
| 1152 current = hash; | 1154 current = hash; |
| 1153 } | 1155 } |
| 1154 return true; | 1156 return true; |
| 1155 } | 1157 } |
| 1156 | 1158 |
| 1157 | 1159 |
| 1158 bool TransitionArray::IsSortedNoDuplicates(int valid_entries) { | 1160 bool TransitionArray::IsSortedNoDuplicates(int valid_entries) { |
| 1159 ASSERT(valid_entries == -1); | 1161 ASSERT(valid_entries == -1); |
| 1160 Name* current_key = NULL; | 1162 Name* current_key = NULL; |
| 1161 uint32_t current = 0; | 1163 uint32_t current = 0; |
| 1162 for (int i = 0; i < number_of_transitions(); i++) { | 1164 for (int i = 0; i < number_of_transitions(); i++) { |
| 1163 Name* key = GetSortedKey(i); | 1165 Name* key = GetSortedKey(i); |
| 1164 if (key == current_key) { | 1166 if (key == current_key) { |
| 1165 PrintTransitions(); | 1167 OFStream os(stdout); |
| 1168 PrintTransitions(os); |
| 1166 return false; | 1169 return false; |
| 1167 } | 1170 } |
| 1168 current_key = key; | 1171 current_key = key; |
| 1169 uint32_t hash = GetSortedKey(i)->Hash(); | 1172 uint32_t hash = GetSortedKey(i)->Hash(); |
| 1170 if (hash < current) { | 1173 if (hash < current) { |
| 1171 PrintTransitions(); | 1174 OFStream os(stdout); |
| 1175 PrintTransitions(os); |
| 1172 return false; | 1176 return false; |
| 1173 } | 1177 } |
| 1174 current = hash; | 1178 current = hash; |
| 1175 } | 1179 } |
| 1176 return true; | 1180 return true; |
| 1177 } | 1181 } |
| 1178 | 1182 |
| 1179 | 1183 |
| 1180 static bool CheckOneBackPointer(Map* current_map, Object* target) { | 1184 static bool CheckOneBackPointer(Map* current_map, Object* target) { |
| 1181 return !target->IsMap() || Map::cast(target)->GetBackPointer() == current_map; | 1185 return !target->IsMap() || Map::cast(target)->GetBackPointer() == current_map; |
| 1182 } | 1186 } |
| 1183 | 1187 |
| 1184 | 1188 |
| 1185 bool TransitionArray::IsConsistentWithBackPointers(Map* current_map) { | 1189 bool TransitionArray::IsConsistentWithBackPointers(Map* current_map) { |
| 1186 for (int i = 0; i < number_of_transitions(); ++i) { | 1190 for (int i = 0; i < number_of_transitions(); ++i) { |
| 1187 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; | 1191 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; |
| 1188 } | 1192 } |
| 1189 return true; | 1193 return true; |
| 1190 } | 1194 } |
| 1191 | 1195 |
| 1192 | 1196 |
| 1193 #endif // DEBUG | 1197 #endif // DEBUG |
| 1194 | 1198 |
| 1195 } } // namespace v8::internal | 1199 } } // namespace v8::internal |
| OLD | NEW |