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

Side by Side Diff: src/elements.h

Issue 11416238: Move CopyElements to the accessor of the target. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed more comments. Created 8 years 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/builtins.cc ('k') | src/elements.cc » ('j') | src/elements.cc » ('J')
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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 // destination array with the hole. 136 // destination array with the hole.
137 static const int kCopyToEndAndInitializeToHole = -2; 137 static const int kCopyToEndAndInitializeToHole = -2;
138 138
139 // Copy elements from one backing store to another. Typically, callers specify 139 // Copy elements from one backing store to another. Typically, callers specify
140 // the source JSObject or JSArray in source_holder. If the holder's backing 140 // the source JSObject or JSArray in source_holder. If the holder's backing
141 // store is available, it can be passed in source and source_holder is 141 // store is available, it can be passed in source and source_holder is
142 // ignored. 142 // ignored.
143 MUST_USE_RESULT virtual MaybeObject* CopyElements( 143 MUST_USE_RESULT virtual MaybeObject* CopyElements(
144 JSObject* source_holder, 144 JSObject* source_holder,
145 uint32_t source_start, 145 uint32_t source_start,
146 ElementsKind source_kind,
146 FixedArrayBase* destination, 147 FixedArrayBase* destination,
147 ElementsKind destination_kind,
148 uint32_t destination_start, 148 uint32_t destination_start,
149 int copy_size, 149 int copy_size,
150 FixedArrayBase* source = NULL) = 0; 150 FixedArrayBase* source = NULL) = 0;
151 151
152 MUST_USE_RESULT MaybeObject* CopyElements(JSObject* from_holder, 152 MUST_USE_RESULT MaybeObject* CopyElements(JSObject* from_holder,
153 FixedArrayBase* to, 153 FixedArrayBase* to,
154 ElementsKind to_kind, 154 ElementsKind from_kind,
155 FixedArrayBase* from = NULL) { 155 FixedArrayBase* from = NULL) {
156 return CopyElements(from_holder, 0, to, to_kind, 0, 156 return CopyElements(from_holder, 0, from_kind, to, 0,
157 kCopyToEndAndInitializeToHole, from); 157 kCopyToEndAndInitializeToHole, from);
158 } 158 }
159 159
160 MUST_USE_RESULT virtual MaybeObject* AddElementsToFixedArray( 160 MUST_USE_RESULT virtual MaybeObject* AddElementsToFixedArray(
161 Object* receiver, 161 Object* receiver,
162 JSObject* holder, 162 JSObject* holder,
163 FixedArray* to, 163 FixedArray* to,
164 FixedArrayBase* from = NULL) = 0; 164 FixedArrayBase* from = NULL) = 0;
165 165
166 // Returns a shared ElementsAccessor for the specified ElementsKind. 166 // Returns a shared ElementsAccessor for the specified ElementsKind.
(...skipping 26 matching lines...) Expand all
193 private: 193 private:
194 static ElementsAccessor** elements_accessors_; 194 static ElementsAccessor** elements_accessors_;
195 const char* name_; 195 const char* name_;
196 196
197 DISALLOW_COPY_AND_ASSIGN(ElementsAccessor); 197 DISALLOW_COPY_AND_ASSIGN(ElementsAccessor);
198 }; 198 };
199 199
200 } } // namespace v8::internal 200 } } // namespace v8::internal
201 201
202 #endif // V8_ELEMENTS_H_ 202 #endif // V8_ELEMENTS_H_
OLDNEW
« no previous file with comments | « src/builtins.cc ('k') | src/elements.cc » ('j') | src/elements.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698