Commit 75497928 authored by ulan's avatar ulan Committed by Commit bot

Fix Heap::ComputeHeapState after 057514 and 6256dc.

This restores size_of_objects and removed unused fields.

BUG=chromium:538539
LOG=NO

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

Cr-Commit-Position: refs/heads/master@{#31072}
parent 3e19476f
......@@ -44,12 +44,6 @@ void GCIdleTimeHeapState::Print() {
PrintF("contexts_disposal_rate=%f ", contexts_disposal_rate);
PrintF("size_of_objects=%" V8_PTR_PREFIX "d ", size_of_objects);
PrintF("incremental_marking_stopped=%d ", incremental_marking_stopped);
PrintF("sweeping_in_progress=%d ", sweeping_in_progress);
PrintF("has_low_allocation_rate=%d", has_low_allocation_rate);
PrintF("mark_compact_speed=%" V8_PTR_PREFIX "d ",
mark_compact_speed_in_bytes_per_ms);
PrintF("incremental_marking_speed=%" V8_PTR_PREFIX "d ",
incremental_marking_speed_in_bytes_per_ms);
}
......
......@@ -63,12 +63,6 @@ class GCIdleTimeHeapState {
double contexts_disposal_rate;
size_t size_of_objects;
bool incremental_marking_stopped;
bool sweeping_in_progress;
bool sweeping_completed;
bool has_low_allocation_rate;
size_t mark_compact_speed_in_bytes_per_ms;
size_t incremental_marking_speed_in_bytes_per_ms;
size_t final_incremental_mark_compact_speed_in_bytes_per_ms;
};
......
......@@ -4089,9 +4089,8 @@ GCIdleTimeHeapState Heap::ComputeHeapState() {
heap_state.contexts_disposed = contexts_disposed_;
heap_state.contexts_disposal_rate =
tracer()->ContextDisposalRateInMilliseconds();
heap_state.size_of_objects = static_cast<size_t>(SizeOfObjects());
heap_state.incremental_marking_stopped = incremental_marking()->IsStopped();
heap_state.mark_compact_speed_in_bytes_per_ms =
static_cast<size_t>(tracer()->MarkCompactSpeedInBytesPerMillisecond());
return heap_state;
}
......
......@@ -24,7 +24,6 @@ class GCIdleTimeHandlerTest : public ::testing::Test {
result.contexts_disposed = 0;
result.contexts_disposal_rate = GCIdleTimeHandler::kHighContextDisposalRate;
result.incremental_marking_stopped = false;
result.mark_compact_speed_in_bytes_per_ms = kMarkCompactSpeed;
return result;
}
......@@ -164,7 +163,7 @@ TEST_F(GCIdleTimeHandlerTest, AfterContextDisposeSmallIdleTime1) {
heap_state.contexts_disposed = 1;
heap_state.contexts_disposal_rate =
GCIdleTimeHandler::kHighContextDisposalRate;
size_t speed = heap_state.mark_compact_speed_in_bytes_per_ms;
size_t speed = kMarkCompactSpeed;
double idle_time_ms = static_cast<double>(kSizeOfObjects / speed - 1);
GCIdleTimeAction action = handler()->Compute(idle_time_ms, heap_state);
EXPECT_EQ(DO_INCREMENTAL_STEP, action.type);
......@@ -176,7 +175,7 @@ TEST_F(GCIdleTimeHandlerTest, AfterContextDisposeSmallIdleTime2) {
heap_state.contexts_disposed = 1;
heap_state.contexts_disposal_rate =
GCIdleTimeHandler::kHighContextDisposalRate;
size_t speed = heap_state.mark_compact_speed_in_bytes_per_ms;
size_t speed = kMarkCompactSpeed;
double idle_time_ms = static_cast<double>(kSizeOfObjects / speed - 1);
GCIdleTimeAction action = handler()->Compute(idle_time_ms, heap_state);
EXPECT_EQ(DO_INCREMENTAL_STEP, action.type);
......@@ -194,7 +193,7 @@ TEST_F(GCIdleTimeHandlerTest, IncrementalMarking1) {
TEST_F(GCIdleTimeHandlerTest, NotEnoughTime) {
GCIdleTimeHeapState heap_state = DefaultHeapState();
heap_state.incremental_marking_stopped = true;
size_t speed = heap_state.mark_compact_speed_in_bytes_per_ms;
size_t speed = kMarkCompactSpeed;
double idle_time_ms = static_cast<double>(kSizeOfObjects / speed - 1);
GCIdleTimeAction action = handler()->Compute(idle_time_ms, heap_state);
EXPECT_EQ(DONE, action.type);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment