OLD | NEW |
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 2375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2386 } | 2386 } |
2387 | 2387 |
2388 | 2388 |
2389 static uword FindPCForTokenPosition(const Code& code, | 2389 static uword FindPCForTokenPosition(const Code& code, |
2390 const CodeSourceMap& code_source_map, | 2390 const CodeSourceMap& code_source_map, |
2391 TokenPosition tp) { | 2391 TokenPosition tp) { |
2392 CodeSourceMap::Iterator it(code_source_map); | 2392 CodeSourceMap::Iterator it(code_source_map); |
2393 | 2393 |
2394 while (it.MoveNext()) { | 2394 while (it.MoveNext()) { |
2395 if (it.TokenPos() == tp) { | 2395 if (it.TokenPos() == tp) { |
2396 return it.PcOffset() + code.EntryPoint(); | 2396 return it.PcOffset() + code.PayloadStart(); |
2397 } | 2397 } |
2398 } | 2398 } |
2399 | 2399 |
2400 return 0; | 2400 return 0; |
2401 } | 2401 } |
2402 | 2402 |
2403 | 2403 |
2404 TEST_CASE(Profiler_GetSourceReport) { | 2404 TEST_CASE(Profiler_GetSourceReport) { |
2405 const char* kScript = | 2405 const char* kScript = |
2406 "doWork(i) => i * i;\n" | 2406 "doWork(i) => i * i;\n" |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2554 EXPECT_SUBSTRING("\"positions\":[\"TempMove\",39]", js.ToCString()); | 2554 EXPECT_SUBSTRING("\"positions\":[\"TempMove\",39]", js.ToCString()); |
2555 // Verify exclusive ticks in main. | 2555 // Verify exclusive ticks in main. |
2556 EXPECT_SUBSTRING("\"exclusiveTicks\":[1,0]", js.ToCString()); | 2556 EXPECT_SUBSTRING("\"exclusiveTicks\":[1,0]", js.ToCString()); |
2557 // Verify inclusive ticks in main. | 2557 // Verify inclusive ticks in main. |
2558 EXPECT_SUBSTRING("\"inclusiveTicks\":[1,2]", js.ToCString()); | 2558 EXPECT_SUBSTRING("\"inclusiveTicks\":[1,2]", js.ToCString()); |
2559 } | 2559 } |
2560 | 2560 |
2561 #endif // !PRODUCT | 2561 #endif // !PRODUCT |
2562 | 2562 |
2563 } // namespace dart | 2563 } // namespace dart |
OLD | NEW |