16void CHA::AddToGuardedClasses(
const Class& cls,
17 intptr_t subclass_count,
18 intptr_t implementor_cid,
20 for (intptr_t
i = 0;
i < guarded_classes_.
length();
i++) {
21 if (guarded_classes_[
i].cls->ptr() == cls.ptr()) {
22 if ((subclass_count >= 0) && (guarded_classes_[
i].subclass_count == -1)) {
23 guarded_classes_[
i].subclass_count = subclass_count;
27 guarded_classes_[
i].implementor_cid = implementor_cid;
29 if (track_future && !guarded_classes_[
i].track_future) {
30 guarded_classes_[
i].track_future = track_future;
36 subclass_count, implementor_cid, track_future};
41 intptr_t subclass_count) {
42 ASSERT(subclass_count >= 0);
43 AddToGuardedClasses(cls, subclass_count,
kIllegalCid,
false);
47 intptr_t implementor_cid) {
50 AddToGuardedClasses(cls, -1, implementor_cid,
false);
58 for (intptr_t
i = 0;
i < guarded_classes_.
length(); ++
i) {
59 if (guarded_classes_[
i].cls->id() ==
cid)
return true;
84 return !direct_subclasses.
IsNull() && (direct_subclasses.
Length() > 0);
100 class_ids->
Add(cls.
id());
105 ASSERT(FLAG_precompiled_mode);
108 if (direct_subclasses.
IsNull()) {
112 for (intptr_t
i = 0;
i < direct_subclasses.
Length();
i++) {
113 subclass ^= direct_subclasses.
At(
i);
133 intptr_t* implementation_cid) {
144 if (FLAG_trace_cha) {
145 THR_Print(
" **(CHA) Type has one implementation: %s\n",
148 if (FLAG_use_cha_deopt) {
152 *implementation_cid =
cid;
172 if (FLAG_use_cha_deopt) {
189 for (intptr_t
i = 0;
i < cls_direct_subclasses.
Length();
i++) {
190 direct_subclass ^= cls_direct_subclasses.
At(
i);
203 for (intptr_t
i = 0;
i < guarded_classes_.
length();
i++) {
204 if (guarded_classes_[
i].subclass_count != -1) {
205 intptr_t current_subclass_count =
207 if (guarded_classes_[
i].subclass_count != current_subclass_count) {
211 if (guarded_classes_[
i].implementor_cid !=
kIllegalCid) {
212 intptr_t current_implementor_cid =
213 guarded_classes_[
i].cls->implementor_cid();
214 if (guarded_classes_[
i].implementor_cid != current_implementor_cid) {
218 if (guarded_classes_[
i].track_future) {
219 if (guarded_classes_[
i].cls->can_be_future()) {
229 intptr_t* subclasses_count) {
245 if (cls_direct_subclasses.
IsNull()) {
249 for (intptr_t
i = 0;
i < cls_direct_subclasses.
Length();
i++) {
250 direct_subclass ^= cls_direct_subclasses.
At(
i);
266 (*subclasses_count)++;
273 for (intptr_t
i = 0;
i < guarded_classes_.
length(); ++
i) {
274 guarded_classes_[
i].cls->RegisterCHACode(
code);
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
bool HasOverride(const Class &cls, const String &function_name, intptr_t *subclass_count)
void AddToGuardedClassesForImplementorCid(const Class &cls, intptr_t implementor_cid)
void RegisterDependencies(const Code &code) const
static bool IsImplemented(const Class &cls)
bool IsGuardedClass(intptr_t cid) const
static bool HasSubclasses(const Class &cls)
void AddToGuardedClassesForSubclassCount(const Class &cls, intptr_t subclass_count)
static bool ConcreteSubclasses(const Class &cls, GrowableArray< intptr_t > *class_ids)
void AddToGuardedClassesToTrackFuture(const Class &cls)
static bool ClassCanBeFuture(const Class &cls)
bool IsConsistentWithCurrentHierarchy() const
static bool HasSingleConcreteImplementation(const Class &interface, intptr_t *implementation_cid)
ClassPtr At(intptr_t cid) const
bool has_dynamically_extendable_subtypes() const
bool can_be_future() const
GrowableObjectArrayPtr direct_subclasses() const
bool IsObjectClass() const
intptr_t implementor_cid() const
FunctionPtr LookupDynamicFunctionUnsafe(const String &name) const
GrowableObjectArrayPtr direct_subclasses_unsafe() const
bool is_implemented() const
bool is_finalized() const
ObjectPtr At(intptr_t index) const
bool all_classes_finalized() const
SafepointRwLock * program_lock()
ClassTable * class_table() const
bool InVMIsolateHeap() const
virtual const char * ToCString() const
static Object & ZoneHandle()
static Thread * Current()
CompilerState & compiler_state()
IsolateGroup * isolate_group() const
#define THR_Print(format,...)
static intptr_t CountFinalizedSubclasses(Thread *thread, const Class &cls)
bool IsInternalOnlyClassId(intptr_t index)
const char *const function_name