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

Unified Diff: src/objects-inl.h

Issue 1058793002: Support for typed arrays added to Heap::RightTrimFixedArray(). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments Created 5 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/objects.h ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 22cdd03fd06f9e7c01ab3b3cb9224297f07d8269..67d64c47794b34068dd78393e380c692500a4b6b 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -4225,7 +4225,7 @@ void* FixedTypedArrayBase::DataPtr() {
}
-int FixedTypedArrayBase::DataSize(InstanceType type) {
+int FixedTypedArrayBase::ElementSize(InstanceType type) {
int element_size;
switch (type) {
#define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \
@@ -4239,7 +4239,12 @@ int FixedTypedArrayBase::DataSize(InstanceType type) {
UNREACHABLE();
return 0;
}
- return length() * element_size;
+ return element_size;
+}
+
+
+int FixedTypedArrayBase::DataSize(InstanceType type) {
+ return length() * ElementSize(type);
}
@@ -4258,6 +4263,11 @@ int FixedTypedArrayBase::TypedArraySize(InstanceType type) {
}
+int FixedTypedArrayBase::TypedArraySize(InstanceType type, int length) {
+ return OBJECT_POINTER_ALIGN(kDataOffset + length * ElementSize(type));
+}
+
+
uint8_t Uint8ArrayTraits::defaultValue() { return 0; }
« no previous file with comments | « src/objects.h ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698