Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Side by Side Diff: runtime/vm/profiler_service.cc

Issue 1834963002: Don't allocate a new handle unnecessarily (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2521 matching lines...) Expand 10 before | Expand all | Expand 10 after
2532 2532
2533 2533
2534 const char* ProfileTrieWalker::CurrentToken() { 2534 const char* ProfileTrieWalker::CurrentToken() {
2535 if (current_ == NULL) { 2535 if (current_ == NULL) {
2536 return NULL; 2536 return NULL;
2537 } 2537 }
2538 if (code_trie_) { 2538 if (code_trie_) {
2539 return NULL; 2539 return NULL;
2540 } 2540 }
2541 ProfileFunction* func = profile_->GetFunction(current_->table_index()); 2541 ProfileFunction* func = profile_->GetFunction(current_->table_index());
2542 const Function& function = Function::Handle(func->function()->raw()); 2542 const Function& function = *(func->function());
2543 if (function.IsNull()) { 2543 if (function.IsNull()) {
2544 // No function. 2544 // No function.
2545 return NULL; 2545 return NULL;
2546 } 2546 }
2547 const Script& script = Script::Handle(function.script()); 2547 const Script& script = Script::Handle(function.script());
2548 if (script.IsNull()) { 2548 if (script.IsNull()) {
2549 // No script. 2549 // No script.
2550 return NULL; 2550 return NULL;
2551 } 2551 }
2552 const TokenStream& token_stream = TokenStream::Handle(script.tokens()); 2552 const TokenStream& token_stream = TokenStream::Handle(script.tokens());
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
2745 // Disable thread interrupts while processing the buffer. 2745 // Disable thread interrupts while processing the buffer.
2746 DisableThreadInterruptsScope dtis(thread); 2746 DisableThreadInterruptsScope dtis(thread);
2747 2747
2748 ClearProfileVisitor clear_profile(isolate); 2748 ClearProfileVisitor clear_profile(isolate);
2749 sample_buffer->VisitSamples(&clear_profile); 2749 sample_buffer->VisitSamples(&clear_profile);
2750 } 2750 }
2751 2751
2752 #endif // !PRODUCT 2752 #endif // !PRODUCT
2753 2753
2754 } // namespace dart 2754 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698