Commit 02f23074 authored by tzik's avatar tzik Committed by Commit Bot

Define CallInterfaceDescriptor for RunMicrotasksEntry

This updates the InterfaceDescriptor for JSRunMicrotasksEntry and
RunMicrotasksTrampoline from DummyDescriptor to RunMicrotasksEntryDescriptor.

Bug: v8:8124
Change-Id: I4522fd45bd18b33a2a4471b76c217d2a0f504cb0
Reviewed-on: https://chromium-review.googlesource.com/c/1412132
Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58879}
parent 4bf28a33
......@@ -257,6 +257,12 @@ void FrameDropperTrampolineDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers);
}
void RunMicrotasksEntryDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {r0, r1};
data->InitializePlatformSpecific(arraysize(registers), registers);
}
} // namespace internal
} // namespace v8
......
......@@ -261,6 +261,12 @@ void FrameDropperTrampolineDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers);
}
void RunMicrotasksEntryDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {x0, x1};
data->InitializePlatformSpecific(arraysize(registers), registers);
}
} // namespace internal
} // namespace v8
......
......@@ -92,7 +92,7 @@ namespace internal {
/* Apply and entries */ \
ASM(JSEntry, Dummy) \
ASM(JSConstructEntry, Dummy) \
ASM(JSRunMicrotasksEntry, Dummy) \
ASM(JSRunMicrotasksEntry, RunMicrotasksEntry) \
ASM(JSEntryTrampoline, Dummy) \
ASM(JSConstructEntryTrampoline, Dummy) \
ASM(ResumeGeneratorTrampoline, ResumeGenerator) \
......@@ -252,7 +252,7 @@ namespace internal {
\
/* Microtask helpers */ \
TFS(EnqueueMicrotask, kMicrotask) \
ASM(RunMicrotasksTrampoline, Dummy) \
ASM(RunMicrotasksTrampoline, RunMicrotasksEntry) \
TFC(RunMicrotasks, RunMicrotasks, 1) \
\
/* Object property helpers */ \
......
......@@ -257,6 +257,11 @@ void FrameDropperTrampolineDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers);
}
void RunMicrotasksEntryDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
data->InitializePlatformSpecific(0, nullptr);
}
} // namespace internal
} // namespace v8
......
......@@ -48,7 +48,7 @@ void CallInterfaceDescriptorData::InitializePlatformIndependent(
for (int i = 0; i < types_length; i++) machine_types_[i] = machine_types[i];
}
DCHECK(AllStackParametersAreTagged());
if (!(flags_ & kNoStackScan)) DCHECK(AllStackParametersAreTagged());
}
#ifdef DEBUG
......
......@@ -64,6 +64,7 @@ namespace internal {
V(NoContext) \
V(RecordWrite) \
V(ResumeGenerator) \
V(RunMicrotasksEntry) \
V(RunMicrotasks) \
V(Store) \
V(StoreGlobal) \
......@@ -88,6 +89,11 @@ class V8_EXPORT_PRIVATE CallInterfaceDescriptorData {
enum Flag {
kNoFlags = 0u,
kNoContext = 1u << 0,
// This indicates that the code uses a special frame that does not scan the
// stack arguments, e.g. EntryFrame. And this allows the code to use
// untagged stack arguments.
kNoStackScan = 1u << 1,
};
typedef base::Flags<Flag> Flags;
......@@ -403,6 +409,20 @@ STATIC_ASSERT(kMaxTFSBuiltinRegisterParams <= kMaxBuiltinRegisterParams);
kParameterCount \
};
// This is valid only for builtins that use EntryFrame, which does not scan
// stack arguments on GC.
#define DEFINE_PARAMETERS_ENTRY(...) \
static constexpr int kDescriptorFlags = \
CallInterfaceDescriptorData::kNoContext | \
CallInterfaceDescriptorData::kNoStackScan; \
static constexpr int kReturnCount = 1; \
enum ParameterIndices { \
__dummy = -1, /* to be able to pass zero arguments */ \
##__VA_ARGS__, \
\
kParameterCount \
};
#define DEFINE_PARAMETERS(...) DEFINE_RESULT_AND_PARAMETERS(1, ##__VA_ARGS__)
#define DEFINE_PARAMETERS_NO_CONTEXT(...) \
......@@ -1105,6 +1125,14 @@ class FrameDropperTrampolineDescriptor final : public CallInterfaceDescriptor {
DECLARE_DESCRIPTOR(FrameDropperTrampolineDescriptor, CallInterfaceDescriptor)
};
class RunMicrotasksEntryDescriptor final : public CallInterfaceDescriptor {
public:
DEFINE_PARAMETERS_ENTRY(kRootRegisterValue, kMicrotaskQueue)
DEFINE_PARAMETER_TYPES(MachineType::Pointer(), // kRootRegisterValue
MachineType::Pointer()) // kMicrotaskQueue
DECLARE_DESCRIPTOR(RunMicrotasksEntryDescriptor, CallInterfaceDescriptor)
};
class RunMicrotasksDescriptor final : public CallInterfaceDescriptor {
public:
DEFINE_PARAMETERS(kMicrotaskQueue)
......
......@@ -285,6 +285,12 @@ void FrameDropperTrampolineDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers);
}
void RunMicrotasksEntryDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {a0, a1};
data->InitializePlatformSpecific(arraysize(registers), registers);
}
} // namespace internal
} // namespace v8
......
......@@ -285,6 +285,12 @@ void FrameDropperTrampolineDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers);
}
void RunMicrotasksEntryDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {a0, a1};
data->InitializePlatformSpecific(arraysize(registers), registers);
}
} // namespace internal
} // namespace v8
......
......@@ -258,6 +258,12 @@ void FrameDropperTrampolineDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers);
}
void RunMicrotasksEntryDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {r3, r4};
data->InitializePlatformSpecific(arraysize(registers), registers);
}
} // namespace internal
} // namespace v8
......
......@@ -256,6 +256,12 @@ void FrameDropperTrampolineDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers);
}
void RunMicrotasksEntryDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {r2, r3};
data->InitializePlatformSpecific(arraysize(registers), registers);
}
} // namespace internal
} // namespace v8
......
......@@ -259,6 +259,12 @@ void FrameDropperTrampolineDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers);
}
void RunMicrotasksEntryDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {arg_reg_1, arg_reg_2};
data->InitializePlatformSpecific(arraysize(registers), registers);
}
} // namespace internal
} // namespace v8
......
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