Commit df57698c authored by zhengxing.li's avatar zhengxing.li Committed by Commit bot

X87: Revert of Provide call counts for constructor calls, surface them as a...

X87: Revert of Provide call counts for constructor calls, surface them as a vector IC. (patchset #4 id:60001 of https://codereview.chromium.org/1476413003/ )

  port e89e08ca (r32599)

  original commit message:
  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.

  Original issue's description:
  > Provide call counts for constructor calls, surface them as a vector IC.
  >
  > CallIC and CallConstructStub look so alike, at least in the feedback they gather even if the implementation differs...and CallIC has such a nice way of surfacing the feedback (CallICNexus), that ther
  >
  > BUG=
  >
  > Committed: https://crrev.com/66d5a9df62da458a51e8c7ed1811dc9660f4f418
  > Cr-Commit-Position: refs/heads/master@{#32452}

  additional description:
  Revert "X87: Provide call counts for constructor calls, surface them as a vector IC." as r32599 does

  This reverts commit 54a9d349.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#32638}
parent 1dda6ac2
......@@ -2888,8 +2888,8 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
__ EmitLoadTypeFeedbackVector(ebx);
__ mov(edx, Immediate(SmiFromSlot(expr->CallNewFeedbackSlot())));
Handle<Code> code = CodeFactory::ConstructIC(isolate()).code();
__ call(code, RelocInfo::CODE_TARGET);
CallConstructStub stub(isolate());
__ call(stub.GetCode(), RelocInfo::CODE_TARGET);
PrepareForBailoutForId(expr->ReturnId(), TOS_REG);
// Restore context register.
__ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
......
......@@ -1644,7 +1644,6 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
// edi : the function to call
Isolate* isolate = masm->isolate();
Label initialize, done, miss, megamorphic, not_array_function;
Label done_increment_count;
// Load the cache state into ecx.
__ mov(ecx, FieldOperand(ebx, edx, times_half_pointer_size,
......@@ -1657,7 +1656,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
// type-feedback-vector.h).
Label check_allocation_site;
__ cmp(edi, FieldOperand(ecx, WeakCell::kValueOffset));
__ j(equal, &done_increment_count, Label::kFar);
__ j(equal, &done, Label::kFar);
__ CompareRoot(ecx, Heap::kmegamorphic_symbolRootIndex);
__ j(equal, &done, Label::kFar);
__ CompareRoot(FieldOperand(ecx, HeapObject::kMapOffset),
......@@ -1680,7 +1679,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
__ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, ecx);
__ cmp(edi, ecx);
__ j(not_equal, &megamorphic);
__ jmp(&done_increment_count, Label::kFar);
__ jmp(&done, Label::kFar);
__ bind(&miss);
......@@ -1699,12 +1698,6 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
// An uninitialized cache is patched with the function or sentinel to
// indicate the ElementsKind if function is the Array constructor.
__ bind(&initialize);
// Initialize the call counter.
__ mov(FieldOperand(ebx, edx, times_half_pointer_size,
FixedArray::kHeaderSize + kPointerSize),
Immediate(Smi::FromInt(ConstructICNexus::kCallCountIncrement)));
// Make sure the function is the Array() function
__ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, ecx);
__ cmp(edi, ecx);
......@@ -1720,18 +1713,11 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
__ bind(&not_array_function);
CreateWeakCellStub weak_cell_stub(isolate);
CallStubInRecordCallTarget(masm, &weak_cell_stub);
__ jmp(&done);
__ bind(&done_increment_count);
__ add(FieldOperand(ebx, edx, times_half_pointer_size,
FixedArray::kHeaderSize + kPointerSize),
Immediate(Smi::FromInt(ConstructICNexus::kCallCountIncrement)));
__ bind(&done);
}
void ConstructICStub::Generate(MacroAssembler* masm) {
void CallConstructStub::Generate(MacroAssembler* masm) {
// eax : number of arguments
// ebx : feedback vector
// edx : slot in feedback vector (Smi, for RecordCallTarget)
......
......@@ -194,15 +194,16 @@ void CallFunctionWithFeedbackAndVectorDescriptor::InitializePlatformSpecific(
}
void ConstructDescriptor::InitializePlatformSpecific(
void CallConstructDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// eax : number of arguments
// ebx : feedback vector
// ecx : new target (for IsSuperConstructorCall)
// edx : slot in feedback vector (Smi, for RecordCallTarget)
// edi : constructor function
// TODO(turbofan): So far we don't gather type feedback and hence skip the
// slot parameter, but ArrayConstructStub needs the vector to be undefined.
Register registers[] = {eax, edi, edx, ebx};
Register registers[] = {eax, edi, ecx, ebx};
data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
}
......
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