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

Unified Diff: runtime/vm/object_test.cc

Issue 10831142: Associate the correct type to method receivers (instead of Dynamic type). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
Index: runtime/vm/object_test.cc
===================================================================
--- runtime/vm/object_test.cc (revision 10199)
+++ runtime/vm/object_test.cc (working copy)
@@ -31,12 +31,12 @@
function_name = Symbols::New("foo");
function = Function::New(
function_name, RawFunction::kRegularFunction,
- false, false, false, false, 0);
+ false, false, false, false, cls, 0);
functions.SetAt(0, function);
function_name = Symbols::New("bar");
function = Function::New(
function_name, RawFunction::kRegularFunction,
- false, false, false, false, 0);
+ false, false, false, false, cls, 0);
const int kNumFixedParameters = 2;
const int kNumOptionalParameters = 3;
@@ -47,24 +47,24 @@
function_name = Symbols::New("baz");
function = Function::New(
function_name, RawFunction::kRegularFunction,
- false, false, false, false, 0);
+ false, false, false, false, cls, 0);
functions.SetAt(2, function);
function_name = Symbols::New("Foo");
function = Function::New(
function_name, RawFunction::kRegularFunction,
- true, false, false, false, 0);
+ true, false, false, false, cls, 0);
functions.SetAt(3, function);
function_name = Symbols::New("Bar");
function = Function::New(
function_name, RawFunction::kRegularFunction,
- true, false, false, false, 0);
+ true, false, false, false, cls, 0);
functions.SetAt(4, function);
function_name = Symbols::New("BaZ");
function = Function::New(
function_name, RawFunction::kRegularFunction,
- true, false, false, false, 0);
+ true, false, false, false, cls, 0);
functions.SetAt(5, function);
// Setup the functions in the class.
@@ -185,8 +185,8 @@
// No functions and no super class for the OneFieldClass.
const Array& one_fields = Array::Handle(Array::New(1));
const String& field_name = String::Handle(Symbols::New("the_field"));
- const Field& field =
- Field::Handle(Field::New(field_name, false, false, false, 0));
+ const Field& field = Field::Handle(
+ Field::New(field_name, false, false, false, one_field_class, 0));
one_fields.SetAt(0, field);
one_field_class.SetFields(one_fields);
one_field_class.Finalize();
@@ -2333,7 +2333,7 @@
Function& parent = Function::Handle();
const String& parent_name = String::Handle(Symbols::New("foo_papa"));
parent = Function::New(parent_name, RawFunction::kRegularFunction,
- false, false, false, false, 0);
+ false, false, false, false, cls, 0);
functions.SetAt(0, parent);
cls.SetFunctions(functions);
@@ -2400,10 +2400,14 @@
#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
static Function* CreateFunction(const char* name) {
+ const String& class_name = String::Handle(Symbols::New("ownerClass"));
+ const Script& script = Script::Handle();
+ const Class& owner_class =
+ Class::Handle(Class::New(class_name, script, Scanner::kDummyTokenIndex));
const String& function_name = String::ZoneHandle(Symbols::New(name));
Function& function = Function::ZoneHandle(
Function::New(function_name, RawFunction::kRegularFunction,
- true, false, false, false, 0));
+ true, false, false, false, owner_class, 0));
return &function;
}
@@ -2554,8 +2558,7 @@
const Class& cls = Class::Handle(CreateTestClass("global:"));
const String& field_name = String::Handle(Symbols::New(name));
const Field& field =
- Field::Handle(Field::New(field_name, true, false, false, 0));
- field.set_owner(cls);
+ Field::Handle(Field::New(field_name, true, false, false, cls, 0));
return field.raw();
}
@@ -2585,6 +2588,8 @@
static RawFunction* GetDummyTarget(const char* name) {
const String& function_name = String::Handle(Symbols::New(name));
+ const Class& cls = Class::Handle(
+ Class::New(function_name, Script::Handle(), Scanner::kDummyTokenIndex));
const bool is_static = false;
const bool is_const = false;
const bool is_abstract = false;
@@ -2595,6 +2600,7 @@
is_const,
is_abstract,
is_external,
+ cls,
0);
}

Powered by Google App Engine
This is Rietveld 408576698