| Index: runtime/vm/precompiler.h
|
| diff --git a/runtime/vm/precompiler.h b/runtime/vm/precompiler.h
|
| index 3f16a2815365e9c7b09cd8d77040d4416bf18de4..43b7b96f9a7e9ab75861830c2dae29872fa3fee0 100644
|
| --- a/runtime/vm/precompiler.h
|
| +++ b/runtime/vm/precompiler.h
|
| @@ -7,6 +7,7 @@
|
|
|
| #include "vm/allocation.h"
|
| #include "vm/hash_map.h"
|
| +#include "vm/hash_table.h"
|
| #include "vm/object.h"
|
|
|
| namespace dart {
|
| @@ -342,6 +343,34 @@ class Precompiler : public ValueObject {
|
| Error& error_;
|
| };
|
|
|
| +
|
| +class FunctionsTraits {
|
| + public:
|
| + static bool IsMatch(const Object& a, const Object& b) {
|
| + Zone* zone = Thread::Current()->zone();
|
| + String& a_s = String::Handle(zone);
|
| + String& b_s = String::Handle(zone);
|
| + a_s = a.IsFunction() ? Function::Cast(a).name() : String::Cast(a).raw();
|
| + b_s = b.IsFunction() ? Function::Cast(b).name() : String::Cast(b).raw();
|
| + ASSERT(a_s.IsSymbol() && b_s.IsSymbol());
|
| + return a_s.raw() == b_s.raw();
|
| + }
|
| + static uword Hash(const Object& obj) {
|
| + if (obj.IsFunction()) {
|
| + return String::Handle(Function::Cast(obj).name()).Hash();
|
| + } else {
|
| + ASSERT(String::Cast(obj).IsSymbol());
|
| + return String::Cast(obj).Hash();
|
| + }
|
| + }
|
| + static RawObject* NewKey(const Function& function) {
|
| + return function.raw();
|
| + }
|
| +};
|
| +
|
| +typedef UnorderedHashSet<FunctionsTraits> UniqueFunctionsSet;
|
| +
|
| +
|
| } // namespace dart
|
|
|
| #endif // VM_PRECOMPILER_H_
|
|
|