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

Unified Diff: runtime/vm/object.cc

Issue 10832401: Gentle start with removing explicit interfaces (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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.cc
===================================================================
--- runtime/vm/object.cc (revision 11079)
+++ runtime/vm/object.cc (working copy)
@@ -752,15 +752,19 @@
cls = object_store->stacktrace_class();
cls.set_super_type(type);
- cls = CreateAndRegisterInterface("Function", script, core_lib);
+ name = Symbols::Function();
+ cls = Class::New(name, script, Scanner::kDummyTokenIndex);
+ core_lib.AddClass(cls);
pending_classes.Add(cls, Heap::kOld);
type = Type::NewNonParameterizedType(cls);
- object_store->set_function_interface(type);
+ object_store->set_function_type(type);
- cls = CreateAndRegisterInterface("num", script, core_lib);
+ name = Symbols::New("num");
siva 2012/08/21 21:22:06 why not make "num" also a predefined symbol in the
hausner 2012/08/23 00:25:06 Done.
+ cls = Class::New(name, script, Scanner::kDummyTokenIndex);
+ core_lib.AddClass(cls);
pending_classes.Add(cls, Heap::kOld);
type = Type::NewNonParameterizedType(cls);
- object_store->set_number_interface(type);
+ object_store->set_number_type(type);
cls = CreateAndRegisterInterface("int", script, core_lib);
pending_classes.Add(cls, Heap::kOld);
@@ -1737,9 +1741,9 @@
result.set_type_arguments_instance_field_offset(
Closure::type_arguments_offset());
// Implements interface "Function".
- const Type& function_interface = Type::Handle(Type::FunctionInterface());
+ const Type& function_type = Type::Handle(Type::Function());
const Array& interfaces = Array::Handle(Array::New(1, Heap::kOld));
- interfaces.SetAt(0, function_interface);
+ interfaces.SetAt(0, function_type);
result.set_interfaces(interfaces);
// Unless the signature function already has a signature class, create a
// canonical signature class by having the signature function point back to
@@ -2569,9 +2573,9 @@
}
-bool AbstractType::IsNumberInterface() const {
+bool AbstractType::IsNumber() const {
return HasResolvedTypeClass() &&
- (type_class() == Type::Handle(Type::NumberInterface()).type_class());
+ (type_class() == Type::Handle(Type::Number()).type_class());
}
@@ -2581,9 +2585,9 @@
}
-bool AbstractType::IsFunctionInterface() const {
+bool AbstractType::IsFunction() const {
return HasResolvedTypeClass() &&
- (type_class() == Type::Handle(Type::FunctionInterface()).type_class());
+ (type_class() == Type::Handle(Type::Function()).type_class());
}
@@ -2699,8 +2703,8 @@
}
-RawType* Type::NumberInterface() {
- return Isolate::Current()->object_store()->number_interface();
+RawType* Type::Number() {
+ return Isolate::Current()->object_store()->number_type();
}
@@ -2709,8 +2713,8 @@
}
-RawType* Type::FunctionInterface() {
- return Isolate::Current()->object_store()->function_interface();
+RawType* Type::Function() {
+ return Isolate::Current()->object_store()->function_type();
}

Powered by Google App Engine
This is Rietveld 408576698