Commit f339f744 authored by Choongwoo Han's avatar Choongwoo Han Committed by Commit Bot

[typedarray] Remove unused C++ implementations

There are functions that were called by TypedArraySpeciesCreate that
is deleted now. This CL removes Create, HasJSTypedArrayPrototype,
DefaultConstructor in JSTypedArray, which is not used anymore.

Change-Id: Ib4785cc52a8f18f2a3dfc3f27e39a23260cb2a4f
Reviewed-on: https://chromium-review.googlesource.com/905712Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51145}
parent 796cf1a3
......@@ -16697,36 +16697,6 @@ size_t JSTypedArray::element_size() {
}
}
// static
MaybeHandle<JSTypedArray> JSTypedArray::Create(Isolate* isolate,
Handle<Object> default_ctor,
int argc, Handle<Object>* argv,
const char* method_name) {
// 1. Let newTypedArray be ? Construct(constructor, argumentList).
Handle<Object> new_obj;
ASSIGN_RETURN_ON_EXCEPTION(isolate, new_obj,
Execution::New(isolate, default_ctor, argc, argv),
JSTypedArray);
// 2. Perform ? ValidateTypedArray(newTypedArray).
Handle<JSTypedArray> new_array;
ASSIGN_RETURN_ON_EXCEPTION(
isolate, new_array, JSTypedArray::Validate(isolate, new_obj, method_name),
JSTypedArray);
// 3. If argumentList is a List of a single Number, then
// If newTypedArray.[[ArrayLength]] < size, throw a TypeError exception.
DCHECK_IMPLIES(argc == 1, argv[0]->IsSmi());
if (argc == 1 && new_array->length_value() < argv[0]->Number()) {
const MessageTemplate::Template message =
MessageTemplate::kTypedArrayTooShort;
THROW_NEW_ERROR(isolate, NewTypeError(message), JSTypedArray);
}
// 4. Return newTypedArray.
return new_array;
}
void JSGlobalObject::InvalidatePropertyCell(Handle<JSGlobalObject> global,
Handle<Name> name) {
// Regardless of whether the property is there or not invalidate
......
......@@ -204,15 +204,6 @@ void JSTypedArray::set_length(Object* value, WriteBarrierMode mode) {
CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kLengthOffset, value, mode);
}
bool JSTypedArray::HasJSTypedArrayPrototype(Isolate* isolate) {
DisallowHeapAllocation no_gc;
Object* proto = map()->prototype();
if (!proto->IsJSObject()) return false;
JSObject* proto_obj = JSObject::cast(proto);
return proto_obj->map()->prototype() == *isolate->typed_array_prototype();
}
// static
MaybeHandle<JSTypedArray> JSTypedArray::Validate(Isolate* isolate,
Handle<Object> receiver,
......@@ -236,26 +227,6 @@ MaybeHandle<JSTypedArray> JSTypedArray::Validate(Isolate* isolate,
return array;
}
// static
Handle<JSFunction> JSTypedArray::DefaultConstructor(
Isolate* isolate, Handle<JSTypedArray> exemplar) {
Handle<JSFunction> default_ctor = isolate->uint8_array_fun();
switch (exemplar->type()) {
#define TYPED_ARRAY_CTOR(Type, type, TYPE, ctype, size) \
case kExternal##Type##Array: { \
default_ctor = isolate->type##_array_fun(); \
break; \
}
TYPED_ARRAYS(TYPED_ARRAY_CTOR)
#undef TYPED_ARRAY_CTOR
default:
UNREACHABLE();
}
return default_ctor;
}
#ifdef VERIFY_HEAP
ACCESSORS(JSTypedArray, raw_length, Object, kLengthOffset)
#endif
......
......@@ -299,17 +299,9 @@ class JSTypedArray : public JSArrayBufferView {
Handle<JSArrayBuffer> GetBuffer();
inline bool HasJSTypedArrayPrototype(Isolate* isolate);
static inline MaybeHandle<JSTypedArray> Validate(Isolate* isolate,
Handle<Object> receiver,
const char* method_name);
static inline Handle<JSFunction> DefaultConstructor(
Isolate* isolate, Handle<JSTypedArray> exemplar);
// ES7 section 22.2.4.6 Create ( constructor, argumentList )
static MaybeHandle<JSTypedArray> Create(Isolate* isolate,
Handle<Object> default_ctor, int argc,
Handle<Object>* argv,
const char* method_name);
// Dispatched behavior.
DECL_PRINTER(JSTypedArray)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment