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

Unified Diff: test/cctest/test-cpu-profiler.cc

Issue 1045753002: CpuProfiler: public API for deopt info in cpu profiler. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: unnecessary typedef was removed Created 5 years, 8 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.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-cpu-profiler.cc
diff --git a/test/cctest/test-cpu-profiler.cc b/test/cctest/test-cpu-profiler.cc
index a8cbdd505cfe0626de7669c6d952a5cccd8dca52..b46db63b616909eb15f119123be2800ed4fcd3fb 100644
--- a/test/cctest/test-cpu-profiler.cc
+++ b/test/cctest/test-cpu-profiler.cc
@@ -56,8 +56,10 @@ static v8::Local<v8::Function> GetFunction(v8::Context* env, const char* name) {
}
-static int offset(const char* src, const char* substring) {
- return static_cast<int>(strstr(src, substring) - src);
+static size_t offset(const char* src, const char* substring) {
+ const char* it = strstr(src, substring);
+ CHECK(it);
+ return static_cast<size_t>(it - src);
}
@@ -1898,10 +1900,11 @@ TEST(DeoptAtFirstLevelInlinedSource) {
const char* branch[] = {"", "test"};
const ProfileNode* itest_node =
GetSimpleBranch(profile, branch, arraysize(branch));
- const std::vector<i::DeoptInfo>& deopt_infos = itest_node->deopt_infos();
+ const std::vector<v8::CpuProfileDeoptInfo>& deopt_infos =
+ itest_node->deopt_infos();
CHECK_EQ(1, deopt_infos.size());
- const i::DeoptInfo& info = deopt_infos[0];
+ const v8::CpuProfileDeoptInfo& info = deopt_infos[0];
CHECK_EQ(reason(i::Deoptimizer::kNotAHeapNumber), info.deopt_reason);
CHECK_EQ(2, info.stack.size());
CHECK_EQ(inlined_script_id, info.stack[0].script_id);
@@ -1970,10 +1973,11 @@ TEST(DeoptAtSecondLevelInlinedSource) {
const char* branch[] = {"", "test1"};
const ProfileNode* itest_node =
GetSimpleBranch(profile, branch, arraysize(branch));
- const std::vector<i::DeoptInfo>& deopt_infos = itest_node->deopt_infos();
+ const std::vector<v8::CpuProfileDeoptInfo>& deopt_infos =
+ itest_node->deopt_infos();
CHECK_EQ(1, deopt_infos.size());
- const i::DeoptInfo info = deopt_infos[0];
+ const v8::CpuProfileDeoptInfo info = deopt_infos[0];
CHECK_EQ(reason(i::Deoptimizer::kNotAHeapNumber), info.deopt_reason);
CHECK_EQ(3, info.stack.size());
CHECK_EQ(inlined_script_id, info.stack[0].script_id);
« no previous file with comments | « src/profile-generator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698