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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 19200002: Change resolving of instance methods to check early for name mismatch. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/dart_entry.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
===================================================================
--- runtime/vm/dart_api_impl.cc (revision 25039)
+++ runtime/vm/dart_api_impl.cc (working copy)
@@ -1874,13 +1874,17 @@
return Api::NewError("Object does not implement the List interface");
}
const String& name = String::Handle(Field::GetterName(Symbols::Length()));
+ const int kNumArgs = 1;
+ ArgumentsDescriptor args_desc(
+ Array::Handle(ArgumentsDescriptor::New(kNumArgs)));
const Function& function =
- Function::Handle(isolate, Resolver::ResolveDynamic(instance, name, 1, 0));
+ Function::Handle(isolate, Resolver::ResolveDynamic(instance,
+ name,
+ args_desc));
if (function.IsNull()) {
return Api::NewError("List object does not have a 'length' field.");
}
- const int kNumArgs = 1;
const Array& args = Array::Handle(isolate, Array::New(kNumArgs));
args.SetAt(0, instance); // Set up the receiver as the first argument.
const Object& retval =
@@ -1940,11 +1944,13 @@
const Instance& instance =
Instance::Handle(isolate, GetListInstance(isolate, obj));
if (!instance.IsNull()) {
+ const int kNumArgs = 2;
+ ArgumentsDescriptor args_desc(
+ Array::Handle(ArgumentsDescriptor::New(kNumArgs)));
const Function& function = Function::Handle(
isolate,
- Resolver::ResolveDynamic(instance, Symbols::IndexToken(), 2, 0));
+ Resolver::ResolveDynamic(instance, Symbols::IndexToken(), args_desc));
if (!function.IsNull()) {
- const int kNumArgs = 2;
const Array& args = Array::Handle(isolate, Array::New(kNumArgs));
const Integer& indexobj = Integer::Handle(isolate, Integer::New(index));
args.SetAt(0, instance);
@@ -1992,12 +1998,14 @@
const Instance& instance =
Instance::Handle(isolate, GetListInstance(isolate, obj));
if (!instance.IsNull()) {
+ const intptr_t kNumArgs = 3;
+ ArgumentsDescriptor args_desc(
+ Array::Handle(ArgumentsDescriptor::New(kNumArgs)));
const Function& function = Function::Handle(
isolate,
Resolver::ResolveDynamic(instance,
Symbols::AssignIndexToken(),
- 3,
- 0));
+ args_desc));
if (!function.IsNull()) {
const Integer& index_obj =
Integer::Handle(isolate, Integer::New(index));
@@ -2006,7 +2014,6 @@
if (!value_obj.IsNull() && !value_obj.IsInstance()) {
RETURN_TYPE_ERROR(isolate, value, Instance);
}
- const intptr_t kNumArgs = 3;
const Array& args = Array::Handle(isolate, Array::New(kNumArgs));
args.SetAt(0, instance);
args.SetAt(1, index_obj);
@@ -2165,13 +2172,15 @@
const Instance& instance =
Instance::Handle(isolate, GetListInstance(isolate, obj));
if (!instance.IsNull()) {
+ const int kNumArgs = 2;
+ ArgumentsDescriptor args_desc(
+ Array::Handle(ArgumentsDescriptor::New(kNumArgs)));
const Function& function = Function::Handle(
isolate,
- Resolver::ResolveDynamic(instance, Symbols::IndexToken(), 2, 0));
+ Resolver::ResolveDynamic(instance, Symbols::IndexToken(), args_desc));
if (!function.IsNull()) {
Object& result = Object::Handle(isolate);
Integer& intobj = Integer::Handle(isolate);
- const int kNumArgs = 2;
const Array& args = Array::Handle(isolate, Array::New(kNumArgs));
args.SetAt(0, instance); // Set up the receiver as the first argument.
for (int i = 0; i < length; i++) {
@@ -2260,16 +2269,17 @@
const Instance& instance =
Instance::Handle(isolate, GetListInstance(isolate, obj));
if (!instance.IsNull()) {
+ const int kNumArgs = 3;
+ ArgumentsDescriptor args_desc(
+ Array::Handle(ArgumentsDescriptor::New(kNumArgs)));
const Function& function = Function::Handle(
isolate,
Resolver::ResolveDynamic(instance,
Symbols::AssignIndexToken(),
- 3,
- 0));
+ args_desc));
if (!function.IsNull()) {
Integer& indexobj = Integer::Handle(isolate);
Integer& valueobj = Integer::Handle(isolate);
- const int kNumArgs = 3;
const Array& args = Array::Handle(isolate, Array::New(kNumArgs));
args.SetAt(0, instance); // Set up the receiver as the first argument.
for (int i = 0; i < length; i++) {
@@ -2957,12 +2967,11 @@
} else if (obj.IsNull() || obj.IsInstance()) {
Instance& instance = Instance::Handle(isolate);
instance ^= obj.raw();
+ ArgumentsDescriptor args_desc(
+ Array::Handle(ArgumentsDescriptor::New(number_of_arguments + 1)));
const Function& function = Function::Handle(
isolate,
- Resolver::ResolveDynamic(instance,
- function_name,
- (number_of_arguments + 1),
- Resolver::kIsQualified));
+ Resolver::ResolveDynamic(instance, function_name, args_desc));
args.SetAt(0, instance);
if (function.IsNull()) {
const Array& args_descriptor =
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/dart_entry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698