| OLD | NEW |
| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 // and filled with the hole values. | 109 // and filled with the hole values. |
| 110 static void AllocateEmptyJSArray(MacroAssembler* masm, | 110 static void AllocateEmptyJSArray(MacroAssembler* masm, |
| 111 Register array_function, | 111 Register array_function, |
| 112 Register result, | 112 Register result, |
| 113 Register scratch1, | 113 Register scratch1, |
| 114 Register scratch2, | 114 Register scratch2, |
| 115 Register scratch3, | 115 Register scratch3, |
| 116 Label* gc_required) { | 116 Label* gc_required) { |
| 117 const int initial_capacity = JSArray::kPreallocatedArrayElements; | 117 const int initial_capacity = JSArray::kPreallocatedArrayElements; |
| 118 STATIC_ASSERT(initial_capacity >= 0); | 118 STATIC_ASSERT(initial_capacity >= 0); |
| 119 __ LoadGlobalInitialConstructedArrayMap(array_function, scratch2, scratch1); | 119 __ LoadInitialArrayMap(array_function, scratch2, scratch1); |
| 120 | 120 |
| 121 // Allocate the JSArray object together with space for a fixed array with the | 121 // Allocate the JSArray object together with space for a fixed array with the |
| 122 // requested elements. | 122 // requested elements. |
| 123 int size = JSArray::kSize; | 123 int size = JSArray::kSize; |
| 124 if (initial_capacity > 0) { | 124 if (initial_capacity > 0) { |
| 125 size += FixedArray::SizeFor(initial_capacity); | 125 size += FixedArray::SizeFor(initial_capacity); |
| 126 } | 126 } |
| 127 __ AllocateInNewSpace(size, | 127 __ AllocateInNewSpace(size, |
| 128 result, | 128 result, |
| 129 scratch2, | 129 scratch2, |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 Register array_function, // Array function. | 205 Register array_function, // Array function. |
| 206 Register array_size, // As a smi, cannot be 0. | 206 Register array_size, // As a smi, cannot be 0. |
| 207 Register result, | 207 Register result, |
| 208 Register elements_array_storage, | 208 Register elements_array_storage, |
| 209 Register elements_array_end, | 209 Register elements_array_end, |
| 210 Register scratch1, | 210 Register scratch1, |
| 211 Register scratch2, | 211 Register scratch2, |
| 212 bool fill_with_hole, | 212 bool fill_with_hole, |
| 213 Label* gc_required) { | 213 Label* gc_required) { |
| 214 // Load the initial map from the array function. | 214 // Load the initial map from the array function. |
| 215 __ LoadGlobalInitialConstructedArrayMap(array_function, scratch2, | 215 __ LoadInitialArrayMap(array_function, scratch2, elements_array_storage); |
| 216 elements_array_storage); | |
| 217 | 216 |
| 218 if (FLAG_debug_code) { // Assert that array size is not zero. | 217 if (FLAG_debug_code) { // Assert that array size is not zero. |
| 219 __ Assert( | 218 __ Assert( |
| 220 ne, "array size is unexpectedly 0", array_size, Operand(zero_reg)); | 219 ne, "array size is unexpectedly 0", array_size, Operand(zero_reg)); |
| 221 } | 220 } |
| 222 | 221 |
| 223 // Allocate the JSArray object together with space for a FixedArray with the | 222 // Allocate the JSArray object together with space for a FixedArray with the |
| 224 // requested number of elements. | 223 // requested number of elements. |
| 225 STATIC_ASSERT(kSmiTagSize == 1 && kSmiTag == 0); | 224 STATIC_ASSERT(kSmiTagSize == 1 && kSmiTag == 0); |
| 226 __ li(elements_array_end, | 225 __ li(elements_array_end, |
| (...skipping 1546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1773 __ bind(&dont_adapt_arguments); | 1772 __ bind(&dont_adapt_arguments); |
| 1774 __ Jump(a3); | 1773 __ Jump(a3); |
| 1775 } | 1774 } |
| 1776 | 1775 |
| 1777 | 1776 |
| 1778 #undef __ | 1777 #undef __ |
| 1779 | 1778 |
| 1780 } } // namespace v8::internal | 1779 } } // namespace v8::internal |
| 1781 | 1780 |
| 1782 #endif // V8_TARGET_ARCH_MIPS | 1781 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |