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

Unified Diff: src/elements.h

Issue 9663002: Use CopyElements for SetFastDoubleElementsCapacityAndLength (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback Created 8 years, 9 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/builtins.cc ('k') | src/elements.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/elements.h
diff --git a/src/elements.h b/src/elements.h
index 5b5be23b100abe8ead0f498ff1cddf3bbb3e4727..e853a8808e08c539c41a64354d19ed61117694b6 100644
--- a/src/elements.h
+++ b/src/elements.h
@@ -88,6 +88,15 @@ class ElementsAccessor {
uint32_t key,
JSReceiver::DeleteMode mode) = 0;
+ // If kCopyToEnd is specified as the copy_size to CopyElements, it copies all
+ // of elements from source after source_start to the destination array.
+ static const int kCopyToEnd = -1;
+ // If kCopyToEndAndInitializeToHole is specified as the copy_size to
+ // CopyElements, it copies all of elements from source after source_start to
+ // destination array, padding any remaining uninitialized elements in the
+ // destination array with the hole.
+ static const int kCopyToEndAndInitializeToHole = -2;
+
// Copy elements from one backing store to another. Typically, callers specify
// the source JSObject or JSArray in source_holder. If the holder's backing
// store is available, it can be passed in source and source_holder is
@@ -98,13 +107,16 @@ class ElementsAccessor {
ElementsKind destination_kind,
uint32_t destination_start,
int copy_size,
+ WriteBarrierMode mode,
FixedArrayBase* source = NULL) = 0;
MaybeObject* CopyElements(JSObject* from_holder,
FixedArrayBase* to,
ElementsKind to_kind,
+ WriteBarrierMode mode,
FixedArrayBase* from = NULL) {
- return CopyElements(from_holder, 0, to, to_kind, 0, -1, from);
+ return CopyElements(from_holder, 0, to, to_kind, 0,
+ kCopyToEndAndInitializeToHole, mode, from);
}
virtual MaybeObject* AddElementsToFixedArray(Object* receiver,
@@ -146,14 +158,14 @@ class ElementsAccessor {
};
-void CopyObjectToObjectElements(AssertNoAllocation* no_gc,
- FixedArray* from_obj,
+void CopyObjectToObjectElements(FixedArray* from_obj,
ElementsKind from_kind,
uint32_t from_start,
FixedArray* to_obj,
ElementsKind to_kind,
uint32_t to_start,
- int copy_size);
+ int copy_size,
+ WriteBarrierMode mode = UPDATE_WRITE_BARRIER);
} } // namespace v8::internal
« no previous file with comments | « src/builtins.cc ('k') | src/elements.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698