OLD | NEW |
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" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 DEFINE_FLAG(bool, show_internal_names, false, | 59 DEFINE_FLAG(bool, show_internal_names, false, |
60 "Show names of internal classes (e.g. \"OneByteString\") in error messages " | 60 "Show names of internal classes (e.g. \"OneByteString\") in error messages " |
61 "instead of showing the corresponding interface names (e.g. \"String\")"); | 61 "instead of showing the corresponding interface names (e.g. \"String\")"); |
62 DEFINE_FLAG(bool, throw_on_javascript_int_overflow, false, | 62 DEFINE_FLAG(bool, throw_on_javascript_int_overflow, false, |
63 "Throw an exception when the result of an integer calculation will not " | 63 "Throw an exception when the result of an integer calculation will not " |
64 "fit into a javascript integer."); | 64 "fit into a javascript integer."); |
65 DEFINE_FLAG(bool, trace_cha, false, "Trace CHA operations"); | 65 DEFINE_FLAG(bool, trace_cha, false, "Trace CHA operations"); |
66 DEFINE_FLAG(bool, use_field_guards, true, "Guard field cids."); | 66 DEFINE_FLAG(bool, use_field_guards, true, "Guard field cids."); |
67 DEFINE_FLAG(bool, use_lib_cache, true, "Use library name cache"); | 67 DEFINE_FLAG(bool, use_lib_cache, true, "Use library name cache"); |
68 DEFINE_FLAG(bool, trace_field_guards, false, "Trace changes in field's cids."); | 68 DEFINE_FLAG(bool, trace_field_guards, false, "Trace changes in field's cids."); |
| 69 DEFINE_FLAG(bool, ignore_patch_signature_mismatch, false, |
| 70 "Ignore patch file member signature mismatch."); |
69 | 71 |
70 DECLARE_FLAG(charp, coverage_dir); | 72 DECLARE_FLAG(charp, coverage_dir); |
71 DECLARE_FLAG(bool, load_deferred_eagerly); | 73 DECLARE_FLAG(bool, load_deferred_eagerly); |
72 DECLARE_FLAG(bool, show_invisible_frames); | 74 DECLARE_FLAG(bool, show_invisible_frames); |
73 DECLARE_FLAG(bool, trace_compiler); | 75 DECLARE_FLAG(bool, trace_compiler); |
74 DECLARE_FLAG(bool, trace_deoptimization); | 76 DECLARE_FLAG(bool, trace_deoptimization); |
75 DECLARE_FLAG(bool, trace_deoptimization_verbose); | 77 DECLARE_FLAG(bool, trace_deoptimization_verbose); |
76 DECLARE_FLAG(bool, write_protect_code); | 78 DECLARE_FLAG(bool, write_protect_code); |
77 | 79 |
78 | 80 |
(...skipping 2809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2888 func = patch.LookupFunction(member_name); | 2890 func = patch.LookupFunction(member_name); |
2889 if (func.IsNull()) { | 2891 if (func.IsNull()) { |
2890 // Non-patched function is preserved, all patched functions are added in | 2892 // Non-patched function is preserved, all patched functions are added in |
2891 // the loop below. | 2893 // the loop below. |
2892 // However, an implicitly created constructor should not be preserved if | 2894 // However, an implicitly created constructor should not be preserved if |
2893 // the patch provides a constructor or a factory. Wait for now. | 2895 // the patch provides a constructor or a factory. Wait for now. |
2894 if (orig_func.raw() != orig_implicit_ctor.raw()) { | 2896 if (orig_func.raw() != orig_implicit_ctor.raw()) { |
2895 new_functions.Add(orig_func); | 2897 new_functions.Add(orig_func); |
2896 } | 2898 } |
2897 } else if (func.UserVisibleSignature() != | 2899 } else if (func.UserVisibleSignature() != |
2898 orig_func.UserVisibleSignature()) { | 2900 orig_func.UserVisibleSignature() |
| 2901 && !FLAG_ignore_patch_signature_mismatch) { |
2899 // Compare user visible signatures to ignore different implicit parameters | 2902 // Compare user visible signatures to ignore different implicit parameters |
2900 // when patching a constructor with a factory. | 2903 // when patching a constructor with a factory. |
2901 *error = LanguageError::NewFormatted( | 2904 *error = LanguageError::NewFormatted( |
2902 *error, // No previous error. | 2905 *error, // No previous error. |
2903 Script::Handle(patch.script()), | 2906 Script::Handle(patch.script()), |
2904 func.token_pos(), | 2907 func.token_pos(), |
2905 Report::kError, | 2908 Report::kError, |
2906 Heap::kNew, | 2909 Heap::kNew, |
2907 "signature mismatch: '%s'", member_name.ToCString()); | 2910 "signature mismatch: '%s'", member_name.ToCString()); |
2908 return false; | 2911 return false; |
(...skipping 18582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
21491 return tag_label.ToCString(); | 21494 return tag_label.ToCString(); |
21492 } | 21495 } |
21493 | 21496 |
21494 | 21497 |
21495 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 21498 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
21496 Instance::PrintJSONImpl(stream, ref); | 21499 Instance::PrintJSONImpl(stream, ref); |
21497 } | 21500 } |
21498 | 21501 |
21499 | 21502 |
21500 } // namespace dart | 21503 } // namespace dart |
OLD | NEW |