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

Side by Side 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, 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/symbols.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
11 #include "vm/bigint_operations.h" 11 #include "vm/bigint_operations.h"
12 #include "vm/bootstrap.h" 12 #include "vm/bootstrap.h"
13 #include "vm/class_finalizer.h" 13 #include "vm/class_finalizer.h"
14 #include "vm/code_generator.h" 14 #include "vm/code_generator.h"
15 #include "vm/code_observers.h" 15 #include "vm/code_observers.h"
16 #include "vm/code_patcher.h" 16 #include "vm/code_patcher.h"
17 #include "vm/compiler.h" 17 #include "vm/compiler.h"
18 #include "vm/compiler_stats.h" 18 #include "vm/compiler_stats.h"
19 #include "vm/dart.h" 19 #include "vm/dart.h"
20 #include "vm/dart_api_state.h" 20 #include "vm/dart_api_state.h"
21 #include "vm/dart_entry.h" 21 #include "vm/dart_entry.h"
22 #include "vm/datastream.h" 22 #include "vm/datastream.h"
23 #include "vm/debugger.h" 23 #include "vm/debugger.h"
24 #include "vm/deopt_instructions.h" 24 #include "vm/deopt_instructions.h"
25 #include "vm/double_conversion.h" 25 #include "vm/double_conversion.h"
26 #include "vm/exceptions.h" 26 #include "vm/exceptions.h"
27 #include "vm/flow_graph_builder.h"
27 #include "vm/growable_array.h" 28 #include "vm/growable_array.h"
28 #include "vm/heap.h" 29 #include "vm/heap.h"
29 #include "vm/intermediate_language.h" 30 #include "vm/intermediate_language.h"
30 #include "vm/intrinsifier.h" 31 #include "vm/intrinsifier.h"
31 #include "vm/object_store.h" 32 #include "vm/object_store.h"
32 #include "vm/parser.h" 33 #include "vm/parser.h"
33 #include "vm/runtime_entry.h" 34 #include "vm/runtime_entry.h"
34 #include "vm/scopes.h" 35 #include "vm/scopes.h"
35 #include "vm/stack_frame.h" 36 #include "vm/stack_frame.h"
36 #include "vm/symbols.h" 37 #include "vm/symbols.h"
(...skipping 6823 matching lines...) Expand 10 before | Expand all | Expand 10 after
6860 cls ^= anon_classes.At(i); 6861 cls ^= anon_classes.At(i);
6861 error = Compiler::CompileAllFunctions(cls); 6862 error = Compiler::CompileAllFunctions(cls);
6862 if (!error.IsNull()) { 6863 if (!error.IsNull()) {
6863 return error.raw(); 6864 return error.raw();
6864 } 6865 }
6865 } 6866 }
6866 } 6867 }
6867 return error.raw(); 6868 return error.raw();
6868 } 6869 }
6869 6870
6871
6870 struct FpDiff { 6872 struct FpDiff {
6871 FpDiff(int32_t old_, int32_t new_): old_fp(old_), new_fp(new_) {} 6873 FpDiff(int32_t old_, int32_t new_): old_fp(old_), new_fp(new_) {}
6872 int32_t old_fp; 6874 int32_t old_fp;
6873 int32_t new_fp; 6875 int32_t new_fp;
6874 }; 6876 };
6875 6877
6878
6876 void Library::CheckFunctionFingerprints() { 6879 void Library::CheckFunctionFingerprints() {
6877 GrowableArray<FpDiff> collected_fp_diffs; 6880 GrowableArray<FpDiff> collected_fp_diffs;
6878 Library& lib = Library::Handle(); 6881 Library& lib = Library::Handle();
6879 Class& cls = Class::Handle(); 6882 Class& cls = Class::Handle();
6880 Function& func = Function::Handle(); 6883 Function& func = Function::Handle();
6881 String& str = String::Handle(); 6884 String& str = String::Handle();
6882 bool has_errors = false; 6885 bool has_errors = false;
6883 6886
6884 #define CHECK_FINGERPRINTS(class_name, function_name, dest, fp) \ 6887 #define CHECK_FINGERPRINTS(class_name, function_name, dest, fp) \
6885 func = Function::null(); \ 6888 func = Function::null(); \
(...skipping 24 matching lines...) Expand all
6910 6913
6911 RECOGNIZED_LIST(CHECK_FINGERPRINTS); 6914 RECOGNIZED_LIST(CHECK_FINGERPRINTS);
6912 6915
6913 lib = Library::MathLibrary(); 6916 lib = Library::MathLibrary();
6914 MATH_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS); 6917 MATH_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS);
6915 6918
6916 lib = Library::TypedDataLibrary(); 6919 lib = Library::TypedDataLibrary();
6917 TYPED_DATA_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS); 6920 TYPED_DATA_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS);
6918 6921
6919 #undef CHECK_FINGERPRINTS 6922 #undef CHECK_FINGERPRINTS
6923
6924 #define CHECK_FACTORY_FINGERPRINTS(factory_symbol, cid, fp) \
6925 cls = Isolate::Current()->class_table()->At(cid); \
6926 func = cls.LookupFunctionAllowPrivate(Symbols::factory_symbol()); \
6927 ASSERT(!func.IsNull()); \
6928 if (func.SourceFingerprint() != fp) { \
6929 has_errors = true; \
6930 OS::Print("Wrong fingerprint for '%s': expecting %d found %d\n", \
6931 func.ToFullyQualifiedCString(), fp, func.SourceFingerprint()); \
6932 collected_fp_diffs.Add(FpDiff(fp, func.SourceFingerprint())); \
6933 } \
6934
6935 RECOGNIZED_LIST_FACTORY_LIST(CHECK_FACTORY_FINGERPRINTS);
6936
6937 #undef CHECK_FACTORY_FINGERPRINTS
6920 if (has_errors) { 6938 if (has_errors) {
6921 for (intptr_t i = 0; i < collected_fp_diffs.length(); i++) { 6939 for (intptr_t i = 0; i < collected_fp_diffs.length(); i++) {
6922 OS::Print("s/%d/%d/\n", 6940 OS::Print("s/%d/%d/\n",
6923 collected_fp_diffs[i].old_fp, collected_fp_diffs[i].new_fp); 6941 collected_fp_diffs[i].old_fp, collected_fp_diffs[i].new_fp);
6924 } 6942 }
6925 OS::Print("\n"); 6943 OS::Print("\n");
6926 FATAL("Fingerprint mismatch."); 6944 FATAL("Fingerprint mismatch.");
6927 } 6945 }
6928 } 6946 }
6929 6947
(...skipping 6237 matching lines...) Expand 10 before | Expand all | Expand 10 after
13167 } 13185 }
13168 return result.raw(); 13186 return result.raw();
13169 } 13187 }
13170 13188
13171 13189
13172 const char* WeakProperty::ToCString() const { 13190 const char* WeakProperty::ToCString() const {
13173 return "_WeakProperty"; 13191 return "_WeakProperty";
13174 } 13192 }
13175 13193
13176 } // namespace dart 13194 } // namespace dart
OLDNEW
« 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