Fix bad inclusive ticks for functions on release x64

BUG=

Review URL: https://codereview.chromium.org//1264523002 .
This commit is contained in:
John McCutchan 2015-07-28 15:18:29 -07:00
parent 902da6eeef
commit b2bdbfdc1e
2 changed files with 6 additions and 3 deletions

View file

@ -97,7 +97,8 @@ ProfileFunction::ProfileFunction(Kind kind,
table_index_(table_index),
profile_codes_(0),
exclusive_ticks_(0),
inclusive_ticks_(0) {
inclusive_ticks_(0),
inclusive_serial_(-1) {
ASSERT((kind_ != kDartFunction) || !function_.IsNull());
ASSERT((kind_ != kDartFunction) || (table_index_ >= 0));
ASSERT(profile_codes_.length() == 0);
@ -1224,6 +1225,7 @@ class ProfileBuilder : public ValueObject {
void BuildInclusiveFunctionTrie(ProfileFunctionTrieNode* root) {
ScopeTimer sw("ProfileBuilder::BuildInclusiveFunctionTrie",
FLAG_trace_profiler);
ASSERT(!tick_functions_);
for (intptr_t sample_index = 0;
sample_index < samples_->length();
sample_index++) {
@ -1254,6 +1256,7 @@ class ProfileBuilder : public ValueObject {
void BuildExclusiveFunctionTrie(ProfileFunctionTrieNode* root) {
ScopeTimer sw("ProfileBuilder::BuildExclusiveFunctionTrie",
FLAG_trace_profiler);
ASSERT(tick_functions_);
for (intptr_t sample_index = 0;
sample_index < samples_->length();
sample_index++) {

View file

@ -369,7 +369,7 @@ TEST_CASE(Profiler_CodeTicks) {
Profile profile(isolate);
AllocationFilter filter(isolate, class_a.id());
profile.Build(&filter, Profile::kNoTags);
// We should have one allocation sample.
// We should have three allocation samples.
EXPECT_EQ(3, profile.sample_count());
ProfileTrieWalker walker(&profile);
@ -461,7 +461,7 @@ TEST_CASE(Profiler_FunctionTicks) {
Profile profile(isolate);
AllocationFilter filter(isolate, class_a.id());
profile.Build(&filter, Profile::kNoTags);
// We should have one allocation sample.
// We should have three allocation samples.
EXPECT_EQ(3, profile.sample_count());
ProfileTrieWalker walker(&profile);