Changeset 214384 in webkit for trunk/Source/JavaScriptCore/b3/testb3.cpp
- Timestamp:
- Mar 24, 2017, 4:25:16 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/b3/testb3.cpp
r213753 r214384 15212 15212 } 15213 15213 15214 void testFastTLS ()15214 void testFastTLSLoad() 15215 15215 { 15216 15216 #if ENABLE(FAST_TLS_JIT) … … 15227 15227 jit.loadFromTLSPtr(fastTLSOffsetForKey(WTF_TESTING_KEY), params[0].gpr()); 15228 15228 }); 15229 15229 15230 15230 root->appendNew<Value>(proc, Return, Origin(), patchpoint); 15231 15231 15232 15232 CHECK_EQ(compileAndRun<uintptr_t>(proc), static_cast<uintptr_t>(0xbeef)); 15233 #endif 15234 } 15235 15236 void testFastTLSStore() 15237 { 15238 #if ENABLE(FAST_TLS_JIT) 15239 Procedure proc; 15240 BasicBlock* root = proc.addBlock(); 15241 15242 PatchpointValue* patchpoint = root->appendNew<PatchpointValue>(proc, Void, Origin()); 15243 patchpoint->clobber(RegisterSet::macroScratchRegisters()); 15244 patchpoint->numGPScratchRegisters = 1; 15245 patchpoint->setGenerator( 15246 [&] (CCallHelpers& jit, const StackmapGenerationParams& params) { 15247 AllowMacroScratchRegisterUsage allowScratch(jit); 15248 GPRReg scratch = params.gpScratch(0); 15249 jit.move(CCallHelpers::TrustedImm32(0xdead), scratch); 15250 jit.storeToTLSPtr(scratch, fastTLSOffsetForKey(WTF_TESTING_KEY)); 15251 }); 15252 15253 root->appendNewControlValue(proc, Return, Origin()); 15254 15255 compileAndRun<void>(proc); 15256 CHECK_EQ(bitwise_cast<uintptr_t>(_pthread_getspecific_direct(WTF_TESTING_KEY)), static_cast<uintptr_t>(0xdead)); 15233 15257 #endif 15234 15258 } … … 16761 16785 RUN(testWasmAddress()); 16762 16786 16763 RUN(testFastTLS()); 16787 RUN(testFastTLSLoad()); 16788 RUN(testFastTLSStore()); 16764 16789 16765 16790 if (isX86()) {
Note:
See TracChangeset
for help on using the changeset viewer.