OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/elements.h" | 5 #include "src/elements.h" |
6 | 6 |
7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/conversions.h" | 8 #include "src/conversions.h" |
9 #include "src/factory.h" | 9 #include "src/factory.h" |
10 #include "src/messages.h" | 10 #include "src/messages.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 MemsetPointer(FixedArray::cast(to_base)->data_start() + start, | 132 MemsetPointer(FixedArray::cast(to_base)->data_start() + start, |
133 heap->the_hole_value(), length); | 133 heap->the_hole_value(), length); |
134 } | 134 } |
135 } | 135 } |
136 } | 136 } |
137 DCHECK((copy_size + static_cast<int>(to_start)) <= to_base->length() && | 137 DCHECK((copy_size + static_cast<int>(to_start)) <= to_base->length() && |
138 (copy_size + static_cast<int>(from_start)) <= from_base->length()); | 138 (copy_size + static_cast<int>(from_start)) <= from_base->length()); |
139 if (copy_size == 0) return; | 139 if (copy_size == 0) return; |
140 FixedArray* from = FixedArray::cast(from_base); | 140 FixedArray* from = FixedArray::cast(from_base); |
141 FixedArray* to = FixedArray::cast(to_base); | 141 FixedArray* to = FixedArray::cast(to_base); |
142 DCHECK(IsFastSmiOrObjectElementsKind(from_kind)); | 142 DCHECK(IsFastSmiOrObjectElementsKind(from_kind) || |
| 143 from_kind == FAST_STRING_WRAPPER_ELEMENTS); |
143 DCHECK(IsFastSmiOrObjectElementsKind(to_kind)); | 144 DCHECK(IsFastSmiOrObjectElementsKind(to_kind)); |
144 | 145 |
145 WriteBarrierMode write_barrier_mode = | 146 WriteBarrierMode write_barrier_mode = |
146 (IsFastObjectElementsKind(from_kind) && IsFastObjectElementsKind(to_kind)) | 147 (IsFastObjectElementsKind(from_kind) && IsFastObjectElementsKind(to_kind)) |
147 ? UPDATE_WRITE_BARRIER | 148 ? UPDATE_WRITE_BARRIER |
148 : SKIP_WRITE_BARRIER; | 149 : SKIP_WRITE_BARRIER; |
149 for (int i = 0; i < copy_size; i++) { | 150 for (int i = 0; i < copy_size; i++) { |
150 Object* value = from->get(from_start + i); | 151 Object* value = from->get(from_start + i); |
151 to->set(to_start + i, value, write_barrier_mode); | 152 to->set(to_start + i, value, write_barrier_mode); |
152 } | 153 } |
(...skipping 2519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2672 } | 2673 } |
2673 } | 2674 } |
2674 | 2675 |
2675 DCHECK(j == result_len); | 2676 DCHECK(j == result_len); |
2676 return result_array; | 2677 return result_array; |
2677 } | 2678 } |
2678 | 2679 |
2679 ElementsAccessor** ElementsAccessor::elements_accessors_ = NULL; | 2680 ElementsAccessor** ElementsAccessor::elements_accessors_ = NULL; |
2680 } // namespace internal | 2681 } // namespace internal |
2681 } // namespace v8 | 2682 } // namespace v8 |
OLD | NEW |