1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
7 #include "src/modules.h"
9 #include "src/ast-value-factory.h"
14 // ---------------------------------------------------------------------------
17 void ModuleDescriptor::Add(const AstRawString* name, Zone* zone, bool* ok) {
18 void* key = const_cast<AstRawString*>(name);
20 ZoneHashMap** map = &exports_;
21 ZoneAllocationPolicy allocator(zone);
23 if (*map == nullptr) {
24 *map = new (zone->New(sizeof(ZoneHashMap)))
25 ZoneHashMap(ZoneHashMap::PointersMatch,
26 ZoneHashMap::kDefaultHashMapCapacity, allocator);
29 ZoneHashMap::Entry* p =
30 (*map)->Lookup(key, name->hash(), !IsFrozen(), allocator);
31 if (p == nullptr || p->value != nullptr) {
38 } // namespace v8::internal