| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 if ((data_ & kTagMask) == kEmptyTag) return; | 119 if ((data_ & kTagMask) == kEmptyTag) return; |
| 120 if ((data_ & kTagMask) == kSingletonTag) { | 120 if ((data_ & kTagMask) == kSingletonTag) { |
| 121 if (pointer == single_value()) { | 121 if (pointer == single_value()) { |
| 122 data_ = kEmptyTag; | 122 data_ = kEmptyTag; |
| 123 } | 123 } |
| 124 return; | 124 return; |
| 125 } | 125 } |
| 126 list()->RemoveElement(pointer); | 126 list()->RemoveElement(pointer); |
| 127 } | 127 } |
| 128 | 128 |
| 129 void RemoveAt(int i) { |
| 130 if ((data_ & kTagMask) == kEmptyTag) return; |
| 131 if ((data_ & kTagMask) == kSingletonTag) { |
| 132 ASSERT(i == 0); |
| 133 data_ = kEmptyTag; |
| 134 return; |
| 135 } |
| 136 list()->Remove(i); |
| 137 } |
| 138 |
| 129 T* RemoveLast() { | 139 T* RemoveLast() { |
| 130 ASSERT((data_ & kTagMask) != kEmptyTag); | 140 ASSERT((data_ & kTagMask) != kEmptyTag); |
| 131 if ((data_ & kTagMask) == kSingletonTag) { | 141 if ((data_ & kTagMask) == kSingletonTag) { |
| 132 T* result = single_value(); | 142 T* result = single_value(); |
| 133 data_ = kEmptyTag; | 143 data_ = kEmptyTag; |
| 134 return result; | 144 return result; |
| 135 } | 145 } |
| 136 return list()->RemoveLast(); | 146 return list()->RemoveLast(); |
| 137 } | 147 } |
| 138 | 148 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 } | 199 } |
| 190 | 200 |
| 191 intptr_t data_; | 201 intptr_t data_; |
| 192 | 202 |
| 193 DISALLOW_COPY_AND_ASSIGN(SmallPointerList); | 203 DISALLOW_COPY_AND_ASSIGN(SmallPointerList); |
| 194 }; | 204 }; |
| 195 | 205 |
| 196 } } // namespace v8::internal | 206 } } // namespace v8::internal |
| 197 | 207 |
| 198 #endif // V8_SMALL_POINTER_LIST_H_ | 208 #endif // V8_SMALL_POINTER_LIST_H_ |
| OLD | NEW |