| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/raw_object.h" | 5 #include "vm/raw_object.h" |
| 6 | 6 |
| 7 #include "vm/class_table.h" | 7 #include "vm/class_table.h" |
| 8 #include "vm/dart.h" | 8 #include "vm/dart.h" |
| 9 #include "vm/freelist.h" | 9 #include "vm/freelist.h" |
| 10 #include "vm/isolate.h" | 10 #include "vm/isolate.h" |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 // these handles are not traversed. The use of handles is mainly to | 365 // these handles are not traversed. The use of handles is mainly to |
| 366 // be able to reuse the handle based code and avoid having to add | 366 // be able to reuse the handle based code and avoid having to add |
| 367 // helper functions to the raw object interface. | 367 // helper functions to the raw object interface. |
| 368 Function fn; | 368 Function fn; |
| 369 fn = raw_fun; | 369 fn = raw_fun; |
| 370 | 370 |
| 371 Code code; | 371 Code code; |
| 372 code = fn.CurrentCode(); | 372 code = fn.CurrentCode(); |
| 373 | 373 |
| 374 if (fn.HasCode() && // The function may not have code. | 374 if (fn.HasCode() && // The function may not have code. |
| 375 !fn.is_intrinsic() && // These may not increment the usage counter. |
| 375 !code.is_optimized() && | 376 !code.is_optimized() && |
| 376 (fn.CurrentCode() == fn.unoptimized_code()) && | 377 (fn.CurrentCode() == fn.unoptimized_code()) && |
| 377 !code.HasBreakpoint() && | 378 !code.HasBreakpoint() && |
| 378 (fn.usage_counter() >= 0)) { | 379 (fn.usage_counter() >= 0)) { |
| 379 fn.set_usage_counter(fn.usage_counter() / 2); | 380 fn.set_usage_counter(fn.usage_counter() / 2); |
| 380 if (FLAG_always_drop_code || (fn.usage_counter() == 0)) { | 381 if (FLAG_always_drop_code || (fn.usage_counter() == 0)) { |
| 381 return true; | 382 return true; |
| 382 } | 383 } |
| 383 } | 384 } |
| 384 return false; | 385 return false; |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 829 | 830 |
| 830 intptr_t RawMirrorReference::VisitMirrorReferencePointers( | 831 intptr_t RawMirrorReference::VisitMirrorReferencePointers( |
| 831 RawMirrorReference* raw_obj, ObjectPointerVisitor* visitor) { | 832 RawMirrorReference* raw_obj, ObjectPointerVisitor* visitor) { |
| 832 // Make sure that we got here with the tagged pointer as this. | 833 // Make sure that we got here with the tagged pointer as this. |
| 833 ASSERT(raw_obj->IsHeapObject()); | 834 ASSERT(raw_obj->IsHeapObject()); |
| 834 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 835 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); |
| 835 return MirrorReference::InstanceSize(); | 836 return MirrorReference::InstanceSize(); |
| 836 } | 837 } |
| 837 | 838 |
| 838 } // namespace dart | 839 } // namespace dart |
| OLD | NEW |