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

Side by Side Diff: runtime/vm/debugger.cc

Issue 19662003: Refactor resolution code in the vm to properly handle ambiguity errors. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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/dart_entry_test.cc ('k') | runtime/vm/exceptions.cc » ('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/debugger.h" 5 #include "vm/debugger.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 8
9 #include "vm/code_generator.h" 9 #include "vm/code_generator.h"
10 #include "vm/code_patcher.h" 10 #include "vm/code_patcher.h"
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after
803 } 803 }
804 // Signal isolate shutdown event. 804 // Signal isolate shutdown event.
805 SignalIsolateEvent(Debugger::kIsolateShutdown); 805 SignalIsolateEvent(Debugger::kIsolateShutdown);
806 } 806 }
807 807
808 808
809 static RawFunction* ResolveLibraryFunction( 809 static RawFunction* ResolveLibraryFunction(
810 const Library& library, 810 const Library& library,
811 const String& fname) { 811 const String& fname) {
812 ASSERT(!library.IsNull()); 812 ASSERT(!library.IsNull());
813 const Object& object = Object::Handle(library.LookupObject(fname)); 813 String& ambiguity_error_msg = String::Handle();
814 const Object& object = Object::Handle(
815 library.LookupObject(fname, &ambiguity_error_msg));
814 if (!object.IsNull() && object.IsFunction()) { 816 if (!object.IsNull() && object.IsFunction()) {
815 return Function::Cast(object).raw(); 817 return Function::Cast(object).raw();
816 } 818 }
817 return Function::null(); 819 return Function::null();
818 } 820 }
819 821
820 void Debugger::SetSingleStep() { 822 void Debugger::SetSingleStep() {
821 isolate_->set_single_step(true); 823 isolate_->set_single_step(true);
822 resume_action_ = kSingleStep; 824 resume_action_ = kSingleStep;
823 } 825 }
(...skipping 10 matching lines...) Expand all
834 836
835 RawFunction* Debugger::ResolveFunction(const Library& library, 837 RawFunction* Debugger::ResolveFunction(const Library& library,
836 const String& class_name, 838 const String& class_name,
837 const String& function_name) { 839 const String& function_name) {
838 ASSERT(!library.IsNull()); 840 ASSERT(!library.IsNull());
839 ASSERT(!class_name.IsNull()); 841 ASSERT(!class_name.IsNull());
840 ASSERT(!function_name.IsNull()); 842 ASSERT(!function_name.IsNull());
841 if (class_name.Length() == 0) { 843 if (class_name.Length() == 0) {
842 return ResolveLibraryFunction(library, function_name); 844 return ResolveLibraryFunction(library, function_name);
843 } 845 }
844 const Class& cls = Class::Handle(library.LookupClass(class_name)); 846 String& ambiguity_error_msg = String::Handle();
847 const Class& cls = Class::Handle(
848 library.LookupClass(class_name, &ambiguity_error_msg));
845 Function& function = Function::Handle(); 849 Function& function = Function::Handle();
846 if (!cls.IsNull()) { 850 if (!cls.IsNull()) {
847 function = cls.LookupStaticFunction(function_name); 851 function = cls.LookupStaticFunction(function_name);
848 if (function.IsNull()) { 852 if (function.IsNull()) {
849 function = cls.LookupDynamicFunction(function_name); 853 function = cls.LookupDynamicFunction(function_name);
850 } 854 }
851 } 855 }
852 return function.raw(); 856 return function.raw();
853 } 857 }
854 858
(...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after
1860 } 1864 }
1861 1865
1862 1866
1863 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { 1867 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) {
1864 ASSERT(bpt->next() == NULL); 1868 ASSERT(bpt->next() == NULL);
1865 bpt->set_next(code_breakpoints_); 1869 bpt->set_next(code_breakpoints_);
1866 code_breakpoints_ = bpt; 1870 code_breakpoints_ = bpt;
1867 } 1871 }
1868 1872
1869 } // namespace dart 1873 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart_entry_test.cc ('k') | runtime/vm/exceptions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698