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

Unified Diff: test/cctest/test-log.cc

Issue 6529055: [Isolates] Merge crankshaft (r5922 from bleeding_edge). (Closed)
Patch Set: Win32 port Created 9 years, 10 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 | « test/cctest/test-heap.cc ('k') | test/cctest/test-log-stack-tracer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-log.cc
diff --git a/test/cctest/test-log.cc b/test/cctest/test-log.cc
index 527183c505bc3ac67ffa8b014e49a1b521807099..44f2ac5a730067fcedc7f8c5be9b9d3e906c0a7f 100644
--- a/test/cctest/test-log.cc
+++ b/test/cctest/test-log.cc
@@ -16,6 +16,7 @@
#include "cpu-profiler.h"
#include "v8threads.h"
#include "cctest.h"
+#include "vm-state-inl.h"
using v8::internal::Address;
using v8::internal::EmbeddedVector;
@@ -246,7 +247,8 @@ class LogBufferMatcher {
static void CheckThatProfilerWorks(LogBufferMatcher* matcher) {
- CHECK(!LoggerTestHelper::IsSamplerActive());
+ CHECK(i::RuntimeProfiler::IsEnabled() ||
+ !LoggerTestHelper::IsSamplerActive());
LoggerTestHelper::ResetSamplesTaken();
LOGGER->ResumeProfiler(v8::PROFILER_MODULE_CPU, 0);
@@ -272,7 +274,8 @@ static void CheckThatProfilerWorks(LogBufferMatcher* matcher) {
}
LOGGER->PauseProfiler(v8::PROFILER_MODULE_CPU, 0);
- CHECK(!LoggerTestHelper::IsSamplerActive());
+ CHECK(i::RuntimeProfiler::IsEnabled() ||
+ !LoggerTestHelper::IsSamplerActive());
// Wait 50 msecs to allow Profiler thread to process the last
// tick sample it has got.
@@ -291,8 +294,12 @@ static void CheckThatProfilerWorks(LogBufferMatcher* matcher) {
TEST(ProfLazyMode) {
ScopedLoggerInitializer initialize_logger(true);
- // No sampling should happen prior to resuming profiler.
- CHECK(!LoggerTestHelper::IsSamplerActive());
+ if (!i::V8::UseCrankshaft()) return;
+
+ // No sampling should happen prior to resuming profiler unless we
+ // are runtime profiling.
+ CHECK(i::RuntimeProfiler::IsEnabled() ||
+ !LoggerTestHelper::IsSamplerActive());
LogBufferMatcher matcher;
// Nothing must be logged until profiling is resumed.
@@ -409,7 +416,7 @@ class LoopingNonJsThread : public LoopingThread {
class TestSampler : public v8::internal::Sampler {
public:
explicit TestSampler(v8::internal::Isolate* isolate)
- : Sampler(isolate, 0, true),
+ : Sampler(isolate, 0, true, true),
semaphore_(v8::internal::OS::CreateSemaphore(0)),
was_sample_stack_called_(false) {
}
@@ -437,30 +444,38 @@ class TestSampler : public v8::internal::Sampler {
} // namespace
TEST(ProfMultipleThreads) {
+ TestSampler* sampler = NULL;
+ {
+ v8::Locker locker;
+ sampler = new TestSampler(v8::internal::Isolate::Current());
+ sampler->Start();
+ CHECK(sampler->IsActive());
+ }
+
LoopingJsThread jsThread(v8::internal::Isolate::Current());
jsThread.Start();
LoopingNonJsThread nonJsThread(v8::internal::Isolate::Current());
nonJsThread.Start();
- TestSampler sampler(v8::internal::Isolate::Current());
- sampler.Start();
- CHECK(!sampler.WasSampleStackCalled());
+ CHECK(!sampler->WasSampleStackCalled());
jsThread.WaitForRunning();
jsThread.SendSigProf();
- CHECK(sampler.WaitForTick());
- CHECK(sampler.WasSampleStackCalled());
- sampler.Reset();
- CHECK(!sampler.WasSampleStackCalled());
+ CHECK(sampler->WaitForTick());
+ CHECK(sampler->WasSampleStackCalled());
+ sampler->Reset();
+ CHECK(!sampler->WasSampleStackCalled());
nonJsThread.WaitForRunning();
nonJsThread.SendSigProf();
- CHECK(!sampler.WaitForTick());
- CHECK(!sampler.WasSampleStackCalled());
- sampler.Stop();
+ CHECK(!sampler->WaitForTick());
+ CHECK(!sampler->WasSampleStackCalled());
+ sampler->Stop();
jsThread.Stop();
nonJsThread.Stop();
jsThread.Join();
nonJsThread.Join();
+
+ delete sampler;
}
#endif // __linux__
« no previous file with comments | « test/cctest/test-heap.cc ('k') | test/cctest/test-log-stack-tracer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698