| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 #ifndef V8_JSON_PARSER_H_ | 5 #ifndef V8_JSON_PARSER_H_ |
| 6 #define V8_JSON_PARSER_H_ | 6 #define V8_JSON_PARSER_H_ |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/char-predicates-inl.h" | 10 #include "src/char-predicates-inl.h" |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 | 393 |
| 394 if (value->FitsRepresentation(expected_representation)) { | 394 if (value->FitsRepresentation(expected_representation)) { |
| 395 if (expected_representation.IsDouble()) { | 395 if (expected_representation.IsDouble()) { |
| 396 value = Object::NewStorageFor(isolate(), value, | 396 value = Object::NewStorageFor(isolate(), value, |
| 397 expected_representation); | 397 expected_representation); |
| 398 } else if (expected_representation.IsHeapObject() && | 398 } else if (expected_representation.IsHeapObject() && |
| 399 !target->instance_descriptors()->GetFieldType( | 399 !target->instance_descriptors()->GetFieldType( |
| 400 descriptor)->NowContains(value)) { | 400 descriptor)->NowContains(value)) { |
| 401 Handle<HeapType> value_type(value->OptimalType( | 401 Handle<HeapType> value_type(value->OptimalType( |
| 402 isolate(), expected_representation)); | 402 isolate(), expected_representation)); |
| 403 Map::GeneralizeFieldType(target, descriptor, value_type); | 403 Map::GeneralizeFieldType(target, descriptor, |
| 404 expected_representation, value_type); |
| 404 } | 405 } |
| 405 DCHECK(target->instance_descriptors()->GetFieldType( | 406 DCHECK(target->instance_descriptors()->GetFieldType( |
| 406 descriptor)->NowContains(value)); | 407 descriptor)->NowContains(value)); |
| 407 properties.Add(value, zone()); | 408 properties.Add(value, zone()); |
| 408 map = target; | 409 map = target; |
| 409 continue; | 410 continue; |
| 410 } else { | 411 } else { |
| 411 transitioning = false; | 412 transitioning = false; |
| 412 } | 413 } |
| 413 } | 414 } |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 | 812 |
| 812 DCHECK_EQ('"', c0_); | 813 DCHECK_EQ('"', c0_); |
| 813 // Advance past the last '"'. | 814 // Advance past the last '"'. |
| 814 AdvanceSkipWhitespace(); | 815 AdvanceSkipWhitespace(); |
| 815 return result; | 816 return result; |
| 816 } | 817 } |
| 817 | 818 |
| 818 } } // namespace v8::internal | 819 } } // namespace v8::internal |
| 819 | 820 |
| 820 #endif // V8_JSON_PARSER_H_ | 821 #endif // V8_JSON_PARSER_H_ |
| OLD | NEW |