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

Unified Diff: src/objects-inl.h

Issue 1912103002: [wasm] Store function names in the wasm object (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@wasm-offset-table-2
Patch Set: rebase Created 4 years, 8 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 | « src/objects.h ('k') | src/v8.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index a629326262070db710ebf4981d9bd3a788623c9d..60a140b79c58f0fda45e1126dc97d0669ed142c0 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -3906,7 +3906,6 @@ void StringCharacterStream::VisitTwoByteString(
int ByteArray::Size() { return RoundUp(length() + kHeaderSize, kPointerSize); }
-
byte ByteArray::get(int index) {
DCHECK(index >= 0 && index < this->length());
return READ_BYTE_FIELD(this, kHeaderSize + index * kCharSize);
@@ -3918,12 +3917,29 @@ void ByteArray::set(int index, byte value) {
WRITE_BYTE_FIELD(this, kHeaderSize + index * kCharSize, value);
}
+void ByteArray::copy_in(int index, const byte* buffer, int length) {
+ DCHECK(index >= 0 && length >= 0 && index + length >= index &&
+ index + length <= this->length());
+ byte* dst_addr = FIELD_ADDR(this, kHeaderSize + index * kCharSize);
+ memcpy(dst_addr, buffer, length);
+}
+
+void ByteArray::copy_out(int index, byte* buffer, int length) {
+ DCHECK(index >= 0 && length >= 0 && index + length >= index &&
+ index + length <= this->length());
+ const byte* src_addr = FIELD_ADDR(this, kHeaderSize + index * kCharSize);
+ memcpy(buffer, src_addr, length);
+}
int ByteArray::get_int(int index) {
- DCHECK(index >= 0 && (index * kIntSize) < this->length());
+ DCHECK(index >= 0 && index < this->length() / kIntSize);
return READ_INT_FIELD(this, kHeaderSize + index * kIntSize);
}
+void ByteArray::set_int(int index, int value) {
+ DCHECK(index >= 0 && index < this->length() / kIntSize);
+ WRITE_INT_FIELD(this, kHeaderSize + index * kIntSize, value);
+}
ByteArray* ByteArray::FromDataStartAddress(Address address) {
DCHECK_TAG_ALIGNED(address);
« no previous file with comments | « src/objects.h ('k') | src/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698