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

Unified Diff: src/json-parser.h

Issue 167303005: Track field types. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ic.cc ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/json-parser.h
diff --git a/src/json-parser.h b/src/json-parser.h
index a7dbd3ab8651d2cb9995bb994a7c1c158e4c6e7f..8c19bc847454751413cd0dfc539f6cfe991d675f 100644
--- a/src/json-parser.h
+++ b/src/json-parser.h
@@ -415,7 +415,15 @@ Handle<Object> JsonParser<seq_ascii>::ParseJsonObject() {
if (value->IsSmi() && expected_representation.IsDouble()) {
value = factory()->NewHeapNumber(
Handle<Smi>::cast(value)->value());
+ } else if (expected_representation.IsHeapObject() &&
+ !target->instance_descriptors()->GetFieldType(
+ descriptor)->NowContains(value)) {
+ Handle<HeapType> value_type(value->OptimalType(
+ isolate(), expected_representation));
+ Map::GeneralizeFieldType(target, descriptor, value_type);
}
+ ASSERT(target->instance_descriptors()->GetFieldType(
+ descriptor)->NowContains(value));
properties.Add(value, zone());
map = target;
continue;
« 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