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 3191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3202 vstr(double_scratch.low(), | 3202 vstr(double_scratch.low(), |
3203 FieldMemOperand(dst, (field_count - 1) * kPointerSize)); | 3203 FieldMemOperand(dst, (field_count - 1) * kPointerSize)); |
3204 } | 3204 } |
3205 } | 3205 } |
3206 | 3206 |
3207 | 3207 |
3208 void MacroAssembler::CopyBytes(Register src, | 3208 void MacroAssembler::CopyBytes(Register src, |
3209 Register dst, | 3209 Register dst, |
3210 Register length, | 3210 Register length, |
3211 Register scratch) { | 3211 Register scratch) { |
3212 Label align_loop, align_loop_1, word_loop, byte_loop, byte_loop_1, done; | 3212 Label align_loop_1, word_loop, byte_loop, byte_loop_1, done; |
3213 | 3213 |
3214 // Align src before copying in word size chunks. | 3214 // Align src before copying in word size chunks. |
3215 bind(&align_loop); | 3215 cmp(length, Operand(kPointerSize)); |
3216 cmp(length, Operand::Zero()); | 3216 b(le, &byte_loop); |
3217 b(eq, &done); | 3217 |
3218 bind(&align_loop_1); | 3218 bind(&align_loop_1); |
3219 tst(src, Operand(kPointerSize - 1)); | 3219 tst(src, Operand(kPointerSize - 1)); |
3220 b(eq, &word_loop); | 3220 b(eq, &word_loop); |
3221 ldrb(scratch, MemOperand(src, 1, PostIndex)); | 3221 ldrb(scratch, MemOperand(src, 1, PostIndex)); |
3222 strb(scratch, MemOperand(dst, 1, PostIndex)); | 3222 strb(scratch, MemOperand(dst, 1, PostIndex)); |
3223 sub(length, length, Operand(1), SetCC); | 3223 sub(length, length, Operand(1), SetCC); |
3224 b(ne, &byte_loop_1); | 3224 b(&align_loop_1); |
3225 | |
3226 // Copy bytes in word size chunks. | 3225 // Copy bytes in word size chunks. |
3227 bind(&word_loop); | 3226 bind(&word_loop); |
3228 if (emit_debug_code()) { | 3227 if (emit_debug_code()) { |
3229 tst(src, Operand(kPointerSize - 1)); | 3228 tst(src, Operand(kPointerSize - 1)); |
3230 Assert(eq, kExpectingAlignmentForCopyBytes); | 3229 Assert(eq, kExpectingAlignmentForCopyBytes); |
3231 } | 3230 } |
3232 cmp(length, Operand(kPointerSize)); | 3231 cmp(length, Operand(kPointerSize)); |
3233 b(lt, &byte_loop); | 3232 b(lt, &byte_loop); |
3234 ldr(scratch, MemOperand(src, kPointerSize, PostIndex)); | 3233 ldr(scratch, MemOperand(src, kPointerSize, PostIndex)); |
3235 if (CpuFeatures::IsSupported(UNALIGNED_ACCESSES)) { | 3234 if (CpuFeatures::IsSupported(UNALIGNED_ACCESSES)) { |
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3902 void CodePatcher::EmitCondition(Condition cond) { | 3901 void CodePatcher::EmitCondition(Condition cond) { |
3903 Instr instr = Assembler::instr_at(masm_.pc_); | 3902 Instr instr = Assembler::instr_at(masm_.pc_); |
3904 instr = (instr & ~kCondMask) | cond; | 3903 instr = (instr & ~kCondMask) | cond; |
3905 masm_.emit(instr); | 3904 masm_.emit(instr); |
3906 } | 3905 } |
3907 | 3906 |
3908 | 3907 |
3909 } } // namespace v8::internal | 3908 } } // namespace v8::internal |
3910 | 3909 |
3911 #endif // V8_TARGET_ARCH_ARM | 3910 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |