Commit a55d8632 authored by jgruber's avatar jgruber Committed by Commit Bot

[stubs] Remove TransitionElementsKindStub

Its contents are now inlined into the one remaining call site.

Bug: v8:6666
Change-Id: Icfcf89013506fec880ffd84eaa88b91e818e28c0
Reviewed-on: https://chromium-review.googlesource.com/1073311Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53363}
parent 1b9ca71d
......@@ -189,13 +189,6 @@ void ConstructTrampolineDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers);
}
void TransitionElementsKindDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {r0, r1};
data->InitializePlatformSpecific(arraysize(registers), registers);
}
void AbortJSDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {r1};
......
......@@ -190,14 +190,6 @@ void ConstructTrampolineDescriptor::InitializePlatformSpecific(
}
void TransitionElementsKindDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// x0: value (js_array)
// x1: to_map
Register registers[] = {x0, x1};
data->InitializePlatformSpecific(arraysize(registers), registers);
}
void AbortJSDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {x1};
......
......@@ -297,9 +297,18 @@ Node* ArrayBuiltinsAssembler::FindProcessor(Node* k_value, Node* k) {
Node* const native_context = LoadNativeContext(context());
Node* const double_map = LoadContextElement(
native_context, Context::JS_ARRAY_HOLEY_DOUBLE_ELEMENTS_MAP_INDEX);
CallStub(CodeFactory::TransitionElementsKind(
isolate(), HOLEY_SMI_ELEMENTS, HOLEY_DOUBLE_ELEMENTS, true),
context(), a(), double_map);
const ElementsKind kFromKind = HOLEY_SMI_ELEMENTS;
const ElementsKind kToKind = HOLEY_DOUBLE_ELEMENTS;
const bool kIsJSArray = true;
Label transition_in_runtime(this, Label::kDeferred);
TransitionElementsKind(a(), double_map, kFromKind, kToKind, kIsJSArray,
&transition_in_runtime);
Goto(&array_double);
BIND(&transition_in_runtime);
CallRuntime(Runtime::kTransitionElementsKind, context(), a(), double_map);
Goto(&array_double);
}
......
......@@ -367,13 +367,5 @@ Callable CodeFactory::FunctionPrototypeBind(Isolate* isolate) {
BuiltinDescriptor(isolate));
}
// static
Callable CodeFactory::TransitionElementsKind(Isolate* isolate,
ElementsKind from, ElementsKind to,
bool is_jsarray) {
TransitionElementsKindStub stub(isolate, from, to, is_jsarray);
return make_callable(stub);
}
} // namespace internal
} // namespace v8
......@@ -91,8 +91,6 @@ class V8_EXPORT_PRIVATE CodeFactory final {
static Callable ExtractFastJSArray(Isolate* isolate);
static Callable CloneFastJSArray(Isolate* isolate);
static Callable FunctionPrototypeBind(Isolate* isolate);
static Callable TransitionElementsKind(Isolate* isolate, ElementsKind from,
ElementsKind to, bool is_jsarray);
};
} // namespace internal
......
......@@ -305,23 +305,6 @@ TF_STUB(ElementsTransitionAndStoreStub, CodeStubAssembler) {
}
}
TF_STUB(TransitionElementsKindStub, CodeStubAssembler) {
Node* context = Parameter(Descriptor::kContext);
Node* object = Parameter(Descriptor::kObject);
Node* new_map = Parameter(Descriptor::kMap);
Label bailout(this);
TransitionElementsKind(object, new_map, stub->from_kind(), stub->to_kind(),
stub->is_jsarray(), &bailout);
Return(object);
BIND(&bailout);
{
Comment("Call runtime");
TailCallRuntime(Runtime::kTransitionElementsKind, context, object, new_map);
}
}
// TODO(ishell): move to builtins-handler-gen.
TF_STUB(KeyedLoadSloppyArgumentsStub, CodeStubAssembler) {
Node* receiver = Parameter(Descriptor::kReceiver);
......
......@@ -44,7 +44,6 @@ class Node;
V(KeyedStoreSloppyArguments) \
V(StoreFastElement) \
V(StoreInterceptor) \
V(TransitionElementsKind) \
V(LoadIndexedInterceptor)
// List of code stubs only used on ARM 32 bits platforms.
......@@ -436,37 +435,6 @@ class StoreInterceptorStub : public TurboFanCodeStub {
DEFINE_TURBOFAN_CODE_STUB(StoreInterceptor, TurboFanCodeStub);
};
class TransitionElementsKindStub : public TurboFanCodeStub {
public:
TransitionElementsKindStub(Isolate* isolate, ElementsKind from_kind,
ElementsKind to_kind, bool is_jsarray)
: TurboFanCodeStub(isolate) {
set_sub_minor_key(FromKindBits::encode(from_kind) |
ToKindBits::encode(to_kind) |
IsJSArrayBits::encode(is_jsarray));
}
void set_sub_minor_key(uint32_t key) { minor_key_ = key; }
uint32_t sub_minor_key() const { return minor_key_; }
ElementsKind from_kind() const {
return FromKindBits::decode(sub_minor_key());
}
ElementsKind to_kind() const { return ToKindBits::decode(sub_minor_key()); }
bool is_jsarray() const { return IsJSArrayBits::decode(sub_minor_key()); }
private:
class ToKindBits : public BitField<ElementsKind, 0, 8> {};
class FromKindBits : public BitField<ElementsKind, ToKindBits::kNext, 8> {};
class IsJSArrayBits : public BitField<bool, FromKindBits::kNext, 1> {};
DEFINE_CALL_INTERFACE_DESCRIPTOR(TransitionElementsKind);
DEFINE_TURBOFAN_CODE_STUB(TransitionElementsKind, TurboFanCodeStub);
};
// TODO(jgruber): Convert this stub into a builtin.
class LoadIndexedInterceptorStub : public TurboFanCodeStub {
public:
......
......@@ -421,6 +421,7 @@ bool IntrinsicHasNoSideEffect(Runtime::FunctionId id) {
V(ThrowRangeError) \
V(ThrowTypeError) \
V(ToName) \
V(TransitionElementsKind) \
/* Misc. */ \
V(Call) \
V(CompleteInobjectSlackTrackingForMap) \
......
......@@ -189,12 +189,6 @@ void ConstructTrampolineDescriptor::InitializePlatformSpecific(
}
void TransitionElementsKindDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {eax, ebx};
data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
}
void AbortJSDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {edx};
......
......@@ -49,7 +49,6 @@ class PlatformInterfaceDescriptor;
V(ConstructWithSpread) \
V(ConstructWithArrayLike) \
V(ConstructTrampoline) \
V(TransitionElementsKind) \
V(AbortJS) \
V(AllocateHeapNumber) \
V(Builtin) \
......@@ -658,12 +657,6 @@ class CallFunctionDescriptor : public CallInterfaceDescriptor {
DECLARE_DESCRIPTOR(CallFunctionDescriptor, CallInterfaceDescriptor)
};
class TransitionElementsKindDescriptor : public CallInterfaceDescriptor {
public:
DEFINE_PARAMETERS(kObject, kMap)
DECLARE_DESCRIPTOR(TransitionElementsKindDescriptor, CallInterfaceDescriptor)
};
class AbortJSDescriptor : public CallInterfaceDescriptor {
public:
DEFINE_PARAMETERS(kObject)
......
......@@ -188,12 +188,6 @@ void ConstructTrampolineDescriptor::InitializePlatformSpecific(
}
void TransitionElementsKindDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {a0, a1};
data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
}
void AbortJSDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {a0};
......
......@@ -188,12 +188,6 @@ void ConstructTrampolineDescriptor::InitializePlatformSpecific(
}
void TransitionElementsKindDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {a0, a1};
data->InitializePlatformSpecific(arraysize(registers), registers, nullptr);
}
void AbortJSDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {a0};
......
......@@ -189,13 +189,6 @@ void ConstructTrampolineDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers);
}
void TransitionElementsKindDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {rax, rbx};
data->InitializePlatformSpecific(arraysize(registers), registers);
}
void AbortJSDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {rdx};
......
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