Browse Source

deps: fix build with libc++ 3.8.0

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: https://github.com/nodejs/node/pull/9763
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
v4.x
Johan Bergström 8 years ago
committed by Myles Borins
parent
commit
c1effb1255
  1. 2
      deps/v8/src/compiler/instruction.h
  2. 5
      deps/v8/src/compiler/js-type-feedback.h
  3. 6
      deps/v8/src/zone-containers.h

2
deps/v8/src/compiler/instruction.h

@ -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;

5
deps/v8/src/compiler/js-type-feedback.h

@ -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_;

6
deps/v8/src/zone-containers.h

@ -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)) {}
};

Loading…
Cancel
Save