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

Unified Diff: src/json-parser.h

Issue 11818025: Continues Latin-1 support. All tests pass with ENABLE_LATIN_1 flag. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: ARM fix Created 7 years, 11 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/json-parser.h
diff --git a/src/json-parser.h b/src/json-parser.h
index 31328d79ae5c81e36870daff3f9488911ac13e56..ccb32866f9268d3e7fc780d811fbdb1da8fdf6d3 100644
--- a/src/json-parser.h
+++ b/src/json-parser.h
@@ -441,21 +441,21 @@ Handle<Object> JsonParser<seq_ascii>::ParseJsonNumber() {
int length = position_ - beg_pos;
double number;
if (seq_ascii) {
- Vector<const char> chars(seq_source_->GetChars() + beg_pos, length);
+ Vector<const uint8_t> chars(seq_source_->GetChars() + beg_pos, length);
number = StringToDouble(isolate()->unicode_cache(),
- chars,
+ Vector<const char>::cast(chars),
NO_FLAGS, // Hex, octal or trailing junk.
OS::nan_value());
} else {
- Vector<char> buffer = Vector<char>::New(length);
+ Vector<uint8_t> buffer = Vector<uint8_t>::New(length);
String::WriteToFlat(*source_, buffer.start(), beg_pos, position_);
- Vector<const char> result =
- Vector<const char>(reinterpret_cast<const char*>(buffer.start()),
- length);
+ Vector<const uint8_t> result =
+ Vector<const uint8_t>(buffer.start(), length);
number = StringToDouble(isolate()->unicode_cache(),
- result,
- NO_FLAGS, // Hex, octal or trailing junk.
- 0.0);
+ // TODO(dcarney): Convert StringToDouble to uint_t.
+ Vector<const char>::cast(result),
+ NO_FLAGS, // Hex, octal or trailing junk.
+ 0.0);
buffer.Dispose();
}
SkipWhitespace();
@@ -627,9 +627,9 @@ Handle<String> JsonParser<seq_ascii>::ScanJsonString() {
c0_ = c0;
int beg_pos = position_;
position_ = position;
- return SlowScanJsonString<SeqOneByteString, char>(source_,
- beg_pos,
- position_);
+ return SlowScanJsonString<SeqOneByteString, uint8_t>(source_,
+ beg_pos,
+ position_);
}
if (c0 < 0x20) return Handle<String>::null();
if (static_cast<uint32_t>(c0) >
@@ -651,7 +651,7 @@ Handle<String> JsonParser<seq_ascii>::ScanJsonString() {
uint32_t hash = (length <= String::kMaxHashCalcLength)
? StringHasher::GetHashCore(running_hash) : length;
Vector<const uint8_t> string_vector(
- seq_source_->GetCharsU() + position_, length);
+ seq_source_->GetChars() + position_, length);
SymbolTable* symbol_table = isolate()->heap()->symbol_table();
uint32_t capacity = symbol_table->Capacity();
uint32_t entry = SymbolTable::FirstProbe(hash, capacity);
@@ -688,9 +688,9 @@ Handle<String> JsonParser<seq_ascii>::ScanJsonString() {
position_);
}
} else {
- return SlowScanJsonString<SeqOneByteString, char>(source_,
- beg_pos,
- position_);
+ return SlowScanJsonString<SeqOneByteString, uint8_t>(source_,
+ beg_pos,
+ position_);
}
} while (c0_ != '"');
int length = position_ - beg_pos;
@@ -699,7 +699,7 @@ Handle<String> JsonParser<seq_ascii>::ScanJsonString() {
result = factory()->LookupOneByteSymbol(seq_source_, beg_pos, length);
} else {
result = factory()->NewRawOneByteString(length, pretenure_);
- char* dest = SeqOneByteString::cast(*result)->GetChars();
+ uint8_t* dest = SeqOneByteString::cast(*result)->GetChars();
String::WriteToFlat(*source_, dest, beg_pos, position_);
}
ASSERT_EQ('"', c0_);

Powered by Google App Engine
This is Rietveld 408576698