Skip to content

Commit

Permalink
Update JSModuleRecord.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarred-Sumner committed Jan 1, 2025
1 parent b3d72e7 commit 609f57a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Source/JavaScriptCore/runtime/JSModuleRecord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@ JSModuleRecord::JSModuleRecord(VM& vm, Structure* structure, const Identifier& m
size_t JSModuleRecord::estimatedSize(JSCell* cell, VM& vm)
{
const auto& thisObject = jsCast<JSModuleRecord*>(cell);
return Base::estimatedSize(cell, vm) + thisObject->sourceCode().memoryCost();
size_t size = Base::estimatedSize(cell, vm);
const SourceCode& sourceCode = thisObject->sourceCode();
StringView view = sourceCode.provider() ? sourceCode.provider()->source() : StringView();
size += view.length() * (view.is8Bit() ? sizeof(LChar) : sizeof(UChar));
size += sourceCode.memoryCost();
return size;
}
#endif
void JSModuleRecord::destroy(JSCell* cell)
Expand Down

0 comments on commit 609f57a

Please sign in to comment.