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 4961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4972 and_(scratch1, Immediate(Map::kElementsKindMask)); | 4972 and_(scratch1, Immediate(Map::kElementsKindMask)); |
4973 shr(scratch1, Immediate(Map::kElementsKindShift)); | 4973 shr(scratch1, Immediate(Map::kElementsKindShift)); |
4974 cmpq(scratch1, Immediate(DICTIONARY_ELEMENTS)); | 4974 cmpq(scratch1, Immediate(DICTIONARY_ELEMENTS)); |
4975 j(equal, found); | 4975 j(equal, found); |
4976 movp(current, FieldOperand(current, Map::kPrototypeOffset)); | 4976 movp(current, FieldOperand(current, Map::kPrototypeOffset)); |
4977 CompareRoot(current, Heap::kNullValueRootIndex); | 4977 CompareRoot(current, Heap::kNullValueRootIndex); |
4978 j(not_equal, &loop_again); | 4978 j(not_equal, &loop_again); |
4979 } | 4979 } |
4980 | 4980 |
4981 | 4981 |
| 4982 void MacroAssembler::FlooringDiv(Register dividend, int32_t divisor) { |
| 4983 ASSERT(!dividend.is(rax)); |
| 4984 ASSERT(!dividend.is(rdx)); |
| 4985 MultiplierAndShift ms(divisor); |
| 4986 movl(rax, Immediate(ms.multiplier())); |
| 4987 imull(dividend); |
| 4988 if (divisor > 0 && ms.multiplier() < 0) addl(rdx, dividend); |
| 4989 if (divisor < 0 && ms.multiplier() > 0) subl(rdx, dividend); |
| 4990 if (ms.shift() > 0) sarl(rdx, Immediate(ms.shift())); |
| 4991 } |
| 4992 |
| 4993 |
4982 } } // namespace v8::internal | 4994 } } // namespace v8::internal |
4983 | 4995 |
4984 #endif // V8_TARGET_ARCH_X64 | 4996 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |