178 {
179 GrowableArray<Library*>
libs(3);
180 Libraries(&libs);
182 bool fingerprints_match = true;
183
188 if (!func.IsNull()) {
189 fingerprints_match =
191 fingerprints_match;
192 func.set_recognized_kind(kind);
193 switch (kind) {
194#define RECOGNIZE_METHOD(class_name, function_name, enum_name, fp) \
195 case MethodRecognizer::k##enum_name: \
196 func.reset_unboxed_parameters_and_return(); \
197 break;
199#undef RECOGNIZE_METHOD
200 default:
201 break;
202 }
203 } else if (!FLAG_precompiled_mode) {
204 fingerprints_match = false;
207 }
208 }
209
210#define SET_FUNCTION_BIT(class_name, function_name, dest, fp, setter, value) \
211 func = Library::GetFunction(libs, #class_name, #function_name); \
212 if (!func.IsNull()) { \
213 fingerprints_match = \
214 func.CheckSourceFingerprint(fp) && fingerprints_match; \
215 func.setter(value); \
216 } else if (!FLAG_precompiled_mode) { \
217 OS::PrintErr("Missing %s::%s\n", #class_name, #function_name); \
218 fingerprints_match = false; \
219 }
220
221#define SET_IS_POLYMORPHIC_TARGET(class_name, function_name, dest, fp) \
222 SET_FUNCTION_BIT(class_name, function_name, dest, fp, \
223 set_is_polymorphic_target, true)
224
226
227#undef SET_RECOGNIZED_KIND
228#undef SET_IS_POLYMORPHIC_TARGET
229#undef SET_FUNCTION_BIT
230
231 if (!fingerprints_match) {
232
233
235 "FP mismatch while recognizing methods. If the behavior of "
236 "these functions has changed, then changes are also needed in "
237 "the VM's compiler. Otherwise the fingerprint can simply be "
238 "updated in recognized_methods_list.h\n");
239 }
240}
static FunctionPtr GetFunction(const GrowableArray< Library * > &libs, const char *class_name, const char *function_name)
static void static void PrintErr(const char *format,...) PRINTF_ATTRIBUTE(1
#define SET_IS_POLYMORPHIC_TARGET(class_name, function_name, dest, fp)
#define RECOGNIZE_METHOD(class_name, function_name, enum_name, fp)
const char *const class_name
static const struct dart::@131 recognized_methods[MethodRecognizer::kNumRecognizedMethods]
const char *const function_name
#define ALL_INTRINSICS_LIST(V)
#define POLYMORPHIC_TARGET_LIST(V)