| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 // Copy elements from one backing store to another. Typically, callers specify | 100 // Copy elements from one backing store to another. Typically, callers specify |
| 101 // the source JSObject or JSArray in source_holder. If the holder's backing | 101 // the source JSObject or JSArray in source_holder. If the holder's backing |
| 102 // store is available, it can be passed in source and source_holder is | 102 // store is available, it can be passed in source and source_holder is |
| 103 // ignored. | 103 // ignored. |
| 104 virtual MaybeObject* CopyElements(JSObject* source_holder, | 104 virtual MaybeObject* CopyElements(JSObject* source_holder, |
| 105 uint32_t source_start, | 105 uint32_t source_start, |
| 106 FixedArrayBase* destination, | 106 FixedArrayBase* destination, |
| 107 ElementsKind destination_kind, | 107 ElementsKind destination_kind, |
| 108 uint32_t destination_start, | 108 uint32_t destination_start, |
| 109 int copy_size, | 109 int copy_size, |
| 110 WriteBarrierMode mode, | |
| 111 FixedArrayBase* source = NULL) = 0; | 110 FixedArrayBase* source = NULL) = 0; |
| 112 | 111 |
| 113 MaybeObject* CopyElements(JSObject* from_holder, | 112 MaybeObject* CopyElements(JSObject* from_holder, |
| 114 FixedArrayBase* to, | 113 FixedArrayBase* to, |
| 115 ElementsKind to_kind, | 114 ElementsKind to_kind, |
| 116 WriteBarrierMode mode, | |
| 117 FixedArrayBase* from = NULL) { | 115 FixedArrayBase* from = NULL) { |
| 118 return CopyElements(from_holder, 0, to, to_kind, 0, | 116 return CopyElements(from_holder, 0, to, to_kind, 0, |
| 119 kCopyToEndAndInitializeToHole, mode, from); | 117 kCopyToEndAndInitializeToHole, from); |
| 120 } | 118 } |
| 121 | 119 |
| 122 virtual MaybeObject* AddElementsToFixedArray(Object* receiver, | 120 virtual MaybeObject* AddElementsToFixedArray(Object* receiver, |
| 123 JSObject* holder, | 121 JSObject* holder, |
| 124 FixedArray* to, | 122 FixedArray* to, |
| 125 FixedArrayBase* from = NULL) = 0; | 123 FixedArrayBase* from = NULL) = 0; |
| 126 | 124 |
| 127 // Returns a shared ElementsAccessor for the specified ElementsKind. | 125 // Returns a shared ElementsAccessor for the specified ElementsKind. |
| 128 static ElementsAccessor* ForKind(ElementsKind elements_kind) { | 126 static ElementsAccessor* ForKind(ElementsKind elements_kind) { |
| 129 ASSERT(elements_kind < kElementsKindCount); | 127 ASSERT(elements_kind < kElementsKindCount); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 157 DISALLOW_COPY_AND_ASSIGN(ElementsAccessor); | 155 DISALLOW_COPY_AND_ASSIGN(ElementsAccessor); |
| 158 }; | 156 }; |
| 159 | 157 |
| 160 | 158 |
| 161 void CopyObjectToObjectElements(FixedArray* from_obj, | 159 void CopyObjectToObjectElements(FixedArray* from_obj, |
| 162 ElementsKind from_kind, | 160 ElementsKind from_kind, |
| 163 uint32_t from_start, | 161 uint32_t from_start, |
| 164 FixedArray* to_obj, | 162 FixedArray* to_obj, |
| 165 ElementsKind to_kind, | 163 ElementsKind to_kind, |
| 166 uint32_t to_start, | 164 uint32_t to_start, |
| 167 int copy_size, | 165 int copy_size); |
| 168 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); | |
| 169 | 166 |
| 170 | 167 |
| 171 } } // namespace v8::internal | 168 } } // namespace v8::internal |
| 172 | 169 |
| 173 #endif // V8_ELEMENTS_H_ | 170 #endif // V8_ELEMENTS_H_ |
| OLD | NEW |