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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 // helper functions to the raw object interface. | 382 // helper functions to the raw object interface. |
383 Function fn; | 383 Function fn; |
384 fn = raw_fun; | 384 fn = raw_fun; |
385 | 385 |
386 Code code; | 386 Code code; |
387 code = fn.CurrentCode(); | 387 code = fn.CurrentCode(); |
388 | 388 |
389 if (!code.IsNull() && // The function may not have code. | 389 if (!code.IsNull() && // The function may not have code. |
390 !code.is_optimized() && | 390 !code.is_optimized() && |
391 (fn.CurrentCode() == fn.unoptimized_code()) && | 391 (fn.CurrentCode() == fn.unoptimized_code()) && |
392 !fn.HasBreakpoint() && | 392 !code.HasBreakpoint() && |
393 (fn.usage_counter() >= 0)) { | 393 (fn.usage_counter() >= 0)) { |
394 fn.set_usage_counter(fn.usage_counter() / 2); | 394 fn.set_usage_counter(fn.usage_counter() / 2); |
395 if (FLAG_always_drop_code || (fn.usage_counter() == 0)) { | 395 if (FLAG_always_drop_code || (fn.usage_counter() == 0)) { |
396 return true; | 396 return true; |
397 } | 397 } |
398 } | 398 } |
399 return false; | 399 return false; |
400 } | 400 } |
401 | 401 |
402 | 402 |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
843 | 843 |
844 intptr_t RawMirrorReference::VisitMirrorReferencePointers( | 844 intptr_t RawMirrorReference::VisitMirrorReferencePointers( |
845 RawMirrorReference* raw_obj, ObjectPointerVisitor* visitor) { | 845 RawMirrorReference* raw_obj, ObjectPointerVisitor* visitor) { |
846 // Make sure that we got here with the tagged pointer as this. | 846 // Make sure that we got here with the tagged pointer as this. |
847 ASSERT(raw_obj->IsHeapObject()); | 847 ASSERT(raw_obj->IsHeapObject()); |
848 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 848 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); |
849 return MirrorReference::InstanceSize(); | 849 return MirrorReference::InstanceSize(); |
850 } | 850 } |
851 | 851 |
852 } // namespace dart | 852 } // namespace dart |
OLD | NEW |