Add counters for write barriers in generated code.

R=hpayer@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18029 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 258d5e8a
......@@ -516,6 +516,12 @@ void MacroAssembler::RecordWrite(Register object,
Check(eq, kWrongAddressOrValuePassedToRecordWrite);
}
// Count number of write barriers in generated code.
isolate()->counters()->write_barriers_static()->Increment();
// TODO(mstarzinger): Dynamic counter missing.
// First, check if a write barrier is even needed. The tests below
// catch stores of smis and stores into the young generation.
Label done;
if (smi_check == INLINE_SMI_CHECK) {
......
......@@ -614,6 +614,10 @@ void MacroAssembler::RecordWriteForMap(
return;
}
// Count number of write barriers in generated code.
isolate()->counters()->write_barriers_static()->Increment();
IncrementCounter(isolate()->counters()->write_barriers_dynamic(), 1);
// A single check of the map's pages interesting flag suffices, since it is
// only set during incremental collection, and then it's also guaranteed that
// the from object's page's interesting flag is also set. This optimization
......@@ -670,6 +674,10 @@ void MacroAssembler::RecordWrite(Register object,
bind(&ok);
}
// Count number of write barriers in generated code.
isolate()->counters()->write_barriers_static()->Increment();
IncrementCounter(isolate()->counters()->write_barriers_dynamic(), 1);
// First, check if a write barrier is even needed. The tests below
// catch stores of Smis and stores into young gen.
Label done;
......
......@@ -275,6 +275,12 @@ void MacroAssembler::RecordWrite(Register object,
eq, kWrongAddressOrValuePassedToRecordWrite, at, Operand(value));
}
// Count number of write barriers in generated code.
isolate()->counters()->write_barriers_static()->Increment();
// TODO(mstarzinger): Dynamic counter missing.
// First, check if a write barrier is even needed. The tests below
// catch stores of smis and stores into the young generation.
Label done;
if (smi_check == INLINE_SMI_CHECK) {
......
......@@ -261,6 +261,9 @@ namespace internal {
SC(soft_deopts_requested, V8.SoftDeoptsRequested) \
SC(soft_deopts_inserted, V8.SoftDeoptsInserted) \
SC(soft_deopts_executed, V8.SoftDeoptsExecuted) \
/* Number of write barriers in generated code. */ \
SC(write_barriers_dynamic, V8.WriteBarriersDynamic) \
SC(write_barriers_static, V8.WriteBarriersStatic) \
SC(new_space_bytes_available, V8.MemoryNewSpaceBytesAvailable) \
SC(new_space_bytes_committed, V8.MemoryNewSpaceBytesCommitted) \
SC(new_space_bytes_used, V8.MemoryNewSpaceBytesUsed) \
......
......@@ -405,6 +405,10 @@ void MacroAssembler::RecordWrite(Register object,
bind(&ok);
}
// Count number of write barriers in generated code.
isolate()->counters()->write_barriers_static()->Increment();
IncrementCounter(isolate()->counters()->write_barriers_dynamic(), 1);
// First, check if a write barrier is even needed. The tests below
// catch stores of smis and stores into the young generation.
Label done;
......
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