@geastack/compiler 1.0.21 → 1.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/compiler.js +2 -1
- package/dist/conversion/build.d.ts +12 -0
- package/dist/conversion/build.js +15 -0
- package/dist/ir/borrow-effects.js +55 -1
- package/dist/ir/callable-class-flow.d.ts +3 -1
- package/dist/ir/callable-class-flow.js +27 -1
- package/dist/ir/certificate.js +87 -16
- package/dist/ir/certify/carrier-keys.js +3 -1
- package/dist/ir/dense-loops.d.ts +16 -2
- package/dist/ir/dense-loops.js +66 -21
- package/dist/ir/facts.d.ts +6 -29
- package/dist/ir/facts.js +46 -1
- package/dist/ir/floats.d.ts +46 -0
- package/dist/ir/floats.js +196 -0
- package/dist/ir/hoist.d.ts +11 -2
- package/dist/ir/hoist.js +17 -2
- package/dist/ir/integer-storage.js +8 -4
- package/dist/ir/integers.d.ts +14 -0
- package/dist/ir/integers.js +55 -1
- package/dist/ir/lower-invocation.js +7 -1
- package/dist/ir/numeric-intrinsics.d.ts +1 -1
- package/dist/ir/numeric-intrinsics.js +3 -2
- package/dist/ir/proven-branches.js +3 -1
- package/dist/ir/reflection-demand.js +10 -0
- package/dist/project-preparation.js +20 -0
- package/dist/semantics/class-alias.d.ts +16 -1
- package/dist/semantics/class-alias.js +21 -2
- package/dist/semantics/class-heritage.js +2 -2
- package/dist/semantics/frontend.js +35 -7
- package/dist/semantics/normalize/bivariant-slot-parameter.js +21 -6
- package/dist/semantics/normalize/commonjs-require.d.ts +9 -5
- package/dist/semantics/normalize/commonjs-require.js +127 -44
- package/dist/semantics/normalize/host-mutation-key-reader.js +35 -10
- package/dist/semantics/normalize/identities.js +15 -0
- package/dist/semantics/normalize/object-bag-bindings.js +16 -2
- package/dist/semantics/normalize/omitted-stated-parameter.d.ts +1 -1
- package/dist/semantics/normalize/omitted-stated-parameter.js +34 -4
- package/dist/semantics/normalize/parameter-bindings.js +33 -7
- package/dist/semantics/normalize/structural.js +17 -0
- package/dist/semantics/program.js +42 -20
- package/dist/semantics/shared-declaration-files.d.ts +44 -0
- package/dist/semantics/shared-declaration-files.js +42 -0
- package/dist/semantics/subclass-member-overlay-transform.js +95 -53
- package/dist/targets/cpp/emit-allocation.js +34 -1
- package/dist/targets/cpp/emit-arrays.d.ts +2 -1
- package/dist/targets/cpp/emit-arrays.js +7 -3
- package/dist/targets/cpp/emit-bindings.js +4 -2
- package/dist/targets/cpp/emit-callable.js +13 -0
- package/dist/targets/cpp/emit-carrier-members.d.ts +3 -1
- package/dist/targets/cpp/emit-carrier-members.js +18 -2
- package/dist/targets/cpp/emit-context.d.ts +13 -0
- package/dist/targets/cpp/emit-context.js +18 -2
- package/dist/targets/cpp/emit-properties.js +16 -3
- package/dist/targets/cpp/emit-union-properties.js +16 -3
- package/dist/targets/cpp/emit.js +36 -4
- package/dist/targets/cpp/host/emit-host-invoke.js +10 -1
- package/dist/targets/cpp/host/host-members.js +43 -30
- package/dist/targets/cpp/manifest/capabilities.js +10 -1
- package/dist/targets/cpp/records.js +8 -1
- package/dist/targets/cpp/types.d.ts +2 -0
- package/dist/targets/cpp/types.js +2 -0
- package/package.json +13 -13
- package/src/targets/cpp/runtime/gea_runtime.h +146 -18
|
@@ -327,4 +327,6 @@ export declare const cppTypeOf: (representation: Representation, ownership?: Own
|
|
|
327
327
|
* unnarrowed form agree everywhere the census says they do.
|
|
328
328
|
*/
|
|
329
329
|
export declare const cppNarrowedIntegerType = "long long";
|
|
330
|
+
/** The storage `ir/floats.ts` admits a float32-valued Number into. */
|
|
331
|
+
export declare const cppNarrowedFloatType = "float";
|
|
330
332
|
export declare const cppBoxedType: (representation: Representation) => string;
|
|
@@ -1338,4 +1338,6 @@ export const cppTypeOf = (representation, ownership = null) => {
|
|
|
1338
1338
|
* unnarrowed form agree everywhere the census says they do.
|
|
1339
1339
|
*/
|
|
1340
1340
|
export const cppNarrowedIntegerType = 'long long';
|
|
1341
|
+
/** The storage `ir/floats.ts` admits a float32-valued Number into. */
|
|
1342
|
+
export const cppNarrowedFloatType = 'float';
|
|
1341
1343
|
export const cppBoxedType = (representation) => `gea::Ref<${cppTypeOf(representation)}>`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geastack/compiler",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.23",
|
|
4
4
|
"description": "The geastack TypeScript-to-C++ compiler: one semantic spine, no source-shaped authority, no boxing of statically typed values.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"test:node-project": "node test/node-project.mjs"
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
|
-
"@geastack/node-compat": "^1.0.
|
|
74
|
+
"@geastack/node-compat": "^1.0.16",
|
|
75
75
|
"typescript": "^5.9.3"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
@@ -79,20 +79,20 @@
|
|
|
79
79
|
"fastify": "^5.0.0",
|
|
80
80
|
"find-my-way": "9.6.0",
|
|
81
81
|
"prettier": "^3.8.3",
|
|
82
|
-
"@geastack/core": "0.1.
|
|
83
|
-
"@geastack/host": "0.1.
|
|
84
|
-
"@geastack/engine": "0.1.
|
|
85
|
-
"@geastack/elements": "0.1.
|
|
82
|
+
"@geastack/core": "0.1.37",
|
|
83
|
+
"@geastack/host": "0.1.14",
|
|
84
|
+
"@geastack/engine": "0.1.13",
|
|
85
|
+
"@geastack/elements": "0.1.5",
|
|
86
86
|
"@geastack/geaos": "0.1.3",
|
|
87
|
-
"@geastack/apple": "0.2.
|
|
88
|
-
"@geastack/geatsc-plugin-gea": "0.1.
|
|
89
|
-
"@geastack/geatsc-plugin-apple-native": "0.1.
|
|
90
|
-
"@geastack/native-webgl-angle": "0.1.
|
|
87
|
+
"@geastack/apple": "0.2.14",
|
|
88
|
+
"@geastack/geatsc-plugin-gea": "0.1.19",
|
|
89
|
+
"@geastack/geatsc-plugin-apple-native": "0.1.4",
|
|
90
|
+
"@geastack/native-webgl-angle": "0.1.9"
|
|
91
91
|
},
|
|
92
92
|
"peerDependencies": {
|
|
93
|
-
"@geastack/apple": ">=0.2.
|
|
94
|
-
"@geastack/geatsc-plugin-apple-native": ">=0.1.
|
|
95
|
-
"@geastack/geatsc-plugin-gea": ">=0.1.
|
|
93
|
+
"@geastack/apple": ">=0.2.14",
|
|
94
|
+
"@geastack/geatsc-plugin-apple-native": ">=0.1.4",
|
|
95
|
+
"@geastack/geatsc-plugin-gea": ">=0.1.19"
|
|
96
96
|
},
|
|
97
97
|
"peerDependenciesMeta": {
|
|
98
98
|
"@geastack/apple": {
|
|
@@ -98,6 +98,30 @@
|
|
|
98
98
|
|
|
99
99
|
namespace gea {
|
|
100
100
|
|
|
101
|
+
/** A single-precision product the compiler may not fuse into a following add.
|
|
102
|
+
* `Math.fround(a * b) + c` is two roundings in ECMA-262; GCC's default
|
|
103
|
+
* `-ffp-contract=fast` turns the pair into one `fmadd.s`, a single rounding, so
|
|
104
|
+
* a float32 product (`ir/floats.ts`) passes through an empty asm that pins it
|
|
105
|
+
* in an FP register. That blocks the contraction for this value alone, where
|
|
106
|
+
* a translation-unit `-ffp-contract=off` would also take FMA away from every
|
|
107
|
+
* hand-written DSP loop in the engine. Clang's default contracts only within
|
|
108
|
+
* one expression, which an emitted statement-per-operation never offers. */
|
|
109
|
+
[[gnu::always_inline]] inline float float32Product(float value) {
|
|
110
|
+
// GEA_FLOAT32_ALLOW_CONTRACTION lets GCC fuse again, for measuring what the
|
|
111
|
+
// second rounding costs; results then differ from Node in the last bit.
|
|
112
|
+
#if defined(GEA_FLOAT32_ALLOW_CONTRACTION)
|
|
113
|
+
#elif (defined(__riscv) && defined(__riscv_flen)) || (defined(__xtensa__) && !defined(__XTENSA_SOFT_FLOAT__))
|
|
114
|
+
__asm__("" : "+f"(value));
|
|
115
|
+
#elif defined(__aarch64__)
|
|
116
|
+
__asm__("" : "+w"(value));
|
|
117
|
+
#elif defined(__arm__) && defined(__ARM_FP)
|
|
118
|
+
__asm__("" : "+t"(value));
|
|
119
|
+
#elif (defined(__x86_64__) || defined(__i386__)) && defined(__SSE__)
|
|
120
|
+
__asm__("" : "+x"(value));
|
|
121
|
+
#endif
|
|
122
|
+
return value;
|
|
123
|
+
}
|
|
124
|
+
|
|
101
125
|
namespace detail {
|
|
102
126
|
|
|
103
127
|
inline void collectReferenceCycles(bool full);
|
|
@@ -246,8 +270,19 @@ T& realmSlot() { return realmSlot<Tag, T, Lifetime>([] { return new T{}; }); }
|
|
|
246
270
|
*
|
|
247
271
|
* A null argument flushes every open output stream, not just `stdout`.
|
|
248
272
|
*/
|
|
249
|
-
|
|
273
|
+
inline void flushAllOutput() {
|
|
274
|
+
#if defined(__PICOLIBC__)
|
|
275
|
+
// picolibc (the ESP32-S31's libc) declares fflush's argument nonnull and has
|
|
276
|
+
// no flush-everything form; the console streams are what a death must keep.
|
|
277
|
+
std::fflush(stdout);
|
|
278
|
+
std::fflush(stderr);
|
|
279
|
+
#else
|
|
250
280
|
std::fflush(nullptr);
|
|
281
|
+
#endif
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
[[noreturn]] inline void abortAfterFlush() {
|
|
285
|
+
flushAllOutput();
|
|
251
286
|
std::abort();
|
|
252
287
|
}
|
|
253
288
|
|
|
@@ -259,7 +294,7 @@ T& realmSlot() { return realmSlot<Tag, T, Lifetime>([] { return new T{}; }); }
|
|
|
259
294
|
inline std::terminate_handler previousTerminateHandler = nullptr;
|
|
260
295
|
|
|
261
296
|
inline void flushThenTerminate() {
|
|
262
|
-
|
|
297
|
+
flushAllOutput();
|
|
263
298
|
if (previousTerminateHandler != nullptr) previousTerminateHandler();
|
|
264
299
|
std::abort();
|
|
265
300
|
}
|
|
@@ -7880,6 +7915,26 @@ inline ClampedUint8 typedArrayElement<ClampedUint8>(double value) {
|
|
|
7880
7915
|
if (value > floorValue + 0.5) return ClampedUint8{static_cast<std::uint8_t>(floorValue + 1.0)};
|
|
7881
7916
|
return ClampedUint8{static_cast<std::uint8_t>(std::fmod(floorValue, 2.0) == 0.0 ? floorValue : floorValue + 1.0)};
|
|
7882
7917
|
}
|
|
7918
|
+
|
|
7919
|
+
/**
|
|
7920
|
+
* `typedArrayElement` for a value the integer census already holds as an
|
|
7921
|
+
* integer. ToIntN/ToUintN of an integer is its low N bits, which is what an
|
|
7922
|
+
* unsigned conversion keeps; a float element is the integer rounded once,
|
|
7923
|
+
* exactly as converting its (exact) double would round it; a clamped byte
|
|
7924
|
+
* clamps, and an integer has no half to round. All in integer registers: the
|
|
7925
|
+
* `double` route costs a software modulo per element on a core with no double
|
|
7926
|
+
* FPU -- an RGB565 palette store paid four of them per pixel.
|
|
7927
|
+
*/
|
|
7928
|
+
template <typename T>
|
|
7929
|
+
[[gnu::always_inline]] inline T typedArrayIntegerElement(long long value) {
|
|
7930
|
+
if constexpr (std::is_same_v<T, ClampedUint8>) {
|
|
7931
|
+
return ClampedUint8{static_cast<std::uint8_t>(value <= 0 ? 0 : value >= 255 ? 255 : value)};
|
|
7932
|
+
} else if constexpr (std::is_integral_v<T>) {
|
|
7933
|
+
return static_cast<T>(static_cast<std::make_unsigned_t<T>>(static_cast<unsigned long long>(value)));
|
|
7934
|
+
} else {
|
|
7935
|
+
return static_cast<T>(value);
|
|
7936
|
+
}
|
|
7937
|
+
}
|
|
7883
7938
|
} // namespace detail
|
|
7884
7939
|
|
|
7885
7940
|
/**
|
|
@@ -8165,6 +8220,16 @@ class TypedArray {
|
|
|
8165
8220
|
const T converted = detail::typedArrayElement<T>(value);
|
|
8166
8221
|
std::memcpy(reinterpret_cast<std::uint8_t*>(base) + index * sizeof(T), &converted, sizeof(T));
|
|
8167
8222
|
}
|
|
8223
|
+
/** `writeInBounds` for a value the integer census holds as an integer (`detail::typedArrayIntegerElement`). */
|
|
8224
|
+
[[gnu::always_inline]] static void writeIntegerInBounds(T* base, std::size_t index, long long value) {
|
|
8225
|
+
const T converted = detail::typedArrayIntegerElement<T>(value);
|
|
8226
|
+
std::memcpy(reinterpret_cast<std::uint8_t*>(base) + index * sizeof(T), &converted, sizeof(T));
|
|
8227
|
+
}
|
|
8228
|
+
/** An integer element as the integer it is, for a result the integer census holds in a `long long`. */
|
|
8229
|
+
[[gnu::always_inline]] static long long readIntegerInBounds(const T* base, std::size_t index) {
|
|
8230
|
+
if constexpr (std::is_same_v<T, ClampedUint8>) return readInBounds(base, index).bits;
|
|
8231
|
+
else return static_cast<long long>(readInBounds(base, index));
|
|
8232
|
+
}
|
|
8168
8233
|
T operator[](std::size_t index) const { return readUnchecked(index); }
|
|
8169
8234
|
T operator[](std::size_t index) { return readUnchecked(index); }
|
|
8170
8235
|
operator std::vector<T>() const {
|
|
@@ -8187,6 +8252,14 @@ class TypedArray {
|
|
|
8187
8252
|
* byte of every message through this.
|
|
8188
8253
|
*/
|
|
8189
8254
|
[[gnu::always_inline]] double elementAtIndex(long long key) const { return static_cast<double>(readUnchecked(requireIndexAt(key))); }
|
|
8255
|
+
/** `elementAtIndex` of an integer view, read into the integer a narrowed result is: no round trip through `double`. */
|
|
8256
|
+
[[gnu::always_inline]] long long elementIntegerAtIndex(long long key) const
|
|
8257
|
+
requires(std::is_integral_v<T> || std::is_same_v<T, ClampedUint8>)
|
|
8258
|
+
{
|
|
8259
|
+
const T value = readUnchecked(requireIndexAt(key));
|
|
8260
|
+
if constexpr (std::is_same_v<T, ClampedUint8>) return value.bits;
|
|
8261
|
+
else return static_cast<long long>(value);
|
|
8262
|
+
}
|
|
8190
8263
|
/**
|
|
8191
8264
|
* A key straight from `charCodeAt` -- a `gea::runtime::string::CodeUnit`, a
|
|
8192
8265
|
* code unit or the out-of-range NaN carried as the sentinel 65536. Every
|
|
@@ -8209,6 +8282,11 @@ class TypedArray {
|
|
|
8209
8282
|
if (static_cast<unsigned long long>(key) >= size()) return;
|
|
8210
8283
|
writeUnchecked(static_cast<std::size_t>(key), detail::typedArrayElement<T>(value));
|
|
8211
8284
|
}
|
|
8285
|
+
/** `setElementAtIndex` for an integer value (`detail::typedArrayIntegerElement`). */
|
|
8286
|
+
[[gnu::always_inline]] void setElementIntegerAtIndex(long long key, long long value) {
|
|
8287
|
+
if (static_cast<unsigned long long>(key) >= size()) return;
|
|
8288
|
+
writeUnchecked(static_cast<std::size_t>(key), detail::typedArrayIntegerElement<T>(value));
|
|
8289
|
+
}
|
|
8212
8290
|
|
|
8213
8291
|
/**
|
|
8214
8292
|
* Whether an indexed read would answer an element -- `requireIndex`'s abort
|
|
@@ -8470,17 +8548,26 @@ class TypedArray {
|
|
|
8470
8548
|
// Shared accesses take the one mutex owned by their backing block. The raw
|
|
8471
8549
|
// helpers remain the non-shared fast path and the implementation used while
|
|
8472
8550
|
// an atomic operation already owns that mutex.
|
|
8473
|
-
|
|
8474
|
-
|
|
8551
|
+
// Inline for the ordinary view, the shared view's lock out of line: with
|
|
8552
|
+
// the lock inside, `-Os` kept the whole function a call, and every element
|
|
8553
|
+
// read a loop could not window paid one.
|
|
8554
|
+
[[gnu::always_inline]] T readUnchecked(std::size_t index) const {
|
|
8555
|
+
if (!sharedBuffer_) [[likely]] return readInBounds(data(), index);
|
|
8556
|
+
return readSharedUnchecked(index);
|
|
8557
|
+
}
|
|
8558
|
+
[[gnu::noinline]] T readSharedUnchecked(std::size_t index) const {
|
|
8475
8559
|
std::lock_guard lock(sharedBuffer_->memoryMutex());
|
|
8476
8560
|
return readInBounds(data(), index);
|
|
8477
8561
|
}
|
|
8478
|
-
void writeUnchecked(std::size_t index, T value) {
|
|
8562
|
+
[[gnu::always_inline]] void writeUnchecked(std::size_t index, T value) {
|
|
8479
8563
|
bytes_->requireAttached();
|
|
8480
|
-
if (!sharedBuffer_) {
|
|
8564
|
+
if (!sharedBuffer_) [[likely]] {
|
|
8481
8565
|
std::memcpy(base_ + index * sizeof(T), &value, sizeof(T));
|
|
8482
8566
|
return;
|
|
8483
8567
|
}
|
|
8568
|
+
writeSharedUnchecked(index, value);
|
|
8569
|
+
}
|
|
8570
|
+
[[gnu::noinline]] void writeSharedUnchecked(std::size_t index, T value) {
|
|
8484
8571
|
std::lock_guard lock(sharedBuffer_->memoryMutex());
|
|
8485
8572
|
std::memcpy(base_ + index * sizeof(T), &value, sizeof(T));
|
|
8486
8573
|
}
|
|
@@ -19768,6 +19855,13 @@ template <typename Element>
|
|
|
19768
19855
|
struct DynamicRestArgument<gea::Ref<gea::ArrayObject<Element>>> {
|
|
19769
19856
|
static constexpr bool supported = DynamicCallableCarrier<Element>::supported;
|
|
19770
19857
|
|
|
19858
|
+
/** 10.2.11: the rest parameter is an Array of every argument from `from` on. */
|
|
19859
|
+
static gea::Ref<gea::ArrayObject<Element>> pack(const Value* arguments, std::size_t count, std::size_t from) {
|
|
19860
|
+
gea::Ref<gea::ArrayObject<Element>> rest = gea::makeRef<gea::ArrayObject<Element>>();
|
|
19861
|
+
for (std::size_t at = from; at < count; at += 1) rest->push(DynamicCallableCarrier<Element>::in(arguments[at], at));
|
|
19862
|
+
return rest;
|
|
19863
|
+
}
|
|
19864
|
+
|
|
19771
19865
|
static void append(std::vector<Value>& destination, const gea::Ref<gea::ArrayObject<Element>>& rest) {
|
|
19772
19866
|
if (!rest) refusePayloadMismatch("a dynamic call adapter's rest argument");
|
|
19773
19867
|
for (std::size_t index = 0; index < rest->size(); index += 1) {
|
|
@@ -19782,6 +19876,48 @@ struct DynamicRestArgument<gea::Ref<gea::ArrayObject<Element>>> {
|
|
|
19782
19876
|
}
|
|
19783
19877
|
};
|
|
19784
19878
|
|
|
19879
|
+
/**
|
|
19880
|
+
* A rest slot carried as a fixed tuple record rather than an Array: a function
|
|
19881
|
+
* that forwards `arguments` (three.js's `WebGLState` wraps every GL call as
|
|
19882
|
+
* `function compressedTexImage2D() { gl.compressedTexImage2D( ...arguments ) }`)
|
|
19883
|
+
* lowers its argument list to a record whose own keys are the canonical
|
|
19884
|
+
* indexes "0".."n". Its own-field table is the whole protocol needed: the
|
|
19885
|
+
* present index keys in order are the argument list, and each incoming
|
|
19886
|
+
* argument is written to its index. A slot the caller did not supply is
|
|
19887
|
+
* deleted, so it is absent as an unsupplied argument is.
|
|
19888
|
+
*/
|
|
19889
|
+
template <typename T>
|
|
19890
|
+
requires(NativeFieldTable<T> && NativeOwnFieldDeletion<T>)
|
|
19891
|
+
struct DynamicRestArgument<gea::Ref<T>> {
|
|
19892
|
+
static constexpr bool supported = true;
|
|
19893
|
+
|
|
19894
|
+
static void append(std::vector<Value>& destination, const gea::Ref<T>& rest) {
|
|
19895
|
+
if (!rest) refusePayloadMismatch("a dynamic call adapter's rest argument");
|
|
19896
|
+
std::vector<PropertyKey> keys;
|
|
19897
|
+
rest->gea_ownFieldKeys(keys);
|
|
19898
|
+
for (const PropertyKey& key : keys) {
|
|
19899
|
+
Value slot;
|
|
19900
|
+
if (!rest->gea_readOwnField(key, slot)) refusePayloadMismatch("a dynamic call adapter's rest argument slot");
|
|
19901
|
+
destination.push_back(std::move(slot));
|
|
19902
|
+
}
|
|
19903
|
+
}
|
|
19904
|
+
|
|
19905
|
+
static gea::Ref<T> pack(const Value* arguments, std::size_t count, std::size_t from) {
|
|
19906
|
+
gea::Ref<T> rest = gea::makeRef<T>();
|
|
19907
|
+
std::vector<PropertyKey> keys;
|
|
19908
|
+
rest->gea_ownFieldKeys(keys);
|
|
19909
|
+
for (std::size_t index = 0; index < keys.size(); index += 1) {
|
|
19910
|
+
if (from + index < count) {
|
|
19911
|
+
if (!rest->gea_writeOwnField(keys[index], arguments[from + index], true))
|
|
19912
|
+
refusePayloadMismatch("a dynamic call adapter's rest argument slot");
|
|
19913
|
+
} else {
|
|
19914
|
+
rest->gea_deleteOwnField(keys[index]);
|
|
19915
|
+
}
|
|
19916
|
+
}
|
|
19917
|
+
return rest;
|
|
19918
|
+
}
|
|
19919
|
+
};
|
|
19920
|
+
|
|
19785
19921
|
/**
|
|
19786
19922
|
* A function value crossing the boundary in the READ direction, and the one
|
|
19787
19923
|
* carrier for which an exact payload match is not the general case.
|
|
@@ -21122,9 +21258,7 @@ struct DynamicRestCallSignature<CallableObject<Result(Arguments...)>, RestFrom>
|
|
|
21122
21258
|
using Args = std::tuple<Arguments...>;
|
|
21123
21259
|
static constexpr bool shaped = sizeof...(Arguments) > 0 && RestFrom + 1 == sizeof...(Arguments);
|
|
21124
21260
|
using RestParam = typename RestSlotOf<shaped, Args>::type;
|
|
21125
|
-
|
|
21126
|
-
static constexpr bool supported = shaped && RestElementOf<RestParam>::ok &&
|
|
21127
|
-
DynamicCallableCarrier<Element>::supported &&
|
|
21261
|
+
static constexpr bool supported = shaped && DynamicRestArgument<RestParam>::supported &&
|
|
21128
21262
|
(std::is_void_v<Result> || DynamicCallableCarrier<Result>::supported) &&
|
|
21129
21263
|
(DynamicCallableCarrier<Arguments>::supported && ...);
|
|
21130
21264
|
|
|
@@ -21137,9 +21271,7 @@ struct DynamicRestCallSignature<CallableObject<Result(Arguments...)>, RestFrom>
|
|
|
21137
21271
|
template <std::size_t... Fixed>
|
|
21138
21272
|
static Value invoke(const CallableObject<Result(Arguments...)>& callable, const Value* arguments, std::size_t count,
|
|
21139
21273
|
std::index_sequence<Fixed...>) {
|
|
21140
|
-
|
|
21141
|
-
for (std::size_t at = RestFrom; at < count; at += 1)
|
|
21142
|
-
rest->push(DynamicCallableCarrier<Element>::in(arguments[at], at));
|
|
21274
|
+
RestParam rest = DynamicRestArgument<RestParam>::pack(arguments, count, RestFrom);
|
|
21143
21275
|
if constexpr (std::is_void_v<Result>) {
|
|
21144
21276
|
callable.call(
|
|
21145
21277
|
DynamicCallableCarrier<std::tuple_element_t<Fixed, Args>>::in(dynamicCallArgument(arguments, count, Fixed), Fixed)...,
|
|
@@ -21174,9 +21306,7 @@ struct DynamicRestCallSignature<CallableConstructorObject<Result(Arguments...),
|
|
|
21174
21306
|
using Args = std::tuple<Arguments...>;
|
|
21175
21307
|
static constexpr bool shaped = sizeof...(Arguments) > 0 && RestFrom + 1 == sizeof...(Arguments);
|
|
21176
21308
|
using RestParam = typename RestSlotOf<shaped, Args>::type;
|
|
21177
|
-
|
|
21178
|
-
static constexpr bool supported = shaped && RestElementOf<RestParam>::ok &&
|
|
21179
|
-
DynamicCallableCarrier<Element>::supported &&
|
|
21309
|
+
static constexpr bool supported = shaped && DynamicRestArgument<RestParam>::supported &&
|
|
21180
21310
|
(std::is_void_v<Result> || DynamicCallableCarrier<Result>::supported) &&
|
|
21181
21311
|
(DynamicCallableCarrier<Arguments>::supported && ...);
|
|
21182
21312
|
|
|
@@ -21187,9 +21317,7 @@ struct DynamicRestCallSignature<CallableConstructorObject<Result(Arguments...),
|
|
|
21187
21317
|
private:
|
|
21188
21318
|
template <std::size_t... Fixed>
|
|
21189
21319
|
static Value invoke(const Callable& callable, const Value* arguments, std::size_t count, std::index_sequence<Fixed...>) {
|
|
21190
|
-
|
|
21191
|
-
for (std::size_t at = RestFrom; at < count; at += 1)
|
|
21192
|
-
rest->push(DynamicCallableCarrier<Element>::in(arguments[at], at));
|
|
21320
|
+
RestParam rest = DynamicRestArgument<RestParam>::pack(arguments, count, RestFrom);
|
|
21193
21321
|
if constexpr (std::is_void_v<Result>) {
|
|
21194
21322
|
callable.call(
|
|
21195
21323
|
DynamicCallableCarrier<std::tuple_element_t<Fixed, Args>>::in(dynamicCallArgument(arguments, count, Fixed), Fixed)...,
|