Commit 197ed667 authored by svenpanne's avatar svenpanne Committed by Commit bot

Tiny simplification of FieldIndex::ForInObjectOffset.

Review URL: https://codereview.chromium.org/884163004

Cr-Commit-Position: refs/heads/master@{#26462}
parent 299b369c
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment