Changeset 80598 in webkit for trunk/Source/JavaScriptCore/jit/JITStubs.cpp
- Timestamp:
- Mar 8, 2011, 3:17:32 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/jit/JITStubs.cpp
r80285 r80598 41 41 #include "ExceptionHelpers.h" 42 42 #include "GetterSetter.h" 43 #include "Global.h" 43 44 #include "JIT.h" 44 45 #include "JSActivation.h" … … 680 681 681 682 JITThunks::JITThunks(JSGlobalData* globalData) 683 : m_hostFunctionStubMap(new HostFunctionStubMap) 682 684 { 683 685 if (!globalData->executableAllocator.isValid()) … … 3484 3486 } 3485 3487 3486 PassRefPtr<NativeExecutable>JITThunks::hostFunctionStub(JSGlobalData* globalData, NativeFunction function)3487 { 3488 std::pair<HostFunctionStubMap::iterator, bool> entry = m_hostFunctionStubMap .add(function, 0);3488 NativeExecutable* JITThunks::hostFunctionStub(JSGlobalData* globalData, NativeFunction function) 3489 { 3490 std::pair<HostFunctionStubMap::iterator, bool> entry = m_hostFunctionStubMap->add(function, Global<NativeExecutable>(Global<NativeExecutable>::EmptyValue)); 3489 3491 if (entry.second) 3490 entry.first->second = NativeExecutable::create(JIT::compileCTINativeCall(globalData, m_executablePool, function), function, ctiNativeConstruct(), callHostFunctionAsConstructor);3491 return entry.first->second ;3492 } 3493 3494 PassRefPtr<NativeExecutable>JITThunks::hostFunctionStub(JSGlobalData* globalData, NativeFunction function, ThunkGenerator generator)3495 { 3496 std::pair<HostFunctionStubMap::iterator, bool> entry = m_hostFunctionStubMap .add(function, 0);3492 entry.first->second.set(*globalData, NativeExecutable::create(*globalData, JIT::compileCTINativeCall(globalData, m_executablePool, function), function, ctiNativeConstruct(), callHostFunctionAsConstructor)); 3493 return entry.first->second.get(); 3494 } 3495 3496 NativeExecutable* JITThunks::hostFunctionStub(JSGlobalData* globalData, NativeFunction function, ThunkGenerator generator) 3497 { 3498 std::pair<HostFunctionStubMap::iterator, bool> entry = m_hostFunctionStubMap->add(function, Global<NativeExecutable>(Global<NativeExecutable>::EmptyValue)); 3497 3499 if (entry.second) { 3498 3500 MacroAssemblerCodePtr code = globalData->canUseJIT() ? generator(globalData, m_executablePool.get()) : MacroAssemblerCodePtr(); 3499 entry.first->second = NativeExecutable::create(code, function, ctiNativeConstruct(), callHostFunctionAsConstructor); 3500 } 3501 return entry.first->second; 3501 entry.first->second.set(*globalData, NativeExecutable::create(*globalData, code, function, ctiNativeConstruct(), callHostFunctionAsConstructor)); 3502 } 3503 return entry.first->second.get(); 3504 } 3505 3506 void JITThunks::clearHostFunctionStubs() 3507 { 3508 m_hostFunctionStubMap.clear(); 3502 3509 } 3503 3510
Note:
See TracChangeset
for help on using the changeset viewer.