Index: src/arm/macro-assembler-arm.cc |
diff --git a/src/arm/macro-assembler-arm.cc b/src/arm/macro-assembler-arm.cc |
index 465bd1067a726da97aabdc8bf2d3f4126e01c378..d1506d0a79c30b1c1c984ef22f1b4291d747ae0a 100644 |
--- a/src/arm/macro-assembler-arm.cc |
+++ b/src/arm/macro-assembler-arm.cc |
@@ -3160,27 +3160,20 @@ void MacroAssembler::AllocateHeapNumberWithValue(Register result, |
// Copies a fixed number of fields of heap objects from src to dst. |
void MacroAssembler::CopyFields(Register dst, |
Register src, |
- RegList temps, |
+ DwVfpRegister double_scratch, |
+ 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!
|
int field_count) { |
- // At least one bit set in the first 15 registers. |
- ASSERT((temps & ((1 << 15) - 1)) != 0); |
- ASSERT((temps & dst.bit()) == 0); |
- ASSERT((temps & src.bit()) == 0); |
- // Primitive implementation using only one temporary register. |
- |
- Register tmp = no_reg; |
- // Find a temp register in temps list. |
- for (int i = 0; i < 15; i++) { |
- if ((temps & (1 << i)) != 0) { |
- tmp.set_code(i); |
- break; |
- } |
- } |
- ASSERT(!tmp.is(no_reg)); |
- |
- for (int i = 0; i < field_count; i++) { |
- ldr(tmp, FieldMemOperand(src, i * kPointerSize)); |
- str(tmp, FieldMemOperand(dst, i * kPointerSize)); |
+ int double_count = field_count / (DwVfpRegister::kSizeInBytes / kPointerSize); |
+ for (int i = 0; i < double_count; i++) { |
+ vldr(double_scratch, FieldMemOperand(src, i * DwVfpRegister::kSizeInBytes)); |
+ vstr(double_scratch, FieldMemOperand(dst, i * DwVfpRegister::kSizeInBytes)); |
+ } |
+ 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.
|
+ if (remain != 0) { |
+ vldr(single_scratch, |
+ FieldMemOperand(src, (field_count - 1) * kPointerSize)); |
+ vstr(single_scratch, |
+ FieldMemOperand(dst, (field_count - 1) * kPointerSize)); |
} |
} |