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

Unified Diff: test/cctest/test-profile-generator.cc

Issue 2056253003: Remove Isolate::cpu_profiler() usage in api.cc (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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
« src/profiler/cpu-profiler.h ('K') | « test/cctest/test-cpu-profiler.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-profile-generator.cc
diff --git a/test/cctest/test-profile-generator.cc b/test/cctest/test-profile-generator.cc
index 71c5ba874363b5941b44880ef259dde27b253d05..05eb8a82ad83b1ee025b6e0dec94c3bcf9bbbc33 100644
--- a/test/cctest/test-profile-generator.cc
+++ b/test/cctest/test-profile-generator.cc
@@ -344,7 +344,8 @@ class TestSetup {
TEST(RecordTickSample) {
TestSetup test_setup;
- CpuProfilesCollection profiles(CcTest::heap());
+ CpuProfilesCollection profiles(CcTest::i_isolate());
+ profiles.set_cpu_profiler(CcTest::i_isolate()->cpu_profiler());
profiles.StartProfiling("", false);
ProfileGenerator generator(&profiles);
CodeEntry* entry1 = profiles.NewCodeEntry(i::Logger::FUNCTION_TAG, "aaa");
@@ -410,7 +411,8 @@ static void CheckNodeIds(ProfileNode* node, unsigned* expectedId) {
TEST(SampleIds) {
TestSetup test_setup;
- CpuProfilesCollection profiles(CcTest::heap());
+ CpuProfilesCollection profiles(CcTest::i_isolate());
+ profiles.set_cpu_profiler(CcTest::i_isolate()->cpu_profiler());
profiles.StartProfiling("", true);
ProfileGenerator generator(&profiles);
CodeEntry* entry1 = profiles.NewCodeEntry(i::Logger::FUNCTION_TAG, "aaa");
@@ -461,7 +463,8 @@ TEST(SampleIds) {
TEST(NoSamples) {
TestSetup test_setup;
- CpuProfilesCollection profiles(CcTest::heap());
+ CpuProfilesCollection profiles(CcTest::i_isolate());
+ profiles.set_cpu_profiler(CcTest::i_isolate()->cpu_profiler());
profiles.StartProfiling("", false);
ProfileGenerator generator(&profiles);
CodeEntry* entry1 = profiles.NewCodeEntry(i::Logger::FUNCTION_TAG, "aaa");
@@ -544,7 +547,8 @@ TEST(RecordStackTraceAtStartProfiling) {
TEST(Issue51919) {
- CpuProfilesCollection collection(CcTest::heap());
+ CpuProfilesCollection collection(CcTest::i_isolate());
+ collection.set_cpu_profiler(CcTest::i_isolate()->cpu_profiler());
i::EmbeddedVector<char*,
CpuProfilesCollection::kMaxSimultaneousProfiles> titles;
for (int i = 0; i < CpuProfilesCollection::kMaxSimultaneousProfiles; ++i) {
@@ -618,16 +622,12 @@ TEST(ProfileNodeScriptId) {
CHECK_EQ(script_a->GetUnboundScript()->GetId(), current->GetScriptId());
}
-
-
-
static const char* line_number_test_source_existing_functions =
"function foo_at_the_first_line() {\n"
"}\n"
"foo_at_the_first_line();\n"
"function lazy_func_at_forth_line() {}\n";
-
static const char* line_number_test_source_profile_time_functions =
"// Empty first line\n"
"function bar_at_the_second_line() {\n"
@@ -652,7 +652,6 @@ int GetFunctionLineNumber(LocalContext* env, const char* name) {
return func_entry->line_number();
}
-
TEST(LineNumber) {
i::FLAG_use_inlining = false;
@@ -683,8 +682,6 @@ TEST(LineNumber) {
profiler->StopProfiling("LineNumber");
}
-
-
TEST(BailoutReason) {
v8::HandleScope scope(CcTest::isolate());
v8::Local<v8::Context> env = CcTest::NewContext(PROFILER_EXTENSION);
« src/profiler/cpu-profiler.h ('K') | « test/cctest/test-cpu-profiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698