Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
72f03f1
WIP: inline small strings (runtime + LLInt + baseline JIT correct)
robobun Jul 17, 2026
c4e77a0
DFG/FTL: guard rope-layout reads against inline small strings
robobun Jul 17, 2026
62b2e01
JIT: handle inline small strings on rope-taken branches (DFG/FTL)
robobun Jul 17, 2026
f3e6686
DFG: don't constant-fold ResolveRope through inline small strings
robobun Jul 17, 2026
a399cf3
JSStringInlines: handle inline small-string fibers in resolveToBuffer
robobun Jul 17, 2026
6f1b2e9
LLInt/runtime: handle inline small-string fibers in op_switch_char an…
robobun Jul 17, 2026
a997dc9
Phase 2: JIT fast paths for inline small strings
robobun Jul 18, 2026
833791a
FTL stringsEqual: inline-vs-inline m_fiber compare
robobun Jul 18, 2026
15e3fea
Add SpecStringInline speculation and literal-vs-inline equality fast …
robobun Jul 18, 2026
aa6d292
FTL: isLikelyInlineString helper + speculative inline length path
robobun Jul 18, 2026
bd1019b
Speculative inline charCodeAt (DFG+FTL) and short-concat inlining
robobun Jul 19, 2026
a35b4e6
JSString::view(): materialize inline strings before returning a Strin…
robobun Jul 19, 2026
73681b5
Use 3-bit inlineLengthMask (0x7) instead of 0x1f
robobun Jul 19, 2026
f4db178
view() returns in-cell StringView again; fix JSStringJoiner instead
robobun Jul 19, 2026
7efd396
DFG/FTL MakeRope: route short all-8-bit concats to the inline creator
robobun Jul 19, 2026
8e8f58a
JSBigInlineString: 24-byte inline cell for 8..15 Latin-1 / 4..7 UTF-1…
robobun Jul 19, 2026
2d2ffd6
JSStringBuilder: stack-buffered builder emitting inline JSString cells
robobun Jul 19, 2026
24def33
Inline small strings: eliminate materialization hotspots + 32-byte bi…
robobun Jul 19, 2026
a6331a3
Revert JSBigInlineString to 24 bytes; width-aware equality bail
robobun Jul 19, 2026
00b30be
FTL MakeRope: allocate the rope cell after inline-child/short-result …
robobun Jul 19, 2026
f4c8066
InlinePropertyKey.h: tagged-uid shim layer (scaffold for change set 6)
robobun Jul 19, 2026
2d8ee4a
CacheableIdentifier: accept 16-byte inline JSStrings as cacheable ByV…
robobun Jul 19, 2026
c3264e5
CacheableIdentifier: make inline JSStrings cacheable ByVal keys (atom…
robobun Jul 19, 2026
ca4be67
Identifier.h: guard include + uidHash/parseIndex shims (BUN_JSC_ADDIT…
robobun Jul 19, 2026
6a977c4
StructureInlines.h: guarded InlinePropertyKey include + uidHash shims
robobun Jul 19, 2026
b6e195a
HasOwnPropertyCache: guard hash() with InlinePropertyKey shim
robobun Jul 19, 2026
b924084
StructureTransitionTable.h: inline-key include, ASSERT relax, static_…
robobun Jul 19, 2026
8e683b9
MegamorphicCache.h: guarded InlinePropertyKey include + uidHash shims
robobun Jul 19, 2026
3d426bc
PropertyTable: InlinePropertyKey shims for ASSERT/ref/deref
robobun Jul 19, 2026
c0ccc0b
InlinePropertyKey phase A: tag-aware deref shims at the hash/isSymbol…
robobun Jul 19, 2026
7647144
MegamorphicCache: keep uid->hash() on non-fiber path for JIT sync
robobun Jul 19, 2026
766c5e1
Phase 3 (partial): view() instead of value() in replaceAll-cache and …
robobun Jul 19, 2026
bdfe860
InlinePropertyKey shims: [[unlikely]] on the fiber-word branch
robobun Jul 19, 2026
96decd2
InlinePropertyKey phase 3: remaining value()->view() swaps
robobun Jul 19, 2026
ac8c3d4
InlinePropertyKey phase D.1+D.2: Identifier tagged uintptr_t storage …
robobun Jul 19, 2026
2f92bdc
InlinePropertyKey phase D.5: deref guards at impl() sites hit after t…
robobun Jul 19, 2026
cfe685d
InlinePropertyKey phase D.6: RefPtr<UniquedStringImpl> fields fiber-a…
robobun Jul 19, 2026
fd4599f
InlinePropertyKey phase C: JIT tag branches at StringImpl::m_hashAndF…
robobun Jul 19, 2026
bcdb7ac
InlinePropertyKey bugfix pass: D.4 single-rep restored, D.6 RefPtr pa…
robobun Jul 20, 2026
c3dce68
InlinePropertyKey bugfix follow-ups: endSwitch StringOffsetTable fibe…
robobun Jul 20, 2026
68736a5
InlinePropertyKey bugfix: identifierToStringWithoutAtomizing() helper…
robobun Jul 20, 2026
07c86b2
InlinePropertyKey bugfix: D.4 seenProperties-bloom coherence at getBy…
robobun Jul 20, 2026
854c31a
InlinePropertyKey bugfix: AssemblyHelpers MegamorphicCache keep uid->…
robobun Jul 20, 2026
601ccbc
InlinePropertyKey D.6: JSModuleNamespaceObject ExportMap FiberAwareRe…
robobun Jul 20, 2026
019e862
InlinePropertyKey D.6 bugfix: LiteralParser equalIdentifier fiber-wor…
robobun Jul 20, 2026
e73f760
InlinePropertyKey D.6 bugfix: JSSymbolTableObject getOwnSpecialProper…
robobun Jul 20, 2026
55b775a
InlinePropertyKey D.6 bugfix: JSPropertyNameEnumerator computeNext ca…
robobun Jul 20, 2026
81ae88f
InlinePropertyKey D.6 bugfix: PropertyName publicName() materialize f…
robobun Jul 20, 2026
47803cd
InlinePropertyKey D.6 bugfix: JSInjectedScriptHost private-member Vec…
robobun Jul 20, 2026
9e3f646
InlinePropertyKey D.6 bugfix: HeapSnapshotBuilder/BunV8HeapSnapshotBu…
robobun Jul 20, 2026
03cb34c
InlinePropertyKey D.6 bugfix: stringSplitFast atomStringToJSStringMap…
robobun Jul 20, 2026
ed33154
InlinePropertyKey D.6 bugfix: jsSubstringOfResolved inline-cell alloc…
robobun Jul 20, 2026
bbcf78e
InlinePropertyKey D.6 bugfix: Identifier utf8/ascii/dump bypass strin…
robobun Jul 20, 2026
b6bcc84
InlinePropertyKey: branch-free uidHash via intHash(bits) + matching J…
robobun Jul 20, 2026
431b7f7
InlinePropertyKey: JIT hash codegen mirrors branch-free intHash(bits)…
robobun Jul 20, 2026
912892c
InlinePropertyKey perf: MegamorphicCache keyed by m_fiber (cacheUid) …
robobun Jul 20, 2026
a8978d7
InlinePropertyKey perf: canonicalFiberWordFor len-first fast-bail + C…
robobun Jul 21, 2026
109b109
InlinePropertyKey perf: PropertyTable::findImpl fiber↔atom bridge → A…
robobun Jul 21, 2026
751a263
InlinePropertyKey perf: Identifier copy/move/assign skip m_materializ…
robobun Jul 21, 2026
8f5292b
InlinePropertyKey perf: uidHash option-B (real→impl->hash(), fiber→in…
robobun Jul 21, 2026
9c93e2f
InlinePropertyKey perf: jsStringFromFiberOrImpl helper; ownPropertyKe…
robobun Jul 21, 2026
db08eca
InlinePropertyKey perf: regexp-phase3-audit — regExpReplaceGeneric vi…
robobun Jul 21, 2026
28e99a7
InlinePropertyKey perf: Structure m_transitionPropertyName back to Co…
robobun Jul 21, 2026
1513fbd
InlinePropertyKey perf: Identifier::string() by-value caller prep (By…
robobun Jul 21, 2026
4d8503d
InlinePropertyKey perf: getPropertyKeys revert to jsOwnedString(ident…
robobun Jul 21, 2026
29681d0
InlinePropertyKey perf: drop Identifier::m_materializedString; string…
robobun Jul 21, 2026
14fc7e2
InlinePropertyKey perf: uidHash Option-A (branch-free ptr-mul) — reve…
robobun Jul 21, 2026
ef3d4d5
InlinePropertyKey perf: jsOwnedAtomBackedString — getPropertyKeys ski…
robobun Jul 21, 2026
7f19099
InlinePropertyKey D.6 bugfix: throwDOMAttribute{Getter,Setter}TypeErr…
robobun Jul 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
name: Linux
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
include:
- lto_flag: ""
Expand Down
3 changes: 3 additions & 0 deletions Source/JavaScriptCore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1330,6 +1330,8 @@ set(JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS
runtime/InferredValueInlines.h
runtime/InitializeThreading.h
runtime/InlineAttribute.h
runtime/InlinePropertyKey.h
runtime/InlineStringCache.h
runtime/Int16Array.h
runtime/Int32Array.h
runtime/Int8Array.h
Expand Down Expand Up @@ -1525,6 +1527,7 @@ set(JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS
runtime/JSSourceCode.h
runtime/JSSourceCodeInlines.h
runtime/JSString.h
runtime/JSStringBuilder.h
runtime/JSStringInlines.h
runtime/JSStringIterator.h
runtime/JSStringIteratorInlines.h
Expand Down
8 changes: 8 additions & 0 deletions Source/JavaScriptCore/builtins/BuiltinNames.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,19 @@ SymbolImpl::StaticSymbolImpl polyProtoPrivateName { "PolyProto", SymbolImpl::s_f
m_privateNameSet.add(symbol); \
} while (0);

#if USE(BUN_JSC_ADDITIONS)
#define INITIALIZE_WELL_KNOWN_SYMBOL_PUBLIC_TO_PRIVATE_ENTRY(name) \
do { \
SymbolImpl* symbol = static_cast<SymbolImpl*>(m_##name##Symbol.impl()); \
m_wellKnownSymbolsMap.add(m_##name##SymbolPrivateIdentifier.string(), symbol); \
} while (0);
#else
#define INITIALIZE_WELL_KNOWN_SYMBOL_PUBLIC_TO_PRIVATE_ENTRY(name) \
do { \
SymbolImpl* symbol = static_cast<SymbolImpl*>(m_##name##Symbol.impl()); \
m_wellKnownSymbolsMap.add(m_##name##SymbolPrivateIdentifier.impl(), symbol); \
} while (0);
#endif

WTF_MAKE_TZONE_ALLOCATED_IMPL(BuiltinNames);

Expand Down
5 changes: 5 additions & 0 deletions Source/JavaScriptCore/bytecode/GetByStatus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,8 +482,13 @@ GetByStatus GetByStatus::computeFor(JSGlobalObject* globalObject, const Structur
if (set.isEmpty())
return GetByStatus();

#if USE(BUN_JSC_ADDITIONS)
if (parseIndex(PropertyName(identifier.uid())))
return GetByStatus(LikelyTakesSlowPath);
#else
if (parseIndex(*identifier.uid()))
return GetByStatus(LikelyTakesSlowPath);
#endif

VM& vm = globalObject->vm();
auto attempToFold = [&]() -> std::optional<GetByStatus> {
Expand Down
6 changes: 6 additions & 0 deletions Source/JavaScriptCore/bytecode/InlineAccess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,12 @@ bool InlineAccess::generateStringLength(PropertyInlineCache& propertyCache)
auto done = jit.jump();

isRope.link(&jit);
#if USE(BUN_JSC_ADDITIONS)
// Inline small strings share the rope branch; their cell is only 16 bytes,
// so JSRopeString::offsetOfLength() would read past the end. Take the slow path.
jit.branchTestPtr(CCallHelpers::Zero, scratch, CCallHelpers::TrustedImm32(JSString::isRopeInPointer))
.linkThunk(propertyCache.slowPathStartLocation, &jit);
#endif
jit.load32(CCallHelpers::Address(base, JSRopeString::offsetOfLength()), value.payloadGPR());

done.link(&jit);
Expand Down
66 changes: 44 additions & 22 deletions Source/JavaScriptCore/bytecode/InlineCacheCompiler.cpp

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions Source/JavaScriptCore/bytecode/InlineCacheCompiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,11 @@ ALWAYS_INLINE bool canUseMegamorphicGetByIdExcludingIndex(VM& vm, UniquedStringI

inline bool canUseMegamorphicGetById(VM& vm, UniquedStringImpl* uid)
{
#if USE(BUN_JSC_ADDITIONS)
return !parseIndex(PropertyName(uid)) && canUseMegamorphicGetByIdExcludingIndex(vm, uid);
#else
return !parseIndex(*uid) && canUseMegamorphicGetByIdExcludingIndex(vm, uid);
#endif
}

inline bool canUseMegamorphicInById(VM& vm, UniquedStringImpl* uid)
Expand All @@ -167,7 +171,11 @@ inline bool canUseMegamorphicInById(VM& vm, UniquedStringImpl* uid)

inline bool canUseMegamorphicPutById(VM& vm, UniquedStringImpl* uid)
{
#if USE(BUN_JSC_ADDITIONS)
return !parseIndex(PropertyName(uid)) && uid != vm.propertyNames->underscoreProto;
#else
return !parseIndex(*uid) && uid != vm.propertyNames->underscoreProto;
#endif
}

bool NODELETE canBeViaGlobalProxy(AccessCase::AccessType);
Expand Down
5 changes: 5 additions & 0 deletions Source/JavaScriptCore/bytecode/PutByStatus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,13 @@ PutByStatus PutByStatus::computeFor(CodeBlock* baselineBlock, ICStatusMap& basel
PutByStatus PutByStatus::computeFor(JSGlobalObject* globalObject, const StructureSet& set, CacheableIdentifier identifier, bool isDirect, PrivateFieldPutKind privateFieldPutKind)
{
UniquedStringImpl* uid = identifier.uid();
#if USE(BUN_JSC_ADDITIONS)
if (parseIndex(PropertyName(uid)))
return PutByStatus(LikelyTakesSlowPath);
#else
if (parseIndex(*uid))
return PutByStatus(LikelyTakesSlowPath);
#endif

if (set.isEmpty())
return PutByStatus();
Expand Down
11 changes: 11 additions & 0 deletions Source/JavaScriptCore/bytecode/SpeculatedType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,13 @@ void dumpSpeculation(PrintStream& outStream, SpeculatedType value)
strOut.print("StringUnresolvedVar");
else
isTop = false;

#if USE(BUN_JSC_ADDITIONS)
if (value & SpecStringInline)
strOut.print("StringInline");
else
isTop = false;
#endif
}
}

Expand Down Expand Up @@ -610,6 +617,10 @@ SpeculatedType speculationFromCell(JSCell* cell)
return SpecStringIdent;
return SpecStringResolved;
}
#if USE(BUN_JSC_ADDITIONS)
if (string->isInline())
return SpecStringInline;
#endif
return SpecString;
}

Expand Down
5 changes: 5 additions & 0 deletions Source/JavaScriptCore/bytecode/SpeculatedType.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,12 @@ static constexpr SpeculatedType SpecObjectOther = 1ull <<
static constexpr SpeculatedType SpecStringIdent = 1ull << 32; // It's definitely a JSString, and it's an identifier.
static constexpr SpeculatedType SpecStringResolvedVar = 1ull << 33; // It's definitely a JSString, and it's not an identifier. And string is resolved.
static constexpr SpeculatedType SpecStringUnresolvedVar = 1ull << 34; // It's definitely a JSString, and it's not an identifier. And string is unresolved.
#if USE(BUN_JSC_ADDITIONS)
static constexpr SpeculatedType SpecStringInline = 1ull << 51; // It's definitely a JSString with inline-small-string storage (not resolved, not a rope).
static constexpr SpeculatedType SpecStringVar = SpecStringUnresolvedVar | SpecStringResolvedVar | SpecStringInline; // It's definitely a JSString, and it's not an identifier.
#else
static constexpr SpeculatedType SpecStringVar = SpecStringUnresolvedVar | SpecStringResolvedVar; // It's definitely a JSString, and it's not an identifier.
#endif
static constexpr SpeculatedType SpecStringResolved = SpecStringIdent | SpecStringResolvedVar; // It's definitely a JSString, and it's resolved. May be an identifier or not.
static constexpr SpeculatedType SpecString = SpecStringIdent | SpecStringVar; // It's definitely a JSString.
static constexpr SpeculatedType SpecSymbol = 1ull << 35; // It's definitely a Symbol.
Expand Down
5 changes: 5 additions & 0 deletions Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,12 @@ class UnlinkedFunctionExecutable final : public JSCell {
};

#if !ASSERT_ENABLED
#if USE(BUN_JSC_ADDITIONS)
// Identifier carries a lazily-materialized AtomString under BUN_JSC_ADDITIONS (phase D.1), which grows this type.
static_assert(sizeof(UnlinkedFunctionExecutable) <= 112, "UnlinkedFunctionExecutable needs to be small");
#else
static_assert(sizeof(UnlinkedFunctionExecutable) <= 96, "UnlinkedFunctionExecutable needs to be small");
#endif
#endif

} // namespace JSC
27 changes: 27 additions & 0 deletions Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4528,6 +4528,24 @@ void BytecodeGenerator::endSwitch(const Vector<Ref<Label>, 8>& labels, Expressio
ASSERT(!labels[i]->isForward());

ASSERT(nodes[i]->isString());
#if USE(BUN_JSC_ADDITIONS)
// StringOffsetTable is RefPtr<StringImpl>-keyed and the runtime lookup
// compares real StringImpl*, so materialize the fiber word here instead
// of letting a tagged pointer reach DefaultRefDerefTraits::refIfNotNull.
const Identifier& caseIdent = static_cast<StringNode*>(nodes[i])->value();
// string() is by-value now; keep the atom alive across add() so a
// fiber-word materialization survives until the table takes its ref.
AtomString clauseAtom = caseIdent.string();
UniquedStringImpl* clause = clauseAtom.impl();
ASSERT(!isInlinePropertyKey(clause));
ASSERT(clause->isAtom());
auto result = jumpTable.m_offsetTable.add(clause, UnlinkedStringJumpTable::OffsetLocation { labels[i]->bind(switchInfo.bytecodeOffset), 0 });
if (result.isNewEntry) {
result.iterator->value.m_indexInTable = jumpTable.m_offsetTable.size() - 1;
jumpTable.m_minLength = std::min(jumpTable.m_minLength, clause->length());
jumpTable.m_maxLength = std::max(jumpTable.m_maxLength, clause->length());
}
#else
UniquedStringImpl* clause = static_cast<StringNode*>(nodes[i])->value().impl();
ASSERT(clause->isAtom());
auto result = jumpTable.m_offsetTable.add(clause, UnlinkedStringJumpTable::OffsetLocation { labels[i]->bind(switchInfo.bytecodeOffset), 0 });
Expand All @@ -4536,6 +4554,7 @@ void BytecodeGenerator::endSwitch(const Vector<Ref<Label>, 8>& labels, Expressio
jumpTable.m_minLength = std::min(jumpTable.m_minLength, clause->length());
jumpTable.m_maxLength = std::max(jumpTable.m_maxLength, clause->length());
}
#endif
}
ASSERT(!defaultLabel.isForward());
jumpTable.m_defaultOffset = defaultLabel.bind(switchInfo.bytecodeOffset);
Expand Down Expand Up @@ -5046,11 +5065,19 @@ RegisterID* BytecodeGenerator::emitGetTemplateObject(RegisterID* dst, TaggedTemp
for (; templateString; templateString = templateString->next()) {
auto* string = templateString->value();
ASSERT(string->raw());
#if USE(BUN_JSC_ADDITIONS)
rawStrings.append(string->raw()->string());
if (!string->cooked())
cookedStrings.append(std::nullopt);
else
cookedStrings.append(string->cooked()->string());
#else
rawStrings.append(string->raw()->impl());
if (!string->cooked())
cookedStrings.append(std::nullopt);
else
cookedStrings.append(string->cooked()->impl());
#endif
}
RefPtr<RegisterID> constant = addTemplateObjectConstant(TemplateObjectDescriptor::create(WTF::move(rawStrings), WTF::move(cookedStrings)), taggedTemplate->endOffset());
if (!dst)
Expand Down
8 changes: 8 additions & 0 deletions Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -1280,7 +1280,11 @@ namespace JSC {
Optimize,
DoNotOptimize
};
#if USE(BUN_JSC_ADDITIONS)
typedef UncheckedKeyHashMap<FiberAwareRefPtr, TDZNecessityLevel, IdentifierRepHash> TDZMap;
#else
typedef UncheckedKeyHashMap<RefPtr<UniquedStringImpl>, TDZNecessityLevel, IdentifierRepHash> TDZMap;
#endif

public:
JSString* addStringConstant(const Identifier&);
Expand Down Expand Up @@ -1355,7 +1359,11 @@ namespace JSC {

// Some of these objects keep pointers to one another. They are arranged
// to ensure a sane destruction order that avoids references to freed memory.
#if USE(BUN_JSC_ADDITIONS)
UncheckedKeyHashSet<FiberAwareRefPtr, IdentifierRepHash> m_functions;
#else
UncheckedKeyHashSet<RefPtr<UniquedStringImpl>, IdentifierRepHash> m_functions;
#endif
RegisterID m_ignoredResultRegister;
RegisterID m_thisRegister;
RegisterID m_calleeRegister;
Expand Down
4 changes: 2 additions & 2 deletions Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4929,9 +4929,9 @@ static void processClauseList(ClauseListNode* list, Vector<ExpressionNode*, 8>&
typeForTable = SwitchNeither;
break;
}
auto& value = static_cast<StringNode*>(clauseExpression)->value().string();
const Identifier& value = static_cast<StringNode*>(clauseExpression)->value();
if (singleCharacterSwitch &= value.length() == 1) {
int32_t intVal = value[0];
int32_t intVal = value.string()[0];
if (intVal < min_num)
min_num = intVal;
if (intVal > max_num)
Expand Down
7 changes: 7 additions & 0 deletions Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h
Original file line number Diff line number Diff line change
Expand Up @@ -5025,7 +5025,14 @@ bool AbstractInterpreter<AbstractStateType>::executeEffects(unsigned clobberLimi
case ResolveRope: {
AbstractValue& value = forNode(node->child1());
JSValue childConst = value.value();
#if USE(BUN_JSC_ADDITIONS)
// Inline small strings are !isRope() but still lack a StringImpl*. Folding them through
// lets the generic constant folder elide this node, leaking an inline fiber to consumers
// (GetByVal/StringCharAt/StringCodePointAt) that load StringImpl fields without a guard.
if (childConst && childConst.isString() && !asString(childConst)->isRope() && !asString(childConst)->isInline()) {
#else
if (childConst && childConst.isString() && !asString(childConst)->isRope()) {
#endif
setConstant(node, *m_graph.freeze(childConst));
break;
}
Expand Down
15 changes: 14 additions & 1 deletion Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1140,6 +1140,19 @@ class FixupPhase : public Phase {
ASSERT(node->arrayMode() == ArrayMode(Array::String, Array::Read, Array::OutOfBounds) || node->arrayMode() == ArrayMode(Array::String, Array::Read, Array::InBounds));
else
ASSERT(node->arrayMode() == ArrayMode(Array::String, Array::Read));
#if USE(BUN_JSC_ADDITIONS)
// For StringCharCodeAt/StringCodePointAt on a monomorphic-inline
// profile, skip the ResolveRope insertion so the compile functions
// read from the cell bytes directly without a StringImpl.
{
SpeculatedType pred = node->child1()->prediction() & SpecString;
if ((op == StringCharCodeAt || op == StringCodePointAt) && pred && !(pred & ~SpecStringInline)) {
fixEdge<StringUse>(node->child1());
fixEdge<Int32Use>(node->child2());
break;
}
}
#endif
blessArrayOperation(node->child1(), node->child2(), node->child1()); // Rewrite child1 with ResolveRope.
fixEdge<KnownStringUse>(node->child1());
fixEdge<Int32Use>(node->child2());
Expand Down Expand Up @@ -2615,7 +2628,7 @@ class FixupPhase : public Phase {
}

case CheckIdent: {
if (node->uidOperand()->isSymbol())
if (uidIsSymbol(node->uidOperand()))
fixEdge<SymbolUse>(node->child1());
else
fixEdge<StringIdentUse>(node->child1());
Expand Down
Loading
Loading