| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 | 407 |
| 408 if (transitioning) { | 408 if (transitioning) { |
| 409 int descriptor = map->NumberOfOwnDescriptors(); | 409 int descriptor = map->NumberOfOwnDescriptors(); |
| 410 PropertyDetails details = | 410 PropertyDetails details = |
| 411 target->instance_descriptors()->GetDetails(descriptor); | 411 target->instance_descriptors()->GetDetails(descriptor); |
| 412 Representation expected_representation = details.representation(); | 412 Representation expected_representation = details.representation(); |
| 413 | 413 |
| 414 if (value->FitsRepresentation(expected_representation)) { | 414 if (value->FitsRepresentation(expected_representation)) { |
| 415 // If the target representation is double and the value is already | 415 // If the target representation is double and the value is already |
| 416 // double, use the existing box. | 416 // double, use the existing box. |
| 417 if (FLAG_track_double_fields && | 417 if (value->IsSmi() && expected_representation.IsDouble()) { |
| 418 value->IsSmi() && | |
| 419 expected_representation.IsDouble()) { | |
| 420 value = factory()->NewHeapNumber( | 418 value = factory()->NewHeapNumber( |
| 421 Handle<Smi>::cast(value)->value()); | 419 Handle<Smi>::cast(value)->value()); |
| 422 } | 420 } |
| 423 properties.Add(value, zone()); | 421 properties.Add(value, zone()); |
| 424 map = target; | 422 map = target; |
| 425 continue; | 423 continue; |
| 426 } else { | 424 } else { |
| 427 transitioning = false; | 425 transitioning = false; |
| 428 } | 426 } |
| 429 } | 427 } |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 800 | 798 |
| 801 ASSERT_EQ('"', c0_); | 799 ASSERT_EQ('"', c0_); |
| 802 // Advance past the last '"'. | 800 // Advance past the last '"'. |
| 803 AdvanceSkipWhitespace(); | 801 AdvanceSkipWhitespace(); |
| 804 return result; | 802 return result; |
| 805 } | 803 } |
| 806 | 804 |
| 807 } } // namespace v8::internal | 805 } } // namespace v8::internal |
| 808 | 806 |
| 809 #endif // V8_JSON_PARSER_H_ | 807 #endif // V8_JSON_PARSER_H_ |
| OLD | NEW |