| 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 1827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1838 pc, | 1838 pc, |
| 1839 pc + 1, | 1839 pc + 1, |
| 1840 0, | 1840 0, |
| 1841 null_code_); | 1841 null_code_); |
| 1842 return code; | 1842 return code; |
| 1843 } | 1843 } |
| 1844 | 1844 |
| 1845 ProfileCode* CreateProfileCode(uword pc) { | 1845 ProfileCode* CreateProfileCode(uword pc) { |
| 1846 const intptr_t kDartCodeAlignment = OS::PreferredCodeAlignment(); | 1846 const intptr_t kDartCodeAlignment = OS::PreferredCodeAlignment(); |
| 1847 const intptr_t kDartCodeAlignmentMask = ~(kDartCodeAlignment - 1); | 1847 const intptr_t kDartCodeAlignmentMask = ~(kDartCodeAlignment - 1); |
| 1848 Code& code = Code::Handle(isolate_); | 1848 Code& code = Code::Handle(isolate_->current_zone()); |
| 1849 | 1849 |
| 1850 // Check current isolate for pc. | 1850 // Check current isolate for pc. |
| 1851 if (isolate_->heap()->CodeContains(pc)) { | 1851 if (isolate_->heap()->CodeContains(pc)) { |
| 1852 code ^= Code::LookupCode(pc); | 1852 code ^= Code::LookupCode(pc); |
| 1853 if (!code.IsNull()) { | 1853 if (!code.IsNull()) { |
| 1854 deoptimized_code_->Add(code); | 1854 deoptimized_code_->Add(code); |
| 1855 return new ProfileCode(ProfileCode::kDartCode, | 1855 return new ProfileCode(ProfileCode::kDartCode, |
| 1856 code.EntryPoint(), | 1856 code.EntryPoint(), |
| 1857 code.EntryPoint() + code.Size(), | 1857 code.EntryPoint() + code.Size(), |
| 1858 code.compile_timestamp(), | 1858 code.compile_timestamp(), |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2290 ASSERT(sample_buffer != NULL); | 2290 ASSERT(sample_buffer != NULL); |
| 2291 | 2291 |
| 2292 ClearProfileVisitor clear_profile(isolate); | 2292 ClearProfileVisitor clear_profile(isolate); |
| 2293 sample_buffer->VisitSamples(&clear_profile); | 2293 sample_buffer->VisitSamples(&clear_profile); |
| 2294 | 2294 |
| 2295 // Enable profile interrupts. | 2295 // Enable profile interrupts. |
| 2296 Profiler::BeginExecution(isolate); | 2296 Profiler::BeginExecution(isolate); |
| 2297 } | 2297 } |
| 2298 | 2298 |
| 2299 } // namespace dart | 2299 } // namespace dart |
| OLD | NEW |