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

Side by Side Diff: src/objects.h

Issue 1506683004: Free one bit in Map by removing unused retaining counter. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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 | « src/mips64/builtins-mips64.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 // 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 9
10 #include "src/allocation.h" 10 #include "src/allocation.h"
(...skipping 5466 matching lines...) Expand 10 before | Expand all | Expand 10 after
5477 kDescriptorIndexBitCount, kDescriptorIndexBitCount> {}; // NOLINT 5477 kDescriptorIndexBitCount, kDescriptorIndexBitCount> {}; // NOLINT
5478 STATIC_ASSERT(kDescriptorIndexBitCount + kDescriptorIndexBitCount == 20); 5478 STATIC_ASSERT(kDescriptorIndexBitCount + kDescriptorIndexBitCount == 20);
5479 class DictionaryMap : public BitField<bool, 20, 1> {}; 5479 class DictionaryMap : public BitField<bool, 20, 1> {};
5480 class OwnsDescriptors : public BitField<bool, 21, 1> {}; 5480 class OwnsDescriptors : public BitField<bool, 21, 1> {};
5481 class IsHiddenPrototype : public BitField<bool, 22, 1> {}; 5481 class IsHiddenPrototype : public BitField<bool, 22, 1> {};
5482 class Deprecated : public BitField<bool, 23, 1> {}; 5482 class Deprecated : public BitField<bool, 23, 1> {};
5483 class IsUnstable : public BitField<bool, 24, 1> {}; 5483 class IsUnstable : public BitField<bool, 24, 1> {};
5484 class IsMigrationTarget : public BitField<bool, 25, 1> {}; 5484 class IsMigrationTarget : public BitField<bool, 25, 1> {};
5485 class IsStrong : public BitField<bool, 26, 1> {}; 5485 class IsStrong : public BitField<bool, 26, 1> {};
5486 class NewTargetIsBase : public BitField<bool, 27, 1> {}; 5486 class NewTargetIsBase : public BitField<bool, 27, 1> {};
5487 // Bit 28 is free.
5487 5488
5488 // Keep this bit field at the very end for better code in 5489 // Keep this bit field at the very end for better code in
5489 // Builtins::kJSConstructStubGeneric stub. 5490 // Builtins::kJSConstructStubGeneric stub.
5490 // This counter is used for in-object slack tracking and for map aging. 5491 // This counter is used for in-object slack tracking.
5491 // The in-object slack tracking is considered enabled when the counter is 5492 // The in-object slack tracking is considered enabled when the counter is
5492 // in the range [kSlackTrackingCounterStart, kSlackTrackingCounterEnd]. 5493 // non zero.
5493 class Counter : public BitField<int, 28, 4> {}; 5494 class ConstructionCounter : public BitField<int, 29, 3> {};
5494 static const int kSlackTrackingCounterStart = 14; 5495 static const int kSlackTrackingCounterStart = 7;
5495 static const int kSlackTrackingCounterEnd = 8; 5496 static const int kSlackTrackingCounterEnd = 1;
5496 static const int kRetainingCounterStart = kSlackTrackingCounterEnd - 1; 5497 static const int kNoSlackTracking = 0;
5497 static const int kRetainingCounterEnd = 0; 5498 STATIC_ASSERT(kSlackTrackingCounterStart <= ConstructionCounter::kMax);
5498 5499
5499 5500
5500 // Inobject slack tracking is the way to reclaim unused inobject space. 5501 // Inobject slack tracking is the way to reclaim unused inobject space.
5501 // 5502 //
5502 // The instance size is initially determined by adding some slack to 5503 // The instance size is initially determined by adding some slack to
5503 // expected_nof_properties (to allow for a few extra properties added 5504 // expected_nof_properties (to allow for a few extra properties added
5504 // after the constructor). There is no guarantee that the extra space 5505 // after the constructor). There is no guarantee that the extra space
5505 // will not be wasted. 5506 // will not be wasted.
5506 // 5507 //
5507 // Here is the algorithm to reclaim the unused inobject space: 5508 // Here is the algorithm to reclaim the unused inobject space:
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
5756 5757
5757 inline int EnumLength(); 5758 inline int EnumLength();
5758 inline void SetEnumLength(int length); 5759 inline void SetEnumLength(int length);
5759 5760
5760 inline bool owns_descriptors(); 5761 inline bool owns_descriptors();
5761 inline void set_owns_descriptors(bool owns_descriptors); 5762 inline void set_owns_descriptors(bool owns_descriptors);
5762 inline void mark_unstable(); 5763 inline void mark_unstable();
5763 inline bool is_stable(); 5764 inline bool is_stable();
5764 inline void set_migration_target(bool value); 5765 inline void set_migration_target(bool value);
5765 inline bool is_migration_target(); 5766 inline bool is_migration_target();
5766 inline void set_counter(int value); 5767 inline void set_construction_counter(int value);
5767 inline int counter(); 5768 inline int construction_counter();
5768 inline void deprecate(); 5769 inline void deprecate();
5769 inline bool is_deprecated(); 5770 inline bool is_deprecated();
5770 inline bool CanBeDeprecated(); 5771 inline bool CanBeDeprecated();
5771 // Returns a non-deprecated version of the input. If the input was not 5772 // Returns a non-deprecated version of the input. If the input was not
5772 // deprecated, it is directly returned. Otherwise, the non-deprecated version 5773 // deprecated, it is directly returned. Otherwise, the non-deprecated version
5773 // is found by re-transitioning from the root of the transition tree using the 5774 // is found by re-transitioning from the root of the transition tree using the
5774 // descriptor array of the map. Returns MaybeHandle<Map>() if no updated map 5775 // descriptor array of the map. Returns MaybeHandle<Map>() if no updated map
5775 // is found. 5776 // is found.
5776 static MaybeHandle<Map> TryUpdate(Handle<Map> map) WARN_UNUSED_RESULT; 5777 static MaybeHandle<Map> TryUpdate(Handle<Map> map) WARN_UNUSED_RESULT;
5777 5778
(...skipping 4899 matching lines...) Expand 10 before | Expand all | Expand 10 after
10677 } 10678 }
10678 return value; 10679 return value;
10679 } 10680 }
10680 }; 10681 };
10681 10682
10682 10683
10683 } // NOLINT, false-positive due to second-order macros. 10684 } // NOLINT, false-positive due to second-order macros.
10684 } // NOLINT, false-positive due to second-order macros. 10685 } // NOLINT, false-positive due to second-order macros.
10685 10686
10686 #endif // V8_OBJECTS_H_ 10687 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/mips64/builtins-mips64.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698