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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 110 } | 110 } |
| 111 ASSERT(!function_.IsNull()); | 111 ASSERT(!function_.IsNull()); |
| 112 const String& func_name = | 112 const String& func_name = |
| 113 String::Handle(function_.QualifiedUserVisibleName()); | 113 String::Handle(function_.QualifiedUserVisibleName()); |
| 114 return func_name.ToCString(); | 114 return func_name.ToCString(); |
| 115 } | 115 } |
| 116 | 116 |
| 117 void ProfileFunction::Tick(bool exclusive, intptr_t inclusive_serial) { | 117 void ProfileFunction::Tick(bool exclusive, intptr_t inclusive_serial) { |
| 118 if (exclusive) { | 118 if (exclusive) { |
| 119 exclusive_ticks_++; | 119 exclusive_ticks_++; |
| 120 } else { | |
| 121 if (inclusive_serial_ == inclusive_serial) { | |
| 122 // Already ticket. | |
| 123 return; | |
| 124 } | |
| 125 inclusive_serial_ = inclusive_serial; | |
| 126 inclusive_ticks_++; | |
| 127 } | 120 } |
| 121 // Fall through and tick inclusive count too. | |
| 122 if (inclusive_serial_ == inclusive_serial) { | |
| 123 // Already ticket. | |
|
rmacnak
2015/07/28 20:35:27
ticked
Cutch
2015/07/28 21:27:36
Done.
| |
| 124 return; | |
| 125 } | |
| 126 inclusive_serial_ = inclusive_serial; | |
| 127 inclusive_ticks_++; | |
| 128 } | 128 } |
| 129 | 129 |
| 130 | 130 |
| 131 const char* ProfileFunction::KindToCString(Kind kind) { | 131 const char* ProfileFunction::KindToCString(Kind kind) { |
| 132 switch (kind) { | 132 switch (kind) { |
| 133 case kDartFunction: | 133 case kDartFunction: |
| 134 return "Dart"; | 134 return "Dart"; |
| 135 case kNativeFunction: | 135 case kNativeFunction: |
| 136 return "Native"; | 136 return "Native"; |
| 137 case kTagFunction: | 137 case kTagFunction: |
| (...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 956 Profile* profile) | 956 Profile* profile) |
| 957 : isolate_(isolate), | 957 : isolate_(isolate), |
| 958 vm_isolate_(Dart::vm_isolate()), | 958 vm_isolate_(Dart::vm_isolate()), |
| 959 filter_(filter), | 959 filter_(filter), |
| 960 tag_order_(tag_order), | 960 tag_order_(tag_order), |
| 961 profile_(profile), | 961 profile_(profile), |
| 962 deoptimized_code_(new DeoptimizedCodeSet(isolate)), | 962 deoptimized_code_(new DeoptimizedCodeSet(isolate)), |
| 963 null_code_(Code::ZoneHandle()), | 963 null_code_(Code::ZoneHandle()), |
| 964 null_function_(Function::ZoneHandle()), | 964 null_function_(Function::ZoneHandle()), |
| 965 tick_functions_(false), | 965 tick_functions_(false), |
| 966 inclusive_tree_(false), | |
| 966 samples_(NULL) { | 967 samples_(NULL) { |
| 967 ASSERT(profile_ != NULL); | 968 ASSERT(profile_ != NULL); |
| 968 } | 969 } |
| 969 | 970 |
| 970 void Build() { | 971 void Build() { |
| 971 ScopeTimer sw("ProfileBuilder::Build", FLAG_trace_profiler); | 972 ScopeTimer sw("ProfileBuilder::Build", FLAG_trace_profiler); |
| 972 FilterSamples(); | 973 FilterSamples(); |
| 973 | 974 |
| 974 Setup(); | 975 Setup(); |
| 975 BuildCodeTable(); | 976 BuildCodeTable(); |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1114 for (intptr_t i = 0; i < tag_table->length(); i++) { | 1115 for (intptr_t i = 0; i < tag_table->length(); i++) { |
| 1115 ProfileCode* code = tag_table->At(i); | 1116 ProfileCode* code = tag_table->At(i); |
| 1116 ASSERT(code != NULL); | 1117 ASSERT(code != NULL); |
| 1117 code->SetFunctionAndName(function_table); | 1118 code->SetFunctionAndName(function_table); |
| 1118 } | 1119 } |
| 1119 } | 1120 } |
| 1120 | 1121 |
| 1121 void BuildCodeTrie(Profile::TrieKind kind) { | 1122 void BuildCodeTrie(Profile::TrieKind kind) { |
| 1122 ProfileCodeTrieNode* root = | 1123 ProfileCodeTrieNode* root = |
| 1123 new ProfileCodeTrieNode(GetProfileCodeTagIndex(VMTag::kRootTagId)); | 1124 new ProfileCodeTrieNode(GetProfileCodeTagIndex(VMTag::kRootTagId)); |
| 1124 if (IsInclusiveTrie(kind)) { | 1125 inclusive_tree_ = IsInclusiveTrie(kind); |
| 1126 if (inclusive_tree_) { | |
| 1125 BuildInclusiveCodeTrie(root); | 1127 BuildInclusiveCodeTrie(root); |
| 1126 } else { | 1128 } else { |
| 1127 BuildExclusiveCodeTrie(root); | 1129 BuildExclusiveCodeTrie(root); |
| 1128 } | 1130 } |
| 1129 root->SortChildren(); | 1131 root->SortChildren(); |
| 1130 profile_->roots_[static_cast<intptr_t>(kind)] = root; | 1132 profile_->roots_[static_cast<intptr_t>(kind)] = root; |
| 1131 } | 1133 } |
| 1132 | 1134 |
| 1133 void BuildInclusiveCodeTrie(ProfileCodeTrieNode* root) { | 1135 void BuildInclusiveCodeTrie(ProfileCodeTrieNode* root) { |
| 1134 ScopeTimer sw("ProfileBuilder::BuildInclusiveCodeTrie", | 1136 ScopeTimer sw("ProfileBuilder::BuildInclusiveCodeTrie", |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1188 current = AppendTruncatedTag(current); | 1190 current = AppendTruncatedTag(current); |
| 1189 } | 1191 } |
| 1190 } | 1192 } |
| 1191 } | 1193 } |
| 1192 | 1194 |
| 1193 void BuildFunctionTrie(Profile::TrieKind kind) { | 1195 void BuildFunctionTrie(Profile::TrieKind kind) { |
| 1194 ProfileFunctionTrieNode* root = | 1196 ProfileFunctionTrieNode* root = |
| 1195 new ProfileFunctionTrieNode( | 1197 new ProfileFunctionTrieNode( |
| 1196 GetProfileFunctionTagIndex(VMTag::kRootTagId)); | 1198 GetProfileFunctionTagIndex(VMTag::kRootTagId)); |
| 1197 // We tick the functions while building the trie, but, we don't want to do | 1199 // We tick the functions while building the trie, but, we don't want to do |
| 1198 // it for both tries, just one. | 1200 // it for both tries, just the exclusive trie. |
| 1199 tick_functions_ = IsInclusiveTrie(kind); | 1201 inclusive_tree_ = IsInclusiveTrie(kind); |
| 1200 if (IsInclusiveTrie(kind)) { | 1202 tick_functions_ = !inclusive_tree_; |
| 1203 if (inclusive_tree_) { | |
| 1201 BuildInclusiveFunctionTrie(root); | 1204 BuildInclusiveFunctionTrie(root); |
| 1202 } else { | 1205 } else { |
| 1203 BuildExclusiveFunctionTrie(root); | 1206 BuildExclusiveFunctionTrie(root); |
| 1204 } | 1207 } |
| 1205 root->SortChildren(); | 1208 root->SortChildren(); |
| 1206 profile_->roots_[static_cast<intptr_t>(kind)] = root; | 1209 profile_->roots_[static_cast<intptr_t>(kind)] = root; |
| 1207 } | 1210 } |
| 1208 | 1211 |
| 1209 void BuildInclusiveFunctionTrie(ProfileFunctionTrieNode* root) { | 1212 void BuildInclusiveFunctionTrie(ProfileFunctionTrieNode* root) { |
| 1210 ScopeTimer sw("ProfileBuilder::BuildInclusiveFunctionTrie", | 1213 ScopeTimer sw("ProfileBuilder::BuildInclusiveFunctionTrie", |
| 1211 FLAG_trace_profiler); | 1214 FLAG_trace_profiler); |
| 1212 for (intptr_t i = 0; i < samples_->length(); i++) { | 1215 for (intptr_t i = 0; i < samples_->length(); i++) { |
| 1213 ProcessedSample* sample = samples_->At(i); | 1216 ProcessedSample* sample = samples_->At(i); |
| 1214 | 1217 |
| 1215 // Tick the root. | 1218 // Tick the root. |
| 1216 ProfileFunctionTrieNode* current = root; | 1219 ProfileFunctionTrieNode* current = root; |
| 1217 current->Tick(); | 1220 current->Tick(); |
| 1218 | 1221 |
| 1219 // VM & User tags. | 1222 // VM & User tags. |
| 1220 current = AppendTags(sample->vm_tag(), sample->user_tag(), current); | 1223 current = AppendTags(sample->vm_tag(), sample->user_tag(), current); |
| 1221 | 1224 |
| 1222 // Truncated tag. | 1225 // Truncated tag. |
| 1223 if (sample->truncated()) { | 1226 if (sample->truncated()) { |
| 1224 current = AppendTruncatedTag(current); | 1227 current = AppendTruncatedTag(current); |
| 1225 InclusiveTickTruncatedTag(); | |
| 1226 } | 1228 } |
| 1227 | 1229 |
| 1228 // Walk the sampled PCs. | 1230 // Walk the sampled PCs. |
| 1229 for (intptr_t j = sample->length() - 1; j >= 0; j--) { | 1231 for (intptr_t j = sample->length() - 1; j >= 0; j--) { |
| 1230 ASSERT(sample->At(j) != 0); | 1232 ASSERT(sample->At(j) != 0); |
| 1231 current = ProcessFunctionPC( | 1233 current = ProcessFrame(current, i, sample, j); |
| 1232 sample->At(j), | |
| 1233 sample->timestamp(), | |
| 1234 current, | |
| 1235 i, | |
| 1236 (j == 0), | |
| 1237 sample->first_frame_executing() || sample->IsAllocationSample(), | |
| 1238 true); | |
| 1239 } | 1234 } |
| 1240 } | 1235 } |
| 1241 } | 1236 } |
| 1242 | 1237 |
| 1243 void BuildExclusiveFunctionTrie(ProfileFunctionTrieNode* root) { | 1238 void BuildExclusiveFunctionTrie(ProfileFunctionTrieNode* root) { |
| 1244 ScopeTimer sw("ProfileBuilder::BuildExclusiveFunctionTrie", | 1239 ScopeTimer sw("ProfileBuilder::BuildExclusiveFunctionTrie", |
| 1245 FLAG_trace_profiler); | 1240 FLAG_trace_profiler); |
| 1246 for (intptr_t i = 0; i < samples_->length(); i++) { | 1241 for (intptr_t i = 0; i < samples_->length(); i++) { |
|
rmacnak
2015/07/28 20:35:27
i -> sample_index
Cutch
2015/07/28 21:27:36
Done here and elsewhere.
| |
| 1247 ProcessedSample* sample = samples_->At(i); | 1242 ProcessedSample* sample = samples_->At(i); |
| 1248 | 1243 |
| 1249 // Tick the root. | 1244 // Tick the root. |
| 1250 ProfileFunctionTrieNode* current = root; | 1245 ProfileFunctionTrieNode* current = root; |
| 1251 current->Tick(); | 1246 current->Tick(); |
| 1252 | 1247 |
| 1253 // VM & User tags. | 1248 // VM & User tags. |
| 1254 current = AppendTags(sample->vm_tag(), sample->user_tag(), current); | 1249 current = AppendTags(sample->vm_tag(), sample->user_tag(), current); |
| 1255 | 1250 |
| 1256 // Walk the sampled PCs. | 1251 // Walk the sampled PCs. |
| 1257 for (intptr_t j = 0; j < sample->length(); j++) { | 1252 for (intptr_t j = 0; j < sample->length(); j++) { |
|
rmacnak
2015/07/28 20:35:27
j -> frame_index
Cutch
2015/07/28 21:27:36
Done here and elsewhere.
| |
| 1258 ASSERT(sample->At(j) != 0); | 1253 ASSERT(sample->At(j) != 0); |
| 1259 current = ProcessFunctionPC( | 1254 current = ProcessFrame(current, i, sample, j); |
| 1260 sample->At(j), | |
| 1261 sample->timestamp(), | |
| 1262 current, | |
| 1263 i, | |
| 1264 (j == 0), | |
| 1265 sample->first_frame_executing() || sample->IsAllocationSample(), | |
| 1266 false); | |
| 1267 } | 1255 } |
| 1268 | 1256 |
| 1269 // Truncated tag. | 1257 // Truncated tag. |
| 1270 if (sample->truncated()) { | 1258 if (sample->truncated()) { |
| 1271 current = AppendTruncatedTag(current); | 1259 current = AppendTruncatedTag(current); |
| 1260 InclusiveTickTruncatedTag(); | |
| 1272 } | 1261 } |
| 1273 } | 1262 } |
| 1274 } | 1263 } |
| 1275 | 1264 |
| 1276 ProfileFunctionTrieNode* ProcessFunctionPC( | 1265 ProfileFunctionTrieNode* ProcessFrame( |
| 1277 uword pc, | |
| 1278 int64_t timestamp, | |
| 1279 ProfileFunctionTrieNode* current, | 1266 ProfileFunctionTrieNode* current, |
| 1280 intptr_t inclusive_serial, | 1267 intptr_t sample_index, |
| 1281 bool top_frame, | 1268 ProcessedSample* sample, |
| 1282 bool top_frame_executing, | 1269 intptr_t frame_index) { |
| 1283 bool inclusive_tree) { | 1270 const uword pc = sample->At(frame_index); |
| 1284 ProfileCode* profile_code = GetProfileCode(pc, timestamp); | 1271 ProfileCode* profile_code = GetProfileCode(pc, |
| 1272 sample->timestamp()); | |
| 1285 ASSERT(profile_code != NULL); | 1273 ASSERT(profile_code != NULL); |
| 1286 const char* code_name = profile_code->name(); | |
| 1287 if (code_name == NULL) { | |
| 1288 code_name = ""; | |
| 1289 } | |
| 1290 intptr_t code_index = profile_code->code_table_index(); | |
| 1291 const Code& code = Code::ZoneHandle(profile_code->code()); | 1274 const Code& code = Code::ZoneHandle(profile_code->code()); |
| 1292 GrowableArray<Function*> inlined_functions; | 1275 GrowableArray<Function*> inlined_functions; |
| 1293 if (!code.IsNull()) { | 1276 if (!code.IsNull()) { |
| 1294 intptr_t offset = pc - code.EntryPoint(); | 1277 intptr_t offset = pc - code.EntryPoint(); |
| 1295 code.GetInlinedFunctionsAt(offset, &inlined_functions); | 1278 code.GetInlinedFunctionsAt(offset, &inlined_functions); |
| 1296 } | 1279 } |
| 1297 if (code.IsNull() || (inlined_functions.length() == 0)) { | 1280 if (code.IsNull() || (inlined_functions.length() == 0)) { |
| 1298 // No inlined functions. | 1281 // No inlined functions. |
| 1299 ProfileFunction* function = profile_code->function(); | 1282 ProfileFunction* function = profile_code->function(); |
| 1300 ASSERT(function != NULL); | 1283 ASSERT(function != NULL); |
| 1301 current = ProcessFunction(function, | 1284 current = ProcessFunction(current, |
| 1302 current, | 1285 sample_index, |
| 1303 inclusive_serial, | 1286 sample, |
| 1304 top_frame, | 1287 frame_index, |
| 1305 top_frame_executing, | 1288 function); |
| 1306 code_index); | |
| 1307 return current; | 1289 return current; |
| 1308 } | 1290 } |
| 1309 | 1291 |
| 1310 if (inclusive_tree) { | 1292 if (inclusive_tree_) { |
| 1311 for (intptr_t i = inlined_functions.length() - 1; i >= 0; i--) { | 1293 for (intptr_t i = inlined_functions.length() - 1; i >= 0; i--) { |
| 1312 Function* inlined_function = inlined_functions[i]; | 1294 Function* inlined_function = inlined_functions[i]; |
| 1313 ASSERT(inlined_function != NULL); | 1295 ASSERT(inlined_function != NULL); |
| 1314 ASSERT(!inlined_function->IsNull()); | 1296 ASSERT(!inlined_function->IsNull()); |
| 1315 current = ProcessInlinedFunction(inlined_function, | 1297 current = ProcessInlinedFunction(current, |
| 1316 current, | 1298 sample_index, |
| 1317 inclusive_serial, | 1299 sample, |
| 1318 top_frame, | 1300 frame_index, |
| 1319 top_frame_executing, | 1301 inlined_function); |
| 1320 code_index); | |
| 1321 top_frame = false; | |
| 1322 } | 1302 } |
| 1323 } else { | 1303 } else { |
| 1324 for (intptr_t i = 0; i < inlined_functions.length(); i++) { | 1304 for (intptr_t i = 0; i < inlined_functions.length(); i++) { |
| 1325 Function* inlined_function = inlined_functions[i]; | 1305 Function* inlined_function = inlined_functions[i]; |
| 1326 ASSERT(inlined_function != NULL); | 1306 ASSERT(inlined_function != NULL); |
| 1327 ASSERT(!inlined_function->IsNull()); | 1307 ASSERT(!inlined_function->IsNull()); |
| 1328 current = ProcessInlinedFunction(inlined_function, | 1308 current = ProcessInlinedFunction(current, |
| 1329 current, | 1309 sample_index, |
| 1330 inclusive_serial, | 1310 sample, |
| 1331 top_frame, | 1311 frame_index + i, |
| 1332 top_frame_executing, | 1312 inlined_function); |
| 1333 code_index); | |
| 1334 top_frame = false; | |
| 1335 } | 1313 } |
| 1336 } | 1314 } |
| 1337 | 1315 |
| 1338 return current; | 1316 return current; |
| 1339 } | 1317 } |
| 1340 | 1318 |
| 1341 ProfileFunctionTrieNode* ProcessInlinedFunction( | 1319 ProfileFunctionTrieNode* ProcessInlinedFunction( |
| 1342 Function* inlined_function, | |
| 1343 ProfileFunctionTrieNode* current, | 1320 ProfileFunctionTrieNode* current, |
| 1344 intptr_t inclusive_serial, | 1321 intptr_t sample_index, |
| 1345 bool top_frame, | 1322 ProcessedSample* sample, |
| 1346 bool top_frame_executing, | 1323 intptr_t frame_index, |
| 1347 intptr_t code_index) { | 1324 Function* inlined_function) { |
| 1348 ProfileFunctionTable* function_table = profile_->functions_; | 1325 ProfileFunctionTable* function_table = profile_->functions_; |
| 1349 ProfileFunction* function = function_table->LookupOrAdd(*inlined_function); | 1326 ProfileFunction* function = function_table->LookupOrAdd(*inlined_function); |
| 1350 ASSERT(function != NULL); | 1327 ASSERT(function != NULL); |
| 1351 return ProcessFunction(function, | 1328 return ProcessFunction(current, |
| 1352 current, | 1329 sample_index, |
| 1353 inclusive_serial, | 1330 sample, |
| 1354 top_frame, | 1331 frame_index, |
| 1355 top_frame_executing, | 1332 function); |
| 1356 code_index); | |
| 1357 } | 1333 } |
| 1358 | 1334 |
| 1359 ProfileFunctionTrieNode* ProcessFunction(ProfileFunction* function, | 1335 ProfileFunctionTrieNode* ProcessFunction(ProfileFunctionTrieNode* current, |
| 1360 ProfileFunctionTrieNode* current, | 1336 intptr_t sample_index, |
| 1361 intptr_t inclusive_serial, | 1337 ProcessedSample* sample, |
| 1362 bool top_frame, | 1338 intptr_t frame_index, |
| 1363 bool top_frame_executing, | 1339 ProfileFunction* function) { |
| 1364 intptr_t code_index) { | |
| 1365 const bool exclusive = top_frame && top_frame_executing; | |
| 1366 if (tick_functions_) { | 1340 if (tick_functions_) { |
| 1367 function->Tick(exclusive, exclusive ? -1 : inclusive_serial); | 1341 function->Tick(IsExecutingFrame(sample, frame_index), sample_index); |
| 1368 } | 1342 } |
| 1369 function->AddProfileCode(code_index); | |
| 1370 current = current->GetChild(function->table_index()); | 1343 current = current->GetChild(function->table_index()); |
| 1371 current->AddCodeObjectIndex(code_index); | 1344 current->Tick(); |
| 1372 if (top_frame) { | |
| 1373 if (top_frame_executing || vm_tags_emitted()) { | |
| 1374 // Only tick if this function is using CPU time or VM tags are emitted. | |
| 1375 current->Tick(); | |
| 1376 } | |
| 1377 } else { | |
| 1378 current->Tick(); | |
| 1379 } | |
| 1380 return current; | 1345 return current; |
| 1381 } | 1346 } |
| 1382 | 1347 |
| 1383 // Tick the truncated tag's inclusive tick count. | 1348 // Tick the truncated tag's inclusive tick count. |
| 1384 void InclusiveTickTruncatedTag() { | 1349 void InclusiveTickTruncatedTag() { |
| 1385 ProfileCodeTable* tag_table = profile_->tag_code_; | 1350 ProfileCodeTable* tag_table = profile_->tag_code_; |
| 1386 intptr_t index = tag_table->FindCodeIndexForPC(VMTag::kTruncatedTagId); | 1351 intptr_t index = tag_table->FindCodeIndexForPC(VMTag::kTruncatedTagId); |
| 1387 ASSERT(index >= 0); | 1352 ASSERT(index >= 0); |
| 1388 ProfileCode* code = tag_table->At(index); | 1353 ProfileCode* code = tag_table->At(index); |
| 1389 code->IncInclusiveTicks(); | 1354 code->IncInclusiveTicks(); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1503 ProfileFunctionTrieNode* current) { | 1468 ProfileFunctionTrieNode* current) { |
| 1504 intptr_t truncated_tag_index = | 1469 intptr_t truncated_tag_index = |
| 1505 GetProfileFunctionTagIndex(VMTag::kTruncatedTagId); | 1470 GetProfileFunctionTagIndex(VMTag::kTruncatedTagId); |
| 1506 ASSERT(truncated_tag_index >= 0); | 1471 ASSERT(truncated_tag_index >= 0); |
| 1507 current = current->GetChild(truncated_tag_index); | 1472 current = current->GetChild(truncated_tag_index); |
| 1508 current->Tick(); | 1473 current->Tick(); |
| 1509 return current; | 1474 return current; |
| 1510 } | 1475 } |
| 1511 | 1476 |
| 1512 ProfileFunctionTrieNode* AppendVMTag(uword vm_tag, | 1477 ProfileFunctionTrieNode* AppendVMTag(uword vm_tag, |
| 1513 ProfileFunctionTrieNode* current) { | 1478 ProfileFunctionTrieNode* current) { |
| 1514 if (VMTag::IsNativeEntryTag(vm_tag)) { | 1479 if (VMTag::IsNativeEntryTag(vm_tag)) { |
| 1515 // Insert a dummy kNativeTagId node. | 1480 // Insert a dummy kNativeTagId node. |
| 1516 intptr_t tag_index = GetProfileFunctionTagIndex(VMTag::kNativeTagId); | 1481 intptr_t tag_index = GetProfileFunctionTagIndex(VMTag::kNativeTagId); |
| 1517 current = current->GetChild(tag_index); | 1482 current = current->GetChild(tag_index); |
| 1518 // Give the tag a tick. | 1483 // Give the tag a tick. |
| 1519 current->Tick(); | 1484 current->Tick(); |
| 1520 } else if (VMTag::IsRuntimeEntryTag(vm_tag)) { | 1485 } else if (VMTag::IsRuntimeEntryTag(vm_tag)) { |
| 1521 // Insert a dummy kRuntimeTagId node. | 1486 // Insert a dummy kRuntimeTagId node. |
| 1522 intptr_t tag_index = GetProfileFunctionTagIndex(VMTag::kRuntimeTagId); | 1487 intptr_t tag_index = GetProfileFunctionTagIndex(VMTag::kRuntimeTagId); |
| 1523 current = current->GetChild(tag_index); | 1488 current = current->GetChild(tag_index); |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1774 | 1739 |
| 1775 Isolate* isolate_; | 1740 Isolate* isolate_; |
| 1776 Isolate* vm_isolate_; | 1741 Isolate* vm_isolate_; |
| 1777 SampleFilter* filter_; | 1742 SampleFilter* filter_; |
| 1778 Profile::TagOrder tag_order_; | 1743 Profile::TagOrder tag_order_; |
| 1779 Profile* profile_; | 1744 Profile* profile_; |
| 1780 DeoptimizedCodeSet* deoptimized_code_; | 1745 DeoptimizedCodeSet* deoptimized_code_; |
| 1781 const Code& null_code_; | 1746 const Code& null_code_; |
| 1782 const Function& null_function_; | 1747 const Function& null_function_; |
| 1783 bool tick_functions_; | 1748 bool tick_functions_; |
| 1749 bool inclusive_tree_; | |
| 1784 | 1750 |
| 1785 ProcessedSampleBuffer* samples_; | 1751 ProcessedSampleBuffer* samples_; |
| 1786 }; | 1752 }; |
| 1787 | 1753 |
| 1788 | 1754 |
| 1789 Profile::Profile(Isolate* isolate) | 1755 Profile::Profile(Isolate* isolate) |
| 1790 : isolate_(isolate), | 1756 : isolate_(isolate), |
| 1791 live_code_(NULL), | 1757 live_code_(NULL), |
| 1792 dead_code_(NULL), | 1758 dead_code_(NULL), |
| 1793 tag_code_(NULL), | 1759 tag_code_(NULL), |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2089 ASSERT(sample_buffer != NULL); | 2055 ASSERT(sample_buffer != NULL); |
| 2090 | 2056 |
| 2091 ClearProfileVisitor clear_profile(isolate); | 2057 ClearProfileVisitor clear_profile(isolate); |
| 2092 sample_buffer->VisitSamples(&clear_profile); | 2058 sample_buffer->VisitSamples(&clear_profile); |
| 2093 | 2059 |
| 2094 // Enable profile interrupts. | 2060 // Enable profile interrupts. |
| 2095 Profiler::BeginExecution(isolate); | 2061 Profiler::BeginExecution(isolate); |
| 2096 } | 2062 } |
| 2097 | 2063 |
| 2098 } // namespace dart | 2064 } // namespace dart |
| OLD | NEW |