diff --git a/src/handles.h b/src/handles.h index eb2023cf33..162b6d282f 100644 --- a/src/handles.h +++ b/src/handles.h @@ -174,13 +174,6 @@ inline Handle handle(T* t) { } -// Key comparison function for Map handles. -inline bool operator<(const Handle& lhs, const Handle& rhs) { - // This is safe because maps don't move. - return *lhs < *rhs; -} - - class DeferredHandles; class HandleScopeImplementer; diff --git a/src/lithium.cc b/src/lithium.cc index 0bebfaa96e..a9d7748ef3 100644 --- a/src/lithium.cc +++ b/src/lithium.cc @@ -273,8 +273,8 @@ LChunk::LChunk(CompilationInfo* info, HGraph* graph) instructions_(32, info->zone()), pointer_maps_(8, info->zone()), inlined_functions_(1, info->zone()), - deprecation_dependencies_(MapLess(), MapAllocator(info->zone())), - stability_dependencies_(MapLess(), MapAllocator(info->zone())) {} + deprecation_dependencies_(32, info->zone()), + stability_dependencies_(8, info->zone()) {} LLabel* LChunk::GetLabel(int block_id) const { @@ -464,17 +464,13 @@ void LChunk::CommitDependencies(Handle code) const { if (!code->is_optimized_code()) return; HandleScope scope(isolate()); - for (MapSet::const_iterator it = deprecation_dependencies_.begin(), - iend = deprecation_dependencies_.end(); it != iend; ++it) { - Handle map = *it; + for (Handle map : deprecation_dependencies_) { DCHECK(!map->is_deprecated()); DCHECK(map->CanBeDeprecated()); Map::AddDependentCode(map, DependentCode::kTransitionGroup, code); } - for (MapSet::const_iterator it = stability_dependencies_.begin(), - iend = stability_dependencies_.end(); it != iend; ++it) { - Handle map = *it; + for (Handle map : stability_dependencies_) { DCHECK(map->is_stable()); DCHECK(map->CanTransition()); Map::AddDependentCode(map, DependentCode::kPrototypeCheckGroup, code); diff --git a/src/lithium.h b/src/lithium.h index c972cbd6b3..046de19fd0 100644 --- a/src/lithium.h +++ b/src/lithium.h @@ -665,14 +665,14 @@ class LChunk : public ZoneObject { DCHECK(!map->is_deprecated()); if (!map->CanBeDeprecated()) return; DCHECK(!info_->IsStub()); - deprecation_dependencies_.insert(map); + deprecation_dependencies_.Add(map, zone()); } void AddStabilityDependency(Handle map) { DCHECK(map->is_stable()); if (!map->CanTransition()) return; DCHECK(!info_->IsStub()); - stability_dependencies_.insert(map); + stability_dependencies_.Add(map, zone()); } Zone* zone() const { return info_->zone(); } @@ -690,10 +690,6 @@ class LChunk : public ZoneObject { int spill_slot_count_; private: - typedef std::less > MapLess; - typedef zone_allocator > MapAllocator; - typedef std::set, MapLess, MapAllocator> MapSet; - void RegisterWeakObjectsInOptimizedCode(Handle code) const; void CommitDependencies(Handle code) const; @@ -703,8 +699,8 @@ class LChunk : public ZoneObject { ZoneList instructions_; ZoneList pointer_maps_; ZoneList> inlined_functions_; - MapSet deprecation_dependencies_; - MapSet stability_dependencies_; + ZoneList> deprecation_dependencies_; + ZoneList> stability_dependencies_; };