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

Unified Diff: runtime/vm/hash_table.h

Issue 1709273003: Make function lookup in classes thread-safe: (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: d Created 4 years, 10 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_optimizer.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/hash_table.h
diff --git a/runtime/vm/hash_table.h b/runtime/vm/hash_table.h
index 2334bbc5ca1b803c07649b8e2ed4dddc867131cd..c1622322137a2364d095f335ee86e41403ec263d 100644
--- a/runtime/vm/hash_table.h
+++ b/runtime/vm/hash_table.h
@@ -99,7 +99,9 @@ class HashTable : public ValueObject {
key_handle_(Object::Handle(zone_)),
smi_handle_(Smi::Handle(zone_)),
data_(&Array::Handle(zone_, data)),
- released_data_(NULL) {}
+ released_data_(NULL) {
+ ASSERT(!data_->IsNull());
+ }
// Returns the final table. The handle is cleared when this HashTable is
// destroyed.
@@ -296,6 +298,7 @@ class HashTable : public ValueObject {
}
intptr_t GetSmiValueAt(intptr_t index) const {
+ ASSERT(!data_->IsNull());
ASSERT(Object::Handle(zone(), data_->At(index)).IsSmi());
return Smi::Value(Smi::RawCast(data_->At(index)));
}
@@ -689,7 +692,9 @@ template<typename KeyTraits>
class UnorderedHashSet : public HashSet<UnorderedHashTable<KeyTraits, 0> > {
public:
typedef HashSet<UnorderedHashTable<KeyTraits, 0> > BaseSet;
- explicit UnorderedHashSet(RawArray* data) : BaseSet(data) {}
+ explicit UnorderedHashSet(RawArray* data) : BaseSet(data) {
+ ASSERT(data != Array::null());
+ }
UnorderedHashSet(Zone* zone, RawArray* data) : BaseSet(zone, data) {}
};
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698