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 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
728 // enum length of the map by counting the number of own descriptors that | 728 // enum length of the map by counting the number of own descriptors that |
729 // are not DONT_ENUM. | 729 // are not DONT_ENUM. |
730 if (own_property_count == Map::kInvalidEnumCache) { | 730 if (own_property_count == Map::kInvalidEnumCache) { |
731 own_property_count = object->map()->NumberOfDescribedProperties( | 731 own_property_count = object->map()->NumberOfDescribedProperties( |
732 OWN_DESCRIPTORS, DONT_ENUM); | 732 OWN_DESCRIPTORS, DONT_ENUM); |
733 | 733 |
734 if (cache_result) object->map()->SetEnumLength(own_property_count); | 734 if (cache_result) object->map()->SetEnumLength(own_property_count); |
735 } | 735 } |
736 | 736 |
737 DescriptorArray* desc = object->map()->instance_descriptors(); | 737 DescriptorArray* desc = object->map()->instance_descriptors(); |
738 Handle<FixedArray> keys(FixedArray::cast(desc->GetEnumCache()), isolate); | 738 Handle<FixedArray> keys(desc->GetEnumCache(), isolate); |
739 | 739 |
740 // In case the number of properties required in the enum are actually | 740 // In case the number of properties required in the enum are actually |
741 // present, we can reuse the enum cache. Otherwise, this means that the | 741 // present, we can reuse the enum cache. Otherwise, this means that the |
742 // enum cache was generated for a previous (smaller) version of the | 742 // enum cache was generated for a previous (smaller) version of the |
743 // Descriptor Array. In that case we regenerate the enum cache. | 743 // Descriptor Array. In that case we regenerate the enum cache. |
744 if (own_property_count <= keys->length()) { | 744 if (own_property_count <= keys->length()) { |
745 isolate->counters()->enum_cache_hits()->Increment(); | 745 isolate->counters()->enum_cache_hits()->Increment(); |
746 return ReduceFixedArrayTo(keys, own_property_count); | 746 return ReduceFixedArrayTo(keys, own_property_count); |
747 } | 747 } |
748 } | 748 } |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1058 data->next = prev_next_; | 1058 data->next = prev_next_; |
1059 data->limit = prev_limit_; | 1059 data->limit = prev_limit_; |
1060 #ifdef DEBUG | 1060 #ifdef DEBUG |
1061 handles_detached_ = true; | 1061 handles_detached_ = true; |
1062 #endif | 1062 #endif |
1063 return deferred; | 1063 return deferred; |
1064 } | 1064 } |
1065 | 1065 |
1066 | 1066 |
1067 } } // namespace v8::internal | 1067 } } // namespace v8::internal |
OLD | NEW |