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

Unified Diff: src/hydrogen-instructions.h

Issue 98163003: Add a bit to HObjectAccess to encode immutable fields. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix type of immutable bitfield. Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index 23dbbd289c6c5d5a9e07697368e9fba6ab05e22d..91374d61fb01bbe59b4e9d3eab65307ffae254a2 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,22 +6147,26 @@ 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<bool, 7, 1> {};
+ class OffsetField : public BitField<int, 8, 24> {};
- uint32_t value_; // encodes portion, representation, and offset
+ uint32_t value_; // encodes portion, representation, immutable, and offset
Handle<String> name_;
friend class HLoadNamedField;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698