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

Unified Diff: src/vector.h

Issue 1911313002: Pass debug name as Vector instead of const char* (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@wasm-offset-table-1
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
Index: src/vector.h
diff --git a/src/vector.h b/src/vector.h
index e4637c91c9804fe5f191976e0ed1a0f9e7a4979c..d120dfc4ac70c36ff9cbc7340546b356f529babd 100644
--- a/src/vector.h
+++ b/src/vector.h
@@ -24,6 +24,9 @@ class Vector {
DCHECK(length == 0 || (length > 0 && data != NULL));
}
+ template <int N>
+ explicit Vector(T (&arr)[N]) : start_(arr), length_(N) {}
+
static Vector<T> New(int length) {
return Vector<T>(NewArray<T>(length), length);
}
@@ -201,6 +204,10 @@ inline Vector<char> MutableCStrVector(char* data, int max) {
return Vector<char>(data, (length < max) ? length : max);
}
+template <typename T, int N>
+inline Vector<T> ArrayVector(T (&arr)[N]) {
+ return Vector<T>(arr);
+}
} // namespace internal
} // namespace v8
« no previous file with comments | « src/compiler/wasm-compiler.cc ('k') | src/wasm/wasm-opcodes.h » ('j') | src/wasm/wasm-opcodes.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698