Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: src/objects.h

Issue 219213003: Fixed power-of-2 predicates, excluding 0. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/mips/lithium-codegen-mips.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 613 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 STATIC_ASSERT((kSeqStringTag & kIsIndirectStringMask) == 0); 624 STATIC_ASSERT((kSeqStringTag & kIsIndirectStringMask) == 0);
625 STATIC_ASSERT((kExternalStringTag & kIsIndirectStringMask) == 0); 625 STATIC_ASSERT((kExternalStringTag & kIsIndirectStringMask) == 0);
626 STATIC_ASSERT( 626 STATIC_ASSERT(
627 (kConsStringTag & kIsIndirectStringMask) == kIsIndirectStringTag); 627 (kConsStringTag & kIsIndirectStringMask) == kIsIndirectStringTag);
628 STATIC_ASSERT( 628 STATIC_ASSERT(
629 (kSlicedStringTag & kIsIndirectStringMask) == kIsIndirectStringTag); 629 (kSlicedStringTag & kIsIndirectStringMask) == kIsIndirectStringTag);
630 630
631 // Use this mask to distinguish between cons and slice only after making 631 // Use this mask to distinguish between cons and slice only after making
632 // sure that the string is one of the two (an indirect string). 632 // sure that the string is one of the two (an indirect string).
633 const uint32_t kSlicedNotConsMask = kSlicedStringTag & ~kConsStringTag; 633 const uint32_t kSlicedNotConsMask = kSlicedStringTag & ~kConsStringTag;
634 STATIC_ASSERT(IS_POWER_OF_TWO(kSlicedNotConsMask) && kSlicedNotConsMask != 0); 634 STATIC_ASSERT(IS_POWER_OF_TWO(kSlicedNotConsMask));
635 635
636 // If bit 7 is clear, then bit 3 indicates whether this two-byte 636 // If bit 7 is clear, then bit 3 indicates whether this two-byte
637 // string actually contains one byte data. 637 // string actually contains one byte data.
638 const uint32_t kOneByteDataHintMask = 0x08; 638 const uint32_t kOneByteDataHintMask = 0x08;
639 const uint32_t kOneByteDataHintTag = 0x08; 639 const uint32_t kOneByteDataHintTag = 0x08;
640 640
641 // If bit 7 is clear and string representation indicates an external string, 641 // If bit 7 is clear and string representation indicates an external string,
642 // then bit 4 indicates whether the data pointer is cached. 642 // then bit 4 indicates whether the data pointer is cached.
643 const uint32_t kShortExternalStringMask = 0x10; 643 const uint32_t kShortExternalStringMask = 0x10;
644 const uint32_t kShortExternalStringTag = 0x10; 644 const uint32_t kShortExternalStringTag = 0x10;
(...skipping 10197 matching lines...) Expand 10 before | Expand all | Expand 10 after
10842 } else { 10842 } else {
10843 value &= ~(1 << bit_position); 10843 value &= ~(1 << bit_position);
10844 } 10844 }
10845 return value; 10845 return value;
10846 } 10846 }
10847 }; 10847 };
10848 10848
10849 } } // namespace v8::internal 10849 } } // namespace v8::internal
10850 10850
10851 #endif // V8_OBJECTS_H_ 10851 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/mips/lithium-codegen-mips.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698