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

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

Issue 9638018: [v8-dev] Optimise Math.floor(x/y) to use integer division for specific divisor.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 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
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 3691 matching lines...) Expand 10 before | Expand all | Expand 10 after
3702 cmp(r3, empty_fixed_array_value); 3702 cmp(r3, empty_fixed_array_value);
3703 b(ne, call_runtime); 3703 b(ne, call_runtime);
3704 3704
3705 // Load the prototype from the map and loop if non-null. 3705 // Load the prototype from the map and loop if non-null.
3706 bind(&check_prototype); 3706 bind(&check_prototype);
3707 ldr(r1, FieldMemOperand(r2, Map::kPrototypeOffset)); 3707 ldr(r1, FieldMemOperand(r2, Map::kPrototypeOffset));
3708 cmp(r1, null_value); 3708 cmp(r1, null_value);
3709 b(ne, &next); 3709 b(ne, &next);
3710 } 3710 }
3711 3711
3712 3712
fschneider 2012/03/28 09:59:18 #ifdef DEBUG
Alexandre 2012/03/28 16:27:38 Done.
3713 bool AreAliased(Register r1, Register r2, Register r3, Register r4) { 3713 bool AreAliased(Register reg1,
3714 if (r1.is(r2)) return true; 3714 Register reg2,
3715 if (r1.is(r3)) return true; 3715 Register reg3,
3716 if (r1.is(r4)) return true; 3716 Register reg4,
3717 if (r2.is(r3)) return true; 3717 Register reg5,
3718 if (r2.is(r4)) return true; 3718 Register reg6) {
3719 if (r3.is(r4)) return true; 3719 int n_of_valid_regs = reg1.is_valid() + reg2.is_valid() +
3720 return false; 3720 reg3.is_valid() + reg4.is_valid() + reg5.is_valid() + reg6.is_valid();
3721
3722 RegList regs = 0;
3723 if (reg1.is_valid()) regs |= reg1.bit();
3724 if (reg2.is_valid()) regs |= reg2.bit();
3725 if (reg3.is_valid()) regs |= reg3.bit();
3726 if (reg4.is_valid()) regs |= reg4.bit();
3727 if (reg5.is_valid()) regs |= reg5.bit();
3728 if (reg6.is_valid()) regs |= reg6.bit();
3729 int n_of_non_aliasing_regs = NumRegs(regs);
3730
3731 return n_of_valid_regs != n_of_non_aliasing_regs;
3721 } 3732 }
3722 3733
fschneider 2012/03/28 09:59:18 #endif // DEBUG
Alexandre 2012/03/28 16:27:38 Done.
3723 3734
3724 CodePatcher::CodePatcher(byte* address, int instructions) 3735 CodePatcher::CodePatcher(byte* address, int instructions)
3725 : address_(address), 3736 : address_(address),
3726 instructions_(instructions), 3737 instructions_(instructions),
3727 size_(instructions * Assembler::kInstrSize), 3738 size_(instructions * Assembler::kInstrSize),
3728 masm_(Isolate::Current(), address, size_ + Assembler::kGap) { 3739 masm_(Isolate::Current(), address, size_ + Assembler::kGap) {
3729 // Create a new macro assembler pointing to the address of the code to patch. 3740 // Create a new macro assembler pointing to the address of the code to patch.
3730 // The size is adjusted with kGap on order for the assembler to generate size 3741 // The size is adjusted with kGap on order for the assembler to generate size
3731 // bytes of instructions without failing with buffer size constraints. 3742 // bytes of instructions without failing with buffer size constraints.
3732 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); 3743 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap);
(...skipping 23 matching lines...) Expand all
3756 void CodePatcher::EmitCondition(Condition cond) { 3767 void CodePatcher::EmitCondition(Condition cond) {
3757 Instr instr = Assembler::instr_at(masm_.pc_); 3768 Instr instr = Assembler::instr_at(masm_.pc_);
3758 instr = (instr & ~kCondMask) | cond; 3769 instr = (instr & ~kCondMask) | cond;
3759 masm_.emit(instr); 3770 masm_.emit(instr);
3760 } 3771 }
3761 3772
3762 3773
3763 } } // namespace v8::internal 3774 } } // namespace v8::internal
3764 3775
3765 #endif // V8_TARGET_ARCH_ARM 3776 #endif // V8_TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698