| 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/isolate.h" | 5 #include "vm/isolate.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "lib/mirrors.h" | 9 #include "lib/mirrors.h" |
| 10 #include "vm/compiler_stats.h" | 10 #include "vm/compiler_stats.h" |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 return 1; | 332 return 1; |
| 333 } else { | 333 } else { |
| 334 return 0; | 334 return 0; |
| 335 } | 335 } |
| 336 } | 336 } |
| 337 | 337 |
| 338 | 338 |
| 339 static void AddFunctionsFromClass(const Class& cls, | 339 static void AddFunctionsFromClass(const Class& cls, |
| 340 GrowableArray<const Function*>* functions) { | 340 GrowableArray<const Function*>* functions) { |
| 341 const Array& class_functions = Array::Handle(cls.functions()); | 341 const Array& class_functions = Array::Handle(cls.functions()); |
| 342 // Class 'Dynamic' is allocated/initialized in a special way, leaving | 342 // Class 'dynamic' is allocated/initialized in a special way, leaving |
| 343 // the functions field NULL instead of empty. | 343 // the functions field NULL instead of empty. |
| 344 const int func_len = class_functions.IsNull() ? 0 : class_functions.Length(); | 344 const int func_len = class_functions.IsNull() ? 0 : class_functions.Length(); |
| 345 for (int j = 0; j < func_len; j++) { | 345 for (int j = 0; j < func_len; j++) { |
| 346 Function& function = Function::Handle(); | 346 Function& function = Function::Handle(); |
| 347 function ^= class_functions.At(j); | 347 function ^= class_functions.At(j); |
| 348 if (function.usage_counter() > 0) { | 348 if (function.usage_counter() > 0) { |
| 349 functions->Add(&function); | 349 functions->Add(&function); |
| 350 } | 350 } |
| 351 } | 351 } |
| 352 } | 352 } |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 | 493 |
| 494 | 494 |
| 495 void Isolate::VisitWeakPersistentHandles(HandleVisitor* visitor, | 495 void Isolate::VisitWeakPersistentHandles(HandleVisitor* visitor, |
| 496 bool visit_prologue_weak_handles) { | 496 bool visit_prologue_weak_handles) { |
| 497 if (api_state() != NULL) { | 497 if (api_state() != NULL) { |
| 498 api_state()->VisitWeakHandles(visitor, visit_prologue_weak_handles); | 498 api_state()->VisitWeakHandles(visitor, visit_prologue_weak_handles); |
| 499 } | 499 } |
| 500 } | 500 } |
| 501 | 501 |
| 502 } // namespace dart | 502 } // namespace dart |
| OLD | NEW |