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

Unified Diff: src/ic/handler-configuration.h

Issue 2438553003: [ic] Support data handlers that represent simple field stores. (Closed)
Patch Set: One more fix for GC stress issues Created 4 years, 2 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/ic/handler-configuration.h
diff --git a/src/ic/handler-configuration.h b/src/ic/handler-configuration.h
index 2741654befad3112745973349cf0156e6a3b29cd..1cb9219f7fb6d0de7cdceef7441cc2d7546f484b 100644
--- a/src/ic/handler-configuration.h
+++ b/src/ic/handler-configuration.h
@@ -66,6 +66,37 @@ class LoadHandler {
bool is_js_array);
};
+// A set of bit fields representing Smi handlers for stores.
+class StoreHandler {
+ public:
+ enum Kind { kForElements, kForFields };
+ class KindBits : public BitField<Kind, 0, 1> {};
+
+ enum FieldRepresentation { kSmi, kDouble, kHeapObject, kTagged };
+
+ //
+ // Encoding when KindBits contains kForFields.
+ //
+ class IsInobjectBits : public BitField<bool, KindBits::kNext, 1> {};
+ class FieldRepresentationBits
+ : public BitField<FieldRepresentation, IsInobjectBits::kNext, 2> {};
+ // +2 here is because each descriptor entry occupies 3 slots in array.
+ class DescriptorValueIndexBits
+ : public BitField<unsigned, FieldRepresentationBits::kNext,
+ kDescriptorIndexBitCount + 2> {};
+ // +1 here is to cover all possible JSObject header sizes.
+ class FieldOffsetBits
+ : public BitField<unsigned, DescriptorValueIndexBits::kNext,
+ kDescriptorIndexBitCount + 1 + kPointerSizeLog2> {};
+ // Make sure we don't overflow the smi.
+ STATIC_ASSERT(FieldOffsetBits::kNext <= kSmiValueSize);
+
+ // Creates a Smi-handler for storing a field to fast object.
+ static inline Handle<Object> StoreField(Isolate* isolate, int descriptor,
+ FieldIndex field_index,
+ Representation representation);
+};
+
} // namespace internal
} // namespace v8
« no previous file with comments | « src/flag-definitions.h ('k') | src/ic/handler-configuration-inl.h » ('j') | src/ic/ic.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698