Changeset 209725 in webkit for trunk/Source/JavaScriptCore/jit/JITThunks.cpp
- Timestamp:
- Dec 12, 2016, 1:46:45 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/jit/JITThunks.cpp
r209678 r209725 45 45 } 46 46 47 MacroAssemblerCodePtr JITThunks::ctiNativeCall(VM* vm)47 JITEntryPointsWithRef JITThunks::jitEntryNativeCall(VM* vm) 48 48 { 49 if (!vm->canUseJIT()) 50 return MacroAssemblerCodePtr::createLLIntCodePtr(llint_native_call_trampoline); 51 return ctiStub(vm, nativeCallGenerator).code(); 49 if (!vm->canUseJIT()) { 50 MacroAssemblerCodePtr nativeCallStub = MacroAssemblerCodePtr::createLLIntCodePtr(llint_native_call_trampoline); 51 return JITEntryPointsWithRef(MacroAssemblerCodeRef::createSelfManagedCodeRef(nativeCallStub), nativeCallStub, nativeCallStub); 52 } 53 return jitEntryStub(vm, nativeCallGenerator); 52 54 } 53 55 54 MacroAssemblerCodePtr JITThunks::ctiNativeConstruct(VM* vm)56 JITEntryPointsWithRef JITThunks::jitEntryNativeConstruct(VM* vm) 55 57 { 56 if (!vm->canUseJIT()) 57 return MacroAssemblerCodePtr::createLLIntCodePtr(llint_native_construct_trampoline); 58 return ctiStub(vm, nativeConstructGenerator).code(); 58 if (!vm->canUseJIT()) { 59 MacroAssemblerCodePtr nativeConstructStub = MacroAssemblerCodePtr::createLLIntCodePtr(llint_native_construct_trampoline); 60 return JITEntryPointsWithRef(MacroAssemblerCodeRef::createSelfManagedCodeRef(nativeConstructStub), nativeConstructStub, nativeConstructStub); 61 } 62 return jitEntryStub(vm, nativeConstructGenerator); 59 63 } 60 64 … … 83 87 } 84 88 89 JITEntryPointsWithRef JITThunks::jitEntryStub(VM* vm, JITEntryGenerator generator) 90 { 91 LockHolder locker(m_lock); 92 JITEntryStubMap::AddResult entry = m_jitEntryStubMap.add(generator, JITEntryPointsWithRef()); 93 if (entry.isNewEntry) { 94 // Compilation thread can only retrieve existing entries. 95 ASSERT(!isCompilationThread()); 96 entry.iterator->value = generator(vm); 97 } 98 return entry.iterator->value; 99 } 100 101 JITJSCallThunkEntryPointsWithRef JITThunks::jitCallThunkEntryStub(VM* vm, JITCallThunkEntryGenerator generator) 102 { 103 LockHolder locker(m_lock); 104 JITCallThunkEntryStubMap::AddResult entry = m_jitCallThunkEntryStubMap.add(generator, JITJSCallThunkEntryPointsWithRef()); 105 if (entry.isNewEntry) { 106 // Compilation thread can only retrieve existing entries. 107 ASSERT(!isCompilationThread()); 108 entry.iterator->value = generator(vm); 109 } 110 return entry.iterator->value; 111 } 112 85 113 void JITThunks::finalize(Handle<Unknown> handle, void*) 86 114 { … … 94 122 } 95 123 96 NativeExecutable* JITThunks::hostFunctionStub(VM* vm, NativeFunction function, NativeFunction constructor, ThunkGenerator generator, Intrinsic intrinsic, const DOMJIT::Signature* signature, const String& name)124 NativeExecutable* JITThunks::hostFunctionStub(VM* vm, NativeFunction function, NativeFunction constructor, JITEntryGenerator generator, Intrinsic intrinsic, const DOMJIT::Signature* signature, const String& name) 97 125 { 98 126 ASSERT(!isCompilationThread()); … … 104 132 RefPtr<JITCode> forCall; 105 133 if (generator) { 106 MacroAssemblerCodeRef entry = generator(vm);107 forCall = adoptRef(new DirectJITCode(entry, entry.code(),JITCode::HostCallThunk));134 JITEntryPointsWithRef entry = generator(vm); 135 forCall = adoptRef(new DirectJITCode(entry, JITCode::HostCallThunk)); 108 136 } else 109 forCall = adoptRef(new NativeJITCode(JIT::compileCTINativeCall(vm, function), JITCode::HostCallThunk));137 forCall = adoptRef(new DirectJITCode(JIT::compileNativeCallEntryPoints(vm, function), JITCode::HostCallThunk)); 110 138 111 RefPtr<JITCode> forConstruct = adoptRef(new NativeJITCode(MacroAssemblerCodeRef::createSelfManagedCodeRef(ctiNativeConstruct(vm)), JITCode::HostCallThunk));139 RefPtr<JITCode> forConstruct = adoptRef(new DirectJITCode(jitEntryNativeConstruct(vm), JITCode::HostCallThunk)); 112 140 113 141 NativeExecutable* nativeExecutable = NativeExecutable::create(*vm, forCall, function, forConstruct, constructor, intrinsic, signature, name); … … 116 144 } 117 145 118 NativeExecutable* JITThunks::hostFunctionStub(VM* vm, NativeFunction function, ThunkGenerator generator, Intrinsic intrinsic, const String& name)146 NativeExecutable* JITThunks::hostFunctionStub(VM* vm, NativeFunction function, JITEntryGenerator generator, Intrinsic intrinsic, const String& name) 119 147 { 120 148 return hostFunctionStub(vm, function, callHostFunctionAsConstructor, generator, intrinsic, nullptr, name);
Note:
See TracChangeset
for help on using the changeset viewer.