Commit 63ea3a50 authored by mvstanton's avatar mvstanton Committed by Commit bot

VectorICs: Remove special code to increment call counts by two.

Previously, we used the lowest bit for something else.

R=bmeurer@chromium.org

Review-Url: https://codereview.chromium.org/2019393002
Cr-Commit-Position: refs/heads/master@{#36599}
parent 18ba2d1c
......@@ -1940,7 +1940,7 @@ void CallICStub::HandleArrayCase(MacroAssembler* masm, Label* miss) {
__ add(r2, r2, Operand::PointerOffsetFromSmiKey(r3));
__ add(r2, r2, Operand(FixedArray::kHeaderSize + kPointerSize));
__ ldr(r3, FieldMemOperand(r2, 0));
__ add(r3, r3, Operand(Smi::FromInt(CallICNexus::kCallCountIncrement)));
__ add(r3, r3, Operand(Smi::FromInt(1)));
__ str(r3, FieldMemOperand(r2, 0));
__ mov(r2, r4);
......@@ -1988,7 +1988,7 @@ void CallICStub::Generate(MacroAssembler* masm) {
__ add(r2, r2, Operand::PointerOffsetFromSmiKey(r3));
__ add(r2, r2, Operand(FixedArray::kHeaderSize + kPointerSize));
__ ldr(r3, FieldMemOperand(r2, 0));
__ add(r3, r3, Operand(Smi::FromInt(CallICNexus::kCallCountIncrement)));
__ add(r3, r3, Operand(Smi::FromInt(1)));
__ str(r3, FieldMemOperand(r2, 0));
__ bind(&call_function);
......@@ -2059,7 +2059,7 @@ void CallICStub::Generate(MacroAssembler* masm) {
__ b(ne, &miss);
// Initialize the call counter.
__ Move(r5, Operand(Smi::FromInt(CallICNexus::kCallCountIncrement)));
__ Move(r5, Operand(Smi::FromInt(1)));
__ add(r4, r2, Operand::PointerOffsetFromSmiKey(r3));
__ str(r5, FieldMemOperand(r4, FixedArray::kHeaderSize + kPointerSize));
......
......@@ -2183,7 +2183,7 @@ void CallICStub::HandleArrayCase(MacroAssembler* masm, Label* miss) {
__ Add(feedback_vector, feedback_vector,
Operand(FixedArray::kHeaderSize + kPointerSize));
__ Ldr(index, FieldMemOperand(feedback_vector, 0));
__ Add(index, index, Operand(Smi::FromInt(CallICNexus::kCallCountIncrement)));
__ Add(index, index, Operand(Smi::FromInt(1)));
__ Str(index, FieldMemOperand(feedback_vector, 0));
// Set up arguments for the array constructor stub.
......@@ -2243,7 +2243,7 @@ void CallICStub::Generate(MacroAssembler* masm) {
__ Add(feedback_vector, feedback_vector,
Operand(FixedArray::kHeaderSize + kPointerSize));
__ Ldr(index, FieldMemOperand(feedback_vector, 0));
__ Add(index, index, Operand(Smi::FromInt(CallICNexus::kCallCountIncrement)));
__ Add(index, index, Operand(Smi::FromInt(1)));
__ Str(index, FieldMemOperand(feedback_vector, 0));
__ Bind(&call_function);
......@@ -2308,7 +2308,7 @@ void CallICStub::Generate(MacroAssembler* masm) {
__ B(ne, &miss);
// Initialize the call counter.
__ Mov(x5, Smi::FromInt(CallICNexus::kCallCountIncrement));
__ Mov(x5, Smi::FromInt(1));
__ Adds(x4, feedback_vector,
Operand::UntagSmiAndScale(index, kPointerSizeLog2));
__ Str(x5, FieldMemOperand(x4, FixedArray::kHeaderSize + kPointerSize));
......
......@@ -1603,7 +1603,7 @@ void CallICStub::HandleArrayCase(MacroAssembler* masm, Label* miss) {
// Increment the call count for monomorphic function calls.
__ add(FieldOperand(ebx, edx, times_half_pointer_size,
FixedArray::kHeaderSize + kPointerSize),
Immediate(Smi::FromInt(CallICNexus::kCallCountIncrement)));
Immediate(Smi::FromInt(1)));
__ mov(ebx, ecx);
__ mov(edx, edi);
......@@ -1651,7 +1651,7 @@ void CallICStub::Generate(MacroAssembler* masm) {
// Increment the call count for monomorphic function calls.
__ add(FieldOperand(ebx, edx, times_half_pointer_size,
FixedArray::kHeaderSize + kPointerSize),
Immediate(Smi::FromInt(CallICNexus::kCallCountIncrement)));
Immediate(Smi::FromInt(1)));
__ bind(&call_function);
__ Set(eax, argc);
......@@ -1722,7 +1722,7 @@ void CallICStub::Generate(MacroAssembler* masm) {
// Initialize the call counter.
__ mov(FieldOperand(ebx, edx, times_half_pointer_size,
FixedArray::kHeaderSize + kPointerSize),
Immediate(Smi::FromInt(CallICNexus::kCallCountIncrement)));
Immediate(Smi::FromInt(1)));
// Store the function. Use a stub since we need a frame for allocation.
// ebx - vector
......
......@@ -2056,7 +2056,7 @@ void CallICStub::HandleArrayCase(MacroAssembler* masm, Label* miss) {
// Increment the call count for monomorphic function calls.
__ Lsa(at, a2, a3, kPointerSizeLog2 - kSmiTagSize);
__ lw(a3, FieldMemOperand(at, FixedArray::kHeaderSize + kPointerSize));
__ Addu(a3, a3, Operand(Smi::FromInt(CallICNexus::kCallCountIncrement)));
__ Addu(a3, a3, Operand(Smi::FromInt(1)));
__ sw(a3, FieldMemOperand(at, FixedArray::kHeaderSize + kPointerSize));
__ mov(a2, t0);
......@@ -2102,7 +2102,7 @@ void CallICStub::Generate(MacroAssembler* masm) {
// Increment the call count for monomorphic function calls.
__ Lsa(at, a2, a3, kPointerSizeLog2 - kSmiTagSize);
__ lw(a3, FieldMemOperand(at, FixedArray::kHeaderSize + kPointerSize));
__ Addu(a3, a3, Operand(Smi::FromInt(CallICNexus::kCallCountIncrement)));
__ Addu(a3, a3, Operand(Smi::FromInt(1)));
__ sw(a3, FieldMemOperand(at, FixedArray::kHeaderSize + kPointerSize));
__ bind(&call_function);
......@@ -2173,7 +2173,7 @@ void CallICStub::Generate(MacroAssembler* masm) {
// Initialize the call counter.
__ Lsa(at, a2, a3, kPointerSizeLog2 - kSmiTagSize);
__ li(t0, Operand(Smi::FromInt(CallICNexus::kCallCountIncrement)));
__ li(t0, Operand(Smi::FromInt(1)));
__ sw(t0, FieldMemOperand(at, FixedArray::kHeaderSize + kPointerSize));
// Store the function. Use a stub since we need a frame for allocation.
......
......@@ -2107,7 +2107,7 @@ void CallICStub::HandleArrayCase(MacroAssembler* masm, Label* miss) {
__ dsrl(t0, a3, 32 - kPointerSizeLog2);
__ Daddu(a3, a2, Operand(t0));
__ ld(t0, FieldMemOperand(a3, FixedArray::kHeaderSize + kPointerSize));
__ Daddu(t0, t0, Operand(Smi::FromInt(CallICNexus::kCallCountIncrement)));
__ Daddu(t0, t0, Operand(Smi::FromInt(1)));
__ sd(t0, FieldMemOperand(a3, FixedArray::kHeaderSize + kPointerSize));
__ mov(a2, a4);
......@@ -2155,7 +2155,7 @@ void CallICStub::Generate(MacroAssembler* masm) {
__ dsrl(t0, a3, 32 - kPointerSizeLog2);
__ Daddu(a3, a2, Operand(t0));
__ ld(t0, FieldMemOperand(a3, FixedArray::kHeaderSize + kPointerSize));
__ Daddu(t0, t0, Operand(Smi::FromInt(CallICNexus::kCallCountIncrement)));
__ Daddu(t0, t0, Operand(Smi::FromInt(1)));
__ sd(t0, FieldMemOperand(a3, FixedArray::kHeaderSize + kPointerSize));
__ bind(&call_function);
......@@ -2228,7 +2228,7 @@ void CallICStub::Generate(MacroAssembler* masm) {
// Initialize the call counter.
__ dsrl(at, a3, 32 - kPointerSizeLog2);
__ Daddu(at, a2, Operand(at));
__ li(t0, Operand(Smi::FromInt(CallICNexus::kCallCountIncrement)));
__ li(t0, Operand(Smi::FromInt(1)));
__ sd(t0, FieldMemOperand(at, FixedArray::kHeaderSize + kPointerSize));
// Store the function. Use a stub since we need a frame for allocation.
......
......@@ -523,7 +523,7 @@ InlineCacheState CallICNexus::StateFromFeedback() const {
int CallICNexus::ExtractCallCount() {
Object* call_count = GetFeedbackExtra();
if (call_count->IsSmi()) {
int value = Smi::cast(call_count)->value() / 2;
int value = Smi::cast(call_count)->value();
return value;
}
return -1;
......@@ -540,14 +540,14 @@ void CallICNexus::ConfigureMonomorphicArray() {
GetIsolate()->factory()->NewAllocationSite();
SetFeedback(*new_site);
}
SetFeedbackExtra(Smi::FromInt(kCallCountIncrement), SKIP_WRITE_BARRIER);
SetFeedbackExtra(Smi::FromInt(1), SKIP_WRITE_BARRIER);
}
void CallICNexus::ConfigureMonomorphic(Handle<JSFunction> function) {
Handle<WeakCell> new_cell = GetIsolate()->factory()->NewWeakCell(function);
SetFeedback(*new_cell);
SetFeedbackExtra(Smi::FromInt(kCallCountIncrement), SKIP_WRITE_BARRIER);
SetFeedbackExtra(Smi::FromInt(1), SKIP_WRITE_BARRIER);
}
......@@ -559,8 +559,7 @@ void CallICNexus::ConfigureMegamorphic() {
void CallICNexus::ConfigureMegamorphic(int call_count) {
SetFeedback(*TypeFeedbackVector::MegamorphicSentinel(GetIsolate()),
SKIP_WRITE_BARRIER);
SetFeedbackExtra(Smi::FromInt(call_count * kCallCountIncrement),
SKIP_WRITE_BARRIER);
SetFeedbackExtra(Smi::FromInt(call_count), SKIP_WRITE_BARRIER);
}
......
......@@ -397,10 +397,6 @@ class FeedbackNexus {
class CallICNexus final : public FeedbackNexus {
public:
// Monomorphic call ics store call counts. Platform code needs to increment
// the count appropriately (ie, by 2).
static const int kCallCountIncrement = 2;
CallICNexus(Handle<TypeFeedbackVector> vector, FeedbackVectorSlot slot)
: FeedbackNexus(vector, slot) {
DCHECK_EQ(FeedbackVectorSlotKind::CALL_IC, vector->GetKind(slot));
......
......@@ -1478,7 +1478,7 @@ void CallICStub::HandleArrayCase(MacroAssembler* masm, Label* miss) {
// Increment the call count for monomorphic function calls.
__ SmiAddConstant(FieldOperand(rbx, rdx, times_pointer_size,
FixedArray::kHeaderSize + kPointerSize),
Smi::FromInt(CallICNexus::kCallCountIncrement));
Smi::FromInt(1));
__ movp(rbx, rcx);
__ movp(rdx, rdi);
......@@ -1528,7 +1528,7 @@ void CallICStub::Generate(MacroAssembler* masm) {
// Increment the call count for monomorphic function calls.
__ SmiAddConstant(FieldOperand(rbx, rdx, times_pointer_size,
FixedArray::kHeaderSize + kPointerSize),
Smi::FromInt(CallICNexus::kCallCountIncrement));
Smi::FromInt(1));
__ bind(&call_function);
__ Set(rax, argc);
......@@ -1598,7 +1598,7 @@ void CallICStub::Generate(MacroAssembler* masm) {
// Initialize the call counter.
__ Move(FieldOperand(rbx, rdx, times_pointer_size,
FixedArray::kHeaderSize + kPointerSize),
Smi::FromInt(CallICNexus::kCallCountIncrement));
Smi::FromInt(1));
// Store the function. Use a stub since we need a frame for allocation.
// rbx - vector
......
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