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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 // JSObject for GC purposes. The first four entries here have typeof | 323 // JSObject for GC purposes. The first four entries here have typeof |
324 // 'object', whereas JS_FUNCTION_TYPE has typeof 'function'. | 324 // 'object', whereas JS_FUNCTION_TYPE has typeof 'function'. |
325 #define INSTANCE_TYPE_LIST_ALL(V) \ | 325 #define INSTANCE_TYPE_LIST_ALL(V) \ |
326 V(STRING_TYPE) \ | 326 V(STRING_TYPE) \ |
327 V(ASCII_STRING_TYPE) \ | 327 V(ASCII_STRING_TYPE) \ |
328 V(CONS_STRING_TYPE) \ | 328 V(CONS_STRING_TYPE) \ |
329 V(CONS_ASCII_STRING_TYPE) \ | 329 V(CONS_ASCII_STRING_TYPE) \ |
330 V(SLICED_STRING_TYPE) \ | 330 V(SLICED_STRING_TYPE) \ |
331 V(EXTERNAL_STRING_TYPE) \ | 331 V(EXTERNAL_STRING_TYPE) \ |
332 V(EXTERNAL_ASCII_STRING_TYPE) \ | 332 V(EXTERNAL_ASCII_STRING_TYPE) \ |
333 V(EXTERNAL_STRING_WITH_ASCII_DATA_TYPE) \ | 333 V(EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE) \ |
334 V(SHORT_EXTERNAL_STRING_TYPE) \ | 334 V(SHORT_EXTERNAL_STRING_TYPE) \ |
335 V(SHORT_EXTERNAL_ASCII_STRING_TYPE) \ | 335 V(SHORT_EXTERNAL_ASCII_STRING_TYPE) \ |
336 V(SHORT_EXTERNAL_STRING_WITH_ASCII_DATA_TYPE) \ | 336 V(SHORT_EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE) \ |
337 \ | 337 \ |
338 V(INTERNALIZED_STRING_TYPE) \ | 338 V(INTERNALIZED_STRING_TYPE) \ |
339 V(ASCII_INTERNALIZED_STRING_TYPE) \ | 339 V(ASCII_INTERNALIZED_STRING_TYPE) \ |
340 V(CONS_INTERNALIZED_STRING_TYPE) \ | 340 V(CONS_INTERNALIZED_STRING_TYPE) \ |
341 V(CONS_ASCII_INTERNALIZED_STRING_TYPE) \ | 341 V(CONS_ASCII_INTERNALIZED_STRING_TYPE) \ |
342 V(EXTERNAL_INTERNALIZED_STRING_TYPE) \ | 342 V(EXTERNAL_INTERNALIZED_STRING_TYPE) \ |
343 V(EXTERNAL_ASCII_INTERNALIZED_STRING_TYPE) \ | 343 V(EXTERNAL_ASCII_INTERNALIZED_STRING_TYPE) \ |
344 V(EXTERNAL_INTERNALIZED_STRING_WITH_ASCII_DATA_TYPE) \ | 344 V(EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE) \ |
345 V(SHORT_EXTERNAL_INTERNALIZED_STRING_TYPE) \ | 345 V(SHORT_EXTERNAL_INTERNALIZED_STRING_TYPE) \ |
346 V(SHORT_EXTERNAL_ASCII_INTERNALIZED_STRING_TYPE) \ | 346 V(SHORT_EXTERNAL_ASCII_INTERNALIZED_STRING_TYPE) \ |
347 V(SHORT_EXTERNAL_INTERNALIZED_STRING_WITH_ASCII_DATA_TYPE) \ | 347 V(SHORT_EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE) \ |
348 \ | 348 \ |
349 V(SYMBOL_TYPE) \ | 349 V(SYMBOL_TYPE) \ |
350 V(MAP_TYPE) \ | 350 V(MAP_TYPE) \ |
351 V(CODE_TYPE) \ | 351 V(CODE_TYPE) \ |
352 V(ODDBALL_TYPE) \ | 352 V(ODDBALL_TYPE) \ |
353 V(JS_GLOBAL_PROPERTY_CELL_TYPE) \ | 353 V(JS_GLOBAL_PROPERTY_CELL_TYPE) \ |
354 \ | 354 \ |
355 V(HEAP_NUMBER_TYPE) \ | 355 V(HEAP_NUMBER_TYPE) \ |
356 V(FOREIGN_TYPE) \ | 356 V(FOREIGN_TYPE) \ |
357 V(BYTE_ARRAY_TYPE) \ | 357 V(BYTE_ARRAY_TYPE) \ |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 sliced_ascii_string, \ | 454 sliced_ascii_string, \ |
455 SlicedAsciiString) \ | 455 SlicedAsciiString) \ |
456 V(EXTERNAL_STRING_TYPE, \ | 456 V(EXTERNAL_STRING_TYPE, \ |
457 ExternalTwoByteString::kSize, \ | 457 ExternalTwoByteString::kSize, \ |
458 external_string, \ | 458 external_string, \ |
459 ExternalString) \ | 459 ExternalString) \ |
460 V(EXTERNAL_ASCII_STRING_TYPE, \ | 460 V(EXTERNAL_ASCII_STRING_TYPE, \ |
461 ExternalAsciiString::kSize, \ | 461 ExternalAsciiString::kSize, \ |
462 external_ascii_string, \ | 462 external_ascii_string, \ |
463 ExternalAsciiString) \ | 463 ExternalAsciiString) \ |
464 V(EXTERNAL_STRING_WITH_ASCII_DATA_TYPE, \ | 464 V(EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE, \ |
465 ExternalTwoByteString::kSize, \ | 465 ExternalTwoByteString::kSize, \ |
466 external_string_with_ascii_data, \ | 466 external_string_with_one_bytei_data, \ |
467 ExternalStringWithAsciiData) \ | 467 ExternalStringWithOneByteData) \ |
468 V(SHORT_EXTERNAL_STRING_TYPE, \ | 468 V(SHORT_EXTERNAL_STRING_TYPE, \ |
469 ExternalTwoByteString::kShortSize, \ | 469 ExternalTwoByteString::kShortSize, \ |
470 short_external_string, \ | 470 short_external_string, \ |
471 ShortExternalString) \ | 471 ShortExternalString) \ |
472 V(SHORT_EXTERNAL_ASCII_STRING_TYPE, \ | 472 V(SHORT_EXTERNAL_ASCII_STRING_TYPE, \ |
473 ExternalAsciiString::kShortSize, \ | 473 ExternalAsciiString::kShortSize, \ |
474 short_external_ascii_string, \ | 474 short_external_ascii_string, \ |
475 ShortExternalAsciiString) \ | 475 ShortExternalAsciiString) \ |
476 V(SHORT_EXTERNAL_STRING_WITH_ASCII_DATA_TYPE, \ | 476 V(SHORT_EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE, \ |
477 ExternalTwoByteString::kShortSize, \ | 477 ExternalTwoByteString::kShortSize, \ |
478 short_external_string_with_ascii_data, \ | 478 short_external_string_with_one_byte_data, \ |
479 ShortExternalStringWithAsciiData) \ | 479 ShortExternalStringWithOneByteData) \ |
480 \ | 480 \ |
481 V(INTERNALIZED_STRING_TYPE, \ | 481 V(INTERNALIZED_STRING_TYPE, \ |
482 kVariableSizeSentinel, \ | 482 kVariableSizeSentinel, \ |
483 internalized_string, \ | 483 internalized_string, \ |
484 InternalizedString) \ | 484 InternalizedString) \ |
485 V(ASCII_INTERNALIZED_STRING_TYPE, \ | 485 V(ASCII_INTERNALIZED_STRING_TYPE, \ |
486 kVariableSizeSentinel, \ | 486 kVariableSizeSentinel, \ |
487 ascii_internalized_string, \ | 487 ascii_internalized_string, \ |
488 AsciiInternalizedString) \ | 488 AsciiInternalizedString) \ |
489 V(CONS_INTERNALIZED_STRING_TYPE, \ | 489 V(CONS_INTERNALIZED_STRING_TYPE, \ |
490 ConsString::kSize, \ | 490 ConsString::kSize, \ |
491 cons_internalized_string, \ | 491 cons_internalized_string, \ |
492 ConsInternalizedString) \ | 492 ConsInternalizedString) \ |
493 V(CONS_ASCII_INTERNALIZED_STRING_TYPE, \ | 493 V(CONS_ASCII_INTERNALIZED_STRING_TYPE, \ |
494 ConsString::kSize, \ | 494 ConsString::kSize, \ |
495 cons_ascii_internalized_string, \ | 495 cons_ascii_internalized_string, \ |
496 ConsAsciiInternalizedString) \ | 496 ConsAsciiInternalizedString) \ |
497 V(EXTERNAL_INTERNALIZED_STRING_TYPE, \ | 497 V(EXTERNAL_INTERNALIZED_STRING_TYPE, \ |
498 ExternalTwoByteString::kSize, \ | 498 ExternalTwoByteString::kSize, \ |
499 external_internalized_string, \ | 499 external_internalized_string, \ |
500 ExternalInternalizedString) \ | 500 ExternalInternalizedString) \ |
501 V(EXTERNAL_ASCII_INTERNALIZED_STRING_TYPE, \ | 501 V(EXTERNAL_ASCII_INTERNALIZED_STRING_TYPE, \ |
502 ExternalAsciiString::kSize, \ | 502 ExternalAsciiString::kSize, \ |
503 external_ascii_internalized_string, \ | 503 external_ascii_internalized_string, \ |
504 ExternalAsciiInternalizedString) \ | 504 ExternalAsciiInternalizedString) \ |
505 V(EXTERNAL_INTERNALIZED_STRING_WITH_ASCII_DATA_TYPE, \ | 505 V(EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE, \ |
506 ExternalTwoByteString::kSize, \ | 506 ExternalTwoByteString::kSize, \ |
507 external_internalized_string_with_ascii_data, \ | 507 external_internalized_string_with_one_byte_data, \ |
508 ExternalInternalizedStringWithAsciiData) \ | 508 ExternalInternalizedStringWithOneByteData) \ |
509 V(SHORT_EXTERNAL_INTERNALIZED_STRING_TYPE, \ | 509 V(SHORT_EXTERNAL_INTERNALIZED_STRING_TYPE, \ |
510 ExternalTwoByteString::kShortSize, \ | 510 ExternalTwoByteString::kShortSize, \ |
511 short_external_internalized_string, \ | 511 short_external_internalized_string, \ |
512 ShortExternalInternalizedString) \ | 512 ShortExternalInternalizedString) \ |
513 V(SHORT_EXTERNAL_ASCII_INTERNALIZED_STRING_TYPE, \ | 513 V(SHORT_EXTERNAL_ASCII_INTERNALIZED_STRING_TYPE, \ |
514 ExternalAsciiString::kShortSize, \ | 514 ExternalAsciiString::kShortSize, \ |
515 short_external_ascii_internalized_string, \ | 515 short_external_ascii_internalized_string, \ |
516 ShortExternalAsciiInternalizedString) \ | 516 ShortExternalAsciiInternalizedString) \ |
517 V(SHORT_EXTERNAL_INTERNALIZED_STRING_WITH_ASCII_DATA_TYPE, \ | 517 V(SHORT_EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE, \ |
518 ExternalTwoByteString::kShortSize, \ | 518 ExternalTwoByteString::kShortSize, \ |
519 short_external_internalized_string_with_ascii_data, \ | 519 short_external_internalized_string_with_one_byte_data, \ |
520 ShortExternalInternalizedStringWithAsciiData) \ | 520 ShortExternalInternalizedStringWithOneByteData) \ |
521 | 521 |
522 // A struct is a simple object a set of object-valued fields. Including an | 522 // A struct is a simple object a set of object-valued fields. Including an |
523 // object type in this causes the compiler to generate most of the boilerplate | 523 // object type in this causes the compiler to generate most of the boilerplate |
524 // code for the class including allocation and garbage collection routines, | 524 // code for the class including allocation and garbage collection routines, |
525 // casts and predicates. All you need to define is the class, methods and | 525 // casts and predicates. All you need to define is the class, methods and |
526 // object verification routines. Easy, no? | 526 // object verification routines. Easy, no? |
527 // | 527 // |
528 // Note that for subtle reasons related to the ordering or numerical values of | 528 // Note that for subtle reasons related to the ordering or numerical values of |
529 // type tags, elements in this list have to be added to the INSTANCE_TYPE_LIST | 529 // type tags, elements in this list have to be added to the INSTANCE_TYPE_LIST |
530 // manually. | 530 // manually. |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 (kConsStringTag & kIsIndirectStringMask) == kIsIndirectStringTag); | 598 (kConsStringTag & kIsIndirectStringMask) == kIsIndirectStringTag); |
599 STATIC_ASSERT( | 599 STATIC_ASSERT( |
600 (kSlicedStringTag & kIsIndirectStringMask) == kIsIndirectStringTag); | 600 (kSlicedStringTag & kIsIndirectStringMask) == kIsIndirectStringTag); |
601 | 601 |
602 // Use this mask to distinguish between cons and slice only after making | 602 // Use this mask to distinguish between cons and slice only after making |
603 // sure that the string is one of the two (an indirect string). | 603 // sure that the string is one of the two (an indirect string). |
604 const uint32_t kSlicedNotConsMask = kSlicedStringTag & ~kConsStringTag; | 604 const uint32_t kSlicedNotConsMask = kSlicedStringTag & ~kConsStringTag; |
605 STATIC_ASSERT(IS_POWER_OF_TWO(kSlicedNotConsMask) && kSlicedNotConsMask != 0); | 605 STATIC_ASSERT(IS_POWER_OF_TWO(kSlicedNotConsMask) && kSlicedNotConsMask != 0); |
606 | 606 |
607 // If bit 7 is clear, then bit 3 indicates whether this two-byte | 607 // If bit 7 is clear, then bit 3 indicates whether this two-byte |
608 // string actually contains ASCII data. | 608 // string actually contains one byte data. |
609 const uint32_t kAsciiDataHintMask = 0x08; | 609 const uint32_t kOneByteDataHintMask = 0x08; |
610 const uint32_t kAsciiDataHintTag = 0x08; | 610 const uint32_t kOneByteDataHintTag = 0x08; |
611 | 611 |
612 // If bit 7 is clear and string representation indicates an external string, | 612 // If bit 7 is clear and string representation indicates an external string, |
613 // then bit 4 indicates whether the data pointer is cached. | 613 // then bit 4 indicates whether the data pointer is cached. |
614 const uint32_t kShortExternalStringMask = 0x10; | 614 const uint32_t kShortExternalStringMask = 0x10; |
615 const uint32_t kShortExternalStringTag = 0x10; | 615 const uint32_t kShortExternalStringTag = 0x10; |
616 | 616 |
617 | 617 |
618 // A ConsString with an empty string as the right side is a candidate | 618 // A ConsString with an empty string as the right side is a candidate |
619 // for being shortcut by the garbage collector unless it is internalized. | 619 // for being shortcut by the garbage collector unless it is internalized. |
620 // It's not common to have non-flat internalized strings, so we do not | 620 // It's not common to have non-flat internalized strings, so we do not |
621 // shortcut them thereby avoiding turning internalized strings into strings. | 621 // shortcut them thereby avoiding turning internalized strings into strings. |
622 // See heap.cc and mark-compact.cc. | 622 // See heap.cc and mark-compact.cc. |
623 const uint32_t kShortcutTypeMask = | 623 const uint32_t kShortcutTypeMask = |
624 kIsNotStringMask | | 624 kIsNotStringMask | |
625 kIsInternalizedMask | | 625 kIsInternalizedMask | |
626 kStringRepresentationMask; | 626 kStringRepresentationMask; |
627 const uint32_t kShortcutTypeTag = kConsStringTag; | 627 const uint32_t kShortcutTypeTag = kConsStringTag; |
628 | 628 |
629 | 629 |
630 enum InstanceType { | 630 enum InstanceType { |
631 // String types. | 631 // String types. |
632 STRING_TYPE = kTwoByteStringTag | kSeqStringTag, | 632 STRING_TYPE = kTwoByteStringTag | kSeqStringTag, |
633 ASCII_STRING_TYPE = kOneByteStringTag | kSeqStringTag, | 633 ASCII_STRING_TYPE = kOneByteStringTag | kSeqStringTag, |
634 CONS_STRING_TYPE = kTwoByteStringTag | kConsStringTag, | 634 CONS_STRING_TYPE = kTwoByteStringTag | kConsStringTag, |
635 CONS_ASCII_STRING_TYPE = kOneByteStringTag | kConsStringTag, | 635 CONS_ASCII_STRING_TYPE = kOneByteStringTag | kConsStringTag, |
636 SLICED_STRING_TYPE = kTwoByteStringTag | kSlicedStringTag, | 636 SLICED_STRING_TYPE = kTwoByteStringTag | kSlicedStringTag, |
637 SLICED_ASCII_STRING_TYPE = kOneByteStringTag | kSlicedStringTag, | 637 SLICED_ASCII_STRING_TYPE = kOneByteStringTag | kSlicedStringTag, |
638 EXTERNAL_STRING_TYPE = kTwoByteStringTag | kExternalStringTag, | 638 EXTERNAL_STRING_TYPE = kTwoByteStringTag | kExternalStringTag, |
639 EXTERNAL_ASCII_STRING_TYPE = kOneByteStringTag | kExternalStringTag, | 639 EXTERNAL_ASCII_STRING_TYPE = kOneByteStringTag | kExternalStringTag, |
640 EXTERNAL_STRING_WITH_ASCII_DATA_TYPE = | 640 EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE = |
641 EXTERNAL_STRING_TYPE | kAsciiDataHintTag, | 641 EXTERNAL_STRING_TYPE | kOneByteDataHintTag, |
642 SHORT_EXTERNAL_STRING_TYPE = EXTERNAL_STRING_TYPE | kShortExternalStringTag, | 642 SHORT_EXTERNAL_STRING_TYPE = EXTERNAL_STRING_TYPE | kShortExternalStringTag, |
643 SHORT_EXTERNAL_ASCII_STRING_TYPE = | 643 SHORT_EXTERNAL_ASCII_STRING_TYPE = |
644 EXTERNAL_ASCII_STRING_TYPE | kShortExternalStringTag, | 644 EXTERNAL_ASCII_STRING_TYPE | kShortExternalStringTag, |
645 SHORT_EXTERNAL_STRING_WITH_ASCII_DATA_TYPE = | 645 SHORT_EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE = |
646 EXTERNAL_STRING_WITH_ASCII_DATA_TYPE | kShortExternalStringTag, | 646 EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE | kShortExternalStringTag, |
647 | 647 |
648 INTERNALIZED_STRING_TYPE = STRING_TYPE | kInternalizedTag, | 648 INTERNALIZED_STRING_TYPE = STRING_TYPE | kInternalizedTag, |
649 ASCII_INTERNALIZED_STRING_TYPE = ASCII_STRING_TYPE | kInternalizedTag, | 649 ASCII_INTERNALIZED_STRING_TYPE = ASCII_STRING_TYPE | kInternalizedTag, |
650 CONS_INTERNALIZED_STRING_TYPE = CONS_STRING_TYPE | kInternalizedTag, | 650 CONS_INTERNALIZED_STRING_TYPE = CONS_STRING_TYPE | kInternalizedTag, |
651 CONS_ASCII_INTERNALIZED_STRING_TYPE = | 651 CONS_ASCII_INTERNALIZED_STRING_TYPE = |
652 CONS_ASCII_STRING_TYPE | kInternalizedTag, | 652 CONS_ASCII_STRING_TYPE | kInternalizedTag, |
653 EXTERNAL_INTERNALIZED_STRING_TYPE = EXTERNAL_STRING_TYPE | kInternalizedTag, | 653 EXTERNAL_INTERNALIZED_STRING_TYPE = EXTERNAL_STRING_TYPE | kInternalizedTag, |
654 EXTERNAL_ASCII_INTERNALIZED_STRING_TYPE = | 654 EXTERNAL_ASCII_INTERNALIZED_STRING_TYPE = |
655 EXTERNAL_ASCII_STRING_TYPE | kInternalizedTag, | 655 EXTERNAL_ASCII_STRING_TYPE | kInternalizedTag, |
656 EXTERNAL_INTERNALIZED_STRING_WITH_ASCII_DATA_TYPE = | 656 EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE = |
657 EXTERNAL_STRING_WITH_ASCII_DATA_TYPE | kInternalizedTag, | 657 EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE | kInternalizedTag, |
658 SHORT_EXTERNAL_INTERNALIZED_STRING_TYPE = | 658 SHORT_EXTERNAL_INTERNALIZED_STRING_TYPE = |
659 SHORT_EXTERNAL_STRING_TYPE | kInternalizedTag, | 659 SHORT_EXTERNAL_STRING_TYPE | kInternalizedTag, |
660 SHORT_EXTERNAL_ASCII_INTERNALIZED_STRING_TYPE = | 660 SHORT_EXTERNAL_ASCII_INTERNALIZED_STRING_TYPE = |
661 SHORT_EXTERNAL_ASCII_STRING_TYPE | kInternalizedTag, | 661 SHORT_EXTERNAL_ASCII_STRING_TYPE | kInternalizedTag, |
662 SHORT_EXTERNAL_INTERNALIZED_STRING_WITH_ASCII_DATA_TYPE = | 662 SHORT_EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE = |
663 SHORT_EXTERNAL_STRING_WITH_ASCII_DATA_TYPE | kInternalizedTag, | 663 SHORT_EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE | kInternalizedTag, |
664 | 664 |
665 // Non-string names | 665 // Non-string names |
666 SYMBOL_TYPE = kNotStringTag, // LAST_NAME_TYPE, FIRST_NONSTRING_TYPE | 666 SYMBOL_TYPE = kNotStringTag, // LAST_NAME_TYPE, FIRST_NONSTRING_TYPE |
667 | 667 |
668 // Objects allocated in their own spaces (never in new space). | 668 // Objects allocated in their own spaces (never in new space). |
669 MAP_TYPE, | 669 MAP_TYPE, |
670 CODE_TYPE, | 670 CODE_TYPE, |
671 ODDBALL_TYPE, | 671 ODDBALL_TYPE, |
672 JS_GLOBAL_PROPERTY_CELL_TYPE, | 672 JS_GLOBAL_PROPERTY_CELL_TYPE, |
673 | 673 |
(...skipping 6955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7629 inline bool IsTwoByteRepresentation(); | 7629 inline bool IsTwoByteRepresentation(); |
7630 | 7630 |
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 HasOnlyAsciiChars(); | 7639 inline bool HasOnlyOneByteChars(); |
7640 | 7640 |
7641 inline bool IsOneByteConvertible(); | 7641 inline bool IsOneByteConvertible(); |
7642 | 7642 |
7643 // Get and set individual two byte chars in the string. | 7643 // Get and set individual two byte chars in the string. |
7644 inline void Set(int index, uint16_t value); | 7644 inline void Set(int index, uint16_t value); |
7645 // Get individual two byte char in the string. Repeated calls | 7645 // Get individual two byte char in the string. Repeated calls |
7646 // to this method are not efficient unless the string is flat. | 7646 // to this method are not efficient unless the string is flat. |
7647 INLINE(uint16_t Get(int index)); | 7647 INLINE(uint16_t Get(int index)); |
7648 | 7648 |
7649 // Try to flatten the string. Checks first inline to see if it is | 7649 // Try to flatten the string. Checks first inline to see if it is |
(...skipping 1813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9463 } else { | 9463 } else { |
9464 value &= ~(1 << bit_position); | 9464 value &= ~(1 << bit_position); |
9465 } | 9465 } |
9466 return value; | 9466 return value; |
9467 } | 9467 } |
9468 }; | 9468 }; |
9469 | 9469 |
9470 } } // namespace v8::internal | 9470 } } // namespace v8::internal |
9471 | 9471 |
9472 #endif // V8_OBJECTS_H_ | 9472 #endif // V8_OBJECTS_H_ |
OLD | NEW |