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

Unified Diff: runtime/vm/object.cc

Issue 14386011: Fix recognition of factories (for setting result cid) and add them to checks. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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.cc ('k') | runtime/vm/symbols.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 22079)
+++ runtime/vm/object.cc (working copy)
@@ -24,6 +24,7 @@
#include "vm/deopt_instructions.h"
#include "vm/double_conversion.h"
#include "vm/exceptions.h"
+#include "vm/flow_graph_builder.h"
#include "vm/growable_array.h"
#include "vm/heap.h"
#include "vm/intermediate_language.h"
@@ -6867,12 +6868,14 @@
return error.raw();
}
+
struct FpDiff {
FpDiff(int32_t old_, int32_t new_): old_fp(old_), new_fp(new_) {}
int32_t old_fp;
int32_t new_fp;
};
+
void Library::CheckFunctionFingerprints() {
GrowableArray<FpDiff> collected_fp_diffs;
Library& lib = Library::Handle();
@@ -6917,6 +6920,21 @@
TYPED_DATA_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS);
#undef CHECK_FINGERPRINTS
+
+#define CHECK_FACTORY_FINGERPRINTS(factory_symbol, cid, fp) \
+ cls = Isolate::Current()->class_table()->At(cid); \
+ func = cls.LookupFunctionAllowPrivate(Symbols::factory_symbol()); \
+ ASSERT(!func.IsNull()); \
+ if (func.SourceFingerprint() != fp) { \
+ has_errors = true; \
+ OS::Print("Wrong fingerprint for '%s': expecting %d found %d\n", \
+ func.ToFullyQualifiedCString(), fp, func.SourceFingerprint()); \
+ collected_fp_diffs.Add(FpDiff(fp, func.SourceFingerprint())); \
+ } \
+
+ RECOGNIZED_LIST_FACTORY_LIST(CHECK_FACTORY_FINGERPRINTS);
+
+#undef CHECK_FACTORY_FINGERPRINTS
if (has_errors) {
for (intptr_t i = 0; i < collected_fp_diffs.length(); i++) {
OS::Print("s/%d/%d/\n",
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/symbols.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698