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

Unified Diff: src/hydrogen.cc

Issue 269353003: Fix constructors for HLoadNamedField. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Deuglify code Created 6 years, 7 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/hydrogen.h ('k') | src/hydrogen-check-elimination.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 627a21d120d12a797649e1d04c663b3e1c111498..ee9f8e41676b054dc34a7797677e68f3a940e6ef 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -5348,8 +5348,24 @@ HInstruction* HOptimizedGraphBuilder::BuildLoadNamedField(
// Load the double value from it.
access = HObjectAccess::ForHeapNumberValue();
}
+
+ SmallMapList* map_list = info->field_maps();
+ if (map_list->length() == 0) {
+ return New<HLoadNamedField>(checked_object, checked_object, access);
+ }
+
+ UniqueSet<Map>* maps = new(zone()) UniqueSet<Map>(map_list->length(), zone());
+ for (int i = 0; i < map_list->length(); ++i) {
+ Handle<Map> map = map_list->at(i);
+ maps->Add(Unique<Map>::CreateImmovable(map), zone());
+ // TODO(bmeurer): Get rid of this shit!
+ if (map->CanTransition()) {
+ Map::AddDependentCompilationInfo(
+ map, DependentCode::kPrototypeCheckGroup, top_info());
+ }
+ }
return New<HLoadNamedField>(
- checked_object, checked_object, access, info->field_maps(), top_info());
+ checked_object, checked_object, access, maps, info->field_type());
}
@@ -5488,6 +5504,7 @@ bool HOptimizedGraphBuilder::PropertyAccessInfo::IsCompatible(
}
}
info->GeneralizeRepresentation(r);
+ info->field_type_ = info->field_type_.Combine(field_type_);
return true;
}
@@ -5539,8 +5556,9 @@ bool HOptimizedGraphBuilder::PropertyAccessInfo::LoadResult(Handle<Map> map) {
void HOptimizedGraphBuilder::PropertyAccessInfo::LoadFieldMaps(
Handle<Map> map) {
- // Clear any previously collected field maps.
+ // Clear any previously collected field maps/type.
field_maps_.Clear();
+ field_type_ = HType::Tagged();
// Figure out the field type from the accessor map.
Handle<HeapType> field_type(lookup_.GetFieldTypeFromMap(*map), isolate());
@@ -5563,6 +5581,22 @@ void HOptimizedGraphBuilder::PropertyAccessInfo::LoadFieldMaps(
field_maps_.Sort();
ASSERT_EQ(num_field_maps, field_maps_.length());
+ // Determine field HType from field HeapType.
+ if (field_type->Is(HeapType::Number())) {
+ field_type_ = HType::HeapNumber();
+ } else if (field_type->Is(HeapType::String())) {
+ field_type_ = HType::String();
+ } else if (field_type->Is(HeapType::Boolean())) {
+ field_type_ = HType::Boolean();
+ } else if (field_type->Is(HeapType::Array())) {
+ field_type_ = HType::JSArray();
+ } else if (field_type->Is(HeapType::Object())) {
+ field_type_ = HType::JSObject();
+ } else if (field_type->Is(HeapType::Null()) ||
+ field_type->Is(HeapType::Undefined())) {
+ field_type_ = HType::NonPrimitive();
+ }
+
// Add dependency on the map that introduced the field.
Map::AddDependentCompilationInfo(
handle(lookup_.GetFieldOwnerFromMap(*map), isolate()),
« no previous file with comments | « src/hydrogen.h ('k') | src/hydrogen-check-elimination.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698