Reviewers: danno,

Description:
Tiny simplification of FieldIndex::ForInObjectOffset.

Please review this at https://codereview.chromium.org/884163004/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+3, -9 lines):
  M src/field-index-inl.h


Index: src/field-index-inl.h
diff --git a/src/field-index-inl.h b/src/field-index-inl.h
index 198422feef4b65f21c7f5c14cc867cc306fb1ff9..b2307cd0bd5aff15837629d4d90a21b624b6f077 100644
--- a/src/field-index-inl.h
+++ b/src/field-index-inl.h
@@ -14,15 +14,9 @@ namespace internal {
 inline FieldIndex FieldIndex::ForInObjectOffset(int offset, Map* map) {
   DCHECK((offset % kPointerSize) == 0);
   int index = offset / kPointerSize;
-  if (map == NULL) {
-    return FieldIndex(true, index, false, index + 1, 0, true);
-  }
-  int first_inobject_offset = map->GetInObjectPropertyOffset(0);
-  if (offset < first_inobject_offset) {
-    return FieldIndex(true, index, false, 0, 0, true);
-  } else {
-    return FieldIndex::ForPropertyIndex(map, offset / kPointerSize);
-  }
+  return (map == NULL || offset < map->GetInObjectPropertyOffset(0))
+             ? FieldIndex(true, index, false, 0, 0, true)
+             : FieldIndex::ForPropertyIndex(map, index);
 }




--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to