Chromium Code Reviews| Index: runtime/vm/object.cc |
| diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc |
| index 0942260d56cc401155ddb08d7594c8034e9a841b..27bd84c533fee0f6710b90a7f76f86da3ceb7165 100644 |
| --- a/runtime/vm/object.cc |
| +++ b/runtime/vm/object.cc |
| @@ -2797,9 +2797,10 @@ static bool IsMutatorOrAtSafepoint() { |
| } |
| #endif |
| + |
| void Class::RegisterCHACode(const Code& code) { |
| if (FLAG_trace_cha) { |
| - THR_Print("RegisterCHACode %s class %s\n", |
| + THR_Print("RegisterCHACode '%s' depends on class '%s'\n", |
| Function::Handle(code.function()).ToQualifiedCString(), ToCString()); |
| } |
| DEBUG_ASSERT(IsMutatorOrAtSafepoint()); |
| @@ -2809,10 +2810,15 @@ void Class::RegisterCHACode(const Code& code) { |
| } |
| -void Class::DisableCHAOptimizedCode() { |
| +void Class::DisableCHAOptimizedCode(const Class& subclass) { |
| ASSERT(Thread::Current()->IsMutatorThread()); |
| CHACodeArray a(*this); |
| - a.DisableCode(); |
|
Florian Schneider
2016/01/04 11:31:38
What about the other call-sites of DisableCode()?
|
| + if (a.HasCodes()) { |
|
Florian Schneider
2016/01/04 11:31:38
If you always check HasCodes before calling Disabl
srdjan
2016/01/04 18:29:53
What I really meant to do (and changed it to):
|
| + if (FLAG_trace_deoptimization) { |
| + THR_Print("Adding subclass %s\n", subclass.ToCString()); |
| + } |
| + a.DisableCode(); |
| + } |
| } |
| @@ -5820,7 +5826,7 @@ bool Function::IsOptimizable() const { |
| ((end_token_pos() - token_pos()) < FLAG_huge_method_cutoff_in_tokens)) { |
| // Additional check needed for implicit getters. |
| return (unoptimized_code() == Object::null()) || |
| - (Code::Handle(unoptimized_code()).Size() < |
| + (Code::Handle(unoptimized_code()).Size() < |
| FLAG_huge_method_cutoff_in_code_size); |
| } |
| return false; |
| @@ -5837,6 +5843,7 @@ void Function::SetIsOptimizable(bool value) const { |
| set_is_optimizable(value); |
| if (!value) { |
| set_is_inlinable(false); |
| + set_usage_counter(INT_MIN); |
| } |
| } |