Index: runtime/vm/precompiler.cc |
diff --git a/runtime/vm/precompiler.cc b/runtime/vm/precompiler.cc |
index 0f9d8d9883254f634d25fbb6c5e4a9231ee2ce41..b4d0326a081c850d8d4634fe84807839955fd162 100644 |
--- a/runtime/vm/precompiler.cc |
+++ b/runtime/vm/precompiler.cc |
@@ -980,7 +980,7 @@ void Precompiler::AddCalleesOf(const Function& function) { |
void Precompiler::AddTypesOf(const Class& cls) { |
if (cls.IsNull()) return; |
- if (classes_to_retain_.HasKey(&cls)) return; |
+ if (classes_to_retain_.Lookup(&cls) != NULL) return; |
classes_to_retain_.Insert(&Class::ZoneHandle(Z, cls.raw())); |
Array& interfaces = Array::Handle(Z, cls.interfaces()); |
@@ -1008,7 +1008,7 @@ void Precompiler::AddTypesOf(const Function& function) { |
if (function.IsNull()) return; |
// We don't expect to see a reference to a redicting factory. |
ASSERT(!function.IsRedirectingFactory()); |
- if (functions_to_retain_.HasKey(&function)) return; |
+ if (functions_to_retain_.Lookup(&function) != NULL) return; |
functions_to_retain_.Insert(&Function::ZoneHandle(Z, function.raw())); |
AbstractType& type = AbstractType::Handle(Z); |
@@ -1050,7 +1050,7 @@ void Precompiler::AddTypesOf(const Function& function) { |
void Precompiler::AddType(const AbstractType& abstype) { |
if (abstype.IsNull()) return; |
- if (types_to_retain_.HasKey(&abstype)) return; |
+ if (types_to_retain_.Lookup(&abstype) != NULL) return; |
types_to_retain_.Insert(&AbstractType::ZoneHandle(Z, abstype.raw())); |
if (abstype.IsType()) { |
@@ -1087,7 +1087,7 @@ void Precompiler::AddType(const AbstractType& abstype) { |
void Precompiler::AddTypeArguments(const TypeArguments& args) { |
if (args.IsNull()) return; |
- if (typeargs_to_retain_.HasKey(&args)) return; |
+ if (typeargs_to_retain_.Lookup(&args) != NULL) return; |
typeargs_to_retain_.Insert(&TypeArguments::ZoneHandle(Z, args.raw())); |
AbstractType& arg = AbstractType::Handle(Z); |
@@ -1121,7 +1121,7 @@ void Precompiler::AddConstObject(const Instance& instance) { |
if (!instance.IsCanonical()) return; |
// Constants are canonicalized and we avoid repeated processing of them. |
- if (consts_to_retain_.HasKey(&instance)) return; |
+ if (consts_to_retain_.Lookup(&instance) != NULL) return; |
consts_to_retain_.Insert(&Instance::ZoneHandle(Z, instance.raw())); |
@@ -1168,7 +1168,7 @@ void Precompiler::AddClosureCall(const Array& arguments_descriptor) { |
void Precompiler::AddField(const Field& field) { |
- if (fields_to_retain_.HasKey(&field)) return; |
+ if (fields_to_retain_.Lookup(&field) != NULL) return; |
fields_to_retain_.Insert(&Field::ZoneHandle(Z, field.raw())); |
@@ -1341,7 +1341,7 @@ RawObject* Precompiler::ExecuteOnce(SequenceNode* fragment) { |
void Precompiler::AddFunction(const Function& function) { |
- if (enqueued_functions_.HasKey(&function)) return; |
+ if (enqueued_functions_.Lookup(&function) != NULL) return; |
enqueued_functions_.Insert(&Function::ZoneHandle(Z, function.raw())); |
pending_functions_.Add(function); |
@@ -1353,7 +1353,7 @@ bool Precompiler::IsSent(const String& selector) { |
if (selector.IsNull()) { |
return false; |
} |
- return sent_selectors_.HasKey(&selector); |
+ return sent_selectors_.Lookup(&selector) != NULL; |
} |
@@ -1661,7 +1661,7 @@ void Precompiler::TraceForRetainedFunctions() { |
functions = cls.functions(); |
for (intptr_t j = 0; j < functions.Length(); j++) { |
function ^= functions.At(j); |
- bool retain = enqueued_functions_.HasKey(&function); |
+ bool retain = enqueued_functions_.Lookup(&function) != NULL; |
if (!retain && function.HasImplicitClosureFunction()) { |
// It can happen that all uses of an implicit closure inline their |
// target function, leaving the target function uncompiled. Keep |
@@ -1681,7 +1681,7 @@ void Precompiler::TraceForRetainedFunctions() { |
closures = isolate()->object_store()->closure_functions(); |
for (intptr_t j = 0; j < closures.Length(); j++) { |
function ^= closures.At(j); |
- bool retain = enqueued_functions_.HasKey(&function); |
+ bool retain = enqueued_functions_.Lookup(&function) != NULL; |
if (retain) { |
AddTypesOf(function); |
@@ -1723,7 +1723,7 @@ void Precompiler::DropFunctions() { |
retained_functions = GrowableObjectArray::New(); |
for (intptr_t j = 0; j < functions.Length(); j++) { |
function ^= functions.At(j); |
- bool retain = functions_to_retain_.HasKey(&function); |
+ bool retain = functions_to_retain_.Lookup(&function) != NULL; |
function.DropUncompiledImplicitClosureFunction(); |
if (retain) { |
retained_functions.Add(function); |
@@ -1758,7 +1758,7 @@ void Precompiler::DropFunctions() { |
retained_functions = GrowableObjectArray::New(); |
for (intptr_t j = 0; j < closures.Length(); j++) { |
function ^= closures.At(j); |
- bool retain = functions_to_retain_.HasKey(&function); |
+ bool retain = functions_to_retain_.Lookup(&function) != NULL; |
if (retain) { |
retained_functions.Add(function); |
} else { |
@@ -1795,7 +1795,7 @@ void Precompiler::DropFields() { |
retained_fields = GrowableObjectArray::New(); |
for (intptr_t j = 0; j < fields.Length(); j++) { |
field ^= fields.At(j); |
- bool retain = fields_to_retain_.HasKey(&field); |
+ bool retain = fields_to_retain_.Lookup(&field) != NULL; |
if (retain) { |
retained_fields.Add(field); |
type = field.type(); |
@@ -1836,7 +1836,7 @@ void Precompiler::DropTypes() { |
types_array = HashTables::ToArray(types_table, false); |
for (intptr_t i = 0; i < (types_array.Length() - 1); i++) { |
type ^= types_array.At(i); |
- bool retain = types_to_retain_.HasKey(&type); |
+ bool retain = types_to_retain_.Lookup(&type) != NULL; |
if (retain) { |
retained_types.Add(type); |
} else { |
@@ -1874,7 +1874,7 @@ void Precompiler::DropTypeArguments() { |
typeargs_array = HashTables::ToArray(typeargs_table, false); |
for (intptr_t i = 0; i < (typeargs_array.Length() - 1); i++) { |
typeargs ^= typeargs_array.At(i); |
- bool retain = typeargs_to_retain_.HasKey(&typeargs); |
+ bool retain = typeargs_to_retain_.Lookup(&typeargs) != NULL; |
if (retain) { |
retained_typeargs.Add(typeargs); |
} else { |
@@ -1960,7 +1960,7 @@ void Precompiler::TraceTypesFromRetainedClasses() { |
retained_constants = GrowableObjectArray::New(); |
for (intptr_t j = 0; j < constants.Length(); j++) { |
constant ^= constants.At(j); |
- bool retain = consts_to_retain_.HasKey(&constant); |
+ bool retain = consts_to_retain_.Lookup(&constant) != NULL; |
if (retain) { |
retained_constants.Add(constant); |
} |
@@ -2025,7 +2025,7 @@ void Precompiler::DropClasses() { |
continue; |
} |
- bool retain = classes_to_retain_.HasKey(&cls); |
+ bool retain = classes_to_retain_.Lookup(&cls) != NULL; |
if (retain) { |
continue; |
} |
@@ -2092,7 +2092,7 @@ void Precompiler::DropLibraries() { |
// A type for a top-level class may be referenced from an object pool as |
// part of an error message. |
const Class& top = Class::Handle(Z, lib.toplevel_class()); |
- if (classes_to_retain_.HasKey(&top)) { |
+ if (classes_to_retain_.Lookup(&top) != NULL) { |
retain = true; |
} |
} |