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

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

Issue 1723733002: Simplify various name flavors in VM. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: address what was discussed in meeting 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
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/native_symbol.h" 8 #include "vm/native_symbol.h"
9 #include "vm/object.h" 9 #include "vm/object.h"
10 #include "vm/os.h" 10 #include "vm/os.h"
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 ProfileFunction* function = NULL; 546 ProfileFunction* function = NULL;
547 if ((kind() == kReusedCode) || (kind() == kCollectedCode)) { 547 if ((kind() == kReusedCode) || (kind() == kCollectedCode)) {
548 if (name() == NULL) { 548 if (name() == NULL) {
549 // Lazily set generated name. 549 // Lazily set generated name.
550 GenerateAndSetSymbolName("[Collected]"); 550 GenerateAndSetSymbolName("[Collected]");
551 } 551 }
552 // Map these to a canonical unknown function. 552 // Map these to a canonical unknown function.
553 function = table->GetUnknown(); 553 function = table->GetUnknown();
554 } else if (kind() == kDartCode) { 554 } else if (kind() == kDartCode) {
555 ASSERT(!code_.IsNull()); 555 ASSERT(!code_.IsNull());
556 const String& name = String::Handle(code_.QualifiedName());
556 const Object& obj = Object::Handle(code_.owner()); 557 const Object& obj = Object::Handle(code_.owner());
557 if (obj.IsFunction()) { 558 if (obj.IsFunction()) {
558 const String& user_name = String::Handle(code_.PrettyName());
559 function = table->LookupOrAdd(Function::Cast(obj)); 559 function = table->LookupOrAdd(Function::Cast(obj));
560 SetName(user_name.ToCString()); 560 SetName(name.ToCString());
561 } else { 561 } else {
562 // A stub. 562 // A stub.
563 const String& user_name = String::Handle(code_.PrettyName()); 563 function = table->AddStub(start(), name.ToCString());
564 function = table->AddStub(start(), user_name.ToCString()); 564 SetName(name.ToCString());
565 SetName(user_name.ToCString());
566 } 565 }
567 } else if (kind() == kNativeCode) { 566 } else if (kind() == kNativeCode) {
568 if (name() == NULL) { 567 if (name() == NULL) {
569 // Lazily set generated name. 568 // Lazily set generated name.
570 GenerateAndSetSymbolName("[Native]"); 569 GenerateAndSetSymbolName("[Native]");
571 } 570 }
572 function = table->AddNative(start(), name()); 571 function = table->AddNative(start(), name());
573 } else if (kind() == kTagCode) { 572 } else if (kind() == kTagCode) {
574 if (name() == NULL) { 573 if (name() == NULL) {
575 if (UserTags::IsUserTag(start())) { 574 if (UserTags::IsUserTag(start())) {
(...skipping 1829 matching lines...) Expand 10 before | Expand all | Expand 10 after
2405 // Disable thread interrupts while processing the buffer. 2404 // Disable thread interrupts while processing the buffer.
2406 DisableThreadInterruptsScope dtis(thread); 2405 DisableThreadInterruptsScope dtis(thread);
2407 2406
2408 ClearProfileVisitor clear_profile(isolate); 2407 ClearProfileVisitor clear_profile(isolate);
2409 sample_buffer->VisitSamples(&clear_profile); 2408 sample_buffer->VisitSamples(&clear_profile);
2410 } 2409 }
2411 2410
2412 #endif // !PRODUCT 2411 #endif // !PRODUCT
2413 2412
2414 } // namespace dart 2413 } // namespace dart
OLDNEW
« runtime/vm/object.cc ('K') | « runtime/vm/parser.cc ('k') | runtime/vm/simulator_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698