Fix a few nits found by PVS Studio

BUG=v8:3192
LOG=n
R=dslomov@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#25086}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@25086 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
jkummerow@chromium.org 2014-11-03 19:44:46 +00:00
parent ce06f447d6
commit e525e76f21
6 changed files with 13 additions and 16 deletions

View File

@ -693,8 +693,7 @@ int Deoptimizer::GetDeoptimizationId(Isolate* isolate,
DeoptimizerData* data = isolate->deoptimizer_data();
MemoryChunk* base = data->deopt_entry_code_[type];
Address start = base->area_start();
if (base == NULL ||
addr < start ||
if (addr < start ||
addr >= start + (kMaxNumberOfEntries * table_entry_size_)) {
return kNotDeoptimizationEntry;
}

View File

@ -12643,9 +12643,10 @@ void HStatistics::Print() {
double normalized_time = source_size_in_kb > 0
? total.InMillisecondsF() / source_size_in_kb
: 0;
double normalized_size_in_kb = source_size_in_kb > 0
? total_size_ / 1024 / source_size_in_kb
: 0;
double normalized_size_in_kb =
source_size_in_kb > 0
? static_cast<double>(total_size_) / 1024 / source_size_in_kb
: 0;
PrintF("%33s %8.3f ms %7.3f kB allocated\n",
"Average per kB source", normalized_time, normalized_size_in_kb);
}

View File

@ -7197,7 +7197,7 @@ class IntrusiveMapTransitionIterator {
int value = Smi::cast(*IteratorField())->value();
int index = -value - 1;
int number_of_transitions = transition_array_->number_of_transitions();
while (index < number_of_transitions) {
if (index < number_of_transitions) {
*IteratorField() = Smi::FromInt(value - 1);
return transition_array_->GetTarget(index);
}

View File

@ -3203,7 +3203,7 @@ Statement* Parser::ParseForStatement(ZoneList<const AstRawString*>* labels,
Scanner::Location lhs_location = scanner()->peek_location();
Expression* expression = ParseExpression(false, CHECK_OK);
ForEachStatement::VisitMode mode;
bool accept_OF = expression->AsVariableProxy();
bool accept_OF = expression->IsVariableProxy();
if (CheckInOrOf(accept_OF, &mode)) {
expression = this->CheckAndRewriteReferenceExpression(

View File

@ -15148,7 +15148,7 @@ THREADED_TEST(PropertyEnumeration2) {
v8::Handle<v8::Array> props = val.As<v8::Object>()->GetPropertyNames();
CHECK_EQ(0, props->Length());
for (uint32_t i = 0; i < props->Length(); i++) {
printf("p[%d]\n", i);
printf("p[%u]\n", i);
}
}

View File

@ -630,14 +630,11 @@ static void VerifyCharacterStream(
static inline void PrintStats(const ConsStringGenerationData& data) {
#ifdef DEBUG
printf(
"%s: [%d], %s: [%d], %s: [%d], %s: [%d], %s: [%d], %s: [%d]\n",
"leaves", data.stats_.leaves_,
"empty", data.stats_.empty_leaves_,
"chars", data.stats_.chars_,
"lefts", data.stats_.left_traversals_,
"rights", data.stats_.right_traversals_,
"early_terminations", data.early_terminations_);
printf("%s: [%u], %s: [%u], %s: [%u], %s: [%u], %s: [%u], %s: [%u]\n",
"leaves", data.stats_.leaves_, "empty", data.stats_.empty_leaves_,
"chars", data.stats_.chars_, "lefts", data.stats_.left_traversals_,
"rights", data.stats_.right_traversals_, "early_terminations",
data.early_terminations_);
#endif
}