Reviewers: Igor Sheludko,

Description:
Add a bit to HObjectAccess to encode immutable fields.

BUG=

Please review this at https://codereview.chromium.org/98163003/

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

Affected files (+10, -2 lines):
  M src/hydrogen-instructions.h


Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index 23dbbd289c6c5d5a9e07697368e9fba6ab05e22d..b30c16983c8730918823f4150f5580c6e174159b 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -5913,6 +5913,10 @@ class HObjectAccess V8_FINAL {
     return name_;
   }

+  inline bool immutable() const {
+    return ImmutableField::decode(value_);
+  }
+
   inline HObjectAccess WithRepresentation(Representation representation) {
     return HObjectAccess(portion(), offset(), representation, name());
   }
@@ -6143,20 +6147,24 @@ class HObjectAccess V8_FINAL {

   HObjectAccess(Portion portion, int offset,
                 Representation representation = Representation::Tagged(),
-                Handle<String> name = Handle<String>::null())
+                Handle<String> name = Handle<String>::null(),
+                bool immutable = false)
     : value_(PortionField::encode(portion) |
              RepresentationField::encode(representation.kind()) |
+             ImmutableField::encode(immutable ? 1 : 0) |
              OffsetField::encode(offset)),
       name_(name) {
     // assert that the fields decode correctly
     ASSERT(this->offset() == offset);
     ASSERT(this->portion() == portion);
+    ASSERT(this->immutable() == immutable);
     ASSERT(RepresentationField::decode(value_) == representation.kind());
   }

   class PortionField : public BitField<Portion, 0, 3> {};
class RepresentationField : public BitField<Representation::Kind, 3, 4> {};
-  class OffsetField : public BitField<int, 7, 25> {};
+  class ImmutableField : public BitField<int, 7, 1> {};
+  class OffsetField : public BitField<int, 8, 24> {};

   uint32_t value_;  // encodes portion, representation, and offset
   Handle<String> name_;


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to