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 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1057 | 1057 |
1058 #ifdef DEBUG | 1058 #ifdef DEBUG |
1059 | 1059 |
1060 void JSObject::IncrementSpillStatistics(SpillInformation* info) { | 1060 void JSObject::IncrementSpillStatistics(SpillInformation* info) { |
1061 info->number_of_objects_++; | 1061 info->number_of_objects_++; |
1062 // Named properties | 1062 // Named properties |
1063 if (HasFastProperties()) { | 1063 if (HasFastProperties()) { |
1064 info->number_of_objects_with_fast_properties_++; | 1064 info->number_of_objects_with_fast_properties_++; |
1065 info->number_of_fast_used_fields_ += map()->NextFreePropertyIndex(); | 1065 info->number_of_fast_used_fields_ += map()->NextFreePropertyIndex(); |
1066 info->number_of_fast_unused_fields_ += map()->unused_property_fields(); | 1066 info->number_of_fast_unused_fields_ += map()->unused_property_fields(); |
| 1067 } else if (IsGlobalObject()) { |
| 1068 GlobalDictionary* dict = global_dictionary(); |
| 1069 info->number_of_slow_used_properties_ += dict->NumberOfElements(); |
| 1070 info->number_of_slow_unused_properties_ += |
| 1071 dict->Capacity() - dict->NumberOfElements(); |
1067 } else { | 1072 } else { |
1068 NameDictionary* dict = property_dictionary(); | 1073 NameDictionary* dict = property_dictionary(); |
1069 info->number_of_slow_used_properties_ += dict->NumberOfElements(); | 1074 info->number_of_slow_used_properties_ += dict->NumberOfElements(); |
1070 info->number_of_slow_unused_properties_ += | 1075 info->number_of_slow_unused_properties_ += |
1071 dict->Capacity() - dict->NumberOfElements(); | 1076 dict->Capacity() - dict->NumberOfElements(); |
1072 } | 1077 } |
1073 // Indexed properties | 1078 // Indexed properties |
1074 switch (GetElementsKind()) { | 1079 switch (GetElementsKind()) { |
1075 case FAST_HOLEY_SMI_ELEMENTS: | 1080 case FAST_HOLEY_SMI_ELEMENTS: |
1076 case FAST_SMI_ELEMENTS: | 1081 case FAST_SMI_ELEMENTS: |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1276 ? it.rinfo()->target_cell() | 1281 ? it.rinfo()->target_cell() |
1277 : it.rinfo()->target_object(); | 1282 : it.rinfo()->target_object(); |
1278 CHECK(!CanLeak(target, heap, skip_weak_cell)); | 1283 CHECK(!CanLeak(target, heap, skip_weak_cell)); |
1279 } | 1284 } |
1280 } | 1285 } |
1281 | 1286 |
1282 | 1287 |
1283 #endif // DEBUG | 1288 #endif // DEBUG |
1284 | 1289 |
1285 } } // namespace v8::internal | 1290 } } // namespace v8::internal |
OLD | NEW |