#include "src/parsing/scanner-character-streams.h"
#include <memory>
#include <vector>
#include "include/v8-callbacks.h"
#include "include/v8-primitive.h"
#include "src/base/strings.h"
#include "src/common/globals.h"
#include "src/execution/isolate-utils.h"
#include "src/handles/handles.h"
#include "src/logging/runtime-call-stats-scope.h"
#include "src/objects/objects-inl.h"
#include "src/parsing/scanner.h"
#include "src/strings/unicode-inl.h"
namespace v8 {
namespace internal {
class V8_NODISCARD ScopedExternalStringLock { … };
namespace {
const unibrow::uchar kUtf8Bom = …;
}
template <typename Char>
struct Range { … };
template <typename Char>
class OnHeapStream { … };
template <typename Char>
class ExternalStringStream { … };
template <typename Char>
class TestingStream { … };
template <typename Char>
class ChunkedStream { … };
template <template <typename T> class ByteStream>
class BufferedCharacterStream : public Utf16CharacterStream { … };
template <template <typename T> class ByteStream>
class UnbufferedCharacterStream : public Utf16CharacterStream { … };
class RelocatingCharacterStream final
: public UnbufferedCharacterStream<OnHeapStream> { … };
class BufferedUtf16CharacterStream : public Utf16CharacterStream { … };
BufferedUtf16CharacterStream::BufferedUtf16CharacterStream()
: … { … }
bool BufferedUtf16CharacterStream::ReadBlock(size_t position) { … }
namespace {
static const base::uc16 kWindows1252ToUC16[256] = …;
}
class Windows1252CharacterStream final : public Utf16CharacterStream { … };
class Utf8ExternalStreamingStream final : public BufferedUtf16CharacterStream { … };
bool Utf8ExternalStreamingStream::SkipToPosition(size_t position) { … }
void Utf8ExternalStreamingStream::FillBufferFromCurrentChunk() { … }
bool Utf8ExternalStreamingStream::FetchChunk() { … }
void Utf8ExternalStreamingStream::SearchPosition(size_t position) { … }
size_t Utf8ExternalStreamingStream::FillBuffer(size_t position) { … }
Utf16CharacterStream* ScannerStream::For(Isolate* isolate,
Handle<String> data) { … }
Utf16CharacterStream* ScannerStream::For(Isolate* isolate, Handle<String> data,
int start_pos, int end_pos) { … }
std::unique_ptr<Utf16CharacterStream> ScannerStream::ForTesting(
const char* data) { … }
std::unique_ptr<Utf16CharacterStream> ScannerStream::ForTesting(
const char* data, size_t length) { … }
std::unique_ptr<Utf16CharacterStream> ScannerStream::ForTesting(
const uint16_t* data, size_t length) { … }
Utf16CharacterStream* ScannerStream::For(
ScriptCompiler::ExternalSourceStream* source_stream,
v8::ScriptCompiler::StreamedSource::Encoding encoding) { … }
}
}