OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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/profiler_service.h" | 5 #include "vm/profiler_service.h" |
6 | 6 |
7 #include "vm/growable_array.h" | 7 #include "vm/growable_array.h" |
8 #include "vm/hash_map.h" | 8 #include "vm/hash_map.h" |
9 #include "vm/log.h" | 9 #include "vm/log.h" |
10 #include "vm/native_symbol.h" | 10 #include "vm/native_symbol.h" |
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 ASSERT(!function.IsNull()); | 535 ASSERT(!function.IsNull()); |
536 ProfileFunction* profile_function = Lookup(function); | 536 ProfileFunction* profile_function = Lookup(function); |
537 if (profile_function != NULL) { | 537 if (profile_function != NULL) { |
538 return profile_function; | 538 return profile_function; |
539 } | 539 } |
540 return Add(function); | 540 return Add(function); |
541 } | 541 } |
542 | 542 |
543 ProfileFunction* Lookup(const Function& function) { | 543 ProfileFunction* Lookup(const Function& function) { |
544 ASSERT(!function.IsNull()); | 544 ASSERT(!function.IsNull()); |
545 return function_hash_.Lookup(&function); | 545 return function_hash_.LookupValue(&function); |
546 } | 546 } |
547 | 547 |
548 ProfileFunction* GetUnknown() { | 548 ProfileFunction* GetUnknown() { |
549 ASSERT(unknown_function_ != NULL); | 549 ASSERT(unknown_function_ != NULL); |
550 return unknown_function_; | 550 return unknown_function_; |
551 } | 551 } |
552 | 552 |
553 // No protection against being called more than once for the same tag_id. | 553 // No protection against being called more than once for the same tag_id. |
554 ProfileFunction* AddTag(uword tag_id, const char* name) { | 554 ProfileFunction* AddTag(uword tag_id, const char* name) { |
555 // TODO(johnmccutchan): Canonicalize ProfileFunctions for tags. | 555 // TODO(johnmccutchan): Canonicalize ProfileFunctions for tags. |
(...skipping 2304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2860 // Disable thread interrupts while processing the buffer. | 2860 // Disable thread interrupts while processing the buffer. |
2861 DisableThreadInterruptsScope dtis(thread); | 2861 DisableThreadInterruptsScope dtis(thread); |
2862 | 2862 |
2863 ClearProfileVisitor clear_profile(isolate); | 2863 ClearProfileVisitor clear_profile(isolate); |
2864 sample_buffer->VisitSamples(&clear_profile); | 2864 sample_buffer->VisitSamples(&clear_profile); |
2865 } | 2865 } |
2866 | 2866 |
2867 #endif // !PRODUCT | 2867 #endif // !PRODUCT |
2868 | 2868 |
2869 } // namespace dart | 2869 } // namespace dart |
OLD | NEW |