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

Unified Diff: src/objects.h

Issue 10824079: Use a special EnumLength field to indicate number of valid enum cache values. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: u Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 3349921d9fc08ef9d12046186807cee4e3303bb5..650729f1c53097689485465102ff7785dd10f966 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -4644,6 +4644,7 @@ class Map: public HeapObject {
class IsShared: public BitField<bool, 0, 1> {};
class FunctionWithPrototype: public BitField<bool, 1, 1> {};
class LastAddedBits: public BitField<int, 2, 11> {};
+ class EnumLengthBits: public BitField<int, 13, 11> {};
// Tells whether the object in the prototype property will be used
// for instances created from this function. If the prototype
@@ -4876,6 +4877,14 @@ class Map: public HeapObject {
set_bit_field3(LastAddedBits::update(bit_field3(), index));
}
+ int EnumLength() {
+ return EnumLengthBits::decode(bit_field3());
+ }
+
+ void SetEnumLength(int index) {
+ set_bit_field3(EnumLengthBits::update(bit_field3(), index));
+ }
+
int LastAdded() {
Michael Starzinger 2012/08/06 15:06:22 Can we move LastAdded() up just above SetLastAdded
Toon Verwaest 2012/08/07 10:49:47 Done.
return LastAddedBits::decode(bit_field3());
}
@@ -5028,6 +5037,7 @@ class Map: public HeapObject {
// Constant for denoting that the LastAdded field was not yet set.
static const int kNoneAdded = LastAddedBits::kMax;
+ static const int kInvalidEnumCache = EnumLengthBits::kMax;
// Layout description.
static const int kInstanceSizesOffset = HeapObject::kHeaderSize;
« src/ia32/lithium-ia32.h ('K') | « src/ia32/macro-assembler-ia32.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698