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

Unified Diff: runtime/vm/hash_map.h

Issue 14021016: Track side-effect free paths in the graph to allow CSE and LICM for instructions that depend on som… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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 | « runtime/vm/flow_graph_type_propagator.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/hash_map.h
diff --git a/runtime/vm/hash_map.h b/runtime/vm/hash_map.h
index fefd788bfeacc6203e7ec0b3d83665f033b2d8d1..babaecae089005d40874837745e2cb7c34f5558b 100644
--- a/runtime/vm/hash_map.h
+++ b/runtime/vm/hash_map.h
@@ -28,7 +28,20 @@ class DirectChainedHashMap: public ValueObject {
bool IsEmpty() const { return count_ == 0; }
- private:
+ void Clear() {
+ if (!IsEmpty()) {
+ count_ = 0;
+ memset(array_, 0, sizeof(HashMapListElement) * array_size_);
+ memset(lists_, 0, sizeof(HashMapListElement) * lists_size_);
+ lists_[0].next = kNil;
+ for (intptr_t i = 1; i < lists_size_; ++i) {
+ lists_[i].next = i - 1;
+ }
+ free_list_head_ = lists_size_ - 1;
+ }
+ }
+
+ protected:
// A linked list of T values. Stored in arrays.
struct HashMapListElement {
typename KeyValueTrait::Pair kv;
« no previous file with comments | « runtime/vm/flow_graph_type_propagator.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698