Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Unified Diff: src/profile-generator.cc

Issue 2745002: Move token-related constants from CodeEntry to TokenEnumerator. (Closed)
Patch Set: Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/profile-generator.h ('k') | test/cctest/test-cpu-profiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/profile-generator.cc
diff --git a/src/profile-generator.cc b/src/profile-generator.cc
index 105c1a8435c3fbf4280b09ed2144318ee50f215e..fb89a221aa5d2cd2e8e93ef1dedf69f14c56cfb5 100644
--- a/src/profile-generator.cc
+++ b/src/profile-generator.cc
@@ -55,7 +55,7 @@ TokenEnumerator::~TokenEnumerator() {
int TokenEnumerator::GetTokenId(Object* token) {
- if (token == NULL) return CodeEntry::kNoSecurityToken;
+ if (token == NULL) return TokenEnumerator::kNoSecurityToken;
for (int i = 0; i < token_locations_.length(); ++i) {
if (*token_locations_[i] == token && !token_removed_[i]) return i;
}
@@ -171,7 +171,7 @@ ProfileTree::ProfileTree()
"(root)",
"",
0,
- CodeEntry::kNoSecurityToken),
+ TokenEnumerator::kNoSecurityToken),
root_(new ProfileNode(this, &root_entry_)) {
}
@@ -248,11 +248,11 @@ class FilteredCloneCallback {
private:
bool IsTokenAcceptable(int token, int parent_token) {
- if (token == CodeEntry::kNoSecurityToken
+ if (token == TokenEnumerator::kNoSecurityToken
|| token == security_token_id_) return true;
- if (token == CodeEntry::kInheritsSecurityToken) {
- ASSERT(parent_token != CodeEntry::kInheritsSecurityToken);
- return parent_token == CodeEntry::kNoSecurityToken
+ if (token == TokenEnumerator::kInheritsSecurityToken) {
+ ASSERT(parent_token != TokenEnumerator::kInheritsSecurityToken);
+ return parent_token == TokenEnumerator::kNoSecurityToken
|| parent_token == security_token_id_;
}
return false;
@@ -373,7 +373,7 @@ void CpuProfile::SetActualSamplingRate(double actual_sampling_rate) {
CpuProfile* CpuProfile::FilteredClone(int security_token_id) {
- ASSERT(security_token_id != CodeEntry::kNoSecurityToken);
+ ASSERT(security_token_id != TokenEnumerator::kNoSecurityToken);
CpuProfile* clone = new CpuProfile(title_, uid_);
clone->top_down_.FilteredClone(&top_down_, security_token_id);
clone->bottom_up_.FilteredClone(&bottom_up_, security_token_id);
@@ -517,7 +517,7 @@ CpuProfile* CpuProfilesCollection::StopProfiling(int security_token_id,
profile->CalculateTotalTicks();
profile->SetActualSamplingRate(actual_sampling_rate);
List<CpuProfile*>* unabridged_list =
- profiles_by_token_[TokenToIndex(CodeEntry::kNoSecurityToken)];
+ profiles_by_token_[TokenToIndex(TokenEnumerator::kNoSecurityToken)];
unabridged_list->Add(profile);
HashMap::Entry* entry =
profiles_uids_.Lookup(reinterpret_cast<void*>(profile->uid()),
@@ -550,8 +550,8 @@ CpuProfile* CpuProfilesCollection::GetProfile(int security_token_id,
return NULL;
}
List<CpuProfile*>* unabridged_list =
- profiles_by_token_[TokenToIndex(CodeEntry::kNoSecurityToken)];
- if (security_token_id == CodeEntry::kNoSecurityToken) {
+ profiles_by_token_[TokenToIndex(TokenEnumerator::kNoSecurityToken)];
+ if (security_token_id == TokenEnumerator::kNoSecurityToken) {
return unabridged_list->at(index);
}
List<CpuProfile*>* list = GetProfilesList(security_token_id);
@@ -564,7 +564,7 @@ CpuProfile* CpuProfilesCollection::GetProfile(int security_token_id,
int CpuProfilesCollection::TokenToIndex(int security_token_id) {
- ASSERT(CodeEntry::kNoSecurityToken == -1);
+ ASSERT(TokenEnumerator::kNoSecurityToken == -1);
return security_token_id + 1; // kNoSecurityToken -> 0, 0 -> 1, ...
}
@@ -575,7 +575,7 @@ List<CpuProfile*>* CpuProfilesCollection::GetProfilesList(
const int lists_to_add = index - profiles_by_token_.length() + 1;
if (lists_to_add > 0) profiles_by_token_.AddBlock(NULL, lists_to_add);
List<CpuProfile*>* unabridged_list =
- profiles_by_token_[TokenToIndex(CodeEntry::kNoSecurityToken)];
+ profiles_by_token_[TokenToIndex(TokenEnumerator::kNoSecurityToken)];
const int current_count = unabridged_list->length();
if (profiles_by_token_[index] == NULL) {
profiles_by_token_[index] = new List<CpuProfile*>(current_count);
@@ -589,8 +589,8 @@ List<CpuProfile*>* CpuProfilesCollection::GetProfilesList(
List<CpuProfile*>* CpuProfilesCollection::Profiles(int security_token_id) {
List<CpuProfile*>* unabridged_list =
- profiles_by_token_[TokenToIndex(CodeEntry::kNoSecurityToken)];
- if (security_token_id == CodeEntry::kNoSecurityToken) {
+ profiles_by_token_[TokenToIndex(TokenEnumerator::kNoSecurityToken)];
+ if (security_token_id == TokenEnumerator::kNoSecurityToken) {
return unabridged_list;
}
List<CpuProfile*>* list = GetProfilesList(security_token_id);
@@ -613,7 +613,7 @@ CodeEntry* CpuProfilesCollection::NewCodeEntry(Logger::LogEventsAndTags tag,
GetFunctionName(name),
GetName(resource_name),
line_number,
- CodeEntry::kNoSecurityToken);
+ TokenEnumerator::kNoSecurityToken);
code_entries_.Add(entry);
return entry;
}
@@ -626,7 +626,7 @@ CodeEntry* CpuProfilesCollection::NewCodeEntry(Logger::LogEventsAndTags tag,
GetFunctionName(name),
"",
v8::CpuProfileNode::kNoLineNumberInfo,
- CodeEntry::kNoSecurityToken);
+ TokenEnumerator::kNoSecurityToken);
code_entries_.Add(entry);
return entry;
}
@@ -640,7 +640,7 @@ CodeEntry* CpuProfilesCollection::NewCodeEntry(Logger::LogEventsAndTags tag,
GetName(name),
"",
v8::CpuProfileNode::kNoLineNumberInfo,
- CodeEntry::kInheritsSecurityToken);
+ TokenEnumerator::kInheritsSecurityToken);
code_entries_.Add(entry);
return entry;
}
@@ -653,7 +653,7 @@ CodeEntry* CpuProfilesCollection::NewCodeEntry(Logger::LogEventsAndTags tag,
GetName(args_count),
"",
v8::CpuProfileNode::kNoLineNumberInfo,
- CodeEntry::kInheritsSecurityToken);
+ TokenEnumerator::kInheritsSecurityToken);
code_entries_.Add(entry);
return entry;
}
« no previous file with comments | « src/profile-generator.h ('k') | test/cctest/test-cpu-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698