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

Side by Side Diff: src/arm/codegen-arm.cc

Issue 10696097: [v8-dev] Port r11344 (Try aligning unboxed double array backing store in allocation or... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 5 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 | « no previous file | 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 __ ldr(r4, FieldMemOperand(r2, JSObject::kElementsOffset)); 114 __ ldr(r4, FieldMemOperand(r2, JSObject::kElementsOffset));
115 __ CompareRoot(r4, Heap::kEmptyFixedArrayRootIndex); 115 __ CompareRoot(r4, Heap::kEmptyFixedArrayRootIndex);
116 __ b(eq, &only_change_map); 116 __ b(eq, &only_change_map);
117 117
118 __ push(lr); 118 __ push(lr);
119 __ ldr(r5, FieldMemOperand(r4, FixedArray::kLengthOffset)); 119 __ ldr(r5, FieldMemOperand(r4, FixedArray::kLengthOffset));
120 // r4: source FixedArray 120 // r4: source FixedArray
121 // r5: number of elements (smi-tagged) 121 // r5: number of elements (smi-tagged)
122 122
123 // Allocate new FixedDoubleArray. 123 // Allocate new FixedDoubleArray.
124 __ mov(lr, Operand(FixedDoubleArray::kHeaderSize)); 124 // Use lr as a temporary register.
125 __ add(lr, lr, Operand(r5, LSL, 2)); 125 __ mov(lr, Operand(r5, LSL, 2));
126 __ add(lr, lr, Operand(FixedDoubleArray::kHeaderSize + kPointerSize));
126 __ AllocateInNewSpace(lr, r6, r7, r9, &gc_required, NO_ALLOCATION_FLAGS); 127 __ AllocateInNewSpace(lr, r6, r7, r9, &gc_required, NO_ALLOCATION_FLAGS);
127 // r6: destination FixedDoubleArray, not tagged as heap object 128 // r6: destination FixedDoubleArray, not tagged as heap object.
129
130 // Align the array conveniently for doubles.
131 // Store a filler value in the unused memory.
132 Label aligned, aligned_done;
133 __ tst(r6, Operand(kDoubleAlignmentMask));
134 __ mov(ip, Operand(masm->isolate()->factory()->one_pointer_filler_map()));
135 __ b(eq, &aligned);
136 // Store at the beginning of the allocated memory and update the base pointer.
137 __ str(ip, MemOperand(r6, kPointerSize, PostIndex));
138 __ b(&aligned_done);
139
140 __ bind(&aligned);
141 // Store the filler at the end of the allocated memory.
142 __ sub(lr, lr, Operand(kPointerSize));
143 __ str(ip, MemOperand(r6, lr));
144
145 __ bind(&aligned_done);
146
128 // Set destination FixedDoubleArray's length and map. 147 // Set destination FixedDoubleArray's length and map.
129 __ LoadRoot(r9, Heap::kFixedDoubleArrayMapRootIndex); 148 __ LoadRoot(r9, Heap::kFixedDoubleArrayMapRootIndex);
130 __ str(r5, MemOperand(r6, FixedDoubleArray::kLengthOffset)); 149 __ str(r5, MemOperand(r6, FixedDoubleArray::kLengthOffset));
150 // Update receiver's map.
131 __ str(r9, MemOperand(r6, HeapObject::kMapOffset)); 151 __ str(r9, MemOperand(r6, HeapObject::kMapOffset));
132 // Update receiver's map.
133 152
134 __ str(r3, FieldMemOperand(r2, HeapObject::kMapOffset)); 153 __ str(r3, FieldMemOperand(r2, HeapObject::kMapOffset));
135 __ RecordWriteField(r2, 154 __ RecordWriteField(r2,
136 HeapObject::kMapOffset, 155 HeapObject::kMapOffset,
137 r3, 156 r3,
138 r9, 157 r9,
139 kLRHasBeenSaved, 158 kLRHasBeenSaved,
140 kDontSaveFPRegs, 159 kDontSaveFPRegs,
141 OMIT_REMEMBERED_SET, 160 OMIT_REMEMBERED_SET,
142 OMIT_SMI_CHECK); 161 OMIT_SMI_CHECK);
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 // Ascii string. 448 // Ascii string.
430 __ ldrb(result, MemOperand(string, index)); 449 __ ldrb(result, MemOperand(string, index));
431 __ bind(&done); 450 __ bind(&done);
432 } 451 }
433 452
434 #undef __ 453 #undef __
435 454
436 } } // namespace v8::internal 455 } } // namespace v8::internal
437 456
438 #endif // V8_TARGET_ARCH_ARM 457 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698