// Copyright 2022 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef jit_riscv64_constant_util_riscv64__h_ #define jit_riscv64_constant_util_riscv64__h_ #include <stdarg.h> #include <stdio.h> #include <string.h> namespace js { namespace jit { template <typename T> class V8Vector { public:
V8Vector() : start_(nullptr), length_(0) {}
V8Vector(T* data, int length) : start_(data), length_(length) {
MOZ_ASSERT(length == 0 || (length > 0 && data != nullptr));
}
// Returns the length of the vector. int length() const { return length_; }
// Returns the pointer to the start of the data in the vector.
T* start() const { return start_; }
// Access individual vector elements - checks bounds in debug mode.
T& operator[](int index) const {
MOZ_ASSERT(0 <= index && index < length_); return start_[index];
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.