Chromium Code Reviews| Index: runtime/vm/method_recognizer.cc |
| =================================================================== |
| --- runtime/vm/method_recognizer.cc (revision 45661) |
| +++ runtime/vm/method_recognizer.cc (working copy) |
| @@ -25,15 +25,21 @@ |
| } |
| -const char* MethodRecognizer::KindToCString(Kind kind) { |
| +static const char* recognized_list_method_name[] = { |
| #define KIND_TO_STRING(class_name, function_name, enum_name, fp) \ |
| - if (kind == k##enum_name) return #enum_name; |
| + #enum_name, |
| RECOGNIZED_LIST(KIND_TO_STRING) |
| #undef KIND_TO_STRING |
|
Ivan Posva
2015/05/08 23:52:00
Can you move the #define and the #undef outside of
siva
2015/05/11 18:22:14
Done.
|
| +}; |
| + |
| +const char* MethodRecognizer::KindToCString(Kind kind) { |
| + if (kind > kUnknown && kind < kNumRecognizedMethods) |
| + return recognized_list_method_name[kind]; |
| return "?"; |
| } |
| +#if defined(DART_NO_SNAPSHOT) |
| void MethodRecognizer::InitializeState() { |
| GrowableArray<Library*> libs(3); |
| libs.Add(&Library::ZoneHandle(Library::CoreLibrary())); |
| @@ -83,5 +89,6 @@ |
| #undef SET_IS_POLYMORPHIC_TARGET |
| #undef SET_FUNCTION_BIT |
| } |
| +#endif // defined(DART_NO_SNAPSHOT). |
| } // namespace dart |