5#ifndef V8_STRINGS_STRING_BUILDER_INL_H_
6#define V8_STRINGS_STRING_BUILDER_INL_H_
27template <
typename sink
char>
42 int length = to -
from;
62template <
typename SrcChar,
typename DestChar>
65 if (
sizeof(DestChar) == 1) {
90 const int length =
N - 1;
91 static_assert(length > 0);
94 const uint8_t* chars =
reinterpret_cast<const uint8_t*
>(
literal);
105template <
typename SrcChar>
115 uint32_t length =
static_cast<uint32_t
>(str.length());
119 reinterpret_cast<const uint8_t*
>(str.data()),
125 for (
size_t i = 0;
i < str.length();
i++) {
146 int worst_case_length = length << 3;
static constexpr bool is_valid(T value)
static constexpr U encode(T value)
void Add(Tagged< Object > value)
bool HasValidCurrentIndex() const
V8_INLINE void ChangeEncoding()
String::Encoding encoding_
V8_INLINE void Append(SrcChar c)
DirectHandle< String > current_part_
V8_INLINE void AppendInt(int i)
V8_INLINE Factory * factory()
static const int kIntToStringViewBufferSize
static const int kMaxPartLength
V8_INLINE DirectHandle< String > current_part()
V8_INLINE int EscapedLengthIfCurrentPartFits(int length)
V8_INLINE void set_current_part(DirectHandle< String > string)
V8_INLINE void AppendCString(const SrcChar *s)
V8_INLINE void ShrinkCurrentPart()
V8_INLINE void AppendCharacter(uint8_t c)
V8_INLINE void AppendString(std::string_view str)
V8_INLINE void AppendCStringLiteral(const char(&literal)[N])
V8_INLINE bool CurrentPartCanFit(int length)
v8::internal::Factory * factory()
static void AddSubjectSlice(FixedArrayBuilder *builder, int from, int to)
void EnsureCapacity(int elements)
FixedArrayBuilder array_builder_
void IncrementCharacterCount(uint32_t by)
static V8_WARN_UNUSED_RESULT Handle< String > Truncate(Isolate *isolate, Handle< SeqString > string, uint32_t new_length)
static constexpr Tagged< Smi > FromInt(int value)
static const uint32_t kMaxLength
FunctionLiteral * literal
constexpr Vector< T > ArrayVector(T(&arr)[N])
const int kStringBuilderConcatHelperPositionBits
V8_INLINE IndirectHandle< T > indirect_handle(DirectHandle< T > handle)
std::string_view IntToStringView(int n, base::Vector< char > buffer)
void StringBuilderConcatHelper(Tagged< String > special, sinkchar *sink, Tagged< FixedArray > fixed_array, int array_length)
int StringBuilderConcatLength(int special_length, Tagged< FixedArray > fixed_array, int array_length, bool *one_byte)
const int kStringBuilderConcatHelperLengthBits
Tagged< To > Cast(Tagged< From > value, const v8::SourceLocation &loc=INIT_SOURCE_LOCATION_IN_DEBUG)
#define DCHECK_GE(v1, v2)
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)
#define DCHECK_GT(v1, v2)