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

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

Issue 2808533002: [heap] Reland "Remove size specializations in static object visitors. (patchset #4 id:60001 of http… (Closed)
Patch Set: Created 3 years, 8 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 920cb0772b3c124602c0f21870ba6ecdd5c4cd0a..3f54f6f690cdb85f929d586563ec24ffd9130ee9 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 {
+ 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