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/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 1858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1869 // Check VM isolate for pc. | 1869 // Check VM isolate for pc. |
1870 if (vm_isolate_->heap()->CodeContains(pc)) { | 1870 if (vm_isolate_->heap()->CodeContains(pc)) { |
1871 code ^= Code::LookupCodeInVmIsolate(pc); | 1871 code ^= Code::LookupCodeInVmIsolate(pc); |
1872 if (!code.IsNull()) { | 1872 if (!code.IsNull()) { |
1873 return new ProfileCode(ProfileCode::kDartCode, | 1873 return new ProfileCode(ProfileCode::kDartCode, |
1874 code.EntryPoint(), | 1874 code.EntryPoint(), |
1875 code.EntryPoint() + code.Size(), | 1875 code.EntryPoint() + code.Size(), |
1876 code.compile_timestamp(), | 1876 code.compile_timestamp(), |
1877 code); | 1877 code); |
1878 } | 1878 } |
| 1879 // Precompiled instructions are in the VM isolate, but the code (except |
| 1880 // stubs) is in the current isolate. |
| 1881 code ^= Code::LookupCode(pc); |
| 1882 if (!code.IsNull()) { |
| 1883 return new ProfileCode(ProfileCode::kDartCode, |
| 1884 code.EntryPoint(), |
| 1885 code.EntryPoint() + code.Size(), |
| 1886 code.compile_timestamp(), |
| 1887 code); |
| 1888 } |
1879 return new ProfileCode(ProfileCode::kCollectedCode, | 1889 return new ProfileCode(ProfileCode::kCollectedCode, |
1880 pc, | 1890 pc, |
1881 (pc & kDartCodeAlignmentMask) + kDartCodeAlignment, | 1891 (pc & kDartCodeAlignmentMask) + kDartCodeAlignment, |
1882 0, | 1892 0, |
1883 code); | 1893 code); |
1884 } | 1894 } |
1885 | 1895 |
1886 // Check NativeSymbolResolver for pc. | 1896 // Check NativeSymbolResolver for pc. |
1887 uintptr_t native_start = 0; | 1897 uintptr_t native_start = 0; |
1888 char* native_name = NativeSymbolResolver::LookupSymbolName(pc, | 1898 char* native_name = NativeSymbolResolver::LookupSymbolName(pc, |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2292 ASSERT(sample_buffer != NULL); | 2302 ASSERT(sample_buffer != NULL); |
2293 | 2303 |
2294 ClearProfileVisitor clear_profile(isolate); | 2304 ClearProfileVisitor clear_profile(isolate); |
2295 sample_buffer->VisitSamples(&clear_profile); | 2305 sample_buffer->VisitSamples(&clear_profile); |
2296 | 2306 |
2297 // Enable profile interrupts. | 2307 // Enable profile interrupts. |
2298 Profiler::BeginExecution(isolate); | 2308 Profiler::BeginExecution(isolate); |
2299 } | 2309 } |
2300 | 2310 |
2301 } // namespace dart | 2311 } // namespace dart |
OLD | NEW |