OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1580 void CompareIC::UpdateCaches(Handle<Object> x, Handle<Object> y) { | 1580 void CompareIC::UpdateCaches(Handle<Object> x, Handle<Object> y) { |
1581 HandleScope scope; | 1581 HandleScope scope; |
1582 Handle<Code> rewritten; | 1582 Handle<Code> rewritten; |
1583 State previous_state = GetState(); | 1583 State previous_state = GetState(); |
1584 State state = TargetState(previous_state, false, x, y); | 1584 State state = TargetState(previous_state, false, x, y); |
1585 if (state == GENERIC) { | 1585 if (state == GENERIC) { |
1586 CompareStub stub(GetCondition(), strict(), NO_COMPARE_FLAGS, a1, a0); | 1586 CompareStub stub(GetCondition(), strict(), NO_COMPARE_FLAGS, a1, a0); |
1587 rewritten = stub.GetCode(); | 1587 rewritten = stub.GetCode(); |
1588 } else { | 1588 } else { |
1589 ICCompareStub stub(op_, state); | 1589 ICCompareStub stub(op_, state); |
| 1590 if (state == KNOWN_OBJECTS) { |
| 1591 stub.set_known_map(Handle<Map>(Handle<JSObject>::cast(x)->map())); |
| 1592 } |
1590 rewritten = stub.GetCode(); | 1593 rewritten = stub.GetCode(); |
1591 } | 1594 } |
1592 set_target(*rewritten); | 1595 set_target(*rewritten); |
1593 | 1596 |
1594 #ifdef DEBUG | 1597 #ifdef DEBUG |
1595 if (FLAG_trace_ic) { | 1598 if (FLAG_trace_ic) { |
1596 PrintF("[CompareIC (%s->%s)#%s]\n", | 1599 PrintF("[CompareIC (%s->%s)#%s]\n", |
1597 GetStateName(previous_state), | 1600 GetStateName(previous_state), |
1598 GetStateName(state), | 1601 GetStateName(state), |
1599 Token::Name(op_)); | 1602 Token::Name(op_)); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1669 Register reg = Register::from_code(Assembler::GetRs(instr_at_patch)); | 1672 Register reg = Register::from_code(Assembler::GetRs(instr_at_patch)); |
1670 patcher.masm()->andi(at, reg, kSmiTagMask); | 1673 patcher.masm()->andi(at, reg, kSmiTagMask); |
1671 patcher.ChangeBranchCondition(eq); | 1674 patcher.ChangeBranchCondition(eq); |
1672 } | 1675 } |
1673 } | 1676 } |
1674 | 1677 |
1675 | 1678 |
1676 } } // namespace v8::internal | 1679 } } // namespace v8::internal |
1677 | 1680 |
1678 #endif // V8_TARGET_ARCH_MIPS | 1681 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |