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( ...@@ -257,6 +257,12 @@ void FrameDropperTrampolineDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void RunMicrotasksEntryDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {r0, r1};
data->InitializePlatformSpecific(arraysize(registers), registers);
}
} // namespace internal } // namespace internal
} // namespace v8 } // namespace v8
......
...@@ -261,6 +261,12 @@ void FrameDropperTrampolineDescriptor::InitializePlatformSpecific( ...@@ -261,6 +261,12 @@ void FrameDropperTrampolineDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void RunMicrotasksEntryDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {x0, x1};
data->InitializePlatformSpecific(arraysize(registers), registers);
}
} // namespace internal } // namespace internal
} // namespace v8 } // namespace v8
......
...@@ -92,7 +92,7 @@ namespace internal { ...@@ -92,7 +92,7 @@ namespace internal {
/* Apply and entries */ \ /* Apply and entries */ \
ASM(JSEntry, Dummy) \ ASM(JSEntry, Dummy) \
ASM(JSConstructEntry, Dummy) \ ASM(JSConstructEntry, Dummy) \
ASM(JSRunMicrotasksEntry, Dummy) \ ASM(JSRunMicrotasksEntry, RunMicrotasksEntry) \
ASM(JSEntryTrampoline, Dummy) \ ASM(JSEntryTrampoline, Dummy) \
ASM(JSConstructEntryTrampoline, Dummy) \ ASM(JSConstructEntryTrampoline, Dummy) \
ASM(ResumeGeneratorTrampoline, ResumeGenerator) \ ASM(ResumeGeneratorTrampoline, ResumeGenerator) \
...@@ -252,7 +252,7 @@ namespace internal { ...@@ -252,7 +252,7 @@ namespace internal {
\ \
/* Microtask helpers */ \ /* Microtask helpers */ \
TFS(EnqueueMicrotask, kMicrotask) \ TFS(EnqueueMicrotask, kMicrotask) \
ASM(RunMicrotasksTrampoline, Dummy) \ ASM(RunMicrotasksTrampoline, RunMicrotasksEntry) \
TFC(RunMicrotasks, RunMicrotasks, 1) \ TFC(RunMicrotasks, RunMicrotasks, 1) \
\ \
/* Object property helpers */ \ /* Object property helpers */ \
......
...@@ -257,6 +257,11 @@ void FrameDropperTrampolineDescriptor::InitializePlatformSpecific( ...@@ -257,6 +257,11 @@ void FrameDropperTrampolineDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void RunMicrotasksEntryDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
data->InitializePlatformSpecific(0, nullptr);
}
} // namespace internal } // namespace internal
} // namespace v8 } // namespace v8
......
...@@ -48,7 +48,7 @@ void CallInterfaceDescriptorData::InitializePlatformIndependent( ...@@ -48,7 +48,7 @@ void CallInterfaceDescriptorData::InitializePlatformIndependent(
for (int i = 0; i < types_length; i++) machine_types_[i] = machine_types[i]; for (int i = 0; i < types_length; i++) machine_types_[i] = machine_types[i];
} }
DCHECK(AllStackParametersAreTagged()); if (!(flags_ & kNoStackScan)) DCHECK(AllStackParametersAreTagged());
} }
#ifdef DEBUG #ifdef DEBUG
......
...@@ -64,6 +64,7 @@ namespace internal { ...@@ -64,6 +64,7 @@ namespace internal {
V(NoContext) \ V(NoContext) \
V(RecordWrite) \ V(RecordWrite) \
V(ResumeGenerator) \ V(ResumeGenerator) \
V(RunMicrotasksEntry) \
V(RunMicrotasks) \ V(RunMicrotasks) \
V(Store) \ V(Store) \
V(StoreGlobal) \ V(StoreGlobal) \
...@@ -88,6 +89,11 @@ class V8_EXPORT_PRIVATE CallInterfaceDescriptorData { ...@@ -88,6 +89,11 @@ class V8_EXPORT_PRIVATE CallInterfaceDescriptorData {
enum Flag { enum Flag {
kNoFlags = 0u, kNoFlags = 0u,
kNoContext = 1u << 0, 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; typedef base::Flags<Flag> Flags;
...@@ -403,6 +409,20 @@ STATIC_ASSERT(kMaxTFSBuiltinRegisterParams <= kMaxBuiltinRegisterParams); ...@@ -403,6 +409,20 @@ STATIC_ASSERT(kMaxTFSBuiltinRegisterParams <= kMaxBuiltinRegisterParams);
kParameterCount \ 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(...) DEFINE_RESULT_AND_PARAMETERS(1, ##__VA_ARGS__)
#define DEFINE_PARAMETERS_NO_CONTEXT(...) \ #define DEFINE_PARAMETERS_NO_CONTEXT(...) \
...@@ -1105,6 +1125,14 @@ class FrameDropperTrampolineDescriptor final : public CallInterfaceDescriptor { ...@@ -1105,6 +1125,14 @@ class FrameDropperTrampolineDescriptor final : public CallInterfaceDescriptor {
DECLARE_DESCRIPTOR(FrameDropperTrampolineDescriptor, 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 { class RunMicrotasksDescriptor final : public CallInterfaceDescriptor {
public: public:
DEFINE_PARAMETERS(kMicrotaskQueue) DEFINE_PARAMETERS(kMicrotaskQueue)
......
...@@ -285,6 +285,12 @@ void FrameDropperTrampolineDescriptor::InitializePlatformSpecific( ...@@ -285,6 +285,12 @@ void FrameDropperTrampolineDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void RunMicrotasksEntryDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {a0, a1};
data->InitializePlatformSpecific(arraysize(registers), registers);
}
} // namespace internal } // namespace internal
} // namespace v8 } // namespace v8
......
...@@ -285,6 +285,12 @@ void FrameDropperTrampolineDescriptor::InitializePlatformSpecific( ...@@ -285,6 +285,12 @@ void FrameDropperTrampolineDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void RunMicrotasksEntryDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {a0, a1};
data->InitializePlatformSpecific(arraysize(registers), registers);
}
} // namespace internal } // namespace internal
} // namespace v8 } // namespace v8
......
...@@ -258,6 +258,12 @@ void FrameDropperTrampolineDescriptor::InitializePlatformSpecific( ...@@ -258,6 +258,12 @@ void FrameDropperTrampolineDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void RunMicrotasksEntryDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {r3, r4};
data->InitializePlatformSpecific(arraysize(registers), registers);
}
} // namespace internal } // namespace internal
} // namespace v8 } // namespace v8
......
...@@ -256,6 +256,12 @@ void FrameDropperTrampolineDescriptor::InitializePlatformSpecific( ...@@ -256,6 +256,12 @@ void FrameDropperTrampolineDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers); data->InitializePlatformSpecific(arraysize(registers), registers);
} }
void RunMicrotasksEntryDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {r2, r3};
data->InitializePlatformSpecific(arraysize(registers), registers);
}
} // namespace internal } // namespace internal
} // namespace v8 } // namespace v8
......
...@@ -259,6 +259,12 @@ void FrameDropperTrampolineDescriptor::InitializePlatformSpecific( ...@@ -259,6 +259,12 @@ void FrameDropperTrampolineDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers); 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 internal
} // namespace v8 } // 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