Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index f835e56d9cf85e3f2999d7d9641faae0bf953333..846c5ea608ea22eaa06f0c4812b66aa3feb8c5e5 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -2307,6 +2307,12 @@ Handle<Object> FixedArray::get(FixedArray* array, int index, Isolate* isolate) { |
return handle(array->get(index), isolate); |
} |
+template <class T> |
+Handle<T> FixedArray::GetValueOrNull(int index) const { |
+ Object* obj = get(index); |
+ if (obj->IsUndefined(GetIsolate())) return Handle<T>::null(); |
+ return Handle<T>(T::cast(obj)); |
+} |
bool FixedArray::is_the_hole(int index) { |
return get(index) == GetHeap()->the_hole_value(); |
@@ -3960,6 +3966,9 @@ byte ByteArray::get(int index) { |
return READ_BYTE_FIELD(this, kHeaderSize + index * kCharSize); |
} |
+const byte* ByteArray::data() const { |
+ return reinterpret_cast<const byte*>(FIELD_ADDR_CONST(this, kHeaderSize)); |
+} |
void ByteArray::set(int index, byte value) { |
DCHECK(index >= 0 && index < this->length()); |