Changeset 241557 in webkit
- Timestamp:
- Feb 14, 2019 11:10:15 AM (5 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r241552 r241557 1 2019-02-14 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] Should have default NativeJITCode 4 https://bugs.webkit.org/show_bug.cgi?id=194634 5 6 Reviewed by Mark Lam. 7 8 In JSC_useJIT=false mode, we always create identical NativeJITCode for call and construct when we create NativeExecutable. 9 This is meaningless since we do not modify NativeJITCode after the creation. This patch adds singleton used as a default one. 10 Since NativeJITCode (& JITCode) is ThreadSafeRefCounted, we can just share it in a whole process level. This removes 446 NativeJITCode 11 allocations, which takes 14KB. 12 13 * runtime/VM.cpp: 14 (JSC::jitCodeForCallTrampoline): 15 (JSC::jitCodeForConstructTrampoline): 16 (JSC::VM::getHostFunction): 17 1 18 2019-02-14 Tadeu Zagallo <tzagallo@apple.com> 2 19 -
trunk/Source/JavaScriptCore/runtime/VM.cpp
r241038 r241557 689 689 } 690 690 691 static Ref<NativeJITCode> jitCodeForCallTrampoline() 692 { 693 static NativeJITCode* result; 694 static std::once_flag onceKey; 695 std::call_once(onceKey, [&] { 696 result = new NativeJITCode(LLInt::getCodeRef<JSEntryPtrTag>(llint_native_call_trampoline), JITCode::HostCallThunk, NoIntrinsic); 697 }); 698 return makeRef(*result); 699 } 700 701 static Ref<NativeJITCode> jitCodeForConstructTrampoline() 702 { 703 static NativeJITCode* result; 704 static std::once_flag onceKey; 705 std::call_once(onceKey, [&] { 706 result = new NativeJITCode(LLInt::getCodeRef<JSEntryPtrTag>(llint_native_construct_trampoline), JITCode::HostCallThunk, NoIntrinsic); 707 }); 708 return makeRef(*result); 709 } 710 691 711 NativeExecutable* VM::getHostFunction(NativeFunction function, Intrinsic intrinsic, NativeFunction constructor, const DOMJIT::Signature* signature, const String& name) 692 712 { … … 701 721 UNUSED_PARAM(intrinsic); 702 722 UNUSED_PARAM(signature); 703 704 return NativeExecutable::create(*this, 705 adoptRef(*new NativeJITCode(LLInt::getCodeRef<JSEntryPtrTag>(llint_native_call_trampoline), JITCode::HostCallThunk, NoIntrinsic)), function, 706 adoptRef(*new NativeJITCode(LLInt::getCodeRef<JSEntryPtrTag>(llint_native_construct_trampoline), JITCode::HostCallThunk, NoIntrinsic)), constructor, 707 name); 723 return NativeExecutable::create(*this, jitCodeForCallTrampoline(), function, jitCodeForConstructTrampoline(), constructor, name); 708 724 } 709 725
Note: See TracChangeset
for help on using the changeset viewer.