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

Side by Side Diff: src/objects.h

Issue 2258473002: Added static assert to BitField to ensure the contents fit within the field (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « no previous file | src/utils.h » ('j') | src/utils.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_OBJECTS_H_ 5 #ifndef V8_OBJECTS_H_
6 #define V8_OBJECTS_H_ 6 #define V8_OBJECTS_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 5451 matching lines...) Expand 10 before | Expand all | Expand 10 after
5462 : public BitField<bool, 2, 1> {}; 5462 : public BitField<bool, 2, 1> {};
5463 // Bit 3 in this bitfield is unused. 5463 // Bit 3 in this bitfield is unused.
5464 class ProfilerTicksField : public BitField<int, 4, 28> {}; 5464 class ProfilerTicksField : public BitField<int, 4, 28> {};
5465 5465
5466 // Flags layout. BitField<type, shift, size>. 5466 // Flags layout. BitField<type, shift, size>.
5467 class HasUnwindingInfoField : public BitField<bool, 0, 1> {}; 5467 class HasUnwindingInfoField : public BitField<bool, 0, 1> {};
5468 class CacheHolderField 5468 class CacheHolderField
5469 : public BitField<CacheHolderFlag, HasUnwindingInfoField::kNext, 2> {}; 5469 : public BitField<CacheHolderFlag, HasUnwindingInfoField::kNext, 2> {};
5470 class KindField : public BitField<Kind, CacheHolderField::kNext, 5> {}; 5470 class KindField : public BitField<Kind, CacheHolderField::kNext, 5> {};
5471 STATIC_ASSERT(NUMBER_OF_KINDS <= KindField::kMax); 5471 STATIC_ASSERT(NUMBER_OF_KINDS <= KindField::kMax);
5472 class ExtraICStateField : public BitField<ExtraICState, KindField::kNext, 5472 class ExtraICStateField
5473 PlatformSmiTagging::kSmiValueSize - 5473 : public BitField<ExtraICState, KindField::kNext,
5474 KindField::kNext + 1> {}; 5474 PlatformSmiTagging::kSmiValueSize - KindField::kNext> {
5475 };
5475 5476
5476 // KindSpecificFlags1 layout (STUB, BUILTIN and OPTIMIZED_FUNCTION) 5477 // KindSpecificFlags1 layout (STUB, BUILTIN and OPTIMIZED_FUNCTION)
5477 static const int kStackSlotsFirstBit = 0; 5478 static const int kStackSlotsFirstBit = 0;
5478 static const int kStackSlotsBitCount = 24; 5479 static const int kStackSlotsBitCount = 24;
5479 static const int kMarkedForDeoptimizationBit = 5480 static const int kMarkedForDeoptimizationBit =
5480 kStackSlotsFirstBit + kStackSlotsBitCount; 5481 kStackSlotsFirstBit + kStackSlotsBitCount;
5481 static const int kIsTurbofannedBit = kMarkedForDeoptimizationBit + 1; 5482 static const int kIsTurbofannedBit = kMarkedForDeoptimizationBit + 1;
5482 static const int kCanHaveWeakObjects = kIsTurbofannedBit + 1; 5483 static const int kCanHaveWeakObjects = kIsTurbofannedBit + 1;
5483 // Could be moved to overlap previous bits when we need more space. 5484 // Could be moved to overlap previous bits when we need more space.
5484 static const int kIsConstructStub = kCanHaveWeakObjects + 1; 5485 static const int kIsConstructStub = kCanHaveWeakObjects + 1;
(...skipping 5688 matching lines...) Expand 10 before | Expand all | Expand 10 after
11173 } 11174 }
11174 return value; 11175 return value;
11175 } 11176 }
11176 }; 11177 };
11177 11178
11178 11179
11179 } // NOLINT, false-positive due to second-order macros. 11180 } // NOLINT, false-positive due to second-order macros.
11180 } // NOLINT, false-positive due to second-order macros. 11181 } // NOLINT, false-positive due to second-order macros.
11181 11182
11182 #endif // V8_OBJECTS_H_ 11183 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « no previous file | src/utils.h » ('j') | src/utils.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698