Commit cc17ead4 authored by mbrandy's avatar mbrandy Committed by Commit bot

Revert "PPC: Provide call counts for constructor calls, surface them as a vector IC."

This reverts commit 55b41ff32ded37bb4730a6e13ff831c5def2841e.

Port e89e08ca

Reason for revert:
    Seems to be (mostly) responsible for the most recent Speedometer regression, not 100% sure.
    Let's see what the bots have to say.

R=bmeurer@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

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

Cr-Commit-Position: refs/heads/master@{#32624}
parent b634a61d
...@@ -3002,8 +3002,8 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) { ...@@ -3002,8 +3002,8 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
__ EmitLoadTypeFeedbackVector(r5); __ EmitLoadTypeFeedbackVector(r5);
__ LoadSmiLiteral(r6, SmiFromSlot(expr->CallNewFeedbackSlot())); __ LoadSmiLiteral(r6, SmiFromSlot(expr->CallNewFeedbackSlot()));
Handle<Code> code = CodeFactory::ConstructIC(isolate()).code(); CallConstructStub stub(isolate());
__ Call(code, RelocInfo::CODE_TARGET); __ Call(stub.GetCode(), RelocInfo::CODE_TARGET);
PrepareForBailoutForId(expr->ReturnId(), TOS_REG); PrepareForBailoutForId(expr->ReturnId(), TOS_REG);
// Restore context register. // Restore context register.
__ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
......
...@@ -2437,7 +2437,6 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) { ...@@ -2437,7 +2437,6 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
// r5 : feedback vector // r5 : feedback vector
// r6 : slot in feedback vector (Smi) // r6 : slot in feedback vector (Smi)
Label initialize, done, miss, megamorphic, not_array_function; Label initialize, done, miss, megamorphic, not_array_function;
Label done_increment_count;
DCHECK_EQ(*TypeFeedbackVector::MegamorphicSentinel(masm->isolate()), DCHECK_EQ(*TypeFeedbackVector::MegamorphicSentinel(masm->isolate()),
masm->isolate()->heap()->megamorphic_symbol()); masm->isolate()->heap()->megamorphic_symbol());
...@@ -2458,7 +2457,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) { ...@@ -2458,7 +2457,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
Register weak_value = r10; Register weak_value = r10;
__ LoadP(weak_value, FieldMemOperand(r8, WeakCell::kValueOffset)); __ LoadP(weak_value, FieldMemOperand(r8, WeakCell::kValueOffset));
__ cmp(r4, weak_value); __ cmp(r4, weak_value);
__ beq(&done_increment_count); __ beq(&done);
__ CompareRoot(r8, Heap::kmegamorphic_symbolRootIndex); __ CompareRoot(r8, Heap::kmegamorphic_symbolRootIndex);
__ beq(&done); __ beq(&done);
__ LoadP(feedback_map, FieldMemOperand(r8, HeapObject::kMapOffset)); __ LoadP(feedback_map, FieldMemOperand(r8, HeapObject::kMapOffset));
...@@ -2481,7 +2480,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) { ...@@ -2481,7 +2480,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
__ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, r8); __ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, r8);
__ cmp(r4, r8); __ cmp(r4, r8);
__ bne(&megamorphic); __ bne(&megamorphic);
__ b(&done_increment_count); __ b(&done);
__ bind(&miss); __ bind(&miss);
...@@ -2501,13 +2500,6 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) { ...@@ -2501,13 +2500,6 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
// An uninitialized cache is patched with the function // An uninitialized cache is patched with the function
__ bind(&initialize); __ bind(&initialize);
// Initialize the call counter.
__ LoadSmiLiteral(r8, Smi::FromInt(CallICNexus::kCallCountIncrement));
__ SmiToPtrArrayOffset(r7, r6);
__ add(r7, r5, r7);
__ StoreP(r8, FieldMemOperand(r7, FixedArray::kHeaderSize + kPointerSize),
r0);
// Make sure the function is the Array() function. // Make sure the function is the Array() function.
__ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, r8); __ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, r8);
__ cmp(r4, r8); __ cmp(r4, r8);
...@@ -2521,23 +2513,14 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) { ...@@ -2521,23 +2513,14 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
__ b(&done); __ b(&done);
__ bind(&not_array_function); __ bind(&not_array_function);
CreateWeakCellStub weak_cell_stub(masm->isolate()); CreateWeakCellStub weak_cell_stub(masm->isolate());
CallStubInRecordCallTarget(masm, &weak_cell_stub); CallStubInRecordCallTarget(masm, &weak_cell_stub);
__ b(&done);
__ bind(&done_increment_count);
__ SmiToPtrArrayOffset(r7, r6);
__ add(r7, r5, r7);
__ LoadP(r8, FieldMemOperand(r7, FixedArray::kHeaderSize + kPointerSize));
__ AddSmiLiteral(r8, r8, Smi::FromInt(CallICNexus::kCallCountIncrement), r0);
__ StoreP(r8, FieldMemOperand(r7, FixedArray::kHeaderSize + kPointerSize),
r0);
__ bind(&done); __ bind(&done);
} }
void ConstructICStub::Generate(MacroAssembler* masm) { void CallConstructStub::Generate(MacroAssembler* masm) {
// r3 : number of arguments // r3 : number of arguments
// r4 : the function to call // r4 : the function to call
// r5 : feedback vector // r5 : feedback vector
......
...@@ -188,15 +188,16 @@ void CallFunctionWithFeedbackAndVectorDescriptor::InitializePlatformSpecific( ...@@ -188,15 +188,16 @@ void CallFunctionWithFeedbackAndVectorDescriptor::InitializePlatformSpecific(
} }
void ConstructDescriptor::InitializePlatformSpecific( void CallConstructDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) { CallInterfaceDescriptorData* data) {
// r3 : number of arguments // r3 : number of arguments
// r4 : the function to call // r4 : the function to call
// r5 : feedback vector // r5 : feedback vector
// r6 : slot in feedback vector (Smi, for RecordCallTarget) // r6 : slot in feedback vector (Smi, for RecordCallTarget)
// r7 : new target (for IsSuperConstructorCall)
// TODO(turbofan): So far we don't gather type feedback and hence skip the // TODO(turbofan): So far we don't gather type feedback and hence skip the
// slot parameter, but ArrayConstructStub needs the vector to be undefined. // slot parameter, but ArrayConstructStub needs the vector to be undefined.
Register registers[] = {r3, r4, r5, r6}; Register registers[] = {r3, r4, r7, r5};
data->InitializePlatformSpecific(arraysize(registers), registers); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
......
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