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

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

Issue 10442015: Rollback of r11638, r11636 on trunk branch. (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 8 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
« no previous file with comments | « src/api.cc ('k') | src/arm/code-stubs-arm.cc » ('j') | 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 // and filled with the hole values. 107 // and filled with the hole values.
108 static void AllocateEmptyJSArray(MacroAssembler* masm, 108 static void AllocateEmptyJSArray(MacroAssembler* masm,
109 Register array_function, 109 Register array_function,
110 Register result, 110 Register result,
111 Register scratch1, 111 Register scratch1,
112 Register scratch2, 112 Register scratch2,
113 Register scratch3, 113 Register scratch3,
114 Label* gc_required) { 114 Label* gc_required) {
115 const int initial_capacity = JSArray::kPreallocatedArrayElements; 115 const int initial_capacity = JSArray::kPreallocatedArrayElements;
116 STATIC_ASSERT(initial_capacity >= 0); 116 STATIC_ASSERT(initial_capacity >= 0);
117 __ LoadInitialArrayMap(array_function, scratch2, scratch1, false); 117 __ LoadInitialArrayMap(array_function, scratch2, scratch1);
118 118
119 // Allocate the JSArray object together with space for a fixed array with the 119 // Allocate the JSArray object together with space for a fixed array with the
120 // requested elements. 120 // requested elements.
121 int size = JSArray::kSize; 121 int size = JSArray::kSize;
122 if (initial_capacity > 0) { 122 if (initial_capacity > 0) {
123 size += FixedArray::SizeFor(initial_capacity); 123 size += FixedArray::SizeFor(initial_capacity);
124 } 124 }
125 __ AllocateInNewSpace(size, 125 __ AllocateInNewSpace(size,
126 result, 126 result,
127 scratch2, 127 scratch2,
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 Register array_function, // Array function. 201 Register array_function, // Array function.
202 Register array_size, // As a smi, cannot be 0. 202 Register array_size, // As a smi, cannot be 0.
203 Register result, 203 Register result,
204 Register elements_array_storage, 204 Register elements_array_storage,
205 Register elements_array_end, 205 Register elements_array_end,
206 Register scratch1, 206 Register scratch1,
207 Register scratch2, 207 Register scratch2,
208 bool fill_with_hole, 208 bool fill_with_hole,
209 Label* gc_required) { 209 Label* gc_required) {
210 // Load the initial map from the array function. 210 // Load the initial map from the array function.
211 __ LoadInitialArrayMap(array_function, scratch2, 211 __ LoadInitialArrayMap(array_function, scratch2, elements_array_storage);
212 elements_array_storage, fill_with_hole);
213 212
214 if (FLAG_debug_code) { // Assert that array size is not zero. 213 if (FLAG_debug_code) { // Assert that array size is not zero.
215 __ tst(array_size, array_size); 214 __ tst(array_size, array_size);
216 __ Assert(ne, "array size is unexpectedly 0"); 215 __ Assert(ne, "array size is unexpectedly 0");
217 } 216 }
218 217
219 // Allocate the JSArray object together with space for a FixedArray with the 218 // Allocate the JSArray object together with space for a FixedArray with the
220 // requested number of elements. 219 // requested number of elements.
221 STATIC_ASSERT(kSmiTagSize == 1 && kSmiTag == 0); 220 STATIC_ASSERT(kSmiTagSize == 1 && kSmiTag == 0);
222 __ mov(elements_array_end, 221 __ mov(elements_array_end,
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 433
435 __ bind(&has_non_smi_element); 434 __ bind(&has_non_smi_element);
436 // Double values are handled by the runtime. 435 // Double values are handled by the runtime.
437 __ CheckMap( 436 __ CheckMap(
438 r2, r9, Heap::kHeapNumberMapRootIndex, &not_double, DONT_DO_SMI_CHECK); 437 r2, r9, Heap::kHeapNumberMapRootIndex, &not_double, DONT_DO_SMI_CHECK);
439 __ bind(&cant_transition_map); 438 __ bind(&cant_transition_map);
440 __ UndoAllocationInNewSpace(r3, r4); 439 __ UndoAllocationInNewSpace(r3, r4);
441 __ b(call_generic_code); 440 __ b(call_generic_code);
442 441
443 __ bind(&not_double); 442 __ bind(&not_double);
444 // Transition FAST_SMI_ELEMENTS to FAST_ELEMENTS. 443 // Transition FAST_SMI_ONLY_ELEMENTS to FAST_ELEMENTS.
445 // r3: JSArray 444 // r3: JSArray
446 __ ldr(r2, FieldMemOperand(r3, HeapObject::kMapOffset)); 445 __ ldr(r2, FieldMemOperand(r3, HeapObject::kMapOffset));
447 __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS, 446 __ LoadTransitionedArrayMapConditional(FAST_SMI_ONLY_ELEMENTS,
448 FAST_ELEMENTS, 447 FAST_ELEMENTS,
449 r2, 448 r2,
450 r9, 449 r9,
451 &cant_transition_map); 450 &cant_transition_map);
452 __ str(r2, FieldMemOperand(r3, HeapObject::kMapOffset)); 451 __ str(r2, FieldMemOperand(r3, HeapObject::kMapOffset));
453 __ RecordWriteField(r3, 452 __ RecordWriteField(r3,
454 HeapObject::kMapOffset, 453 HeapObject::kMapOffset,
455 r2, 454 r2,
456 r9, 455 r9,
457 kLRHasNotBeenSaved, 456 kLRHasNotBeenSaved,
(...skipping 1302 matching lines...) Expand 10 before | Expand all | Expand 10 after
1760 __ bind(&dont_adapt_arguments); 1759 __ bind(&dont_adapt_arguments);
1761 __ Jump(r3); 1760 __ Jump(r3);
1762 } 1761 }
1763 1762
1764 1763
1765 #undef __ 1764 #undef __
1766 1765
1767 } } // namespace v8::internal 1766 } } // namespace v8::internal
1768 1767
1769 #endif // V8_TARGET_ARCH_ARM 1768 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/arm/code-stubs-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698