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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 1136163002: Some more cleanup of the finger print checking code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 7 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_builder.h ('k') | runtime/vm/method_recognizer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_builder.cc
===================================================================
--- runtime/vm/flow_graph_builder.cc (revision 45703)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -67,6 +67,41 @@
}
+#define RECOGNIZE_FACTORY(test_factory_symbol, cid, fp) \
+ { Symbols::k##test_factory_symbol##Id, cid, \
+ fp, #test_factory_symbol ", " #cid },
+
+static struct {
+ intptr_t symbold_id;
+ intptr_t cid;
+ intptr_t finger_print;
+ const char* name;
+} factory_recognizer_list[] = {
+ RECOGNIZED_LIST_FACTORY_LIST(RECOGNIZE_FACTORY)
+};
+
+#undef RECOGNIZE_FACTORY
+
+intptr_t FactoryRecognizer::ResultCid(const Function& factory) {
+ ASSERT(factory.IsFactory());
+ const Class& function_class = Class::Handle(factory.Owner());
+ const Library& lib = Library::Handle(function_class.library());
+ ASSERT((lib.raw() == Library::CoreLibrary()) ||
+ (lib.raw() == Library::TypedDataLibrary()));
+ const String& factory_name = String::Handle(factory.name());
+ for (intptr_t i = 0;
+ factory_recognizer_list[i].symbold_id != Symbols::kIllegal;
+ i++) {
+ if (String::EqualsIgnoringPrivateKey(
+ factory_name,
+ Symbols::Symbol(factory_recognizer_list[i].symbold_id))) {
+ return factory_recognizer_list[i].cid;
+ }
+ }
+ return kDynamicCid;
+}
+
+
// Base class for a stack of enclosing statements of interest (e.g.,
// blocks (breakable) and loops (continuable)).
class NestedStatement : public ValueObject {
« no previous file with comments | « runtime/vm/flow_graph_builder.h ('k') | runtime/vm/method_recognizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698