Move token-related constants from CodeEntry to TokenEnumerator.

Review URL: http://codereview.chromium.org/2745002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4819 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent aaaebbe5
...@@ -294,7 +294,8 @@ CpuProfile* CpuProfiler::StopProfiling(Object* security_token, String* title) { ...@@ -294,7 +294,8 @@ CpuProfile* CpuProfiler::StopProfiling(Object* security_token, String* title) {
int CpuProfiler::GetProfilesCount() { int CpuProfiler::GetProfilesCount() {
ASSERT(singleton_ != NULL); ASSERT(singleton_ != NULL);
// The count of profiles doesn't depend on a security token. // The count of profiles doesn't depend on a security token.
return singleton_->profiles_->Profiles(CodeEntry::kNoSecurityToken)->length(); return singleton_->profiles_->Profiles(
TokenEnumerator::kNoSecurityToken)->length();
} }
...@@ -380,7 +381,7 @@ void CpuProfiler::CodeDeleteEvent(Address from) { ...@@ -380,7 +381,7 @@ void CpuProfiler::CodeDeleteEvent(Address from) {
void CpuProfiler::FunctionCreateEvent(JSFunction* function) { void CpuProfiler::FunctionCreateEvent(JSFunction* function) {
int security_token_id = CodeEntry::kNoSecurityToken; int security_token_id = TokenEnumerator::kNoSecurityToken;
if (function->unchecked_context()->IsContext()) { if (function->unchecked_context()->IsContext()) {
security_token_id = singleton_->token_enumerator_->GetTokenId( security_token_id = singleton_->token_enumerator_->GetTokenId(
function->context()->global_context()->security_token()); function->context()->global_context()->security_token());
...@@ -476,9 +477,10 @@ void CpuProfiler::StartProcessorIfNotStarted() { ...@@ -476,9 +477,10 @@ void CpuProfiler::StartProcessorIfNotStarted() {
CpuProfile* CpuProfiler::StopCollectingProfile(const char* title) { CpuProfile* CpuProfiler::StopCollectingProfile(const char* title) {
const double actual_sampling_rate = generator_->actual_sampling_rate(); const double actual_sampling_rate = generator_->actual_sampling_rate();
StopProcessorIfLastProfile(); StopProcessorIfLastProfile();
CpuProfile* result = profiles_->StopProfiling(CodeEntry::kNoSecurityToken, CpuProfile* result =
title, profiles_->StopProfiling(TokenEnumerator::kNoSecurityToken,
actual_sampling_rate); title,
actual_sampling_rate);
if (result != NULL) { if (result != NULL) {
result->Print(); result->Print();
} }
......
...@@ -55,7 +55,7 @@ TokenEnumerator::~TokenEnumerator() { ...@@ -55,7 +55,7 @@ TokenEnumerator::~TokenEnumerator() {
int TokenEnumerator::GetTokenId(Object* token) { 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) { for (int i = 0; i < token_locations_.length(); ++i) {
if (*token_locations_[i] == token && !token_removed_[i]) return i; if (*token_locations_[i] == token && !token_removed_[i]) return i;
} }
...@@ -171,7 +171,7 @@ ProfileTree::ProfileTree() ...@@ -171,7 +171,7 @@ ProfileTree::ProfileTree()
"(root)", "(root)",
"", "",
0, 0,
CodeEntry::kNoSecurityToken), TokenEnumerator::kNoSecurityToken),
root_(new ProfileNode(this, &root_entry_)) { root_(new ProfileNode(this, &root_entry_)) {
} }
...@@ -248,11 +248,11 @@ class FilteredCloneCallback { ...@@ -248,11 +248,11 @@ class FilteredCloneCallback {
private: private:
bool IsTokenAcceptable(int token, int parent_token) { bool IsTokenAcceptable(int token, int parent_token) {
if (token == CodeEntry::kNoSecurityToken if (token == TokenEnumerator::kNoSecurityToken
|| token == security_token_id_) return true; || token == security_token_id_) return true;
if (token == CodeEntry::kInheritsSecurityToken) { if (token == TokenEnumerator::kInheritsSecurityToken) {
ASSERT(parent_token != CodeEntry::kInheritsSecurityToken); ASSERT(parent_token != TokenEnumerator::kInheritsSecurityToken);
return parent_token == CodeEntry::kNoSecurityToken return parent_token == TokenEnumerator::kNoSecurityToken
|| parent_token == security_token_id_; || parent_token == security_token_id_;
} }
return false; return false;
...@@ -373,7 +373,7 @@ void CpuProfile::SetActualSamplingRate(double actual_sampling_rate) { ...@@ -373,7 +373,7 @@ void CpuProfile::SetActualSamplingRate(double actual_sampling_rate) {
CpuProfile* CpuProfile::FilteredClone(int security_token_id) { 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_); CpuProfile* clone = new CpuProfile(title_, uid_);
clone->top_down_.FilteredClone(&top_down_, security_token_id); clone->top_down_.FilteredClone(&top_down_, security_token_id);
clone->bottom_up_.FilteredClone(&bottom_up_, security_token_id); clone->bottom_up_.FilteredClone(&bottom_up_, security_token_id);
...@@ -517,7 +517,7 @@ CpuProfile* CpuProfilesCollection::StopProfiling(int security_token_id, ...@@ -517,7 +517,7 @@ CpuProfile* CpuProfilesCollection::StopProfiling(int security_token_id,
profile->CalculateTotalTicks(); profile->CalculateTotalTicks();
profile->SetActualSamplingRate(actual_sampling_rate); profile->SetActualSamplingRate(actual_sampling_rate);
List<CpuProfile*>* unabridged_list = List<CpuProfile*>* unabridged_list =
profiles_by_token_[TokenToIndex(CodeEntry::kNoSecurityToken)]; profiles_by_token_[TokenToIndex(TokenEnumerator::kNoSecurityToken)];
unabridged_list->Add(profile); unabridged_list->Add(profile);
HashMap::Entry* entry = HashMap::Entry* entry =
profiles_uids_.Lookup(reinterpret_cast<void*>(profile->uid()), profiles_uids_.Lookup(reinterpret_cast<void*>(profile->uid()),
...@@ -550,8 +550,8 @@ CpuProfile* CpuProfilesCollection::GetProfile(int security_token_id, ...@@ -550,8 +550,8 @@ CpuProfile* CpuProfilesCollection::GetProfile(int security_token_id,
return NULL; return NULL;
} }
List<CpuProfile*>* unabridged_list = List<CpuProfile*>* unabridged_list =
profiles_by_token_[TokenToIndex(CodeEntry::kNoSecurityToken)]; profiles_by_token_[TokenToIndex(TokenEnumerator::kNoSecurityToken)];
if (security_token_id == CodeEntry::kNoSecurityToken) { if (security_token_id == TokenEnumerator::kNoSecurityToken) {
return unabridged_list->at(index); return unabridged_list->at(index);
} }
List<CpuProfile*>* list = GetProfilesList(security_token_id); List<CpuProfile*>* list = GetProfilesList(security_token_id);
...@@ -564,7 +564,7 @@ CpuProfile* CpuProfilesCollection::GetProfile(int security_token_id, ...@@ -564,7 +564,7 @@ CpuProfile* CpuProfilesCollection::GetProfile(int security_token_id,
int CpuProfilesCollection::TokenToIndex(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, ... return security_token_id + 1; // kNoSecurityToken -> 0, 0 -> 1, ...
} }
...@@ -575,7 +575,7 @@ List<CpuProfile*>* CpuProfilesCollection::GetProfilesList( ...@@ -575,7 +575,7 @@ List<CpuProfile*>* CpuProfilesCollection::GetProfilesList(
const int lists_to_add = index - profiles_by_token_.length() + 1; const int lists_to_add = index - profiles_by_token_.length() + 1;
if (lists_to_add > 0) profiles_by_token_.AddBlock(NULL, lists_to_add); if (lists_to_add > 0) profiles_by_token_.AddBlock(NULL, lists_to_add);
List<CpuProfile*>* unabridged_list = List<CpuProfile*>* unabridged_list =
profiles_by_token_[TokenToIndex(CodeEntry::kNoSecurityToken)]; profiles_by_token_[TokenToIndex(TokenEnumerator::kNoSecurityToken)];
const int current_count = unabridged_list->length(); const int current_count = unabridged_list->length();
if (profiles_by_token_[index] == NULL) { if (profiles_by_token_[index] == NULL) {
profiles_by_token_[index] = new List<CpuProfile*>(current_count); profiles_by_token_[index] = new List<CpuProfile*>(current_count);
...@@ -589,8 +589,8 @@ List<CpuProfile*>* CpuProfilesCollection::GetProfilesList( ...@@ -589,8 +589,8 @@ List<CpuProfile*>* CpuProfilesCollection::GetProfilesList(
List<CpuProfile*>* CpuProfilesCollection::Profiles(int security_token_id) { List<CpuProfile*>* CpuProfilesCollection::Profiles(int security_token_id) {
List<CpuProfile*>* unabridged_list = List<CpuProfile*>* unabridged_list =
profiles_by_token_[TokenToIndex(CodeEntry::kNoSecurityToken)]; profiles_by_token_[TokenToIndex(TokenEnumerator::kNoSecurityToken)];
if (security_token_id == CodeEntry::kNoSecurityToken) { if (security_token_id == TokenEnumerator::kNoSecurityToken) {
return unabridged_list; return unabridged_list;
} }
List<CpuProfile*>* list = GetProfilesList(security_token_id); List<CpuProfile*>* list = GetProfilesList(security_token_id);
...@@ -613,7 +613,7 @@ CodeEntry* CpuProfilesCollection::NewCodeEntry(Logger::LogEventsAndTags tag, ...@@ -613,7 +613,7 @@ CodeEntry* CpuProfilesCollection::NewCodeEntry(Logger::LogEventsAndTags tag,
GetFunctionName(name), GetFunctionName(name),
GetName(resource_name), GetName(resource_name),
line_number, line_number,
CodeEntry::kNoSecurityToken); TokenEnumerator::kNoSecurityToken);
code_entries_.Add(entry); code_entries_.Add(entry);
return entry; return entry;
} }
...@@ -626,7 +626,7 @@ CodeEntry* CpuProfilesCollection::NewCodeEntry(Logger::LogEventsAndTags tag, ...@@ -626,7 +626,7 @@ CodeEntry* CpuProfilesCollection::NewCodeEntry(Logger::LogEventsAndTags tag,
GetFunctionName(name), GetFunctionName(name),
"", "",
v8::CpuProfileNode::kNoLineNumberInfo, v8::CpuProfileNode::kNoLineNumberInfo,
CodeEntry::kNoSecurityToken); TokenEnumerator::kNoSecurityToken);
code_entries_.Add(entry); code_entries_.Add(entry);
return entry; return entry;
} }
...@@ -640,7 +640,7 @@ CodeEntry* CpuProfilesCollection::NewCodeEntry(Logger::LogEventsAndTags tag, ...@@ -640,7 +640,7 @@ CodeEntry* CpuProfilesCollection::NewCodeEntry(Logger::LogEventsAndTags tag,
GetName(name), GetName(name),
"", "",
v8::CpuProfileNode::kNoLineNumberInfo, v8::CpuProfileNode::kNoLineNumberInfo,
CodeEntry::kInheritsSecurityToken); TokenEnumerator::kInheritsSecurityToken);
code_entries_.Add(entry); code_entries_.Add(entry);
return entry; return entry;
} }
...@@ -653,7 +653,7 @@ CodeEntry* CpuProfilesCollection::NewCodeEntry(Logger::LogEventsAndTags tag, ...@@ -653,7 +653,7 @@ CodeEntry* CpuProfilesCollection::NewCodeEntry(Logger::LogEventsAndTags tag,
GetName(args_count), GetName(args_count),
"", "",
v8::CpuProfileNode::kNoLineNumberInfo, v8::CpuProfileNode::kNoLineNumberInfo,
CodeEntry::kInheritsSecurityToken); TokenEnumerator::kInheritsSecurityToken);
code_entries_.Add(entry); code_entries_.Add(entry);
return entry; return entry;
} }
......
...@@ -41,6 +41,9 @@ class TokenEnumerator { ...@@ -41,6 +41,9 @@ class TokenEnumerator {
~TokenEnumerator(); ~TokenEnumerator();
int GetTokenId(Object* token); int GetTokenId(Object* token);
static const int kNoSecurityToken = -1;
static const int kInheritsSecurityToken = -2;
private: private:
static void TokenRemovedCallback(v8::Persistent<v8::Value> handle, static void TokenRemovedCallback(v8::Persistent<v8::Value> handle,
void* parameter); void* parameter);
...@@ -78,8 +81,6 @@ class CodeEntry { ...@@ -78,8 +81,6 @@ class CodeEntry {
void CopyData(const CodeEntry& source); void CopyData(const CodeEntry& source);
static const char* kEmptyNamePrefix; static const char* kEmptyNamePrefix;
static const int kNoSecurityToken = -1;
static const int kInheritsSecurityToken = -2;
private: private:
unsigned call_uid_; unsigned call_uid_;
......
...@@ -16,6 +16,7 @@ using i::CpuProfilesCollection; ...@@ -16,6 +16,7 @@ using i::CpuProfilesCollection;
using i::ProfileGenerator; using i::ProfileGenerator;
using i::ProfileNode; using i::ProfileNode;
using i::ProfilerEventsProcessor; using i::ProfilerEventsProcessor;
using i::TokenEnumerator;
TEST(StartStop) { TEST(StartStop) {
...@@ -115,7 +116,7 @@ TEST(CodeEvents) { ...@@ -115,7 +116,7 @@ TEST(CodeEvents) {
processor.CodeCreateEvent(i::Logger::STUB_TAG, 3, ToAddress(0x1600), 0x10); processor.CodeCreateEvent(i::Logger::STUB_TAG, 3, ToAddress(0x1600), 0x10);
processor.CodeDeleteEvent(ToAddress(0x1600)); processor.CodeDeleteEvent(ToAddress(0x1600));
processor.FunctionCreateEvent(ToAddress(0x1700), ToAddress(0x1000), processor.FunctionCreateEvent(ToAddress(0x1700), ToAddress(0x1000),
CodeEntry::kNoSecurityToken); TokenEnumerator::kNoSecurityToken);
// Enqueue a tick event to enable code events processing. // Enqueue a tick event to enable code events processing.
EnqueueTickSampleEvent(&processor, ToAddress(0x1000)); EnqueueTickSampleEvent(&processor, ToAddress(0x1000));
...@@ -178,7 +179,7 @@ TEST(TickEvents) { ...@@ -178,7 +179,7 @@ TEST(TickEvents) {
processor.Stop(); processor.Stop();
processor.Join(); processor.Join();
CpuProfile* profile = CpuProfile* profile =
profiles.StopProfiling(CodeEntry::kNoSecurityToken, "", 1); profiles.StopProfiling(TokenEnumerator::kNoSecurityToken, "", 1);
CHECK_NE(NULL, profile); CHECK_NE(NULL, profile);
// Check call trees. // Check call trees.
......
...@@ -39,7 +39,7 @@ class TokenEnumeratorTester { ...@@ -39,7 +39,7 @@ class TokenEnumeratorTester {
TEST(TokenEnumerator) { TEST(TokenEnumerator) {
TokenEnumerator te; TokenEnumerator te;
CHECK_EQ(CodeEntry::kNoSecurityToken, te.GetTokenId(NULL)); CHECK_EQ(TokenEnumerator::kNoSecurityToken, te.GetTokenId(NULL));
v8::HandleScope hs; v8::HandleScope hs;
v8::Local<v8::String> token1(v8::String::New("1")); v8::Local<v8::String> token1(v8::String::New("1"));
CHECK_EQ(0, te.GetTokenId(*v8::Utils::OpenHandle(*token1))); CHECK_EQ(0, te.GetTokenId(*v8::Utils::OpenHandle(*token1)));
...@@ -65,20 +65,20 @@ TEST(TokenEnumerator) { ...@@ -65,20 +65,20 @@ TEST(TokenEnumerator) {
TEST(ProfileNodeFindOrAddChild) { TEST(ProfileNodeFindOrAddChild) {
ProfileNode node(NULL, NULL); ProfileNode node(NULL, NULL);
CodeEntry entry1( CodeEntry entry1(i::Logger::FUNCTION_TAG, "", "aaa", "", 0,
i::Logger::FUNCTION_TAG, "", "aaa", "", 0, CodeEntry::kNoSecurityToken); TokenEnumerator::kNoSecurityToken);
ProfileNode* childNode1 = node.FindOrAddChild(&entry1); ProfileNode* childNode1 = node.FindOrAddChild(&entry1);
CHECK_NE(NULL, childNode1); CHECK_NE(NULL, childNode1);
CHECK_EQ(childNode1, node.FindOrAddChild(&entry1)); CHECK_EQ(childNode1, node.FindOrAddChild(&entry1));
CodeEntry entry2( CodeEntry entry2(i::Logger::FUNCTION_TAG, "", "bbb", "", 0,
i::Logger::FUNCTION_TAG, "", "bbb", "", 0, CodeEntry::kNoSecurityToken); TokenEnumerator::kNoSecurityToken);
ProfileNode* childNode2 = node.FindOrAddChild(&entry2); ProfileNode* childNode2 = node.FindOrAddChild(&entry2);
CHECK_NE(NULL, childNode2); CHECK_NE(NULL, childNode2);
CHECK_NE(childNode1, childNode2); CHECK_NE(childNode1, childNode2);
CHECK_EQ(childNode1, node.FindOrAddChild(&entry1)); CHECK_EQ(childNode1, node.FindOrAddChild(&entry1));
CHECK_EQ(childNode2, node.FindOrAddChild(&entry2)); CHECK_EQ(childNode2, node.FindOrAddChild(&entry2));
CodeEntry entry3( CodeEntry entry3(i::Logger::FUNCTION_TAG, "", "ccc", "", 0,
i::Logger::FUNCTION_TAG, "", "ccc", "", 0, CodeEntry::kNoSecurityToken); TokenEnumerator::kNoSecurityToken);
ProfileNode* childNode3 = node.FindOrAddChild(&entry3); ProfileNode* childNode3 = node.FindOrAddChild(&entry3);
CHECK_NE(NULL, childNode3); CHECK_NE(NULL, childNode3);
CHECK_NE(childNode1, childNode3); CHECK_NE(childNode1, childNode3);
...@@ -119,12 +119,12 @@ class ProfileTreeTestHelper { ...@@ -119,12 +119,12 @@ class ProfileTreeTestHelper {
} // namespace } // namespace
TEST(ProfileTreeAddPathFromStart) { TEST(ProfileTreeAddPathFromStart) {
CodeEntry entry1( CodeEntry entry1(i::Logger::FUNCTION_TAG, "", "aaa", "", 0,
i::Logger::FUNCTION_TAG, "", "aaa", "", 0, CodeEntry::kNoSecurityToken); TokenEnumerator::kNoSecurityToken);
CodeEntry entry2( CodeEntry entry2(i::Logger::FUNCTION_TAG, "", "bbb", "", 0,
i::Logger::FUNCTION_TAG, "", "bbb", "", 0, CodeEntry::kNoSecurityToken); TokenEnumerator::kNoSecurityToken);
CodeEntry entry3( CodeEntry entry3(i::Logger::FUNCTION_TAG, "", "ccc", "", 0,
i::Logger::FUNCTION_TAG, "", "ccc", "", 0, CodeEntry::kNoSecurityToken); TokenEnumerator::kNoSecurityToken);
ProfileTree tree; ProfileTree tree;
ProfileTreeTestHelper helper(&tree); ProfileTreeTestHelper helper(&tree);
CHECK_EQ(NULL, helper.Walk(&entry1)); CHECK_EQ(NULL, helper.Walk(&entry1));
...@@ -189,12 +189,12 @@ TEST(ProfileTreeAddPathFromStart) { ...@@ -189,12 +189,12 @@ TEST(ProfileTreeAddPathFromStart) {
TEST(ProfileTreeAddPathFromEnd) { TEST(ProfileTreeAddPathFromEnd) {
CodeEntry entry1( CodeEntry entry1(i::Logger::FUNCTION_TAG, "", "aaa", "", 0,
i::Logger::FUNCTION_TAG, "", "aaa", "", 0, CodeEntry::kNoSecurityToken); TokenEnumerator::kNoSecurityToken);
CodeEntry entry2( CodeEntry entry2(i::Logger::FUNCTION_TAG, "", "bbb", "", 0,
i::Logger::FUNCTION_TAG, "", "bbb", "", 0, CodeEntry::kNoSecurityToken); TokenEnumerator::kNoSecurityToken);
CodeEntry entry3( CodeEntry entry3(i::Logger::FUNCTION_TAG, "", "ccc", "", 0,
i::Logger::FUNCTION_TAG, "", "ccc", "", 0, CodeEntry::kNoSecurityToken); TokenEnumerator::kNoSecurityToken);
ProfileTree tree; ProfileTree tree;
ProfileTreeTestHelper helper(&tree); ProfileTreeTestHelper helper(&tree);
CHECK_EQ(NULL, helper.Walk(&entry1)); CHECK_EQ(NULL, helper.Walk(&entry1));
...@@ -272,8 +272,8 @@ TEST(ProfileTreeCalculateTotalTicks) { ...@@ -272,8 +272,8 @@ TEST(ProfileTreeCalculateTotalTicks) {
CHECK_EQ(1, empty_tree.root()->total_ticks()); CHECK_EQ(1, empty_tree.root()->total_ticks());
CHECK_EQ(1, empty_tree.root()->self_ticks()); CHECK_EQ(1, empty_tree.root()->self_ticks());
CodeEntry entry1( CodeEntry entry1(i::Logger::FUNCTION_TAG, "", "aaa", "", 0,
i::Logger::FUNCTION_TAG, "", "aaa", "", 0, CodeEntry::kNoSecurityToken); TokenEnumerator::kNoSecurityToken);
CodeEntry* e1_path[] = {&entry1}; CodeEntry* e1_path[] = {&entry1};
Vector<CodeEntry*> e1_path_vec( Vector<CodeEntry*> e1_path_vec(
e1_path, sizeof(e1_path) / sizeof(e1_path[0])); e1_path, sizeof(e1_path) / sizeof(e1_path[0]));
...@@ -294,8 +294,8 @@ TEST(ProfileTreeCalculateTotalTicks) { ...@@ -294,8 +294,8 @@ TEST(ProfileTreeCalculateTotalTicks) {
CHECK_EQ(1, node1->total_ticks()); CHECK_EQ(1, node1->total_ticks());
CHECK_EQ(1, node1->self_ticks()); CHECK_EQ(1, node1->self_ticks());
CodeEntry entry2( CodeEntry entry2(i::Logger::FUNCTION_TAG, "", "bbb", "", 0,
i::Logger::FUNCTION_TAG, "", "bbb", "", 0, CodeEntry::kNoSecurityToken); TokenEnumerator::kNoSecurityToken);
CodeEntry* e1_e2_path[] = {&entry1, &entry2}; CodeEntry* e1_e2_path[] = {&entry1, &entry2};
Vector<CodeEntry*> e1_e2_path_vec( Vector<CodeEntry*> e1_e2_path_vec(
e1_e2_path, sizeof(e1_e2_path) / sizeof(e1_e2_path[0])); e1_e2_path, sizeof(e1_e2_path) / sizeof(e1_e2_path[0]));
...@@ -330,8 +330,8 @@ TEST(ProfileTreeCalculateTotalTicks) { ...@@ -330,8 +330,8 @@ TEST(ProfileTreeCalculateTotalTicks) {
CodeEntry* e2_path[] = {&entry2}; CodeEntry* e2_path[] = {&entry2};
Vector<CodeEntry*> e2_path_vec( Vector<CodeEntry*> e2_path_vec(
e2_path, sizeof(e2_path) / sizeof(e2_path[0])); e2_path, sizeof(e2_path) / sizeof(e2_path[0]));
CodeEntry entry3( CodeEntry entry3(i::Logger::FUNCTION_TAG, "", "ccc", "", 0,
i::Logger::FUNCTION_TAG, "", "ccc", "", 0, CodeEntry::kNoSecurityToken); TokenEnumerator::kNoSecurityToken);
CodeEntry* e3_path[] = {&entry3}; CodeEntry* e3_path[] = {&entry3};
Vector<CodeEntry*> e3_path_vec( Vector<CodeEntry*> e3_path_vec(
e3_path, sizeof(e3_path) / sizeof(e3_path[0])); e3_path, sizeof(e3_path) / sizeof(e3_path[0]));
...@@ -394,7 +394,7 @@ TEST(ProfileTreeFilteredClone) { ...@@ -394,7 +394,7 @@ TEST(ProfileTreeFilteredClone) {
CodeEntry entry3(i::Logger::FUNCTION_TAG, "", "ccc", "", 0, token0); CodeEntry entry3(i::Logger::FUNCTION_TAG, "", "ccc", "", 0, token0);
CodeEntry entry4( CodeEntry entry4(
i::Logger::FUNCTION_TAG, "", "ddd", "", 0, i::Logger::FUNCTION_TAG, "", "ddd", "", 0,
CodeEntry::kInheritsSecurityToken); TokenEnumerator::kInheritsSecurityToken);
{ {
CodeEntry* e1_e2_path[] = {&entry1, &entry2}; CodeEntry* e1_e2_path[] = {&entry1, &entry2};
...@@ -491,14 +491,14 @@ static inline i::Address ToAddress(int n) { ...@@ -491,14 +491,14 @@ static inline i::Address ToAddress(int n) {
TEST(CodeMapAddCode) { TEST(CodeMapAddCode) {
CodeMap code_map; CodeMap code_map;
CodeEntry entry1( CodeEntry entry1(i::Logger::FUNCTION_TAG, "", "aaa", "", 0,
i::Logger::FUNCTION_TAG, "", "aaa", "", 0, CodeEntry::kNoSecurityToken); TokenEnumerator::kNoSecurityToken);
CodeEntry entry2( CodeEntry entry2(i::Logger::FUNCTION_TAG, "", "bbb", "", 0,
i::Logger::FUNCTION_TAG, "", "bbb", "", 0, CodeEntry::kNoSecurityToken); TokenEnumerator::kNoSecurityToken);
CodeEntry entry3( CodeEntry entry3(i::Logger::FUNCTION_TAG, "", "ccc", "", 0,
i::Logger::FUNCTION_TAG, "", "ccc", "", 0, CodeEntry::kNoSecurityToken); TokenEnumerator::kNoSecurityToken);
CodeEntry entry4( CodeEntry entry4(i::Logger::FUNCTION_TAG, "", "ddd", "", 0,
i::Logger::FUNCTION_TAG, "", "ddd", "", 0, CodeEntry::kNoSecurityToken); TokenEnumerator::kNoSecurityToken);
code_map.AddCode(ToAddress(0x1500), &entry1, 0x200); code_map.AddCode(ToAddress(0x1500), &entry1, 0x200);
code_map.AddCode(ToAddress(0x1700), &entry2, 0x100); code_map.AddCode(ToAddress(0x1700), &entry2, 0x100);
code_map.AddCode(ToAddress(0x1900), &entry3, 0x50); code_map.AddCode(ToAddress(0x1900), &entry3, 0x50);
...@@ -525,10 +525,10 @@ TEST(CodeMapAddCode) { ...@@ -525,10 +525,10 @@ TEST(CodeMapAddCode) {
TEST(CodeMapMoveAndDeleteCode) { TEST(CodeMapMoveAndDeleteCode) {
CodeMap code_map; CodeMap code_map;
CodeEntry entry1( CodeEntry entry1(i::Logger::FUNCTION_TAG, "", "aaa", "", 0,
i::Logger::FUNCTION_TAG, "", "aaa", "", 0, CodeEntry::kNoSecurityToken); TokenEnumerator::kNoSecurityToken);
CodeEntry entry2( CodeEntry entry2(i::Logger::FUNCTION_TAG, "", "bbb", "", 0,
i::Logger::FUNCTION_TAG, "", "bbb", "", 0, CodeEntry::kNoSecurityToken); TokenEnumerator::kNoSecurityToken);
code_map.AddCode(ToAddress(0x1500), &entry1, 0x200); code_map.AddCode(ToAddress(0x1500), &entry1, 0x200);
code_map.AddCode(ToAddress(0x1700), &entry2, 0x100); code_map.AddCode(ToAddress(0x1700), &entry2, 0x100);
CHECK_EQ(&entry1, code_map.FindEntry(ToAddress(0x1500))); CHECK_EQ(&entry1, code_map.FindEntry(ToAddress(0x1500)));
...@@ -601,7 +601,7 @@ TEST(RecordTickSample) { ...@@ -601,7 +601,7 @@ TEST(RecordTickSample) {
generator.RecordTickSample(sample3); generator.RecordTickSample(sample3);
CpuProfile* profile = CpuProfile* profile =
profiles.StopProfiling(CodeEntry::kNoSecurityToken, "", 1); profiles.StopProfiling(TokenEnumerator::kNoSecurityToken, "", 1);
CHECK_NE(NULL, profile); CHECK_NE(NULL, profile);
ProfileTreeTestHelper top_down_test_helper(profile->top_down()); ProfileTreeTestHelper top_down_test_helper(profile->top_down());
CHECK_EQ(NULL, top_down_test_helper.Walk(entry2)); CHECK_EQ(NULL, top_down_test_helper.Walk(entry2));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment