OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 void ExternalFloatArray::ExternalFloatArrayVerify() { | 299 void ExternalFloatArray::ExternalFloatArrayVerify() { |
300 CHECK(IsExternalFloatArray()); | 300 CHECK(IsExternalFloatArray()); |
301 } | 301 } |
302 | 302 |
303 | 303 |
304 void ExternalDoubleArray::ExternalDoubleArrayVerify() { | 304 void ExternalDoubleArray::ExternalDoubleArrayVerify() { |
305 CHECK(IsExternalDoubleArray()); | 305 CHECK(IsExternalDoubleArray()); |
306 } | 306 } |
307 | 307 |
308 | 308 |
| 309 bool JSObject::ElementsAreSafeToExamine() { |
| 310 return (FLAG_use_gvn && FLAG_use_allocation_folding) || |
| 311 reinterpret_cast<Map*>(elements()) != |
| 312 GetHeap()->one_pointer_filler_map(); |
| 313 } |
| 314 |
| 315 |
309 void JSObject::JSObjectVerify() { | 316 void JSObject::JSObjectVerify() { |
310 VerifyHeapPointer(properties()); | 317 VerifyHeapPointer(properties()); |
311 VerifyHeapPointer(elements()); | 318 VerifyHeapPointer(elements()); |
312 | 319 |
313 if (GetElementsKind() == NON_STRICT_ARGUMENTS_ELEMENTS) { | 320 if (GetElementsKind() == NON_STRICT_ARGUMENTS_ELEMENTS) { |
314 CHECK(this->elements()->IsFixedArray()); | 321 CHECK(this->elements()->IsFixedArray()); |
315 CHECK_GE(this->elements()->length(), 2); | 322 CHECK_GE(this->elements()->length(), 2); |
316 } | 323 } |
317 | 324 |
318 if (HasFastProperties()) { | 325 if (HasFastProperties()) { |
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1132 number_of_fast_used_elements_, number_of_fast_unused_elements_); | 1139 number_of_fast_used_elements_, number_of_fast_unused_elements_); |
1133 | 1140 |
1134 PrintF(" - slow elements (#%d): %d (used) %d (unused)\n", | 1141 PrintF(" - slow elements (#%d): %d (used) %d (unused)\n", |
1135 number_of_objects_ - number_of_objects_with_fast_elements_, | 1142 number_of_objects_ - number_of_objects_with_fast_elements_, |
1136 number_of_slow_used_elements_, number_of_slow_unused_elements_); | 1143 number_of_slow_used_elements_, number_of_slow_unused_elements_); |
1137 | 1144 |
1138 PrintF("\n"); | 1145 PrintF("\n"); |
1139 } | 1146 } |
1140 | 1147 |
1141 | 1148 |
1142 bool JSObject::ElementsAreSafeToExamine() { | |
1143 return (FLAG_use_gvn && FLAG_use_allocation_folding) || | |
1144 reinterpret_cast<Map*>(elements()) != | |
1145 GetHeap()->one_pointer_filler_map(); | |
1146 } | |
1147 | |
1148 | |
1149 bool DescriptorArray::IsSortedNoDuplicates(int valid_entries) { | 1149 bool DescriptorArray::IsSortedNoDuplicates(int valid_entries) { |
1150 if (valid_entries == -1) valid_entries = number_of_descriptors(); | 1150 if (valid_entries == -1) valid_entries = number_of_descriptors(); |
1151 Name* current_key = NULL; | 1151 Name* current_key = NULL; |
1152 uint32_t current = 0; | 1152 uint32_t current = 0; |
1153 for (int i = 0; i < number_of_descriptors(); i++) { | 1153 for (int i = 0; i < number_of_descriptors(); i++) { |
1154 Name* key = GetSortedKey(i); | 1154 Name* key = GetSortedKey(i); |
1155 if (key == current_key) { | 1155 if (key == current_key) { |
1156 PrintDescriptors(); | 1156 PrintDescriptors(); |
1157 return false; | 1157 return false; |
1158 } | 1158 } |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1199 for (int i = 0; i < number_of_transitions(); ++i) { | 1199 for (int i = 0; i < number_of_transitions(); ++i) { |
1200 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; | 1200 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; |
1201 } | 1201 } |
1202 return true; | 1202 return true; |
1203 } | 1203 } |
1204 | 1204 |
1205 | 1205 |
1206 #endif // DEBUG | 1206 #endif // DEBUG |
1207 | 1207 |
1208 } } // namespace v8::internal | 1208 } } // namespace v8::internal |
OLD | NEW |