Save zone memory in LEnvironment by using a bit vector.
authorfschneider@chromium.org <fschneider@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 31 Jan 2012 17:19:19 +0000 (17:19 +0000)
committerfschneider@chromium.org <fschneider@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 31 Jan 2012 17:19:19 +0000 (17:19 +0000)
We don't need to store the full representation for each value. Instead
a bit to indicate tagged/untagged is enough.
Review URL: http://codereview.chromium.org/9104042

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10572 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/lithium.h

index 6d2fbbf90f1be6ee28b251145f0d37de044323ff..4987b5a4cd2dc12b9c6f3a4e4c8f95e782314cf1 100644 (file)
@@ -453,7 +453,7 @@ class LEnvironment: public ZoneObject {
         parameter_count_(parameter_count),
         pc_offset_(-1),
         values_(value_count),
-        representations_(value_count),
+        is_tagged_(value_count),
         spilled_registers_(NULL),
         spilled_double_registers_(NULL),
         outer_(outer) {
@@ -475,11 +475,13 @@ class LEnvironment: public ZoneObject {
 
   void AddValue(LOperand* operand, Representation representation) {
     values_.Add(operand);
-    representations_.Add(representation);
+    if (representation.IsTagged()) {
+      is_tagged_.Add(values_.length() - 1);
+    }
   }
 
   bool HasTaggedValueAt(int index) const {
-    return representations_[index].IsTagged();
+    return is_tagged_.Contains(index);
   }
 
   void Register(int deoptimization_index,
@@ -514,7 +516,7 @@ class LEnvironment: public ZoneObject {
   int parameter_count_;
   int pc_offset_;
   ZoneList<LOperand*> values_;
-  ZoneList<Representation> representations_;
+  BitVector is_tagged_;
 
   // Allocation index indexed arrays of spill slot operands for registers
   // that are also in spill slots at an OSR entry.  NULL for environments