summaryrefslogtreecommitdiff
path: root/deps/v8/src/parsing/literal-buffer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/parsing/literal-buffer.cc')
-rw-r--r--deps/v8/src/parsing/literal-buffer.cc20
1 files changed, 11 insertions, 9 deletions
diff --git a/deps/v8/src/parsing/literal-buffer.cc b/deps/v8/src/parsing/literal-buffer.cc
index a3e665a5c3..25388e938a 100644
--- a/deps/v8/src/parsing/literal-buffer.cc
+++ b/deps/v8/src/parsing/literal-buffer.cc
@@ -4,6 +4,7 @@
#include "src/parsing/literal-buffer.h"
+#include "src/base/strings.h"
#include "src/execution/isolate.h"
#include "src/execution/local-isolate.h"
#include "src/heap/factory.h"
@@ -31,7 +32,8 @@ int LiteralBuffer::NewCapacity(int min_capacity) {
void LiteralBuffer::ExpandBuffer() {
int min_capacity = std::max({kInitialCapacity, backing_store_.length()});
- Vector<byte> new_store = Vector<byte>::New(NewCapacity(min_capacity));
+ base::Vector<byte> new_store =
+ base::Vector<byte>::New(NewCapacity(min_capacity));
if (position_ > 0) {
MemCopy(new_store.begin(), backing_store_.begin(), position_);
}
@@ -41,12 +43,12 @@ void LiteralBuffer::ExpandBuffer() {
void LiteralBuffer::ConvertToTwoByte() {
DCHECK(is_one_byte());
- Vector<byte> new_store;
- int new_content_size = position_ * kUC16Size;
+ base::Vector<byte> new_store;
+ int new_content_size = position_ * base::kUC16Size;
if (new_content_size >= backing_store_.length()) {
// Ensure room for all currently read code units as UC16 as well
// as the code unit about to be stored.
- new_store = Vector<byte>::New(NewCapacity(new_content_size));
+ new_store = base::Vector<byte>::New(NewCapacity(new_content_size));
} else {
new_store = backing_store_;
}
@@ -63,21 +65,21 @@ void LiteralBuffer::ConvertToTwoByte() {
is_one_byte_ = false;
}
-void LiteralBuffer::AddTwoByteChar(uc32 code_unit) {
+void LiteralBuffer::AddTwoByteChar(base::uc32 code_unit) {
DCHECK(!is_one_byte());
if (position_ >= backing_store_.length()) ExpandBuffer();
if (code_unit <=
- static_cast<uc32>(unibrow::Utf16::kMaxNonSurrogateCharCode)) {
+ static_cast<base::uc32>(unibrow::Utf16::kMaxNonSurrogateCharCode)) {
*reinterpret_cast<uint16_t*>(&backing_store_[position_]) = code_unit;
- position_ += kUC16Size;
+ position_ += base::kUC16Size;
} else {
*reinterpret_cast<uint16_t*>(&backing_store_[position_]) =
unibrow::Utf16::LeadSurrogate(code_unit);
- position_ += kUC16Size;
+ position_ += base::kUC16Size;
if (position_ >= backing_store_.length()) ExpandBuffer();
*reinterpret_cast<uint16_t*>(&backing_store_[position_]) =
unibrow::Utf16::TrailSurrogate(code_unit);
- position_ += kUC16Size;
+ position_ += base::kUC16Size;
}
}