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

Unified Diff: runtime/vm/object.cc

Issue 16286002: Simplyfy the NumTypeArguments check. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 23504)
+++ runtime/vm/object.cc (working copy)
@@ -976,6 +976,7 @@
// Set the super type of class Stacktrace to Object type so that the
// 'toString' method is implemented.
cls = object_store->stacktrace_class();
+ type = object_store->object_type();
cls.set_super_type(type);
// Note: The abstract class Function is represented by VM class
@@ -1586,13 +1587,14 @@
intptr_t Class::NumTypeArguments() const {
// To work properly, this call requires the super class of this class to be
// resolved, which is checked by the SuperClass() call.
- Class& cls = Class::Handle(raw());
+ Isolate* isolate = Isolate::Current();
+ Class& cls = Class::Handle(isolate, raw());
intptr_t num_type_args = 0;
do {
if (cls.IsSignatureClass()) {
const Function& signature_fun =
- Function::Handle(cls.signature_function());
+ Function::Handle(isolate, cls.signature_function());
if (!signature_fun.is_static() &&
!signature_fun.HasInstantiatedSignature()) {
cls = signature_fun.Owner();
@@ -1600,7 +1602,8 @@
}
num_type_args += cls.NumTypeParameters();
// Object is its own super class during bootstrap.
Ivan Posva 2013/06/01 01:10:34 Why does Object have to be its own super class dur
siva 2013/06/03 17:43:38 Not sure, I will have to wait for Regis to answer
regis 2013/06/10 15:19:35 I do not think we have to set the super_type of cl
siva 2013/06/11 00:34:02 If I remove the setting in parser.cc during parsin
regis 2013/06/11 11:51:14 Sorry, I was not clear. Classes that do not speci
- if (cls.SuperClass() == Class::null() || cls.SuperClass() == cls.raw()) {
+ if (cls.super_type() == Type::null() ||
+ cls.super_type() == isolate->object_store()->object_type()) {
break;
}
cls = cls.SuperClass();
@@ -1621,10 +1624,10 @@
RawClass* Class::SuperClass() const {
- const AbstractType& sup_type = AbstractType::Handle(super_type());
- if (sup_type.IsNull()) {
+ if (super_type() == Type::null()) {
return Class::null();
}
+ const AbstractType& sup_type = AbstractType::Handle(super_type());
return sup_type.type_class();
}
@@ -6890,10 +6893,11 @@
RawObject* Namespace::Lookup(const String& name) const {
- const Library& lib = Library::Handle(library());
+ Isolate* isolate = Isolate::Current();
+ const Library& lib = Library::Handle(isolate, library());
intptr_t ignore = 0;
// Lookup the name in the library's symbols.
- Object& obj = Object::Handle(lib.LookupEntry(name, &ignore));
+ Object& obj = Object::Handle(isolate, lib.LookupEntry(name, &ignore));
if (obj.IsNull()) {
// Lookup in the re-exported symbols.
obj = lib.LookupExport(name);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698