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

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

Issue 10442015: Rollback of r11638, r11636 on trunk branch. (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 8 years, 7 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/lithium.cc ('k') | src/mips/code-stubs-mips.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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 // and filled with the hole values. 111 // and filled with the hole values.
112 static void AllocateEmptyJSArray(MacroAssembler* masm, 112 static void AllocateEmptyJSArray(MacroAssembler* masm,
113 Register array_function, 113 Register array_function,
114 Register result, 114 Register result,
115 Register scratch1, 115 Register scratch1,
116 Register scratch2, 116 Register scratch2,
117 Register scratch3, 117 Register scratch3,
118 Label* gc_required) { 118 Label* gc_required) {
119 const int initial_capacity = JSArray::kPreallocatedArrayElements; 119 const int initial_capacity = JSArray::kPreallocatedArrayElements;
120 STATIC_ASSERT(initial_capacity >= 0); 120 STATIC_ASSERT(initial_capacity >= 0);
121 __ LoadInitialArrayMap(array_function, scratch2, scratch1, false); 121 __ LoadInitialArrayMap(array_function, scratch2, scratch1);
122 122
123 // Allocate the JSArray object together with space for a fixed array with the 123 // Allocate the JSArray object together with space for a fixed array with the
124 // requested elements. 124 // requested elements.
125 int size = JSArray::kSize; 125 int size = JSArray::kSize;
126 if (initial_capacity > 0) { 126 if (initial_capacity > 0) {
127 size += FixedArray::SizeFor(initial_capacity); 127 size += FixedArray::SizeFor(initial_capacity);
128 } 128 }
129 __ AllocateInNewSpace(size, 129 __ AllocateInNewSpace(size,
130 result, 130 result,
131 scratch2, 131 scratch2,
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 Register array_function, // Array function. 207 Register array_function, // Array function.
208 Register array_size, // As a smi, cannot be 0. 208 Register array_size, // As a smi, cannot be 0.
209 Register result, 209 Register result,
210 Register elements_array_storage, 210 Register elements_array_storage,
211 Register elements_array_end, 211 Register elements_array_end,
212 Register scratch1, 212 Register scratch1,
213 Register scratch2, 213 Register scratch2,
214 bool fill_with_hole, 214 bool fill_with_hole,
215 Label* gc_required) { 215 Label* gc_required) {
216 // Load the initial map from the array function. 216 // Load the initial map from the array function.
217 __ LoadInitialArrayMap(array_function, scratch2, 217 __ LoadInitialArrayMap(array_function, scratch2, elements_array_storage);
218 elements_array_storage, fill_with_hole);
219 218
220 if (FLAG_debug_code) { // Assert that array size is not zero. 219 if (FLAG_debug_code) { // Assert that array size is not zero.
221 __ Assert( 220 __ Assert(
222 ne, "array size is unexpectedly 0", array_size, Operand(zero_reg)); 221 ne, "array size is unexpectedly 0", array_size, Operand(zero_reg));
223 } 222 }
224 223
225 // Allocate the JSArray object together with space for a FixedArray with the 224 // Allocate the JSArray object together with space for a FixedArray with the
226 // requested number of elements. 225 // requested number of elements.
227 STATIC_ASSERT(kSmiTagSize == 1 && kSmiTag == 0); 226 STATIC_ASSERT(kSmiTagSize == 1 && kSmiTag == 0);
228 __ li(elements_array_end, 227 __ li(elements_array_end,
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 442
444 __ bind(&has_non_smi_element); 443 __ bind(&has_non_smi_element);
445 // Double values are handled by the runtime. 444 // Double values are handled by the runtime.
446 __ CheckMap( 445 __ CheckMap(
447 a2, t5, Heap::kHeapNumberMapRootIndex, &not_double, DONT_DO_SMI_CHECK); 446 a2, t5, Heap::kHeapNumberMapRootIndex, &not_double, DONT_DO_SMI_CHECK);
448 __ bind(&cant_transition_map); 447 __ bind(&cant_transition_map);
449 __ UndoAllocationInNewSpace(a3, t0); 448 __ UndoAllocationInNewSpace(a3, t0);
450 __ Branch(call_generic_code); 449 __ Branch(call_generic_code);
451 450
452 __ bind(&not_double); 451 __ bind(&not_double);
453 // Transition FAST_SMI_ELEMENTS to FAST_ELEMENTS. 452 // Transition FAST_SMI_ONLY_ELEMENTS to FAST_ELEMENTS.
454 // a3: JSArray 453 // a3: JSArray
455 __ lw(a2, FieldMemOperand(a3, HeapObject::kMapOffset)); 454 __ lw(a2, FieldMemOperand(a3, HeapObject::kMapOffset));
456 __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS, 455 __ LoadTransitionedArrayMapConditional(FAST_SMI_ONLY_ELEMENTS,
457 FAST_ELEMENTS, 456 FAST_ELEMENTS,
458 a2, 457 a2,
459 t5, 458 t5,
460 &cant_transition_map); 459 &cant_transition_map);
461 __ sw(a2, FieldMemOperand(a3, HeapObject::kMapOffset)); 460 __ sw(a2, FieldMemOperand(a3, HeapObject::kMapOffset));
462 __ RecordWriteField(a3, 461 __ RecordWriteField(a3,
463 HeapObject::kMapOffset, 462 HeapObject::kMapOffset,
464 a2, 463 a2,
465 t5, 464 t5,
466 kRAHasNotBeenSaved, 465 kRAHasNotBeenSaved,
(...skipping 1330 matching lines...) Expand 10 before | Expand all | Expand 10 after
1797 __ bind(&dont_adapt_arguments); 1796 __ bind(&dont_adapt_arguments);
1798 __ Jump(a3); 1797 __ Jump(a3);
1799 } 1798 }
1800 1799
1801 1800
1802 #undef __ 1801 #undef __
1803 1802
1804 } } // namespace v8::internal 1803 } } // namespace v8::internal
1805 1804
1806 #endif // V8_TARGET_ARCH_MIPS 1805 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/lithium.cc ('k') | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698