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/heap/objects-visiting.h" | 9 #include "src/heap/objects-visiting.h" |
10 #include "src/jsregexp.h" | 10 #include "src/jsregexp.h" |
(...skipping 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1177 } | 1177 } |
1178 current = hash; | 1178 current = hash; |
1179 } | 1179 } |
1180 return true; | 1180 return true; |
1181 } | 1181 } |
1182 | 1182 |
1183 | 1183 |
1184 bool TransitionArray::IsSortedNoDuplicates(int valid_entries) { | 1184 bool TransitionArray::IsSortedNoDuplicates(int valid_entries) { |
1185 DCHECK(valid_entries == -1); | 1185 DCHECK(valid_entries == -1); |
1186 Name* current_key = NULL; | 1186 Name* current_key = NULL; |
| 1187 bool current_is_data_property = false; |
| 1188 PropertyAttributes current_attributes = NONE; |
1187 uint32_t current = 0; | 1189 uint32_t current = 0; |
1188 for (int i = 0; i < number_of_transitions(); i++) { | 1190 for (int i = 0; i < number_of_transitions(); i++) { |
1189 Name* key = GetSortedKey(i); | 1191 Name* key = GetSortedKey(i); |
1190 if (key == current_key) { | 1192 Map* target = GetTarget(i); |
| 1193 PropertyDetails details = GetTargetDetails(key, target); |
| 1194 bool is_data_property = |
| 1195 details.type() == FIELD || details.type() == CONSTANT; |
| 1196 PropertyAttributes attributes = details.attributes(); |
| 1197 |
| 1198 if ((key == current_key) && (attributes == current_attributes) && |
| 1199 (is_data_property == current_is_data_property)) { |
1191 OFStream os(stdout); | 1200 OFStream os(stdout); |
1192 PrintTransitions(os); | 1201 PrintTransitions(os); |
1193 return false; | 1202 return false; |
1194 } | 1203 } |
1195 current_key = key; | 1204 current_key = key; |
| 1205 current_is_data_property = is_data_property; |
| 1206 current_attributes = attributes; |
1196 uint32_t hash = GetSortedKey(i)->Hash(); | 1207 uint32_t hash = GetSortedKey(i)->Hash(); |
1197 if (hash < current) { | 1208 if (hash < current) { |
1198 OFStream os(stdout); | 1209 OFStream os(stdout); |
1199 PrintTransitions(os); | 1210 PrintTransitions(os); |
1200 return false; | 1211 return false; |
1201 } | 1212 } |
1202 current = hash; | 1213 current = hash; |
1203 } | 1214 } |
1204 return true; | 1215 return true; |
1205 } | 1216 } |
1206 | 1217 |
1207 | 1218 |
1208 static bool CheckOneBackPointer(Map* current_map, Object* target) { | 1219 static bool CheckOneBackPointer(Map* current_map, Object* target) { |
1209 return !target->IsMap() || Map::cast(target)->GetBackPointer() == current_map; | 1220 return !target->IsMap() || Map::cast(target)->GetBackPointer() == current_map; |
1210 } | 1221 } |
1211 | 1222 |
1212 | 1223 |
1213 bool TransitionArray::IsConsistentWithBackPointers(Map* current_map) { | 1224 bool TransitionArray::IsConsistentWithBackPointers(Map* current_map) { |
1214 for (int i = 0; i < number_of_transitions(); ++i) { | 1225 for (int i = 0; i < number_of_transitions(); ++i) { |
1215 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; | 1226 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; |
1216 } | 1227 } |
1217 return true; | 1228 return true; |
1218 } | 1229 } |
1219 | 1230 |
1220 | 1231 |
1221 #endif // DEBUG | 1232 #endif // DEBUG |
1222 | 1233 |
1223 } } // namespace v8::internal | 1234 } } // namespace v8::internal |
OLD | NEW |