Reviewers: Mads Ager,

Description:
Migrate flags from bit_field2 to bit_field3


[email protected]
BUG=none
TEST=none


Please review this at http://codereview.chromium.org/7064029/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  src/objects-inl.h
  M src/objects.h
  M src/objects.cc


Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index fcbe4e612d9080d21c0a980a2afed3969e7bec2b..bc18f93eb4090a78aab393dda2ed15708a6f2389 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -2527,27 +2527,27 @@ bool Map::is_extensible() {

 void Map::set_attached_to_shared_function_info(bool value) {
   if (value) {
-    set_bit_field2(bit_field2() | (1 << kAttachedToSharedFunctionInfo));
+    set_bit_field3(bit_field3() | (1 << kAttachedToSharedFunctionInfo));
   } else {
-    set_bit_field2(bit_field2() & ~(1 << kAttachedToSharedFunctionInfo));
+    set_bit_field3(bit_field3() & ~(1 << kAttachedToSharedFunctionInfo));
   }
 }

 bool Map::attached_to_shared_function_info() {
-  return ((1 << kAttachedToSharedFunctionInfo) & bit_field2()) != 0;
+  return ((1 << kAttachedToSharedFunctionInfo) & bit_field3()) != 0;
 }


 void Map::set_is_shared(bool value) {
   if (value) {
-    set_bit_field2(bit_field2() | (1 << kIsShared));
+    set_bit_field3(bit_field3() | (1 << kIsShared));
   } else {
-    set_bit_field2(bit_field2() & ~(1 << kIsShared));
+    set_bit_field3(bit_field3() & ~(1 << kIsShared));
   }
 }

 bool Map::is_shared() {
-  return ((1 << kIsShared) & bit_field2()) != 0;
+  return ((1 << kIsShared) & bit_field3()) != 0;
 }


Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index d7e6e1cd7c3c16685dc98bf14cb05363ae52a1b4..185da4ae1b992a65482d492ce75c49de8541aea3 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -2535,8 +2535,8 @@ bool NormalizedMapCache::CheckHit(Map* slow,
                                     fast->inobject_properties()) &&
     slow->instance_type() == fast->instance_type() &&
     slow->bit_field() == fast->bit_field() &&
-    slow->bit_field3() == fast->bit_field3() &&
-    (slow->bit_field2() & ~(1<<Map::kIsShared)) == fast->bit_field2();
+    slow->bit_field2() == fast->bit_field2() &&
+    (slow->bit_field3() & ~(1<<Map::kIsShared)) == fast->bit_field3();
 }


@@ -6174,8 +6174,8 @@ void SharedFunctionInfo::DetachInitialMap() {
   Map* map = reinterpret_cast<Map*>(initial_map());

   // Make the map remember to restore the link if it survives the GC.
-  map->set_bit_field2(
-      map->bit_field2() | (1 << Map::kAttachedToSharedFunctionInfo));
+  map->set_bit_field3(
+      map->bit_field3() | (1 << Map::kAttachedToSharedFunctionInfo));

   // Undo state changes made by StartInobjectTracking (except the
// construction_count). This way if the initial map does not survive the GC
@@ -6194,8 +6194,8 @@ void SharedFunctionInfo::DetachInitialMap() {

 // Called from GC, hence reinterpret_cast and unchecked accessors.
 void SharedFunctionInfo::AttachInitialMap(Map* map) {
-  map->set_bit_field2(
-      map->bit_field2() & ~(1 << Map::kAttachedToSharedFunctionInfo));
+  map->set_bit_field3(
+      map->bit_field3() & ~(1 << Map::kAttachedToSharedFunctionInfo));

   // Resume inobject slack tracking.
   set_initial_map(map);
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 0d3a206ee7671dbc5ee8e3c912e7bbd5ea73e1cf..9957bc93f694e7d8905543f1f6dcd823e04eb5a8 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -3988,10 +3988,12 @@ class Map: public HeapObject {
   static const int kFunctionWithPrototype = 1;
   static const int kHasFastElements = 2;
   static const int kStringWrapperSafeForDefaultValueOf = 3;
-  static const int kAttachedToSharedFunctionInfo = 4;
-  static const int kIsShared = 5;
   static const int kHasExternalArrayElements = 6;

+  // Bit positions for bit field 3
+  static const int kAttachedToSharedFunctionInfo = 0;
+  static const int kIsShared = 1;
+
// Layout of the default cache. It holds alternating name and code objects.
   static const int kCodeCacheEntrySize = 2;
   static const int kCodeCacheEntryNameOffset = 0;


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to