diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-01-04 14:17:57 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-01-05 10:05:06 +0000 |
commit | 39d357e3248f80abea0159765ff39554affb40db (patch) | |
tree | aba0e6bfb76de0244bba0f5fdbd64b830dd6e621 /chromium/v8/src/field-index-inl.h | |
parent | 87778abf5a1f89266f37d1321b92a21851d8244d (diff) | |
download | qtwebengine-chromium-39d357e3248f80abea0159765ff39554affb40db.tar.gz |
BASELINE: Update Chromium to 55.0.2883.105
And updates ninja to 1.7.2
Change-Id: I20d43c737f82764d857ada9a55586901b18b9243
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/v8/src/field-index-inl.h')
-rw-r--r-- | chromium/v8/src/field-index-inl.h | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/chromium/v8/src/field-index-inl.h b/chromium/v8/src/field-index-inl.h index 2e6693ce388..c2f25bb7f04 100644 --- a/chromium/v8/src/field-index-inl.h +++ b/chromium/v8/src/field-index-inl.h @@ -6,6 +6,7 @@ #define V8_FIELD_INDEX_INL_H_ #include "src/field-index.h" +#include "src/ic/handler-configuration.h" namespace v8 { namespace internal { @@ -39,8 +40,7 @@ inline FieldIndex FieldIndex::ForPropertyIndex(Map* map, is_double, inobject_properties, first_inobject_offset); } - -// Takes an index as computed by GetLoadFieldByIndex and reconstructs a +// Takes an index as computed by GetLoadByFieldIndex and reconstructs a // FieldIndex object from it. inline FieldIndex FieldIndex::ForLoadByFieldIndex(Map* map, int orig_index) { int field_index = orig_index; @@ -85,6 +85,38 @@ inline int FieldIndex::GetLoadByFieldIndex() const { return is_double() ? (result | 1) : result; } +// Takes an offset as computed by GetLoadByFieldOffset and reconstructs a +// FieldIndex object from it. +// static +inline FieldIndex FieldIndex::ForLoadByFieldOffset(Map* map, int offset) { + DCHECK(LoadHandlerTypeBit::decode(offset) == kLoadICHandlerForProperties); + bool is_inobject = FieldOffsetIsInobject::decode(offset); + bool is_double = FieldOffsetIsDouble::decode(offset); + int field_index = FieldOffsetOffset::decode(offset) >> kPointerSizeLog2; + int first_inobject_offset = 0; + if (is_inobject) { + first_inobject_offset = + map->IsJSObjectMap() ? map->GetInObjectPropertyOffset(0) : 0; + } else { + first_inobject_offset = FixedArray::kHeaderSize; + } + int inobject_properties = + map->IsJSObjectMap() ? map->GetInObjectProperties() : 0; + FieldIndex result(is_inobject, field_index, is_double, inobject_properties, + first_inobject_offset); + DCHECK(result.GetLoadByFieldOffset() == offset); + return result; +} + +// Returns the offset format consumed by TurboFan stubs: +// (offset << 3) | (is_double << 2) | (is_inobject << 1) | is_property +// Where |offset| is relative to object start or FixedArray start, respectively. +inline int FieldIndex::GetLoadByFieldOffset() const { + return FieldOffsetIsInobject::encode(is_inobject()) | + FieldOffsetIsDouble::encode(is_double()) | + FieldOffsetOffset::encode(index() << kPointerSizeLog2) | + LoadHandlerTypeBit::encode(kLoadICHandlerForProperties); +} inline FieldIndex FieldIndex::ForDescriptor(Map* map, int descriptor_index) { PropertyDetails details = |