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

Side by Side Diff: src/json-parser.h

Issue 236843002: Revert "Track field types." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ic.cc ('k') | src/objects.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 PropertyDetails details = 408 PropertyDetails details =
409 target->instance_descriptors()->GetDetails(descriptor); 409 target->instance_descriptors()->GetDetails(descriptor);
410 Representation expected_representation = details.representation(); 410 Representation expected_representation = details.representation();
411 411
412 if (value->FitsRepresentation(expected_representation)) { 412 if (value->FitsRepresentation(expected_representation)) {
413 // If the target representation is double and the value is already 413 // If the target representation is double and the value is already
414 // double, use the existing box. 414 // double, use the existing box.
415 if (value->IsSmi() && expected_representation.IsDouble()) { 415 if (value->IsSmi() && expected_representation.IsDouble()) {
416 value = factory()->NewHeapNumber( 416 value = factory()->NewHeapNumber(
417 Handle<Smi>::cast(value)->value()); 417 Handle<Smi>::cast(value)->value());
418 } else if (expected_representation.IsHeapObject() &&
419 !target->instance_descriptors()->GetFieldType(
420 descriptor)->NowContains(value)) {
421 Handle<HeapType> value_type(value->OptimalType(
422 isolate(), expected_representation));
423 Map::GeneralizeFieldType(target, descriptor, value_type);
424 } 418 }
425 ASSERT(target->instance_descriptors()->GetFieldType(
426 descriptor)->NowContains(value));
427 properties.Add(value, zone()); 419 properties.Add(value, zone());
428 map = target; 420 map = target;
429 continue; 421 continue;
430 } else { 422 } else {
431 transitioning = false; 423 transitioning = false;
432 } 424 }
433 } 425 }
434 426
435 // Commit the intermediate state to the object and stop transitioning. 427 // Commit the intermediate state to the object and stop transitioning.
436 JSObject::AllocateStorageForMap(json_object, map); 428 JSObject::AllocateStorageForMap(json_object, map);
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 796
805 ASSERT_EQ('"', c0_); 797 ASSERT_EQ('"', c0_);
806 // Advance past the last '"'. 798 // Advance past the last '"'.
807 AdvanceSkipWhitespace(); 799 AdvanceSkipWhitespace();
808 return result; 800 return result;
809 } 801 }
810 802
811 } } // namespace v8::internal 803 } } // namespace v8::internal
812 804
813 #endif // V8_JSON_PARSER_H_ 805 #endif // V8_JSON_PARSER_H_
OLDNEW
« no previous file with comments | « src/ic.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698