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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 } | 147 } |
148 | 148 |
149 | 149 |
150 static void CopyObjectToObjectElements(FixedArrayBase* from_base, | 150 static void CopyObjectToObjectElements(FixedArrayBase* from_base, |
151 ElementsKind from_kind, | 151 ElementsKind from_kind, |
152 uint32_t from_start, | 152 uint32_t from_start, |
153 FixedArrayBase* to_base, | 153 FixedArrayBase* to_base, |
154 ElementsKind to_kind, | 154 ElementsKind to_kind, |
155 uint32_t to_start, | 155 uint32_t to_start, |
156 int raw_copy_size) { | 156 int raw_copy_size) { |
157 ASSERT(to_base->map() != HEAP->fixed_cow_array_map()); | 157 ASSERT(to_base->map() != |
| 158 from_base->GetIsolate()->heap()->fixed_cow_array_map()); |
158 DisallowHeapAllocation no_allocation; | 159 DisallowHeapAllocation no_allocation; |
159 int copy_size = raw_copy_size; | 160 int copy_size = raw_copy_size; |
160 if (raw_copy_size < 0) { | 161 if (raw_copy_size < 0) { |
161 ASSERT(raw_copy_size == ElementsAccessor::kCopyToEnd || | 162 ASSERT(raw_copy_size == ElementsAccessor::kCopyToEnd || |
162 raw_copy_size == ElementsAccessor::kCopyToEndAndInitializeToHole); | 163 raw_copy_size == ElementsAccessor::kCopyToEndAndInitializeToHole); |
163 copy_size = Min(from_base->length() - from_start, | 164 copy_size = Min(from_base->length() - from_start, |
164 to_base->length() - to_start); | 165 to_base->length() - to_start); |
165 if (raw_copy_size == ElementsAccessor::kCopyToEndAndInitializeToHole) { | 166 if (raw_copy_size == ElementsAccessor::kCopyToEndAndInitializeToHole) { |
166 int start = to_start + copy_size; | 167 int start = to_start + copy_size; |
167 int length = to_base->length() - start; | 168 int length = to_base->length() - start; |
(...skipping 1889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2057 UNREACHABLE(); | 2058 UNREACHABLE(); |
2058 break; | 2059 break; |
2059 } | 2060 } |
2060 | 2061 |
2061 array->set_elements(elms); | 2062 array->set_elements(elms); |
2062 array->set_length(Smi::FromInt(number_of_elements)); | 2063 array->set_length(Smi::FromInt(number_of_elements)); |
2063 return array; | 2064 return array; |
2064 } | 2065 } |
2065 | 2066 |
2066 } } // namespace v8::internal | 2067 } } // namespace v8::internal |
OLD | NEW |