fix assertion in Logger::CurrentTimeEvent with --prof
authorofrobots <ofrobots@google.com>
Tue, 28 Apr 2015 08:54:17 +0000 (01:54 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 28 Apr 2015 08:53:49 +0000 (08:53 +0000)
assertion did match the conditions under which this method gets called
(Runtime_DateCurrentTime). The bug got introduced as part of this change:
https://codereview.chromium.org/802333002

The assertion crash can be reproduced using:
% out/Debug/d8 --prof -e 'new Date();'

R=jkummerow@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1104303002

Cr-Commit-Position: refs/heads/master@{#28096}

src/log.cc

index 25d38dd..ec2bb63 100644 (file)
@@ -904,7 +904,7 @@ void Logger::CodeDeoptEvent(Code* code, Address pc, int fp_to_sp_delta) {
 
 void Logger::CurrentTimeEvent() {
   if (!log_->IsEnabled()) return;
-  DCHECK(FLAG_log_internal_timer_events);
+  DCHECK(FLAG_log_timer_events || FLAG_prof_cpp);
   Log::MessageBuilder msg(log_);
   int since_epoch = static_cast<int>(timer_.Elapsed().InMicroseconds());
   msg.Append("current-time,%ld", since_epoch);