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

Unified Diff: src/asmjs/asm-wasm-builder.cc

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-typer.cc ('k') | src/ast/ast.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/asmjs/asm-wasm-builder.cc
diff --git a/src/asmjs/asm-wasm-builder.cc b/src/asmjs/asm-wasm-builder.cc
index 5f8233391e85233f2a723ae26afe4c35889550fc..ac2585e6eaacc5453d317981309671a121c0ec22 100644
--- a/src/asmjs/asm-wasm-builder.cc
+++ b/src/asmjs/asm-wasm-builder.cc
@@ -664,8 +664,8 @@ class AsmWasmBuilderImpl final : public AstVisitor<AsmWasmBuilderImpl> {
FunctionTableIndices* container = new (zone()) FunctionTableIndices();
container->start_index = start_index;
container->signature_index = signature_index;
- ZoneHashMap::Entry* entry =
- function_tables_.LookupOrInsert(v, ComputePointerHash(v));
+ ZoneHashMap::Entry* entry = function_tables_.LookupOrInsert(
+ v, ComputePointerHash(v), ZoneAllocationPolicy(zone()));
entry->value = container;
}
@@ -700,8 +700,8 @@ class AsmWasmBuilderImpl final : public AstVisitor<AsmWasmBuilderImpl> {
void AddImport(Variable* v, const char* name, int name_length) {
ImportedFunctionIndices* indices = new (builder_->zone())
ImportedFunctionIndices(name, name_length, builder_->zone());
- ZoneHashMap::Entry* entry =
- table_.LookupOrInsert(v, ComputePointerHash(v));
+ ZoneHashMap::Entry* entry = table_.LookupOrInsert(
+ v, ComputePointerHash(v), ZoneAllocationPolicy(builder_->zone()));
entry->value = indices;
}
@@ -1694,7 +1694,8 @@ class AsmWasmBuilderImpl final : public AstVisitor<AsmWasmBuilderImpl> {
index = current_function_builder_->AddLocal(type);
IndexContainer* container = new (zone()) IndexContainer();
container->index = index;
- entry = local_variables_.LookupOrInsert(v, ComputePointerHash(v));
+ entry = local_variables_.LookupOrInsert(v, ComputePointerHash(v),
+ ZoneAllocationPolicy(zone()));
entry->value = container;
}
return (reinterpret_cast<IndexContainer*>(entry->value))->index;
@@ -1708,7 +1709,8 @@ class AsmWasmBuilderImpl final : public AstVisitor<AsmWasmBuilderImpl> {
DCHECK_NULL(entry);
IndexContainer* container = new (zone()) IndexContainer();
container->index = index;
- entry = local_variables_.LookupOrInsert(v, ComputePointerHash(v));
+ entry = local_variables_.LookupOrInsert(v, ComputePointerHash(v),
+ ZoneAllocationPolicy(zone()));
entry->value = container;
}
@@ -1719,7 +1721,8 @@ class AsmWasmBuilderImpl final : public AstVisitor<AsmWasmBuilderImpl> {
uint32_t index = builder_->AddGlobal(type, 0);
IndexContainer* container = new (zone()) IndexContainer();
container->index = index;
- entry = global_variables_.LookupOrInsert(v, ComputePointerHash(v));
+ entry = global_variables_.LookupOrInsert(v, ComputePointerHash(v),
+ ZoneAllocationPolicy(zone()));
entry->value = container;
}
return (reinterpret_cast<IndexContainer*>(entry->value))->index;
@@ -1732,7 +1735,8 @@ class AsmWasmBuilderImpl final : public AstVisitor<AsmWasmBuilderImpl> {
uint32_t index = builder_->AddFunction();
IndexContainer* container = new (zone()) IndexContainer();
container->index = index;
- entry = functions_.LookupOrInsert(v, ComputePointerHash(v));
+ entry = functions_.LookupOrInsert(v, ComputePointerHash(v),
+ ZoneAllocationPolicy(zone()));
entry->value = container;
}
return (reinterpret_cast<IndexContainer*>(entry->value))->index;
« no previous file with comments | « src/asmjs/asm-typer.cc ('k') | src/ast/ast.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698