@@ -74,7 +74,7 @@ static inline NativeExecutable& NODELETE getMayBeDyingNativeExecutable(const Wea
7474
7575inline unsigned JITThunks::WeakNativeExecutableHash::hash (const NativeExecutable* executable)
7676{
77- return hash (executable->function (), executable->constructor (), executable->implementationVisibility (), executable->name ());
77+ return hash (executable->function (), executable->constructor (), executable->implementationVisibility (), executable->length (), executable-> name ());
7878}
7979
8080inline unsigned JITThunks::WeakNativeExecutableHash::hash (const Weak<NativeExecutable>& key)
@@ -86,7 +86,7 @@ inline bool JITThunks::WeakNativeExecutableHash::equal(const NativeExecutable& a
8686{
8787 if (&a == &b)
8888 return true ;
89- return a.function () == b.function () && a.constructor () == b.constructor () && a.implementationVisibility () == b.implementationVisibility () && a.name () == b.name ();
89+ return a.function () == b.function () && a.constructor () == b.constructor () && a.implementationVisibility () == b.implementationVisibility () && a.length () == b. length () && a. name () == b.name ();
9090}
9191
9292inline bool JITThunks::WeakNativeExecutableHash::equal (const Weak<NativeExecutable>& a, const Weak<NativeExecutable>& b)
@@ -102,7 +102,7 @@ inline bool JITThunks::WeakNativeExecutableHash::equal(const Weak<NativeExecutab
102102inline bool JITThunks::WeakNativeExecutableHash::equal (const Weak<NativeExecutable>& a, const HostFunctionKey& b)
103103{
104104 auto & aExecutable = getMayBeDyingNativeExecutable (a);
105- return aExecutable.function () == std::get<0 >(b) && aExecutable.constructor () == std::get<1 >(b) && aExecutable.implementationVisibility () == std::get<2 >(b) && aExecutable.name () == std::get<3 >(b);
105+ return aExecutable.function () == std::get<0 >(b) && aExecutable.constructor () == std::get<1 >(b) && aExecutable.implementationVisibility () == std::get<2 >(b) && aExecutable.length () == std::get<3 >(b) && aExecutable. name () == std::get< 4 >(b);
106106}
107107
108108CodePtr<JITThunkPtrTag> JITThunks::ctiNativeCall (VM &)
@@ -227,7 +227,7 @@ struct JITThunks::NativeExecutableTranslator {
227227void JITThunks::finalize (Handle<Unknown> handle, void *)
228228{
229229 auto * nativeExecutable = static_cast <NativeExecutable*>(handle.get ().asCell ());
230- auto hostFunctionKey = std::make_tuple (nativeExecutable->function (), nativeExecutable->constructor (), nativeExecutable->implementationVisibility (), nativeExecutable->name ());
230+ auto hostFunctionKey = std::make_tuple (nativeExecutable->function (), nativeExecutable->constructor (), nativeExecutable->implementationVisibility (), nativeExecutable->length (), nativeExecutable-> name ());
231231 {
232232 AssertNoGC assertNoGC;
233233 auto iterator = m_nativeExecutableSet.find <HostKeySearcher>(hostFunctionKey);
@@ -238,17 +238,17 @@ void JITThunks::finalize(Handle<Unknown> handle, void*)
238238 }
239239}
240240
241- NativeExecutable* JITThunks::hostFunctionStub (VM & vm, TaggedNativeFunction function, TaggedNativeFunction constructor, ImplementationVisibility implementationVisibility, const String& name)
241+ NativeExecutable* JITThunks::hostFunctionStub (VM & vm, TaggedNativeFunction function, TaggedNativeFunction constructor, ImplementationVisibility implementationVisibility, unsigned length, const String& name)
242242{
243- return hostFunctionStub (vm, function, constructor, nullptr , implementationVisibility, NoIntrinsic, nullptr , name);
243+ return hostFunctionStub (vm, function, constructor, nullptr , implementationVisibility, NoIntrinsic, nullptr , length, name);
244244}
245245
246- NativeExecutable* JITThunks::hostFunctionStub (VM & vm, TaggedNativeFunction function, TaggedNativeFunction constructor, ThunkGenerator generator, ImplementationVisibility implementationVisibility, Intrinsic intrinsic, const DOMJIT ::Signature* signature, const String& name)
246+ NativeExecutable* JITThunks::hostFunctionStub (VM & vm, TaggedNativeFunction function, TaggedNativeFunction constructor, ThunkGenerator generator, ImplementationVisibility implementationVisibility, Intrinsic intrinsic, const DOMJIT ::Signature* signature, unsigned length, const String& name)
247247{
248- ASSERT (!isCompilationThread ());
248+ ASSERT (!isCompilationThread ());
249249 ASSERT (Options::useJIT ());
250250
251- auto hostFunctionKey = std::make_tuple (function, constructor, implementationVisibility, name);
251+ auto hostFunctionKey = std::make_tuple (function, constructor, implementationVisibility, length, name);
252252 {
253253 AssertNoGC assertNoGC;
254254 auto iterator = m_nativeExecutableSet.find <HostKeySearcher>(hostFunctionKey);
@@ -268,10 +268,10 @@ NativeExecutable* JITThunks::hostFunctionStub(VM& vm, TaggedNativeFunction funct
268268 forCall = adoptRef (new NativeDOMJITCode (MacroAssemblerCodeRef<JSEntryPtrTag>::createSelfManagedCodeRef (ctiNativeCall (vm).retagged <JSEntryPtrTag>()), JITType::HostCallThunk, intrinsic, signature));
269269 else
270270 forCall = adoptRef (new NativeJITCode (MacroAssemblerCodeRef<JSEntryPtrTag>::createSelfManagedCodeRef (ctiNativeCall (vm).retagged <JSEntryPtrTag>()), JITType::HostCallThunk, intrinsic));
271-
271+
272272 Ref<JSC ::JITCode> forConstruct = adoptRef (*new NativeJITCode (MacroAssemblerCodeRef<JSEntryPtrTag>::createSelfManagedCodeRef (ctiNativeConstruct (vm).retagged <JSEntryPtrTag>()), JITType::HostCallThunk, NoIntrinsic));
273-
274- NativeExecutable* nativeExecutable = NativeExecutable::create (vm, forCall.releaseNonNull (), function, WTF::move (forConstruct), constructor, implementationVisibility, name);
273+
274+ NativeExecutable* nativeExecutable = NativeExecutable::create (vm, forCall.releaseNonNull (), function, WTF::move (forConstruct), constructor, implementationVisibility, length, name);
275275 {
276276 AssertNoGC assertNoGC;
277277 auto addResult = m_nativeExecutableSet.add <NativeExecutableTranslator>(nativeExecutable);
@@ -291,9 +291,9 @@ NativeExecutable* JITThunks::hostFunctionStub(VM& vm, TaggedNativeFunction funct
291291 return nativeExecutable;
292292}
293293
294- NativeExecutable* JITThunks::hostFunctionStub (VM & vm, TaggedNativeFunction function, ThunkGenerator generator, ImplementationVisibility implementationVisibility, Intrinsic intrinsic, const String& name)
294+ NativeExecutable* JITThunks::hostFunctionStub (VM & vm, TaggedNativeFunction function, ThunkGenerator generator, ImplementationVisibility implementationVisibility, Intrinsic intrinsic, unsigned length, const String& name)
295295{
296- return hostFunctionStub (vm, function, callHostFunctionAsConstructor, generator, implementationVisibility, intrinsic, nullptr , name);
296+ return hostFunctionStub (vm, function, callHostFunctionAsConstructor, generator, implementationVisibility, intrinsic, nullptr , length, name);
297297}
298298
299299} // namespace JSC
0 commit comments