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

Unified Diff: src/field-index-inl.h

Issue 884163004: Tiny simplification of FieldIndex::ForInObjectOffset. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
danno 2015/02/05 13:17:52 Where did the "index + 1" go for parameter 4? At f
- }
- 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);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698