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 4395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4406 | 4406 |
4407 private: | 4407 private: |
4408 DISALLOW_IMPLICIT_CONSTRUCTORS(SeqString); | 4408 DISALLOW_IMPLICIT_CONSTRUCTORS(SeqString); |
4409 }; | 4409 }; |
4410 | 4410 |
4411 | 4411 |
4412 // The AsciiString class captures sequential ascii string objects. | 4412 // The AsciiString class captures sequential ascii string objects. |
4413 // Each character in the AsciiString is an ascii character. | 4413 // Each character in the AsciiString is an ascii character. |
4414 class SeqAsciiString: public SeqString { | 4414 class SeqAsciiString: public SeqString { |
4415 public: | 4415 public: |
| 4416 static const bool kHasAsciiEncoding = true; |
| 4417 |
4416 // Dispatched behavior. | 4418 // Dispatched behavior. |
4417 inline uint16_t SeqAsciiStringGet(int index); | 4419 inline uint16_t SeqAsciiStringGet(int index); |
4418 inline void SeqAsciiStringSet(int index, uint16_t value); | 4420 inline void SeqAsciiStringSet(int index, uint16_t value); |
4419 | 4421 |
4420 // Get the address of the characters in this string. | 4422 // Get the address of the characters in this string. |
4421 inline Address GetCharsAddress(); | 4423 inline Address GetCharsAddress(); |
4422 | 4424 |
4423 inline char* GetChars(); | 4425 inline char* GetChars(); |
4424 | 4426 |
4425 // Casting | 4427 // Casting |
(...skipping 29 matching lines...) Expand all Loading... |
4455 | 4457 |
4456 private: | 4458 private: |
4457 DISALLOW_IMPLICIT_CONSTRUCTORS(SeqAsciiString); | 4459 DISALLOW_IMPLICIT_CONSTRUCTORS(SeqAsciiString); |
4458 }; | 4460 }; |
4459 | 4461 |
4460 | 4462 |
4461 // The TwoByteString class captures sequential unicode string objects. | 4463 // The TwoByteString class captures sequential unicode string objects. |
4462 // Each character in the TwoByteString is a two-byte uint16_t. | 4464 // Each character in the TwoByteString is a two-byte uint16_t. |
4463 class SeqTwoByteString: public SeqString { | 4465 class SeqTwoByteString: public SeqString { |
4464 public: | 4466 public: |
| 4467 static const bool kHasAsciiEncoding = false; |
| 4468 |
4465 // Dispatched behavior. | 4469 // Dispatched behavior. |
4466 inline uint16_t SeqTwoByteStringGet(int index); | 4470 inline uint16_t SeqTwoByteStringGet(int index); |
4467 inline void SeqTwoByteStringSet(int index, uint16_t value); | 4471 inline void SeqTwoByteStringSet(int index, uint16_t value); |
4468 | 4472 |
4469 // Get the address of the characters in this string. | 4473 // Get the address of the characters in this string. |
4470 inline Address GetCharsAddress(); | 4474 inline Address GetCharsAddress(); |
4471 | 4475 |
4472 inline uc16* GetChars(); | 4476 inline uc16* GetChars(); |
4473 | 4477 |
4474 // For regexp code. | 4478 // For regexp code. |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4587 | 4591 |
4588 private: | 4592 private: |
4589 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalString); | 4593 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalString); |
4590 }; | 4594 }; |
4591 | 4595 |
4592 | 4596 |
4593 // The ExternalAsciiString class is an external string backed by an | 4597 // The ExternalAsciiString class is an external string backed by an |
4594 // ASCII string. | 4598 // ASCII string. |
4595 class ExternalAsciiString: public ExternalString { | 4599 class ExternalAsciiString: public ExternalString { |
4596 public: | 4600 public: |
| 4601 static const bool kHasAsciiEncoding = true; |
| 4602 |
4597 typedef v8::String::ExternalAsciiStringResource Resource; | 4603 typedef v8::String::ExternalAsciiStringResource Resource; |
4598 | 4604 |
4599 // The underlying resource. | 4605 // The underlying resource. |
4600 inline Resource* resource(); | 4606 inline Resource* resource(); |
4601 inline void set_resource(Resource* buffer); | 4607 inline void set_resource(Resource* buffer); |
4602 | 4608 |
4603 // Dispatched behavior. | 4609 // Dispatched behavior. |
4604 uint16_t ExternalAsciiStringGet(int index); | 4610 uint16_t ExternalAsciiStringGet(int index); |
4605 | 4611 |
4606 // Casting. | 4612 // Casting. |
(...skipping 12 matching lines...) Expand all Loading... |
4619 | 4625 |
4620 private: | 4626 private: |
4621 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalAsciiString); | 4627 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalAsciiString); |
4622 }; | 4628 }; |
4623 | 4629 |
4624 | 4630 |
4625 // The ExternalTwoByteString class is an external string backed by a UTF-16 | 4631 // The ExternalTwoByteString class is an external string backed by a UTF-16 |
4626 // encoded string. | 4632 // encoded string. |
4627 class ExternalTwoByteString: public ExternalString { | 4633 class ExternalTwoByteString: public ExternalString { |
4628 public: | 4634 public: |
| 4635 static const bool kHasAsciiEncoding = false; |
| 4636 |
4629 typedef v8::String::ExternalStringResource Resource; | 4637 typedef v8::String::ExternalStringResource Resource; |
4630 | 4638 |
4631 // The underlying string resource. | 4639 // The underlying string resource. |
4632 inline Resource* resource(); | 4640 inline Resource* resource(); |
4633 inline void set_resource(Resource* buffer); | 4641 inline void set_resource(Resource* buffer); |
4634 | 4642 |
4635 // Dispatched behavior. | 4643 // Dispatched behavior. |
4636 uint16_t ExternalTwoByteStringGet(int index); | 4644 uint16_t ExternalTwoByteStringGet(int index); |
4637 | 4645 |
4638 // For regexp code. | 4646 // For regexp code. |
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5349 } else { | 5357 } else { |
5350 value &= ~(1 << bit_position); | 5358 value &= ~(1 << bit_position); |
5351 } | 5359 } |
5352 return value; | 5360 return value; |
5353 } | 5361 } |
5354 }; | 5362 }; |
5355 | 5363 |
5356 } } // namespace v8::internal | 5364 } } // namespace v8::internal |
5357 | 5365 |
5358 #endif // V8_OBJECTS_H_ | 5366 #endif // V8_OBJECTS_H_ |
OLD | NEW |