Commit 6c4c6c84 authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[runtime] Remove obsolete Runtime::ElementsKindToType.

This removes the static helper which is by now only used by a single
runtime function. In general the {Runtime} class no longer acts as a
grab-bag for various helper functions.

R=petermarshall@chromium.org

Change-Id: I9c2141bbd88db27ae1f95fe004bcc8a7c5506208
Reviewed-on: https://chromium-review.googlesource.com/459597
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#44174}
parent 048f89c8
......@@ -120,6 +120,25 @@ RUNTIME_FUNCTION(Runtime_ThrowTypeError) {
#undef THROW_ERROR
namespace {
const char* ElementsKindToType(ElementsKind fixed_elements_kind) {
switch (fixed_elements_kind) {
#define ELEMENTS_KIND_CASE(Type, type, TYPE, ctype, size) \
case TYPE##_ELEMENTS: \
return #Type "Array";
TYPED_ARRAYS(ELEMENTS_KIND_CASE)
#undef ELEMENTS_KIND_CASE
default:
UNREACHABLE();
return "";
}
}
} // namespace
RUNTIME_FUNCTION(Runtime_ThrowInvalidTypedArrayAlignment) {
HandleScope scope(isolate);
DCHECK_EQ(2, args.length());
......@@ -128,8 +147,8 @@ RUNTIME_FUNCTION(Runtime_ThrowInvalidTypedArrayAlignment) {
ElementsKind kind = map->elements_kind();
Handle<String> type = isolate->factory()->NewStringFromAsciiChecked(
Runtime::ElementsKindToType(kind));
Handle<String> type =
isolate->factory()->NewStringFromAsciiChecked(ElementsKindToType(kind));
ExternalArrayType external_type =
isolate->factory()->GetArrayTypeFromElementsKind(kind);
......
......@@ -78,21 +78,6 @@ RUNTIME_FUNCTION(Runtime_TypedArrayCopyElements) {
return CopyElements(isolate, holder, source, length);
}
const char* Runtime::ElementsKindToType(ElementsKind fixed_elements_kind) {
switch (fixed_elements_kind) {
#define ELEMENTS_KIND_CASE(Type, type, TYPE, ctype, size) \
case TYPE##_ELEMENTS: \
return #Type "Array";
TYPED_ARRAYS(ELEMENTS_KIND_CASE)
#undef ELEMENTS_KIND_CASE
default:
UNREACHABLE();
return "";
}
}
// Initializes a typed array from an array-like object, and its backing store as
// well.
RUNTIME_FUNCTION(Runtime_TypedArrayInitializeFromArrayLike) {
......
......@@ -779,10 +779,8 @@ class Runtime : public AllStatic {
Isolate* isolate, Handle<Object> object, Handle<Object> key,
bool* is_found_out = nullptr);
static const char* ElementsKindToType(ElementsKind fixed_elements_kind);
static MaybeHandle<JSArray> GetInternalProperties(Isolate* isolate,
Handle<Object>);
MUST_USE_RESULT static MaybeHandle<JSArray> GetInternalProperties(
Isolate* isolate, Handle<Object>);
};
......
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