Skip to content

Commit 3cb3a6f

Browse files
committed
Proof of Concept: Multiplexing Temporal getters to pare down code size
1 parent 0398669 commit 3cb3a6f

File tree

8 files changed

+581
-581
lines changed

8 files changed

+581
-581
lines changed

Diff for: src/builtins/builtins-definitions.h

+6-186
Large diffs are not rendered by default.

Diff for: src/builtins/builtins-temporal.cc

+287-230
Large diffs are not rendered by default.

Diff for: src/init/bootstrapper.cc

+233-126
Large diffs are not rendered by default.

Diff for: src/init/heap-symbols.h

+2
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,8 @@
519519
V(_, strict_function_transition_symbol) \
520520
V(_, template_literal_function_literal_id_symbol) \
521521
V(_, template_literal_slot_id_symbol) \
522+
V(_, temporal_ctor_id_symbol) \
523+
V(_, temporal_calendar_prop_symbol) \
522524
V(_, wasm_exception_tag_symbol) \
523525
V(_, wasm_exception_values_symbol) \
524526
V(_, wasm_uncatchable_symbol) \

Diff for: src/objects/js-function.h

-2
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,6 @@ class JSFunction : public TorqueGeneratedJSFunction<
343343
DECL_PRINTER(JSFunction)
344344
DECL_VERIFIER(JSFunction)
345345

346-
static Handle<String> GetName(Handle<JSFunction> function);
347-
348346
// ES6 section 9.2.11 SetFunctionName
349347
// Because of the way this abstract operation is used in the spec,
350348
// it should never fail, but in practice it will fail if the generated

Diff for: src/objects/js-temporal-objects.h

