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

Side by Side Diff: src/mark-compact.cc

Issue 10831148: Fix integer division truncation error. (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 595
596 596
597 void MarkCompactCollector::CollectEvacuationCandidates(PagedSpace* space) { 597 void MarkCompactCollector::CollectEvacuationCandidates(PagedSpace* space) {
598 ASSERT(space->identity() == OLD_POINTER_SPACE || 598 ASSERT(space->identity() == OLD_POINTER_SPACE ||
599 space->identity() == OLD_DATA_SPACE || 599 space->identity() == OLD_DATA_SPACE ||
600 space->identity() == CODE_SPACE); 600 space->identity() == CODE_SPACE);
601 601
602 static const int kMaxMaxEvacuationCandidates = 1000; 602 static const int kMaxMaxEvacuationCandidates = 1000;
603 int number_of_pages = space->CountTotalPages(); 603 int number_of_pages = space->CountTotalPages();
604 int max_evacuation_candidates = 604 int max_evacuation_candidates =
605 static_cast<int>(sqrt(static_cast<double>(number_of_pages / 2)) + 1); 605 static_cast<int>(sqrt(number_of_pages / 2.0) + 1);
606 606
607 if (FLAG_stress_compaction || FLAG_always_compact) { 607 if (FLAG_stress_compaction || FLAG_always_compact) {
608 max_evacuation_candidates = kMaxMaxEvacuationCandidates; 608 max_evacuation_candidates = kMaxMaxEvacuationCandidates;
609 } 609 }
610 610
611 class Candidate { 611 class Candidate {
612 public: 612 public:
613 Candidate() : fragmentation_(0), page_(NULL) { } 613 Candidate() : fragmentation_(0), page_(NULL) { }
614 Candidate(int f, Page* p) : fragmentation_(f), page_(p) { } 614 Candidate(int f, Page* p) : fragmentation_(f), page_(p) { }
615 615
(...skipping 3632 matching lines...) Expand 10 before | Expand all | Expand 10 after
4248 while (buffer != NULL) { 4248 while (buffer != NULL) {
4249 SlotsBuffer* next_buffer = buffer->next(); 4249 SlotsBuffer* next_buffer = buffer->next();
4250 DeallocateBuffer(buffer); 4250 DeallocateBuffer(buffer);
4251 buffer = next_buffer; 4251 buffer = next_buffer;
4252 } 4252 }
4253 *buffer_address = NULL; 4253 *buffer_address = NULL;
4254 } 4254 }
4255 4255
4256 4256
4257 } } // namespace v8::internal 4257 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698