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

Unified Diff: src/factory.cc

Issue 1257223002: Revert of Remove ExternalArray, derived types, and element kinds (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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/factory.h ('k') | src/heap-snapshot-generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 1d594d3eb5a6eda62470d908f7669c9b30028cbe..e2a5e05693a1202c1f1a41b1ccc7bb47d78580ee 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -883,14 +883,18 @@
}
-Handle<FixedTypedArrayBase> Factory::NewFixedTypedArrayWithExternalPointer(
- int length, ExternalArrayType array_type, void* external_pointer,
- PretenureFlag pretenure) {
+Handle<ExternalArray> Factory::NewExternalArray(int length,
+ ExternalArrayType array_type,
+ void* external_pointer,
+ PretenureFlag pretenure) {
DCHECK(0 <= length && length <= Smi::kMaxValue);
CALL_HEAP_FUNCTION(
- isolate(), isolate()->heap()->AllocateFixedTypedArrayWithExternalPointer(
- length, array_type, external_pointer, pretenure),
- FixedTypedArrayBase);
+ isolate(),
+ isolate()->heap()->AllocateExternalArray(length,
+ array_type,
+ external_pointer,
+ pretenure),
+ ExternalArray);
}
@@ -1761,11 +1765,11 @@
switch (type) {
#define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \
case kExternal##Type##Array: \
- return TYPE##_ELEMENTS;
+ return EXTERNAL_##TYPE##_ELEMENTS;
TYPED_ARRAYS(TYPED_ARRAY_CASE)
}
UNREACHABLE();
- return FIRST_FIXED_TYPED_ARRAY_ELEMENTS_KIND;
+ return FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND;
#undef TYPED_ARRAY_CASE
}
@@ -1907,7 +1911,7 @@
Handle<Object> length_object = NewNumberFromSize(length);
obj->set_length(*length_object);
- Handle<FixedTypedArrayBase> elements = NewFixedTypedArrayWithExternalPointer(
+ Handle<ExternalArray> elements = NewExternalArray(
static_cast<int>(length), type,
static_cast<uint8_t*>(buffer->backing_store()) + byte_offset);
Handle<Map> map = JSObject::GetElementsTransitionMap(obj, elements_kind);
« no previous file with comments | « src/factory.h ('k') | src/heap-snapshot-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698