OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/json-parser.h" | 5 #include "src/json-parser.h" |
6 | 6 |
7 #include "src/char-predicates-inl.h" | 7 #include "src/char-predicates-inl.h" |
8 #include "src/conversions.h" | 8 #include "src/conversions.h" |
9 #include "src/debug/debug.h" | 9 #include "src/debug/debug.h" |
10 #include "src/factory.h" | 10 #include "src/factory.h" |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 target->instance_descriptors()->GetDetails(descriptor); | 392 target->instance_descriptors()->GetDetails(descriptor); |
393 Representation expected_representation = details.representation(); | 393 Representation expected_representation = details.representation(); |
394 | 394 |
395 if (value->FitsRepresentation(expected_representation)) { | 395 if (value->FitsRepresentation(expected_representation)) { |
396 if (expected_representation.IsHeapObject() && | 396 if (expected_representation.IsHeapObject() && |
397 !target->instance_descriptors() | 397 !target->instance_descriptors() |
398 ->GetFieldType(descriptor) | 398 ->GetFieldType(descriptor) |
399 ->NowContains(value)) { | 399 ->NowContains(value)) { |
400 Handle<FieldType> value_type( | 400 Handle<FieldType> value_type( |
401 value->OptimalType(isolate(), expected_representation)); | 401 value->OptimalType(isolate(), expected_representation)); |
402 Map::GeneralizeFieldType(target, descriptor, | 402 Map::GeneralizeField(target, descriptor, expected_representation, |
403 expected_representation, value_type); | 403 value_type); |
404 } | 404 } |
405 DCHECK(target->instance_descriptors() | 405 DCHECK(target->instance_descriptors() |
406 ->GetFieldType(descriptor) | 406 ->GetFieldType(descriptor) |
407 ->NowContains(value)); | 407 ->NowContains(value)); |
408 properties.Add(value, zone()); | 408 properties.Add(value, zone()); |
409 map = target; | 409 map = target; |
410 descriptor++; | 410 descriptor++; |
411 continue; | 411 continue; |
412 } else { | 412 } else { |
413 transitioning = false; | 413 transitioning = false; |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
803 AdvanceSkipWhitespace(); | 803 AdvanceSkipWhitespace(); |
804 return result; | 804 return result; |
805 } | 805 } |
806 | 806 |
807 // Explicit instantiation. | 807 // Explicit instantiation. |
808 template class JsonParser<true>; | 808 template class JsonParser<true>; |
809 template class JsonParser<false>; | 809 template class JsonParser<false>; |
810 | 810 |
811 } // namespace internal | 811 } // namespace internal |
812 } // namespace v8 | 812 } // namespace v8 |
OLD | NEW |