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

Unified Diff: runtime/vm/method_recognizer.cc

Issue 2018363004: VM: Add result cid information for recognized methods. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: updated comment Created 4 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/method_recognizer.h ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/method_recognizer.cc
diff --git a/runtime/vm/method_recognizer.cc b/runtime/vm/method_recognizer.cc
index 45a6f59743f4791a5899789f77033cb1d4218b01..03014ac358530d47fbb24b9b50a252058e93c46f 100644
--- a/runtime/vm/method_recognizer.cc
+++ b/runtime/vm/method_recognizer.cc
@@ -25,7 +25,19 @@ bool MethodRecognizer::PolymorphicTarget(const Function& function) {
}
-#define KIND_TO_STRING(class_name, function_name, enum_name, fp) \
+intptr_t MethodRecognizer::ResultCid(const Function& function) {
+ switch (function.recognized_kind()) {
+#define DEFINE_CASE(cname, fname, ename, result_type, fingerprint) \
+ case k##ename: return k##result_type##Cid;
+ RECOGNIZED_LIST(DEFINE_CASE)
+#undef DEFINE_CASE
+ default:
+ return kDynamicCid;
+ }
+}
+
+
+#define KIND_TO_STRING(class_name, function_name, enum_name, type, fp) \
#enum_name,
static const char* recognized_list_method_name[] = {
"Unknown",
@@ -51,7 +63,7 @@ void MethodRecognizer::InitializeState() {
libs.Add(&Library::ZoneHandle(Library::DeveloperLibrary()));
Function& func = Function::Handle();
-#define SET_RECOGNIZED_KIND(class_name, function_name, enum_name, fp) \
+#define SET_RECOGNIZED_KIND(class_name, function_name, enum_name, type, fp) \
func = Library::GetFunction(libs, #class_name, #function_name); \
if (func.IsNull()) { \
OS::PrintErr("Missing %s::%s\n", #class_name, #function_name); \
@@ -74,7 +86,7 @@ void MethodRecognizer::InitializeState() {
#define SET_IS_ALWAYS_INLINE(class_name, function_name, dest, fp) \
SET_FUNCTION_BIT(class_name, function_name, dest, fp, set_always_inline, true)
-#define SET_IS_NEVER_INLINE(class_name, function_name, dest, fp) \
+#define SET_IS_NEVER_INLINE(class_name, function_name, dest, fp) \
SET_FUNCTION_BIT(class_name, function_name, dest, fp, set_is_inlinable, false)
#define SET_IS_POLYMORPHIC_TARGET(class_name, function_name, dest, fp) \
« no previous file with comments | « runtime/vm/method_recognizer.h ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698