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

Unified Diff: runtime/vm/cha.h

Issue 463103002: Fix bug with CHA dependencies by recording a set of classes for registering code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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
« no previous file with comments | « no previous file | runtime/vm/cha.cc » ('j') | runtime/vm/cha.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/cha.h
===================================================================
--- runtime/vm/cha.h (revision 39070)
+++ runtime/vm/cha.h (working copy)
@@ -6,6 +6,7 @@
#define VM_CHA_H_
#include "vm/allocation.h"
+#include "vm/growable_array.h"
namespace dart {
@@ -14,33 +15,41 @@
template <typename T> class ZoneGrowableArray;
class String;
-class CHA : public AllStatic {
+class CHA : public StackResource {
public:
+ explicit CHA(Isolate* isolate)
+ : StackResource(isolate),
+ isolate_(isolate),
+ cha_classes_(isolate, 1),
+ previous_(isolate->cha()) {
+ isolate->set_cha(this);
+ }
+
+ ~CHA() {
+ ASSERT(isolate_->cha() == this);
+ isolate_->set_cha(previous_);
+ }
+
// Returns true if the class given by its cid has subclasses.
- static bool HasSubclasses(intptr_t cid);
+ bool HasSubclasses(intptr_t cid);
// Use only on known private classes that can never be subclassed by lazy
// class finalization. Does not affect Isolate::use_cha flag.
- static bool HasSubclassesSafe(intptr_t cid);
+ bool HasSubclassesSafe(intptr_t cid);
- // Returns an array containing the cids of the direct and indirect subclasses
- // of the class given by its cid.
- // Must not be called for kInstanceCid.
- static ZoneGrowableArray<intptr_t>* GetSubclassIdsOf(intptr_t cid);
Florian Schneider 2014/08/12 11:37:10 I removed these methods since are never used (exce
+ // Returns true if any subclass of 'cls' contains the function.
+ bool HasOverride(const Class& cls, const String& function_name);
- // Returns an array containing instance functions of the given name and
- // belonging to the classes given by their cids.
- // Cids must not contain kInstanceCid.
- static ZoneGrowableArray<Function*>* GetNamedInstanceFunctionsOf(
- const ZoneGrowableArray<intptr_t>& cids,
- const String& function_name);
+ const GrowableArray<Class*>& cha_classes() const {
+ return cha_classes_;
+ }
- // Returns an array of functions overriding the given function.
- // Must not be called for a function of class Object.
- static ZoneGrowableArray<Function*>* GetOverridesOf(const Function& function);
+ private:
+ void AddToCHAClasses(Class* cls);
- // Returns true if any subclass of 'cls' contains the function.
- static bool HasOverride(const Class& cls, const String& function_name);
+ Isolate* isolate_;
+ GrowableArray<Class*> cha_classes_;
+ CHA* previous_;
};
} // namespace dart
« no previous file with comments | « no previous file | runtime/vm/cha.cc » ('j') | runtime/vm/cha.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698