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

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

Issue 10818026: Relax requirement from VFP3 to VFP2 where possible. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 4 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 MacroAssembler* masm, Label* fail) { 100 MacroAssembler* masm, Label* fail) {
101 // ----------- S t a t e ------------- 101 // ----------- S t a t e -------------
102 // -- r0 : value 102 // -- r0 : value
103 // -- r1 : key 103 // -- r1 : key
104 // -- r2 : receiver 104 // -- r2 : receiver
105 // -- lr : return address 105 // -- lr : return address
106 // -- r3 : target map, scratch for subsequent call 106 // -- r3 : target map, scratch for subsequent call
107 // -- r4 : scratch (elements) 107 // -- r4 : scratch (elements)
108 // ----------------------------------- 108 // -----------------------------------
109 Label loop, entry, convert_hole, gc_required, only_change_map, done; 109 Label loop, entry, convert_hole, gc_required, only_change_map, done;
110 bool vfp3_supported = CpuFeatures::IsSupported(VFP3); 110 bool vfp2_supported = CpuFeatures::IsSupported(VFP2);
111 111
112 // Check for empty arrays, which only require a map transition and no changes 112 // Check for empty arrays, which only require a map transition and no changes
113 // to the backing store. 113 // to the backing store.
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
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 __ add(r3, r4, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); 175 __ add(r3, r4, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
176 __ add(r7, r6, Operand(FixedDoubleArray::kHeaderSize)); 176 __ add(r7, r6, Operand(FixedDoubleArray::kHeaderSize));
177 __ add(r6, r7, Operand(r5, LSL, 2)); 177 __ add(r6, r7, Operand(r5, LSL, 2));
178 __ mov(r4, Operand(kHoleNanLower32)); 178 __ mov(r4, Operand(kHoleNanLower32));
179 __ mov(r5, Operand(kHoleNanUpper32)); 179 __ mov(r5, Operand(kHoleNanUpper32));
180 // r3: begin of source FixedArray element fields, not tagged 180 // r3: begin of source FixedArray element fields, not tagged
181 // r4: kHoleNanLower32 181 // r4: kHoleNanLower32
182 // r5: kHoleNanUpper32 182 // r5: kHoleNanUpper32
183 // r6: end of destination FixedDoubleArray, not tagged 183 // r6: end of destination FixedDoubleArray, not tagged
184 // r7: begin of FixedDoubleArray element fields, not tagged 184 // r7: begin of FixedDoubleArray element fields, not tagged
185 if (!vfp3_supported) __ Push(r1, r0); 185 if (!vfp2_supported) __ Push(r1, r0);
186 186
187 __ b(&entry); 187 __ b(&entry);
188 188
189 __ bind(&only_change_map); 189 __ bind(&only_change_map);
190 __ str(r3, FieldMemOperand(r2, HeapObject::kMapOffset)); 190 __ str(r3, FieldMemOperand(r2, HeapObject::kMapOffset));
191 __ RecordWriteField(r2, 191 __ RecordWriteField(r2,
192 HeapObject::kMapOffset, 192 HeapObject::kMapOffset,
193 r3, 193 r3,
194 r9, 194 r9,
195 kLRHasBeenSaved, 195 kLRHasBeenSaved,
196 kDontSaveFPRegs, 196 kDontSaveFPRegs,
197 OMIT_REMEMBERED_SET, 197 OMIT_REMEMBERED_SET,
198 OMIT_SMI_CHECK); 198 OMIT_SMI_CHECK);
199 __ b(&done); 199 __ b(&done);
200 200
201 // Call into runtime if GC is required. 201 // Call into runtime if GC is required.
202 __ bind(&gc_required); 202 __ bind(&gc_required);
203 __ pop(lr); 203 __ pop(lr);
204 __ b(fail); 204 __ b(fail);
205 205
206 // Convert and copy elements. 206 // Convert and copy elements.
207 __ bind(&loop); 207 __ bind(&loop);
208 __ ldr(r9, MemOperand(r3, 4, PostIndex)); 208 __ ldr(r9, MemOperand(r3, 4, PostIndex));
209 // r9: current element 209 // r9: current element
210 __ UntagAndJumpIfNotSmi(r9, r9, &convert_hole); 210 __ UntagAndJumpIfNotSmi(r9, r9, &convert_hole);
211 211
212 // Normal smi, convert to double and store. 212 // Normal smi, convert to double and store.
213 if (vfp3_supported) { 213 if (vfp2_supported) {
214 CpuFeatures::Scope scope(VFP3); 214 CpuFeatures::Scope scope(VFP2);
215 __ vmov(s0, r9); 215 __ vmov(s0, r9);
216 __ vcvt_f64_s32(d0, s0); 216 __ vcvt_f64_s32(d0, s0);
217 __ vstr(d0, r7, 0); 217 __ vstr(d0, r7, 0);
218 __ add(r7, r7, Operand(8)); 218 __ add(r7, r7, Operand(8));
219 } else { 219 } else {
220 FloatingPointHelper::ConvertIntToDouble(masm, 220 FloatingPointHelper::ConvertIntToDouble(masm,
221 r9, 221 r9,
222 FloatingPointHelper::kCoreRegisters, 222 FloatingPointHelper::kCoreRegisters,
223 d0, 223 d0,
224 r0, 224 r0,
(...skipping 12 matching lines...) Expand all
237 __ orr(r9, r9, Operand(1)); 237 __ orr(r9, r9, Operand(1));
238 __ CompareRoot(r9, Heap::kTheHoleValueRootIndex); 238 __ CompareRoot(r9, Heap::kTheHoleValueRootIndex);
239 __ Assert(eq, "object found in smi-only array"); 239 __ Assert(eq, "object found in smi-only array");
240 } 240 }
241 __ Strd(r4, r5, MemOperand(r7, 8, PostIndex)); 241 __ Strd(r4, r5, MemOperand(r7, 8, PostIndex));
242 242
243 __ bind(&entry); 243 __ bind(&entry);
244 __ cmp(r7, r6); 244 __ cmp(r7, r6);
245 __ b(lt, &loop); 245 __ b(lt, &loop);
246 246
247 if (!vfp3_supported) __ Pop(r1, r0); 247 if (!vfp2_supported) __ Pop(r1, r0);
248 __ pop(lr); 248 __ pop(lr);
249 __ bind(&done); 249 __ bind(&done);
250 } 250 }
251 251
252 252
253 void ElementsTransitionGenerator::GenerateDoubleToObject( 253 void ElementsTransitionGenerator::GenerateDoubleToObject(
254 MacroAssembler* masm, Label* fail) { 254 MacroAssembler* masm, Label* fail) {
255 // ----------- S t a t e ------------- 255 // ----------- S t a t e -------------
256 // -- r0 : value 256 // -- r0 : value
257 // -- r1 : key 257 // -- r1 : key
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 // Ascii string. 448 // Ascii string.
449 __ ldrb(result, MemOperand(string, index)); 449 __ ldrb(result, MemOperand(string, index));
450 __ bind(&done); 450 __ bind(&done);
451 } 451 }
452 452
453 #undef __ 453 #undef __
454 454
455 } } // namespace v8::internal 455 } } // namespace v8::internal
456 456
457 #endif // V8_TARGET_ARCH_ARM 457 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« build/common.gypi ('K') | « src/arm/code-stubs-arm.cc ('k') | src/arm/full-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698