+12
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@
1515
namespace v8 {
1616
namespace internal {
1717

18+
enum TemporalConstructorType {
19+
kDuration,
20+
kInstant,
21+
kPlainDate,
22+
kPlainDateTime,
23+
kPlainMonthDay,
24+
kPlainTime,
25+
kPlainYearMonth,
26+
kZonedDateTime,
27+
kNumTemporalConstructors,
28+
};
29+
1830
#include "torque-generated/src/objects/js-temporal-objects-tq.inc"
1931

2032
#define DECLARE_TEMPORAL_INLINE_GETTER_SETTER(field) \

Diff for: src/roots/static-roots.h

+40-36
Original file line numberDiff line numberDiff line change
@@ -749,48 +749,50 @@ struct StaticReadOnlyRoot {
749749
static constexpr Tagged_t ktemplate_literal_function_literal_id_symbol =
750750
0x5e35;
751751
static constexpr Tagged_t ktemplate_literal_slot_id_symbol = 0x5e45;
752-
static constexpr Tagged_t kwasm_exception_tag_symbol = 0x5e55;
753-
static constexpr Tagged_t kwasm_exception_values_symbol = 0x5e65;
754-
static constexpr Tagged_t kwasm_uncatchable_symbol = 0x5e75;
755-
static constexpr Tagged_t kwasm_wrapped_object_symbol = 0x5e85;
756-
static constexpr Tagged_t kwasm_debug_proxy_cache_symbol = 0x5e95;
757-
static constexpr Tagged_t kwasm_debug_proxy_names_symbol = 0x5ea5;
758-
static constexpr Tagged_t kasync_iterator_symbol = 0x5eb5;
759-
static constexpr Tagged_t kintl_fallback_symbol = 0x5ee5;
760-
static constexpr Tagged_t kmatch_symbol = 0x5f1d;
761-
static constexpr Tagged_t ksearch_symbol = 0x5f45;
762-
static constexpr Tagged_t kto_primitive_symbol = 0x5f71;
763-
static constexpr Tagged_t kunscopables_symbol = 0x5fa1;
764-
static constexpr Tagged_t khas_instance_symbol = 0x5fd1;
765-
static constexpr Tagged_t kto_string_tag_symbol = 0x6001;
766-
static constexpr Tagged_t kconstructor_string = 0x6059;
767-
static constexpr Tagged_t knext_string = 0x6071;
768-
static constexpr Tagged_t kresolve_string = 0x6081;
769-
static constexpr Tagged_t kthen_string = 0x6095;
770-
static constexpr Tagged_t kiterator_symbol = 0x60a5;
771-
static constexpr Tagged_t kmatch_all_symbol = 0x60b5;
772-
static constexpr Tagged_t kreplace_symbol = 0x60c5;
773-
static constexpr Tagged_t kspecies_symbol = 0x60d5;
774-
static constexpr Tagged_t ksplit_symbol = 0x60e5;
775-
static constexpr Tagged_t kis_concat_spreadable_symbol = 0x60f5;
776-
static constexpr Tagged_t kEmptySlowElementDictionary = 0x6105;
777-
static constexpr Tagged_t kEmptySymbolTable = 0x6129;
778-
static constexpr Tagged_t kEmptyOrderedHashMap = 0x6145;
779-
static constexpr Tagged_t kEmptyOrderedHashSet = 0x6159;
780-
static constexpr Tagged_t kEmptyFeedbackMetadata = 0x616d;
781-
static constexpr Tagged_t kGlobalThisBindingScopeInfo = 0x6179;
782-
static constexpr Tagged_t kEmptyFunctionScopeInfo = 0x6199;
783-
static constexpr Tagged_t kNativeScopeInfo = 0x61bd;
784-
static constexpr Tagged_t kShadowRealmScopeInfo = 0x61d5;
785-
static constexpr Tagged_t kEmptyExternalPointerArray = 0x61ed;
786-
static constexpr Tagged_t kWasmNullPadding = 0x61f5;
752+
static constexpr Tagged_t ktemporal_ctor_id_symbol = 0x5e55;
753+
static constexpr Tagged_t ktemporal_calendar_prop_symbol = 0x5e65;
754+
static constexpr Tagged_t kwasm_exception_tag_symbol = 0x5e75;
755+
static constexpr Tagged_t kwasm_exception_values_symbol = 0x5e85;
756+
static constexpr Tagged_t kwasm_uncatchable_symbol = 0x5e95;
757+
static constexpr Tagged_t kwasm_wrapped_object_symbol = 0x5ea5;
758+
static constexpr Tagged_t kwasm_debug_proxy_cache_symbol = 0x5eb5;
759+
static constexpr Tagged_t kwasm_debug_proxy_names_symbol = 0x5ec5;
760+
static constexpr Tagged_t kasync_iterator_symbol = 0x5ed5;
761+
static constexpr Tagged_t kintl_fallback_symbol = 0x5f05;
762+
static constexpr Tagged_t kmatch_symbol = 0x5f3d;
763+
static constexpr Tagged_t ksearch_symbol = 0x5f65;
764+
static constexpr Tagged_t kto_primitive_symbol = 0x5f91;
765+
static constexpr Tagged_t kunscopables_symbol = 0x5fc1;
766+
static constexpr Tagged_t khas_instance_symbol = 0x5ff1;
767+
static constexpr Tagged_t kto_string_tag_symbol = 0x6021;
768+
static constexpr Tagged_t kconstructor_string = 0x6079;
769+
static constexpr Tagged_t knext_string = 0x6091;
770+
static constexpr Tagged_t kresolve_string = 0x60a1;
771+
static constexpr Tagged_t kthen_string = 0x60b5;
772+
static constexpr Tagged_t kiterator_symbol = 0x60c5;
773+
static constexpr Tagged_t kmatch_all_symbol = 0x60d5;
774+
static constexpr Tagged_t kreplace_symbol = 0x60e5;
775+
static constexpr Tagged_t kspecies_symbol = 0x60f5;
776+
static constexpr Tagged_t ksplit_symbol = 0x6105;
777+
static constexpr Tagged_t kis_concat_spreadable_symbol = 0x6115;
778+
static constexpr Tagged_t kEmptySlowElementDictionary = 0x6125;
779+
static constexpr Tagged_t kEmptySymbolTable = 0x6149;
780+
static constexpr Tagged_t kEmptyOrderedHashMap = 0x6165;
781+
static constexpr Tagged_t kEmptyOrderedHashSet = 0x6179;
782+
static constexpr Tagged_t kEmptyFeedbackMetadata = 0x618d;
783+
static constexpr Tagged_t kGlobalThisBindingScopeInfo = 0x6199;
784+
static constexpr Tagged_t kEmptyFunctionScopeInfo = 0x61b9;
785+
static constexpr Tagged_t kNativeScopeInfo = 0x61dd;
786+
static constexpr Tagged_t kShadowRealmScopeInfo = 0x61f5;
787+
static constexpr Tagged_t kEmptyExternalPointerArray = 0x620d;
788+
static constexpr Tagged_t kWasmNullPadding = 0x6215;
787789
static constexpr Tagged_t kWasmNull = 0xfffd;
788790
static constexpr Tagged_t kJSSharedArrayMap = 0x20001;
789791
static constexpr Tagged_t kJSAtomicsMutexMap = 0x20045;
790792
static constexpr Tagged_t kJSAtomicsConditionMap = 0x2006d;
791793
};
792794

793-
static constexpr std::array<Tagged_t, 759> StaticReadOnlyRootsPointerTable = {
795+
static constexpr std::array<Tagged_t, 761> StaticReadOnlyRootsPointerTable = {
794796
StaticReadOnlyRoot::kFreeSpaceMap,
795797
StaticReadOnlyRoot::kOnePointerFillerMap,
796798
StaticReadOnlyRoot::kTwoPointerFillerMap,
@@ -1444,6 +1446,8 @@ static constexpr std::array<Tagged_t, 759> StaticReadOnlyRootsPointerTable = {
14441446
StaticReadOnlyRoot::kstrict_function_transition_symbol,
14451447
StaticReadOnlyRoot::ktemplate_literal_function_literal_id_symbol,
14461448
StaticReadOnlyRoot::ktemplate_literal_slot_id_symbol,
1449+
StaticReadOnlyRoot::ktemporal_ctor_id_symbol,
1450+
StaticReadOnlyRoot::ktemporal_calendar_prop_symbol,
14471451
StaticReadOnlyRoot::kwasm_exception_tag_symbol,
14481452
StaticReadOnlyRoot::kwasm_exception_values_symbol,
14491453
StaticReadOnlyRoot::kwasm_uncatchable_symbol,

Diff for: tools/dev/gen-static-roots.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def machine_target():
9191
with (build_dir / "args.gn").open("w") as f:
9292
for line in gn_args:
9393
result = re.search(r"^([^ ]+) = (.+)$", line)
94-
if len(result.groups()) != 2:
94+
if result is None or len(result.groups()) != 2:
9595
print(f"Error parsing {build_dir / 'args.gn'} at line '{line}'")
9696
exit(255)
9797
if result.group(1) in gn_args_template:

0 commit comments

Comments
 (0)