OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 4194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4205 uint32_t GetHashField(); | 4205 uint32_t GetHashField(); |
4206 | 4206 |
4207 // Returns true if the characters seen so far make up a legal array | 4207 // Returns true if the characters seen so far make up a legal array |
4208 // index. | 4208 // index. |
4209 bool is_array_index() { return is_array_index_; } | 4209 bool is_array_index() { return is_array_index_; } |
4210 | 4210 |
4211 bool is_valid() { return is_valid_; } | 4211 bool is_valid() { return is_valid_; } |
4212 | 4212 |
4213 void invalidate() { is_valid_ = false; } | 4213 void invalidate() { is_valid_ = false; } |
4214 | 4214 |
| 4215 // Calculated hash value for a string consisting of 1 to |
| 4216 // String::kMaxArrayIndexSize digits with no leading zeros (except "0"). |
| 4217 // value is represented decimal value. |
| 4218 static uint32_t MakeCachedArrayIndex(uint32_t value, int length); |
| 4219 |
4215 private: | 4220 private: |
4216 | 4221 |
4217 uint32_t array_index() { | 4222 uint32_t array_index() { |
4218 ASSERT(is_array_index()); | 4223 ASSERT(is_array_index()); |
4219 return array_index_; | 4224 return array_index_; |
4220 } | 4225 } |
4221 | 4226 |
4222 inline uint32_t GetHash(); | 4227 inline uint32_t GetHash(); |
4223 | 4228 |
4224 int length_; | 4229 int length_; |
(...skipping 1322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5547 } else { | 5552 } else { |
5548 value &= ~(1 << bit_position); | 5553 value &= ~(1 << bit_position); |
5549 } | 5554 } |
5550 return value; | 5555 return value; |
5551 } | 5556 } |
5552 }; | 5557 }; |
5553 | 5558 |
5554 } } // namespace v8::internal | 5559 } } // namespace v8::internal |
5555 | 5560 |
5556 #endif // V8_OBJECTS_H_ | 5561 #endif // V8_OBJECTS_H_ |
OLD | NEW |