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

Unified Diff: src/objects-inl.h

Issue 1717603002: [LookupIterator] Optimize the path that writes to fields. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 0e2560b37f11791af2bf2508ac365e68fcd99624..6c9a9e66bf6b10134a2ae09dc6254042003b6c56 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -991,14 +991,14 @@ ElementsKind Object::OptimalElementsKind() {
bool Object::FitsRepresentation(Representation representation) {
- if (FLAG_track_fields && representation.IsNone()) {
- return false;
- } else if (FLAG_track_fields && representation.IsSmi()) {
+ if (FLAG_track_fields && representation.IsSmi()) {
return IsSmi();
} else if (FLAG_track_double_fields && representation.IsDouble()) {
return IsMutableHeapNumber() || IsNumber();
} else if (FLAG_track_heap_object_fields && representation.IsHeapObject()) {
return IsHeapObject();
+ } else if (FLAG_track_fields && representation.IsNone()) {
+ return false;
}
return true;
}
@@ -2088,15 +2088,10 @@ void JSObject::FastPropertyAtPut(FieldIndex index, Object* value) {
}
}
-
-void JSObject::WriteToField(int descriptor, Object* value) {
- DisallowHeapAllocation no_gc;
-
- DescriptorArray* desc = map()->instance_descriptors();
- PropertyDetails details = desc->GetDetails(descriptor);
-
+void JSObject::WriteToField(int descriptor, PropertyDetails details,
+ Object* value) {
DCHECK(details.type() == DATA);
-
+ DisallowHeapAllocation no_gc;
FieldIndex index = FieldIndex::ForDescriptor(map(), descriptor);
if (details.representation().IsDouble()) {
// Nothing more to be done.
@@ -2113,6 +2108,11 @@ void JSObject::WriteToField(int descriptor, Object* value) {
}
}
+void JSObject::WriteToField(int descriptor, Object* value) {
+ DescriptorArray* desc = map()->instance_descriptors();
+ PropertyDetails details = desc->GetDetails(descriptor);
+ WriteToField(descriptor, details, value);
+}
int JSObject::GetInObjectPropertyOffset(int index) {
return map()->GetInObjectPropertyOffset(index);
« 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