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

Unified Diff: src/objects-inl.h

Issue 2094563002: [wasm] Complete separation of compilation and instantiation (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: MaybeHandle Created 4 years, 6 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
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index f835e56d9cf85e3f2999d7d9641faae0bf953333..106cebfc67ba2bce49c44e33da4ac35fa2d99024 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -2307,12 +2307,24 @@ Handle<Object> FixedArray::get(FixedArray* array, int index, Isolate* isolate) {
return handle(array->get(index), isolate);
}
+template <class T>
+MaybeHandle<T> FixedArray::GetValueOrNull(int index) const {
+ Object* obj = get(index);
+ if (obj->IsUndefined(GetIsolate())) return MaybeHandle<T>();
+ return Handle<T>(T::cast(obj));
+}
+
+template <class T>
+Handle<T> FixedArray::GetValue(int index) const {
+ Object* obj = get(index);
+ CHECK(!obj->IsUndefined(GetIsolate()));
+ return Handle<T>(T::cast(obj));
+}
bool FixedArray::is_the_hole(int index) {
return get(index) == GetHeap()->the_hole_value();
}
-
void FixedArray::set(int index, Smi* value) {
DCHECK(map() != GetHeap()->fixed_cow_array_map());
DCHECK(index >= 0 && index < this->length());
@@ -3960,6 +3972,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());

Powered by Google App Engine
This is Rietveld 408576698