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 2149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2160 } | 2160 } |
2161 | 2161 |
2162 | 2162 |
2163 void DescriptorArray::SwapSortedKeys(int first, int second) { | 2163 void DescriptorArray::SwapSortedKeys(int first, int second) { |
2164 int first_key = GetSortedKeyIndex(first); | 2164 int first_key = GetSortedKeyIndex(first); |
2165 SetSortedKey(first, GetSortedKeyIndex(second)); | 2165 SetSortedKey(first, GetSortedKeyIndex(second)); |
2166 SetSortedKey(second, first_key); | 2166 SetSortedKey(second, first_key); |
2167 } | 2167 } |
2168 | 2168 |
2169 | 2169 |
2170 FixedArray::WhitenessWitness::WhitenessWitness(FixedArray* array) | 2170 DescriptorArray::WhitenessWitness::WhitenessWitness(FixedArray* array) |
2171 : marking_(array->GetHeap()->incremental_marking()) { | 2171 : marking_(array->GetHeap()->incremental_marking()) { |
2172 marking_->EnterNoMarkingScope(); | 2172 marking_->EnterNoMarkingScope(); |
2173 ASSERT(Marking::Color(array) == Marking::WHITE_OBJECT); | 2173 ASSERT(Marking::Color(array) == Marking::WHITE_OBJECT); |
2174 } | 2174 } |
2175 | 2175 |
2176 | 2176 |
2177 FixedArray::WhitenessWitness::~WhitenessWitness() { | 2177 DescriptorArray::WhitenessWitness::~WhitenessWitness() { |
2178 marking_->LeaveNoMarkingScope(); | 2178 marking_->LeaveNoMarkingScope(); |
2179 } | 2179 } |
2180 | 2180 |
2181 | 2181 |
2182 template<typename Shape, typename Key> | 2182 template<typename Shape, typename Key> |
2183 int HashTable<Shape, Key>::ComputeCapacity(int at_least_space_for) { | 2183 int HashTable<Shape, Key>::ComputeCapacity(int at_least_space_for) { |
2184 const int kMinCapacity = 32; | 2184 const int kMinCapacity = 32; |
2185 int capacity = RoundUpToPowerOf2(at_least_space_for * 2); | 2185 int capacity = RoundUpToPowerOf2(at_least_space_for * 2); |
2186 if (capacity < kMinCapacity) { | 2186 if (capacity < kMinCapacity) { |
2187 capacity = kMinCapacity; // Guarantee min capacity. | 2187 capacity = kMinCapacity; // Guarantee min capacity. |
(...skipping 3297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5485 #undef WRITE_UINT32_FIELD | 5485 #undef WRITE_UINT32_FIELD |
5486 #undef READ_SHORT_FIELD | 5486 #undef READ_SHORT_FIELD |
5487 #undef WRITE_SHORT_FIELD | 5487 #undef WRITE_SHORT_FIELD |
5488 #undef READ_BYTE_FIELD | 5488 #undef READ_BYTE_FIELD |
5489 #undef WRITE_BYTE_FIELD | 5489 #undef WRITE_BYTE_FIELD |
5490 | 5490 |
5491 | 5491 |
5492 } } // namespace v8::internal | 5492 } } // namespace v8::internal |
5493 | 5493 |
5494 #endif // V8_OBJECTS_INL_H_ | 5494 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |