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

Unified Diff: src/parsing/json-parser.h

Issue 1439693002: [runtime] Support Proxy setPrototypeOf trap (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@2015-11-09_new_Proxy_1417063011
Patch Set: merging with master Created 5 years, 1 month 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
« no previous file with comments | « src/parsing/func-name-inferrer.cc ('k') | src/parsing/parser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/json-parser.h
diff --git a/src/parsing/json-parser.h b/src/parsing/json-parser.h
index 7273c36dfde00c53d4961155524541a2385aac56..46f77aaa9f1ab527bfc3d5e7235dc076241ab8ee 100644
--- a/src/parsing/json-parser.h
+++ b/src/parsing/json-parser.h
@@ -98,9 +98,7 @@ class JsonParser BASE_EMBEDDED {
// literals. The string must only be double-quoted (not single-quoted), and
// the only allowed backslash-escapes are ", /, \, b, f, n, r, t and
// four-digit hex escapes (uXXXX). Any other use of backslashes is invalid.
- Handle<String> ParseJsonString() {
- return ScanJsonString<false>();
- }
+ Handle<String> ParseJsonString() { return ScanJsonString<false>(); }
bool ParseJsonString(Handle<String> expected) {
int length = expected->length();
@@ -476,7 +474,8 @@ Handle<Object> JsonParser<seq_one_byte>::ParseJsonObject() {
if (value.is_null()) return ReportUnexpectedCharacter();
JSObject::DefinePropertyOrElementIgnoreAttributes(json_object, key,
- value).Check();
+ value)
+ .Check();
}
}
@@ -582,7 +581,7 @@ Handle<Object> JsonParser<seq_one_byte>::ParseJsonNumber() {
int length = position_ - beg_pos;
double number;
if (seq_one_byte) {
- Vector<const uint8_t> chars(seq_source_->GetChars() + beg_pos, length);
+ Vector<const uint8_t> chars(seq_source_->GetChars() + beg_pos, length);
number = StringToDouble(isolate()->unicode_cache(), chars,
NO_FLAGS, // Hex, octal or trailing junk.
std::numeric_limits<double>::quiet_NaN());
@@ -591,8 +590,7 @@ Handle<Object> JsonParser<seq_one_byte>::ParseJsonNumber() {
String::WriteToFlat(*source_, buffer.start(), beg_pos, position_);
Vector<const uint8_t> result =
Vector<const uint8_t>(buffer.start(), length);
- number = StringToDouble(isolate()->unicode_cache(),
- result,
+ number = StringToDouble(isolate()->unicode_cache(), result,
NO_FLAGS, // Hex, octal or trailing junk.
0.0);
buffer.Dispose();
@@ -616,21 +614,18 @@ inline void SeqStringSet(Handle<SeqOneByteString> seq_str, int i, uc32 c) {
}
template <typename StringType>
-inline Handle<StringType> NewRawString(Factory* factory,
- int length,
+inline Handle<StringType> NewRawString(Factory* factory, int length,
PretenureFlag pretenure);
template <>
-inline Handle<SeqTwoByteString> NewRawString(Factory* factory,
- int length,
+inline Handle<SeqTwoByteString> NewRawString(Factory* factory, int length,
PretenureFlag pretenure) {
return factory->NewRawTwoByteString(length, pretenure).ToHandleChecked();
}
template <>
-inline Handle<SeqOneByteString> NewRawString(Factory* factory,
- int length,
- PretenureFlag pretenure) {
+inline Handle<SeqOneByteString> NewRawString(Factory* factory, int length,
+ PretenureFlag pretenure) {
return factory->NewRawOneByteString(length, pretenure).ToHandleChecked();
}
@@ -713,8 +708,7 @@ Handle<String> JsonParser<seq_one_byte>::SlowScanJsonString(
// char.
position_ -= 6; // Rewind position_ to \ in \uxxxx.
Advance();
- return SlowScanJsonString<SeqTwoByteString, uc16>(seq_string,
- 0,
+ return SlowScanJsonString<SeqTwoByteString, uc16>(seq_string, 0,
count);
}
}
@@ -756,19 +750,16 @@ Handle<String> JsonParser<seq_one_byte>::ScanJsonString() {
c0_ = c0;
int beg_pos = position_;
position_ = position;
- return SlowScanJsonString<SeqOneByteString, uint8_t>(source_,
- beg_pos,
+ return SlowScanJsonString<SeqOneByteString, uint8_t>(source_, beg_pos,
position_);
}
if (c0 < 0x20) return Handle<String>::null();
if (static_cast<uint32_t>(c0) >
unibrow::Utf16::kMaxNonSurrogateCharCode) {
- running_hash =
- StringHasher::AddCharacterCore(running_hash,
- unibrow::Utf16::LeadSurrogate(c0));
- running_hash =
- StringHasher::AddCharacterCore(running_hash,
- unibrow::Utf16::TrailSurrogate(c0));
+ running_hash = StringHasher::AddCharacterCore(
+ running_hash, unibrow::Utf16::LeadSurrogate(c0));
+ running_hash = StringHasher::AddCharacterCore(
+ running_hash, unibrow::Utf16::TrailSurrogate(c0));
} else {
running_hash = StringHasher::AddCharacterCore(running_hash, c0);
}
@@ -780,8 +771,8 @@ Handle<String> JsonParser<seq_one_byte>::ScanJsonString() {
uint32_t hash = (length <= String::kMaxHashCalcLength)
? StringHasher::GetHashCore(running_hash)
: static_cast<uint32_t>(length);
- Vector<const uint8_t> string_vector(
- seq_source_->GetChars() + position_, length);
+ Vector<const uint8_t> string_vector(seq_source_->GetChars() + position_,
+ length);
StringTable* string_table = isolate()->heap()->string_table();
uint32_t capacity = string_table->Capacity();
uint32_t entry = StringTable::FirstProbe(hash, capacity);
@@ -791,8 +782,8 @@ Handle<String> JsonParser<seq_one_byte>::ScanJsonString() {
Object* element = string_table->KeyAt(entry);
if (element == isolate()->heap()->undefined_value()) {
// Lookup failure.
- result = factory()->InternalizeOneByteString(
- seq_source_, position_, length);
+ result =
+ factory()->InternalizeOneByteString(seq_source_, position_, length);
break;
}
if (element != isolate()->heap()->the_hole_value() &&
@@ -823,13 +814,11 @@ Handle<String> JsonParser<seq_one_byte>::ScanJsonString() {
if (seq_one_byte || c0_ <= String::kMaxOneByteCharCode) {
Advance();
} else {
- return SlowScanJsonString<SeqTwoByteString, uc16>(source_,
- beg_pos,
+ return SlowScanJsonString<SeqTwoByteString, uc16>(source_, beg_pos,
position_);
}
} else {
- return SlowScanJsonString<SeqOneByteString, uint8_t>(source_,
- beg_pos,
+ return SlowScanJsonString<SeqOneByteString, uint8_t>(source_, beg_pos,
position_);
}
} while (c0_ != '"');
« no previous file with comments | « src/parsing/func-name-inferrer.cc ('k') | src/parsing/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698