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 3142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3153 Label* gc_required) { | 3153 Label* gc_required) { |
3154 AllocateHeapNumber(result, scratch1, scratch2, heap_number_map, gc_required); | 3154 AllocateHeapNumber(result, scratch1, scratch2, heap_number_map, gc_required); |
3155 sub(scratch1, result, Operand(kHeapObjectTag)); | 3155 sub(scratch1, result, Operand(kHeapObjectTag)); |
3156 vstr(value, scratch1, HeapNumber::kValueOffset); | 3156 vstr(value, scratch1, HeapNumber::kValueOffset); |
3157 } | 3157 } |
3158 | 3158 |
3159 | 3159 |
3160 // Copies a fixed number of fields of heap objects from src to dst. | 3160 // Copies a fixed number of fields of heap objects from src to dst. |
3161 void MacroAssembler::CopyFields(Register dst, | 3161 void MacroAssembler::CopyFields(Register dst, |
3162 Register src, | 3162 Register src, |
3163 RegList temps, | 3163 DwVfpRegister double_scratch, |
3164 SwVfpRegister single_scratch, | |
ulan
2013/04/12 14:07:04
Can we implicitly use double_scratch.low() for sin
Rodolph Perfetta
2013/04/12 14:42:59
not all double registers have a low (or high), onl
ulan
2013/04/15 07:44:06
I see, thanks for clarification!
| |
3164 int field_count) { | 3165 int field_count) { |
3165 // At least one bit set in the first 15 registers. | 3166 int double_count = field_count / (DwVfpRegister::kSizeInBytes / kPointerSize); |
3166 ASSERT((temps & ((1 << 15) - 1)) != 0); | 3167 for (int i = 0; i < double_count; i++) { |
3167 ASSERT((temps & dst.bit()) == 0); | 3168 vldr(double_scratch, FieldMemOperand(src, i * DwVfpRegister::kSizeInBytes)); |
3168 ASSERT((temps & src.bit()) == 0); | 3169 vstr(double_scratch, FieldMemOperand(dst, i * DwVfpRegister::kSizeInBytes)); |
3169 // Primitive implementation using only one temporary register. | |
3170 | |
3171 Register tmp = no_reg; | |
3172 // Find a temp register in temps list. | |
3173 for (int i = 0; i < 15; i++) { | |
3174 if ((temps & (1 << i)) != 0) { | |
3175 tmp.set_code(i); | |
3176 break; | |
3177 } | |
3178 } | 3170 } |
3179 ASSERT(!tmp.is(no_reg)); | 3171 int remain = field_count % (DwVfpRegister::kSizeInBytes / kPointerSize); |
ulan
2013/04/12 14:07:04
This works when:
STATIC_ASSERT(SwVfpRegister::kSiz
Rodolph Perfetta
2013/04/12 14:42:59
Done.
| |
3180 | 3172 if (remain != 0) { |
3181 for (int i = 0; i < field_count; i++) { | 3173 vldr(single_scratch, |
3182 ldr(tmp, FieldMemOperand(src, i * kPointerSize)); | 3174 FieldMemOperand(src, (field_count - 1) * kPointerSize)); |
3183 str(tmp, FieldMemOperand(dst, i * kPointerSize)); | 3175 vstr(single_scratch, |
3176 FieldMemOperand(dst, (field_count - 1) * kPointerSize)); | |
3184 } | 3177 } |
3185 } | 3178 } |
3186 | 3179 |
3187 | 3180 |
3188 void MacroAssembler::CopyBytes(Register src, | 3181 void MacroAssembler::CopyBytes(Register src, |
3189 Register dst, | 3182 Register dst, |
3190 Register length, | 3183 Register length, |
3191 Register scratch) { | 3184 Register scratch) { |
3192 Label align_loop, align_loop_1, word_loop, byte_loop, byte_loop_1, done; | 3185 Label align_loop, align_loop_1, word_loop, byte_loop, byte_loop_1, done; |
3193 | 3186 |
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3862 void CodePatcher::EmitCondition(Condition cond) { | 3855 void CodePatcher::EmitCondition(Condition cond) { |
3863 Instr instr = Assembler::instr_at(masm_.pc_); | 3856 Instr instr = Assembler::instr_at(masm_.pc_); |
3864 instr = (instr & ~kCondMask) | cond; | 3857 instr = (instr & ~kCondMask) | cond; |
3865 masm_.emit(instr); | 3858 masm_.emit(instr); |
3866 } | 3859 } |
3867 | 3860 |
3868 | 3861 |
3869 } } // namespace v8::internal | 3862 } } // namespace v8::internal |
3870 | 3863 |
3871 #endif // V8_TARGET_ARCH_ARM | 3864 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |