summaryrefslogtreecommitdiff
path: root/deps/v8/src/json
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2019-11-08 15:39:11 +0100
committerMichaël Zasso <targos@protonmail.com>2019-11-08 15:46:25 +0100
commit6ca81ad72a3c6fdf16c683335be748f22aaa9a0d (patch)
tree33c8ee75f729aed76c2c0b89c63f9bf1b4dd66aa /deps/v8/src/json
parent1eee0b8bf8bba39b600fb16a9223e545e3bac2bc (diff)
downloadandroid-node-v8-6ca81ad72a3c6fdf16c683335be748f22aaa9a0d.tar.gz
android-node-v8-6ca81ad72a3c6fdf16c683335be748f22aaa9a0d.tar.bz2
android-node-v8-6ca81ad72a3c6fdf16c683335be748f22aaa9a0d.zip
deps: update V8 to 7.9.317.20
PR-URL: https://github.com/nodejs/node/pull/30020 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'deps/v8/src/json')
-rw-r--r--deps/v8/src/json/json-parser.cc50
-rw-r--r--deps/v8/src/json/json-stringifier.cc2
2 files changed, 31 insertions, 21 deletions
diff --git a/deps/v8/src/json/json-parser.cc b/deps/v8/src/json/json-parser.cc
index e49775704d..3a790c210d 100644
--- a/deps/v8/src/json/json-parser.cc
+++ b/deps/v8/src/json/json-parser.cc
@@ -394,7 +394,8 @@ Handle<Map> ParentOfDescriptorOwner(Isolate* isolate, Handle<Map> maybe_root,
DCHECK_EQ(0, maybe_root->NumberOfOwnDescriptors());
return maybe_root;
}
- return handle(source->FindFieldOwner(isolate, descriptor - 1), isolate);
+ return handle(source->FindFieldOwner(isolate, InternalIndex(descriptor - 1)),
+ isolate);
}
} // namespace
@@ -461,10 +462,11 @@ Handle<Object> JsonParser<Char>::BuildJsonObject(
if (property.string.is_index()) continue;
Handle<String> expected;
Handle<Map> target;
+ InternalIndex descriptor_index(descriptor);
if (descriptor < feedback_descriptors) {
- expected = handle(
- String::cast(feedback->instance_descriptors().GetKey(descriptor)),
- isolate_);
+ expected = handle(String::cast(feedback->instance_descriptors().GetKey(
+ descriptor_index)),
+ isolate_);
} else {
DisallowHeapAllocation no_gc;
TransitionsAccessor transitions(isolate(), *map, &no_gc);
@@ -495,7 +497,7 @@ Handle<Object> JsonParser<Char>::BuildJsonObject(
Handle<Object> value = property.value;
PropertyDetails details =
- target->instance_descriptors().GetDetails(descriptor);
+ target->instance_descriptors().GetDetails(descriptor_index);
Representation expected_representation = details.representation();
if (!value->FitsRepresentation(expected_representation)) {
@@ -507,23 +509,24 @@ Handle<Object> JsonParser<Char>::BuildJsonObject(
}
Handle<FieldType> value_type =
value->OptimalType(isolate(), representation);
- Map::GeneralizeField(isolate(), target, descriptor, details.constness(),
- representation, value_type);
+ Map::GeneralizeField(isolate(), target, descriptor_index,
+ details.constness(), representation, value_type);
} else if (expected_representation.IsHeapObject() &&
!target->instance_descriptors()
- .GetFieldType(descriptor)
+ .GetFieldType(descriptor_index)
.NowContains(value)) {
Handle<FieldType> value_type =
value->OptimalType(isolate(), expected_representation);
- Map::GeneralizeField(isolate(), target, descriptor, details.constness(),
- expected_representation, value_type);
+ Map::GeneralizeField(isolate(), target, descriptor_index,
+ details.constness(), expected_representation,
+ value_type);
} else if (!FLAG_unbox_double_fields &&
expected_representation.IsDouble() && value->IsSmi()) {
new_mutable_double++;
}
DCHECK(target->instance_descriptors()
- .GetFieldType(descriptor)
+ .GetFieldType(descriptor_index)
.NowContains(value));
map = target;
descriptor++;
@@ -560,18 +563,21 @@ Handle<Object> JsonParser<Char>::BuildJsonObject(
: reinterpret_cast<Address>(
mutable_double_buffer->GetDataStartAddress());
Address filler_address = mutable_double_address;
- if (IsAligned(mutable_double_address, kDoubleAlignment)) {
- mutable_double_address += kTaggedSize;
- } else {
- filler_address += HeapNumber::kSize;
+ if (kTaggedSize != kDoubleSize) {
+ if (IsAligned(mutable_double_address, kDoubleAlignment)) {
+ mutable_double_address += kTaggedSize;
+ } else {
+ filler_address += HeapNumber::kSize;
+ }
}
for (int j = 0; j < i; j++) {
const JsonProperty& property = property_stack[start + j];
if (property.string.is_index()) continue;
+ InternalIndex descriptor_index(descriptor);
PropertyDetails details =
- map->instance_descriptors().GetDetails(descriptor);
+ map->instance_descriptors().GetDetails(descriptor_index);
Object value = *property.value;
- FieldIndex index = FieldIndex::ForDescriptor(*map, descriptor);
+ FieldIndex index = FieldIndex::ForDescriptor(*map, descriptor_index);
descriptor++;
if (details.representation().IsDouble()) {
@@ -619,9 +625,13 @@ Handle<Object> JsonParser<Char>::BuildJsonObject(
#ifdef DEBUG
Address end =
reinterpret_cast<Address>(mutable_double_buffer->GetDataEndAddress());
- DCHECK_EQ(Min(filler_address, mutable_double_address), end);
- DCHECK_GE(filler_address, end);
- DCHECK_GE(mutable_double_address, end);
+ if (kTaggedSize != kDoubleSize) {
+ DCHECK_EQ(Min(filler_address, mutable_double_address), end);
+ DCHECK_GE(filler_address, end);
+ DCHECK_GE(mutable_double_address, end);
+ } else {
+ DCHECK_EQ(mutable_double_address, end);
+ }
#endif
mutable_double_buffer->set_length(0);
}
diff --git a/deps/v8/src/json/json-stringifier.cc b/deps/v8/src/json/json-stringifier.cc
index 684bcdcf54..47d6a0ddad 100644
--- a/deps/v8/src/json/json-stringifier.cc
+++ b/deps/v8/src/json/json-stringifier.cc
@@ -771,7 +771,7 @@ JsonStringifier::Result JsonStringifier::SerializeJSObject(
builder_.AppendCharacter('{');
Indent();
bool comma = false;
- for (int i = 0; i < map->NumberOfOwnDescriptors(); i++) {
+ for (InternalIndex i : map->IterateOwnDescriptors()) {
Handle<Name> name(map->instance_descriptors().GetKey(i), isolate_);
// TODO(rossberg): Should this throw?
if (!name->IsString()) continue;