Chromium Code Reviews| 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 1887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1898 char* native_name = NativeSymbolResolver::LookupSymbolName(pc, | 1898 char* native_name = NativeSymbolResolver::LookupSymbolName(pc, |
| 1899 &native_start); | 1899 &native_start); |
| 1900 if (native_name == NULL) { | 1900 if (native_name == NULL) { |
| 1901 // No native name found. | 1901 // No native name found. |
| 1902 return new ProfileCode(ProfileCode::kNativeCode, | 1902 return new ProfileCode(ProfileCode::kNativeCode, |
| 1903 pc, | 1903 pc, |
| 1904 pc + 1, | 1904 pc + 1, |
| 1905 0, | 1905 0, |
| 1906 code); | 1906 code); |
| 1907 } | 1907 } |
| 1908 | |
| 1909 #if defined(HOST_ARCH_ARM) | |
|
zra
2015/10/30 18:28:31
We should probably check that __thumb__ or __thumb
rmacnak
2015/10/30 18:36:50
Other compilation units or dynamic libraries in ou
| |
| 1910 if ((native_start % 2) == 1) { | |
|
zra
2015/10/30 18:28:30
unconditionally:
const uintptr_t one = 1;
native_s
rmacnak
2015/10/30 18:36:50
Done.
Florian Schneider
2015/10/30 19:12:02
I'd 1U for unsigned literal one. Here however, sig
rmacnak
2015/10/30 19:48:51
ack
| |
| 1911 // The symbol for a Thumb function will be xxx1, but we may have samples | |
| 1912 // at function entry which will have pc xxx0. | |
| 1913 native_start -= 1; | |
| 1914 } | |
| 1915 #endif | |
| 1916 | |
| 1908 ASSERT(pc >= native_start); | 1917 ASSERT(pc >= native_start); |
| 1909 ProfileCode* profile_code = | 1918 ProfileCode* profile_code = |
| 1910 new ProfileCode(ProfileCode::kNativeCode, | 1919 new ProfileCode(ProfileCode::kNativeCode, |
| 1911 native_start, | 1920 native_start, |
| 1912 pc + 1, | 1921 pc + 1, |
| 1913 0, | 1922 0, |
| 1914 code); | 1923 code); |
| 1915 profile_code->SetName(native_name); | 1924 profile_code->SetName(native_name); |
| 1916 free(native_name); | 1925 NativeSymbolResolver::FreeSymbolName(native_name); |
| 1917 return profile_code; | 1926 return profile_code; |
| 1918 } | 1927 } |
| 1919 | 1928 |
| 1920 ProfileCode* RegisterProfileCode(uword pc, int64_t timestamp) { | 1929 ProfileCode* RegisterProfileCode(uword pc, int64_t timestamp) { |
| 1921 ProfileCodeTable* live_table = profile_->live_code_; | 1930 ProfileCodeTable* live_table = profile_->live_code_; |
| 1922 ProfileCodeTable* dead_table = profile_->dead_code_; | 1931 ProfileCodeTable* dead_table = profile_->dead_code_; |
| 1923 | 1932 |
| 1924 ProfileCode* code = live_table->FindCodeForPC(pc); | 1933 ProfileCode* code = live_table->FindCodeForPC(pc); |
| 1925 if (code == NULL) { | 1934 if (code == NULL) { |
| 1926 // Code not found. | 1935 // Code not found. |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2302 ASSERT(sample_buffer != NULL); | 2311 ASSERT(sample_buffer != NULL); |
| 2303 | 2312 |
| 2304 ClearProfileVisitor clear_profile(isolate); | 2313 ClearProfileVisitor clear_profile(isolate); |
| 2305 sample_buffer->VisitSamples(&clear_profile); | 2314 sample_buffer->VisitSamples(&clear_profile); |
| 2306 | 2315 |
| 2307 // Enable profile interrupts. | 2316 // Enable profile interrupts. |
| 2308 Profiler::BeginExecution(isolate); | 2317 Profiler::BeginExecution(isolate); |
| 2309 } | 2318 } |
| 2310 | 2319 |
| 2311 } // namespace dart | 2320 } // namespace dart |
| OLD | NEW |