Commit 1ecb2254 authored by zhengxing.li's avatar zhengxing.li Committed by Commit bot

X87: [ic] Change CompareIC to handle JSReceiver instead of JSObject.

  port 0ed08780 (r32642)

  original commit message:
  There's no reason to limit the CompareIC to (known) JSObject instances,
  as all JSReceivers behave the same wrt. abstract and strict equality.
  So remove this historical limitation and track JSReceivers instead.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#32645}
parent 086d4598
......@@ -3306,19 +3306,20 @@ void CompareICStub::GenerateStrings(MacroAssembler* masm) {
}
void CompareICStub::GenerateObjects(MacroAssembler* masm) {
DCHECK(state() == CompareICState::OBJECT);
void CompareICStub::GenerateReceivers(MacroAssembler* masm) {
DCHECK_EQ(CompareICState::RECEIVER, state());
Label miss;
__ mov(ecx, edx);
__ and_(ecx, eax);
__ JumpIfSmi(ecx, &miss, Label::kNear);
__ CmpObjectType(eax, JS_OBJECT_TYPE, ecx);
__ j(not_equal, &miss, Label::kNear);
__ CmpObjectType(edx, JS_OBJECT_TYPE, ecx);
__ j(not_equal, &miss, Label::kNear);
STATIC_ASSERT(LAST_TYPE == LAST_JS_RECEIVER_TYPE);
__ CmpObjectType(eax, FIRST_JS_RECEIVER_TYPE, ecx);
__ j(below, &miss, Label::kNear);
__ CmpObjectType(edx, FIRST_JS_RECEIVER_TYPE, ecx);
__ j(below, &miss, Label::kNear);
DCHECK(GetCondition() == equal);
DCHECK_EQ(equal, GetCondition());
__ sub(eax, edx);
__ ret(0);
......@@ -3327,7 +3328,7 @@ void CompareICStub::GenerateObjects(MacroAssembler* masm) {
}
void CompareICStub::GenerateKnownObjects(MacroAssembler* masm) {
void CompareICStub::GenerateKnownReceivers(MacroAssembler* masm) {
Label miss;
Handle<WeakCell> cell = Map::WeakCellForMap(known_map_);
__ mov(ecx, edx);
......
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