Skip to content

Commit

Permalink
deps: fix build with libc++ 3.8.0
Browse files Browse the repository at this point in the history
Make sure the map allocators are of the same type. This fixes
building Node.js 4.x on libc++ 3.8.0 (for instance FreeBSD 11).

Upstream bug/patch: https://bugs.freebsd.org/208467

PR-URL: #9763
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Myles Borins <[email protected]>
Reviewed-By: Ali Ijaz Sheikh <[email protected]>
  • Loading branch information
jbergstroem authored and MylesBorins committed Dec 1, 2016
1 parent 9144d37 commit c1effb1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion deps/v8/src/compiler/instruction.h
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,7 @@ class InstructionBlock final : public ZoneObject {

typedef ZoneDeque<Constant> ConstantDeque;
typedef std::map<int, Constant, std::less<int>,
zone_allocator<std::pair<int, Constant> > > ConstantMap;
zone_allocator<std::pair<const int, Constant> > > ConstantMap;

typedef ZoneDeque<Instruction*> InstructionDeque;
typedef ZoneDeque<ReferenceMap*> ReferenceMapDeque;
Expand Down
5 changes: 3 additions & 2 deletions deps/v8/src/compiler/js-type-feedback.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ class JSTypeFeedbackTable : public ZoneObject {
private:
friend class JSTypeFeedbackSpecializer;
typedef std::map<NodeId, TypeFeedbackId, std::less<NodeId>,
zone_allocator<TypeFeedbackId> > TypeFeedbackIdMap;
zone_allocator<std::pair<const NodeId, TypeFeedbackId> > >
TypeFeedbackIdMap;
typedef std::map<NodeId, FeedbackVectorICSlot, std::less<NodeId>,
zone_allocator<FeedbackVectorICSlot> >
zone_allocator<std::pair<const NodeId, FeedbackVectorICSlot> > >
FeedbackVectorICSlotMap;

TypeFeedbackIdMap type_feedback_id_map_;
Expand Down
6 changes: 3 additions & 3 deletions deps/v8/src/zone-containers.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@ class ZoneSet : public std::set<K, Compare, zone_allocator<K>> {
// a zone allocator.
template <typename K, typename V, typename Compare = std::less<K>>
class ZoneMap
: public std::map<K, V, Compare, zone_allocator<std::pair<K, V>>> {
: public std::map<K, V, Compare, zone_allocator<std::pair<const K, V>>> {
public:
// Constructs an empty map.
explicit ZoneMap(Zone* zone)
: std::map<K, V, Compare, zone_allocator<std::pair<K, V>>>(
Compare(), zone_allocator<std::pair<K, V>>(zone)) {}
: std::map<K, V, Compare, zone_allocator<std::pair<const K, V>>>(
Compare(), zone_allocator<std::pair<const K, V>>(zone)) {}
};


Expand Down

0 comments on commit c1effb1

Please sign in to comment.