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, ...@@ -516,6 +516,12 @@ void MacroAssembler::RecordWrite(Register object,
Check(eq, kWrongAddressOrValuePassedToRecordWrite); 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; Label done;
if (smi_check == INLINE_SMI_CHECK) { if (smi_check == INLINE_SMI_CHECK) {
......
...@@ -614,6 +614,10 @@ void MacroAssembler::RecordWriteForMap( ...@@ -614,6 +614,10 @@ void MacroAssembler::RecordWriteForMap(
return; 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 // 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 // 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 // the from object's page's interesting flag is also set. This optimization
...@@ -670,6 +674,10 @@ void MacroAssembler::RecordWrite(Register object, ...@@ -670,6 +674,10 @@ void MacroAssembler::RecordWrite(Register object,
bind(&ok); 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 // First, check if a write barrier is even needed. The tests below
// catch stores of Smis and stores into young gen. // catch stores of Smis and stores into young gen.
Label done; Label done;
......
...@@ -275,6 +275,12 @@ void MacroAssembler::RecordWrite(Register object, ...@@ -275,6 +275,12 @@ void MacroAssembler::RecordWrite(Register object,
eq, kWrongAddressOrValuePassedToRecordWrite, at, Operand(value)); 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; Label done;
if (smi_check == INLINE_SMI_CHECK) { if (smi_check == INLINE_SMI_CHECK) {
......
...@@ -261,6 +261,9 @@ namespace internal { ...@@ -261,6 +261,9 @@ namespace internal {
SC(soft_deopts_requested, V8.SoftDeoptsRequested) \ SC(soft_deopts_requested, V8.SoftDeoptsRequested) \
SC(soft_deopts_inserted, V8.SoftDeoptsInserted) \ SC(soft_deopts_inserted, V8.SoftDeoptsInserted) \
SC(soft_deopts_executed, V8.SoftDeoptsExecuted) \ 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_available, V8.MemoryNewSpaceBytesAvailable) \
SC(new_space_bytes_committed, V8.MemoryNewSpaceBytesCommitted) \ SC(new_space_bytes_committed, V8.MemoryNewSpaceBytesCommitted) \
SC(new_space_bytes_used, V8.MemoryNewSpaceBytesUsed) \ SC(new_space_bytes_used, V8.MemoryNewSpaceBytesUsed) \
......
...@@ -405,6 +405,10 @@ void MacroAssembler::RecordWrite(Register object, ...@@ -405,6 +405,10 @@ void MacroAssembler::RecordWrite(Register object,
bind(&ok); 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 // First, check if a write barrier is even needed. The tests below
// catch stores of smis and stores into the young generation. // catch stores of smis and stores into the young generation.
Label done; 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