| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 5156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5167 int length_; | 5167 int length_; |
| 5168 uint32_t raw_running_hash_; | 5168 uint32_t raw_running_hash_; |
| 5169 uint32_t array_index_; | 5169 uint32_t array_index_; |
| 5170 bool is_array_index_; | 5170 bool is_array_index_; |
| 5171 bool is_first_char_; | 5171 bool is_first_char_; |
| 5172 bool is_valid_; | 5172 bool is_valid_; |
| 5173 friend class TwoCharHashTableKey; | 5173 friend class TwoCharHashTableKey; |
| 5174 }; | 5174 }; |
| 5175 | 5175 |
| 5176 | 5176 |
| 5177 // Calculates string hash. |
| 5178 template <typename schar> |
| 5179 inline uint32_t HashSequentialString(const schar* chars, int length); |
| 5180 |
| 5181 |
| 5177 // The characteristics of a string are stored in its map. Retrieving these | 5182 // The characteristics of a string are stored in its map. Retrieving these |
| 5178 // few bits of information is moderately expensive, involving two memory | 5183 // few bits of information is moderately expensive, involving two memory |
| 5179 // loads where the second is dependent on the first. To improve efficiency | 5184 // loads where the second is dependent on the first. To improve efficiency |
| 5180 // the shape of the string is given its own class so that it can be retrieved | 5185 // the shape of the string is given its own class so that it can be retrieved |
| 5181 // once and used for several string operations. A StringShape is small enough | 5186 // once and used for several string operations. A StringShape is small enough |
| 5182 // to be passed by value and is immutable, but be aware that flattening a | 5187 // to be passed by value and is immutable, but be aware that flattening a |
| 5183 // string can potentially alter its shape. Also be aware that a GC caused by | 5188 // string can potentially alter its shape. Also be aware that a GC caused by |
| 5184 // something else can alter the shape of a string due to ConsString | 5189 // something else can alter the shape of a string due to ConsString |
| 5185 // shortcutting. Keeping these restrictions in mind has proven to be error- | 5190 // shortcutting. Keeping these restrictions in mind has proven to be error- |
| 5186 // prone and so we no longer put StringShapes in variables unless there is a | 5191 // prone and so we no longer put StringShapes in variables unless there is a |
| (...skipping 1372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6559 | 6564 |
| 6560 // Visits a contiguous arrays of external references (references to the C++ | 6565 // Visits a contiguous arrays of external references (references to the C++ |
| 6561 // heap) in the half-open range [start, end). Any or all of the values | 6566 // heap) in the half-open range [start, end). Any or all of the values |
| 6562 // may be modified on return. | 6567 // may be modified on return. |
| 6563 virtual void VisitExternalReferences(Address* start, Address* end) {} | 6568 virtual void VisitExternalReferences(Address* start, Address* end) {} |
| 6564 | 6569 |
| 6565 inline void VisitExternalReference(Address* p) { | 6570 inline void VisitExternalReference(Address* p) { |
| 6566 VisitExternalReferences(p, p + 1); | 6571 VisitExternalReferences(p, p + 1); |
| 6567 } | 6572 } |
| 6568 | 6573 |
| 6574 // Visits a handle that has an embedder-assigned class ID. |
| 6575 virtual void VisitEmbedderReference(Object** p, uint16_t class_id) {} |
| 6576 |
| 6569 #ifdef DEBUG | 6577 #ifdef DEBUG |
| 6570 // Intended for serialization/deserialization checking: insert, or | 6578 // Intended for serialization/deserialization checking: insert, or |
| 6571 // check for the presence of, a tag at this position in the stream. | 6579 // check for the presence of, a tag at this position in the stream. |
| 6572 virtual void Synchronize(const char* tag) {} | 6580 virtual void Synchronize(const char* tag) {} |
| 6573 #else | 6581 #else |
| 6574 inline void Synchronize(const char* tag) {} | 6582 inline void Synchronize(const char* tag) {} |
| 6575 #endif | 6583 #endif |
| 6576 }; | 6584 }; |
| 6577 | 6585 |
| 6578 | 6586 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 6607 } else { | 6615 } else { |
| 6608 value &= ~(1 << bit_position); | 6616 value &= ~(1 << bit_position); |
| 6609 } | 6617 } |
| 6610 return value; | 6618 return value; |
| 6611 } | 6619 } |
| 6612 }; | 6620 }; |
| 6613 | 6621 |
| 6614 } } // namespace v8::internal | 6622 } } // namespace v8::internal |
| 6615 | 6623 |
| 6616 #endif // V8_OBJECTS_H_ | 6624 #endif // V8_OBJECTS_H_ |
| OLD | NEW |