| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1480 Code::StubType type, | 1480 Code::StubType type, |
| 1481 IcCheckType check) { | 1481 IcCheckType check) { |
| 1482 Label miss; | 1482 Label miss; |
| 1483 | 1483 |
| 1484 if (check == PROPERTY && | 1484 if (check == PROPERTY && |
| 1485 (kind() == Code::KEYED_LOAD_IC || kind() == Code::KEYED_STORE_IC)) { | 1485 (kind() == Code::KEYED_LOAD_IC || kind() == Code::KEYED_STORE_IC)) { |
| 1486 __ Branch(&miss, ne, this->name(), Operand(name)); | 1486 __ Branch(&miss, ne, this->name(), Operand(name)); |
| 1487 } | 1487 } |
| 1488 | 1488 |
| 1489 Label number_case; | 1489 Label number_case; |
| 1490 Register match = scratch1(); |
| 1490 Label* smi_target = IncludesNumberType(types) ? &number_case : &miss; | 1491 Label* smi_target = IncludesNumberType(types) ? &number_case : &miss; |
| 1491 __ JumpIfSmi(receiver(), smi_target); | 1492 __ JumpIfSmi(receiver(), smi_target, match); // Reg match is 0 if Smi. |
| 1492 | 1493 |
| 1493 Register map_reg = scratch1(); | 1494 Register map_reg = scratch2(); |
| 1494 | 1495 |
| 1495 int receiver_count = types->length(); | 1496 int receiver_count = types->length(); |
| 1496 int number_of_handled_maps = 0; | 1497 int number_of_handled_maps = 0; |
| 1497 __ lw(map_reg, FieldMemOperand(receiver(), HeapObject::kMapOffset)); | 1498 __ lw(map_reg, FieldMemOperand(receiver(), HeapObject::kMapOffset)); |
| 1498 for (int current = 0; current < receiver_count; ++current) { | 1499 for (int current = 0; current < receiver_count; ++current) { |
| 1499 Handle<HeapType> type = types->at(current); | 1500 Handle<HeapType> type = types->at(current); |
| 1500 Handle<Map> map = IC::TypeToMap(*type, isolate()); | 1501 Handle<Map> map = IC::TypeToMap(*type, isolate()); |
| 1501 if (!map->is_deprecated()) { | 1502 if (!map->is_deprecated()) { |
| 1502 number_of_handled_maps++; | 1503 number_of_handled_maps++; |
| 1504 // Check map and tail call if there's a match. |
| 1505 // Separate compare from branch, to provide path for above JumpIfSmi(). |
| 1506 __ Subu(match, map_reg, Operand(map)); |
| 1503 if (type->Is(HeapType::Number())) { | 1507 if (type->Is(HeapType::Number())) { |
| 1504 ASSERT(!number_case.is_unused()); | 1508 ASSERT(!number_case.is_unused()); |
| 1505 __ bind(&number_case); | 1509 __ bind(&number_case); |
| 1506 } | 1510 } |
| 1507 __ Jump(handlers->at(current), RelocInfo::CODE_TARGET, | 1511 __ Jump(handlers->at(current), RelocInfo::CODE_TARGET, |
| 1508 eq, map_reg, Operand(map)); | 1512 eq, match, Operand(zero_reg)); |
| 1509 } | 1513 } |
| 1510 } | 1514 } |
| 1511 ASSERT(number_of_handled_maps != 0); | 1515 ASSERT(number_of_handled_maps != 0); |
| 1512 | 1516 |
| 1513 __ bind(&miss); | 1517 __ bind(&miss); |
| 1514 TailCallBuiltin(masm(), MissBuiltin(kind())); | 1518 TailCallBuiltin(masm(), MissBuiltin(kind())); |
| 1515 | 1519 |
| 1516 // Return the generated code. | 1520 // Return the generated code. |
| 1517 InlineCacheState state = | 1521 InlineCacheState state = |
| 1518 number_of_handled_maps > 1 ? POLYMORPHIC : MONOMORPHIC; | 1522 number_of_handled_maps > 1 ? POLYMORPHIC : MONOMORPHIC; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1596 // ----------------------------------- | 1600 // ----------------------------------- |
| 1597 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 1601 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
| 1598 } | 1602 } |
| 1599 | 1603 |
| 1600 | 1604 |
| 1601 #undef __ | 1605 #undef __ |
| 1602 | 1606 |
| 1603 } } // namespace v8::internal | 1607 } } // namespace v8::internal |
| 1604 | 1608 |
| 1605 #endif // V8_TARGET_ARCH_MIPS | 1609 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |