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 7620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7631 // Cons and slices have an encoding flag that may not represent the actual | 7631 // Cons and slices have an encoding flag that may not represent the actual |
7632 // encoding of the underlying string. This is taken into account here. | 7632 // encoding of the underlying string. This is taken into account here. |
7633 // Requires: this->IsFlat() | 7633 // Requires: this->IsFlat() |
7634 inline bool IsOneByteRepresentationUnderneath(); | 7634 inline bool IsOneByteRepresentationUnderneath(); |
7635 inline bool IsTwoByteRepresentationUnderneath(); | 7635 inline bool IsTwoByteRepresentationUnderneath(); |
7636 | 7636 |
7637 // NOTE: this should be considered only a hint. False negatives are | 7637 // NOTE: this should be considered only a hint. False negatives are |
7638 // possible. | 7638 // possible. |
7639 inline bool HasOnlyOneByteChars(); | 7639 inline bool HasOnlyOneByteChars(); |
7640 | 7640 |
7641 inline bool IsOneByteConvertible(); | |
7642 | |
7643 // Get and set individual two byte chars in the string. | 7641 // Get and set individual two byte chars in the string. |
7644 inline void Set(int index, uint16_t value); | 7642 inline void Set(int index, uint16_t value); |
7645 // Get individual two byte char in the string. Repeated calls | 7643 // Get individual two byte char in the string. Repeated calls |
7646 // to this method are not efficient unless the string is flat. | 7644 // to this method are not efficient unless the string is flat. |
7647 INLINE(uint16_t Get(int index)); | 7645 INLINE(uint16_t Get(int index)); |
7648 | 7646 |
7649 // Try to flatten the string. Checks first inline to see if it is | 7647 // Try to flatten the string. Checks first inline to see if it is |
7650 // necessary. Does nothing if the string is not a cons string. | 7648 // necessary. Does nothing if the string is not a cons string. |
7651 // Flattening allocates a sequential string with the same data as | 7649 // Flattening allocates a sequential string with the same data as |
7652 // the given string and mutates the cons string to a degenerate | 7650 // the given string and mutates the cons string to a degenerate |
(...skipping 1810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9463 } else { | 9461 } else { |
9464 value &= ~(1 << bit_position); | 9462 value &= ~(1 << bit_position); |
9465 } | 9463 } |
9466 return value; | 9464 return value; |
9467 } | 9465 } |
9468 }; | 9466 }; |
9469 | 9467 |
9470 } } // namespace v8::internal | 9468 } } // namespace v8::internal |
9471 | 9469 |
9472 #endif // V8_OBJECTS_H_ | 9470 #endif // V8_OBJECTS_H_ |
OLD | NEW |