Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(330)

Side by Side Diff: src/x64/macro-assembler-x64.cc

Issue 197873029: Tweaked FlooringDiv back to TruncatingDiv again. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/x64/macro-assembler-x64.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 4974 matching lines...) Expand 10 before | Expand all | Expand 10 after
4985 and_(scratch1, Immediate(Map::kElementsKindMask)); 4985 and_(scratch1, Immediate(Map::kElementsKindMask));
4986 shr(scratch1, Immediate(Map::kElementsKindShift)); 4986 shr(scratch1, Immediate(Map::kElementsKindShift));
4987 cmpq(scratch1, Immediate(DICTIONARY_ELEMENTS)); 4987 cmpq(scratch1, Immediate(DICTIONARY_ELEMENTS));
4988 j(equal, found); 4988 j(equal, found);
4989 movp(current, FieldOperand(current, Map::kPrototypeOffset)); 4989 movp(current, FieldOperand(current, Map::kPrototypeOffset));
4990 CompareRoot(current, Heap::kNullValueRootIndex); 4990 CompareRoot(current, Heap::kNullValueRootIndex);
4991 j(not_equal, &loop_again); 4991 j(not_equal, &loop_again);
4992 } 4992 }
4993 4993
4994 4994
4995 void MacroAssembler::FlooringDiv(Register dividend, int32_t divisor) { 4995 void MacroAssembler::TruncatingDiv(Register dividend, int32_t divisor) {
4996 ASSERT(!dividend.is(rax)); 4996 ASSERT(!dividend.is(rax));
4997 ASSERT(!dividend.is(rdx)); 4997 ASSERT(!dividend.is(rdx));
4998 MultiplierAndShift ms(divisor); 4998 MultiplierAndShift ms(divisor);
4999 movl(rax, Immediate(ms.multiplier())); 4999 movl(rax, Immediate(ms.multiplier()));
5000 imull(dividend); 5000 imull(dividend);
5001 if (divisor > 0 && ms.multiplier() < 0) addl(rdx, dividend); 5001 if (divisor > 0 && ms.multiplier() < 0) addl(rdx, dividend);
5002 if (divisor < 0 && ms.multiplier() > 0) subl(rdx, dividend); 5002 if (divisor < 0 && ms.multiplier() > 0) subl(rdx, dividend);
5003 if (ms.shift() > 0) sarl(rdx, Immediate(ms.shift())); 5003 if (ms.shift() > 0) sarl(rdx, Immediate(ms.shift()));
5004 movl(rax, dividend);
5005 shrl(rax, Immediate(31));
5006 addl(rdx, rax);
5004 } 5007 }
5005 5008
5006 5009
5007 } } // namespace v8::internal 5010 } } // namespace v8::internal
5008 5011
5009 #endif // V8_TARGET_ARCH_X64 5012 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/macro-assembler-x64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698