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

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

Issue 2686813006: Reapply "Use CodeSourceMap for stack traces (still JIT only)." (Closed)
Patch Set: Created 3 years, 10 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 | « runtime/vm/profiler_service.cc ('k') | runtime/vm/raw_object.h » ('j') | 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 "platform/assert.h" 5 #include "platform/assert.h"
6 6
7 #include "vm/dart_api_impl.h" 7 #include "vm/dart_api_impl.h"
8 #include "vm/dart_api_state.h" 8 #include "vm/dart_api_state.h"
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 #include "vm/profiler.h" 10 #include "vm/profiler.h"
(...skipping 2435 matching lines...) Expand 10 before | Expand all | Expand 10 after
2446 } 2446 }
2447 sample->SetAt(i, 0); 2447 sample->SetAt(i, 0);
2448 } 2448 }
2449 2449
2450 2450
2451 static uword FindPCForTokenPosition(const Code& code, 2451 static uword FindPCForTokenPosition(const Code& code,
2452 TokenPosition tp) { 2452 TokenPosition tp) {
2453 GrowableArray<const Function*> functions; 2453 GrowableArray<const Function*> functions;
2454 GrowableArray<TokenPosition> token_positions; 2454 GrowableArray<TokenPosition> token_positions;
2455 for (intptr_t pc_offset = 0; pc_offset < code.Size(); pc_offset++) { 2455 for (intptr_t pc_offset = 0; pc_offset < code.Size(); pc_offset++) {
2456 code.GetInlinedFunctionsAt(pc_offset, &functions, &token_positions); 2456 code.GetInlinedFunctionsAtInstruction(pc_offset, &functions,
2457 &token_positions);
2457 if (token_positions[0] == tp) { 2458 if (token_positions[0] == tp) {
2458 return code.PayloadStart() + pc_offset; 2459 return code.PayloadStart() + pc_offset;
2459 } 2460 }
2460 } 2461 }
2461 2462
2462 return 0; 2463 return 0;
2463 } 2464 }
2464 2465
2465 2466
2466 TEST_CASE(Profiler_GetSourceReport) { 2467 TEST_CASE(Profiler_GetSourceReport) {
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
2592 EXPECT_SUBSTRING("\"positions\":[\"TempMove\",39]", js.ToCString()); 2593 EXPECT_SUBSTRING("\"positions\":[\"TempMove\",39]", js.ToCString());
2593 // Verify exclusive ticks in main. 2594 // Verify exclusive ticks in main.
2594 EXPECT_SUBSTRING("\"exclusiveTicks\":[1,0]", js.ToCString()); 2595 EXPECT_SUBSTRING("\"exclusiveTicks\":[1,0]", js.ToCString());
2595 // Verify inclusive ticks in main. 2596 // Verify inclusive ticks in main.
2596 EXPECT_SUBSTRING("\"inclusiveTicks\":[1,2]", js.ToCString()); 2597 EXPECT_SUBSTRING("\"inclusiveTicks\":[1,2]", js.ToCString());
2597 } 2598 }
2598 2599
2599 #endif // !PRODUCT 2600 #endif // !PRODUCT
2600 2601
2601 } // namespace dart 2602 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/profiler_service.cc ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698