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

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

Issue 2826001: ARM: Be more smart about switching instructions when immediates... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 6 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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 __ str(scratch3, FieldMemOperand(result, JSArray::kLengthOffset)); 129 __ str(scratch3, FieldMemOperand(result, JSArray::kLengthOffset));
130 130
131 // Calculate the location of the elements array and set elements array member 131 // Calculate the location of the elements array and set elements array member
132 // of the JSArray. 132 // of the JSArray.
133 // result: JSObject 133 // result: JSObject
134 // scratch2: start of next object 134 // scratch2: start of next object
135 __ add(scratch1, result, Operand(JSArray::kSize)); 135 __ add(scratch1, result, Operand(JSArray::kSize));
136 __ str(scratch1, FieldMemOperand(result, JSArray::kElementsOffset)); 136 __ str(scratch1, FieldMemOperand(result, JSArray::kElementsOffset));
137 137
138 // Clear the heap tag on the elements array. 138 // Clear the heap tag on the elements array.
139 __ and_(scratch1, scratch1, Operand(~kHeapObjectTagMask)); 139 ASSERT(kSmiTag == 0);
140 __ sub(scratch1, scratch1, Operand(kHeapObjectTag));
140 141
141 // Initialize the FixedArray and fill it with holes. FixedArray length is 142 // Initialize the FixedArray and fill it with holes. FixedArray length is
142 // stored as a smi. 143 // stored as a smi.
143 // result: JSObject 144 // result: JSObject
144 // scratch1: elements array (untagged) 145 // scratch1: elements array (untagged)
145 // scratch2: start of next object 146 // scratch2: start of next object
146 __ LoadRoot(scratch3, Heap::kFixedArrayMapRootIndex); 147 __ LoadRoot(scratch3, Heap::kFixedArrayMapRootIndex);
147 ASSERT_EQ(0 * kPointerSize, FixedArray::kMapOffset); 148 ASSERT_EQ(0 * kPointerSize, FixedArray::kMapOffset);
148 __ str(scratch3, MemOperand(scratch1, kPointerSize, PostIndex)); 149 __ str(scratch3, MemOperand(scratch1, kPointerSize, PostIndex));
149 __ mov(scratch3, Operand(Smi::FromInt(initial_capacity))); 150 __ mov(scratch3, Operand(Smi::FromInt(initial_capacity)));
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 234
234 // Calculate the location of the elements array and set elements array member 235 // Calculate the location of the elements array and set elements array member
235 // of the JSArray. 236 // of the JSArray.
236 // result: JSObject 237 // result: JSObject
237 // array_size: size of array (smi) 238 // array_size: size of array (smi)
238 __ add(elements_array_storage, result, Operand(JSArray::kSize)); 239 __ add(elements_array_storage, result, Operand(JSArray::kSize));
239 __ str(elements_array_storage, 240 __ str(elements_array_storage,
240 FieldMemOperand(result, JSArray::kElementsOffset)); 241 FieldMemOperand(result, JSArray::kElementsOffset));
241 242
242 // Clear the heap tag on the elements array. 243 // Clear the heap tag on the elements array.
243 __ and_(elements_array_storage, 244 ASSERT(kSmiTag == 0);
244 elements_array_storage, 245 __ sub(elements_array_storage,
245 Operand(~kHeapObjectTagMask)); 246 elements_array_storage,
247 Operand(kHeapObjectTag));
246 // Initialize the fixed array and fill it with holes. FixedArray length is 248 // Initialize the fixed array and fill it with holes. FixedArray length is
247 // stored as a smi. 249 // stored as a smi.
248 // result: JSObject 250 // result: JSObject
249 // elements_array_storage: elements array (untagged) 251 // elements_array_storage: elements array (untagged)
250 // array_size: size of array (smi) 252 // array_size: size of array (smi)
251 __ LoadRoot(scratch1, Heap::kFixedArrayMapRootIndex); 253 __ LoadRoot(scratch1, Heap::kFixedArrayMapRootIndex);
252 ASSERT_EQ(0 * kPointerSize, FixedArray::kMapOffset); 254 ASSERT_EQ(0 * kPointerSize, FixedArray::kMapOffset);
253 __ str(scratch1, MemOperand(elements_array_storage, kPointerSize, PostIndex)); 255 __ str(scratch1, MemOperand(elements_array_storage, kPointerSize, PostIndex));
254 ASSERT(kSmiTag == 0); 256 ASSERT(kSmiTag == 0);
255 __ tst(array_size, array_size); 257 __ tst(array_size, array_size);
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 // Check if a non-empty properties array is needed. Continue with allocated 612 // Check if a non-empty properties array is needed. Continue with allocated
611 // object if not fall through to runtime call if it is. 613 // object if not fall through to runtime call if it is.
612 // r1: constructor function 614 // r1: constructor function
613 // r4: JSObject 615 // r4: JSObject
614 // r5: start of next object (not tagged) 616 // r5: start of next object (not tagged)
615 // r7: undefined value 617 // r7: undefined value
616 __ ldrb(r3, FieldMemOperand(r2, Map::kUnusedPropertyFieldsOffset)); 618 __ ldrb(r3, FieldMemOperand(r2, Map::kUnusedPropertyFieldsOffset));
617 // The field instance sizes contains both pre-allocated property fields and 619 // The field instance sizes contains both pre-allocated property fields and
618 // in-object properties. 620 // in-object properties.
619 __ ldr(r0, FieldMemOperand(r2, Map::kInstanceSizesOffset)); 621 __ ldr(r0, FieldMemOperand(r2, Map::kInstanceSizesOffset));
620 __ and_(r6, 622 __ Ubfx(r6, r0, Map::kPreAllocatedPropertyFieldsByte * 8, 8);
621 r0, 623 __ add(r3, r3, Operand(r6));
622 Operand(0x000000FF << Map::kPreAllocatedPropertyFieldsByte * 8)); 624 __ Ubfx(r6, r0, Map::kInObjectPropertiesByte * 8, 8);
623 __ add(r3, r3, Operand(r6, LSR, Map::kPreAllocatedPropertyFieldsByte * 8)); 625 __ sub(r3, r3, Operand(r6), SetCC);
624 __ and_(r6, r0, Operand(0x000000FF << Map::kInObjectPropertiesByte * 8));
625 __ sub(r3, r3, Operand(r6, LSR, Map::kInObjectPropertiesByte * 8), SetCC);
626 626
627 // Done if no extra properties are to be allocated. 627 // Done if no extra properties are to be allocated.
628 __ b(eq, &allocated); 628 __ b(eq, &allocated);
629 __ Assert(pl, "Property allocation count failed."); 629 __ Assert(pl, "Property allocation count failed.");
630 630
631 // Scale the number of elements by pointer size and add the header for 631 // Scale the number of elements by pointer size and add the header for
632 // FixedArrays to the start of the next object calculation from above. 632 // FixedArrays to the start of the next object calculation from above.
633 // r1: constructor 633 // r1: constructor
634 // r3: number of elements in properties array 634 // r3: number of elements in properties array
635 // r4: JSObject 635 // r4: JSObject
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after
1311 __ bind(&dont_adapt_arguments); 1311 __ bind(&dont_adapt_arguments);
1312 __ Jump(r3); 1312 __ Jump(r3);
1313 } 1313 }
1314 1314
1315 1315
1316 #undef __ 1316 #undef __
1317 1317
1318 } } // namespace v8::internal 1318 } } // namespace v8::internal
1319 1319
1320 #endif // V8_TARGET_ARCH_ARM 1320 #endif // V8_TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698