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

Unified Diff: src/objects-body-descriptors-inl.h

Issue 2763413007: [heap] Remove size specializations in static object visitors. (Closed)
Patch Set: fast body descriptor for js objects Created 3 years, 9 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
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-body-descriptors-inl.h
diff --git a/src/objects-body-descriptors-inl.h b/src/objects-body-descriptors-inl.h
index d34c0f04e40a9e68bce0b75011441de7a7761209..ff679c984629063c6e1554ec680ad6d5848601f6 100644
--- a/src/objects-body-descriptors-inl.h
+++ b/src/objects-body-descriptors-inl.h
@@ -131,6 +131,31 @@ class JSObject::BodyDescriptor final : public BodyDescriptorBase {
}
};
+class JSObject::FastBodyDescriptor final : public BodyDescriptorBase {
ulan 2017/03/27 11:23:24 This is the same as FlexibleBodyDescriptor except
+ public:
+ static const int kStartOffset = JSReceiver::kPropertiesOffset;
+
+ static bool IsValidSlot(HeapObject* obj, int offset) {
+ return offset >= kStartOffset;
+ }
+
+ template <typename ObjectVisitor>
+ static inline void IterateBody(HeapObject* obj, int object_size,
+ ObjectVisitor* v) {
+ IteratePointers(obj, kStartOffset, object_size, v);
+ }
+
+ template <typename StaticVisitor>
+ static inline void IterateBody(HeapObject* obj, int object_size) {
+ Heap* heap = obj->GetHeap();
+ IteratePointers<StaticVisitor>(heap, obj, kStartOffset, object_size);
+ }
+
+ static inline int SizeOf(Map* map, HeapObject* object) {
+ return map->instance_size();
+ }
+};
+
// Iterates the function object according to the visiting policy.
template <JSFunction::BodyVisitingPolicy body_visiting_policy>
class JSFunction::BodyDescriptorImpl final : public BodyDescriptorBase {
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698