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

Unified Diff: src/ast/ast.h

Issue 2351393003: [base] Revert "Move hashmap allocator to a field" (Closed)
Patch Set: Whoops, patch sets should build Created 4 years, 3 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/asmjs/asm-wasm-builder.cc ('k') | src/ast/ast.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/ast.h
diff --git a/src/ast/ast.h b/src/ast/ast.h
index 0ed089f155e0e2980e5c05c60605c60d574d2bcc..fa462f01d65fef171d6eb30954b03005b4ceddf2 100644
--- a/src/ast/ast.h
+++ b/src/ast/ast.h
@@ -129,13 +129,14 @@ AST_NODE_LIST(DEF_FORWARD_DECLARATION)
class FeedbackVectorSlotCache {
public:
explicit FeedbackVectorSlotCache(Zone* zone)
- : hash_map_(base::HashMap::PointersMatch,
+ : zone_(zone),
+ hash_map_(base::HashMap::PointersMatch,
ZoneHashMap::kDefaultHashMapCapacity,
ZoneAllocationPolicy(zone)) {}
void Put(Variable* variable, FeedbackVectorSlot slot) {
- ZoneHashMap::Entry* entry =
- hash_map_.LookupOrInsert(variable, ComputePointerHash(variable));
+ ZoneHashMap::Entry* entry = hash_map_.LookupOrInsert(
+ variable, ComputePointerHash(variable), ZoneAllocationPolicy(zone_));
entry->value = reinterpret_cast<void*>(slot.ToInt());
}
@@ -144,6 +145,7 @@ class FeedbackVectorSlotCache {
}
private:
+ Zone* zone_;
ZoneHashMap hash_map_;
};
@@ -1523,7 +1525,7 @@ class AccessorTable
zone_(zone) {}
Iterator lookup(Literal* literal) {
- Iterator it = find(literal, true);
+ Iterator it = find(literal, true, ZoneAllocationPolicy(zone_));
if (it->second == NULL) it->second = new (zone_) ObjectLiteral::Accessors();
return it;
}
« no previous file with comments | « src/asmjs/asm-wasm-builder.cc ('k') | src/ast/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698