Changeset 181990 in webkit for trunk/Source/JavaScriptCore/jit/Repatch.cpp
- Timestamp:
- Mar 25, 2015, 6:26:56 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/jit/Repatch.cpp
r179831 r181990 294 294 } 295 295 296 static voidgenerateByIdStub(296 static bool generateByIdStub( 297 297 ExecState* exec, ByIdStubKind kind, const Identifier& propertyName, 298 298 FunctionPtr custom, StructureStubInfo& stubInfo, StructureChain* chain, size_t count, … … 575 575 emitRestoreScratch(stubJit, needToRestoreScratch, scratchGPR, success, fail, failureCases); 576 576 577 LinkBuffer patchBuffer(*vm, stubJit, exec->codeBlock()); 577 LinkBuffer patchBuffer(*vm, stubJit, exec->codeBlock(), JITCompilationCanFail); 578 if (patchBuffer.didFailToAllocate()) 579 return false; 578 580 579 581 linkRestoreScratch(patchBuffer, needToRestoreScratch, success, fail, failureCases, successLabel, slowCaseLabel); … … 602 604 else 603 605 stubRoutine = createJITStubRoutine(code, *vm, codeBlock->ownerExecutable(), true); 606 607 return true; 604 608 } 605 609 … … 688 692 emitRestoreScratch(stubJit, needToRestoreScratch, scratchGPR, success, fail, failureCases); 689 693 690 LinkBuffer patchBuffer(*vm, stubJit, codeBlock); 694 LinkBuffer patchBuffer(*vm, stubJit, codeBlock, JITCompilationCanFail); 695 if (patchBuffer.didFailToAllocate()) 696 return GiveUpOnCache; 691 697 692 698 linkRestoreScratch(patchBuffer, needToRestoreScratch, stubInfo, success, fail, failureCases); … … 718 724 MacroAssembler::Jump success = stubJit.jump(); 719 725 720 LinkBuffer patchBuffer(*vm, stubJit, codeBlock); 721 726 LinkBuffer patchBuffer(*vm, stubJit, codeBlock, JITCompilationCanFail); 727 if (patchBuffer.didFailToAllocate()) 728 return GiveUpOnCache; 729 722 730 patchBuffer.link(success, stubInfo.callReturnLocation.labelAtOffset(stubInfo.patch.deltaCallToDone)); 723 731 patchBuffer.link(failure, stubInfo.callReturnLocation.labelAtOffset(stubInfo.patch.deltaCallToSlowCase)); … … 845 853 846 854 RefPtr<JITStubRoutine> stubRoutine; 847 generateByIdStub(855 bool result = generateByIdStub( 848 856 exec, kindFor(slot), ident, customFor(slot), stubInfo, prototypeChain, count, offset, 849 857 structure, loadTargetFromProxy, slot.watchpointSet(), 850 858 stubInfo.callReturnLocation.labelAtOffset(stubInfo.patch.deltaCallToDone), 851 859 CodeLocationLabel(list->currentSlowPathTarget(stubInfo)), stubRoutine); 860 if (!result) 861 return GiveUpOnCache; 852 862 853 863 GetByIdAccess::AccessType accessType; … … 902 912 } 903 913 904 static voidemitPutReplaceStub(914 static bool emitPutReplaceStub( 905 915 ExecState* exec, 906 916 const Identifier&, … … 969 979 } 970 980 971 LinkBuffer patchBuffer(*vm, stubJit, exec->codeBlock()); 981 LinkBuffer patchBuffer(*vm, stubJit, exec->codeBlock(), JITCompilationCanFail); 982 if (patchBuffer.didFailToAllocate()) 983 return false; 984 972 985 patchBuffer.link(success, stubInfo.callReturnLocation.labelAtOffset(stubInfo.patch.deltaCallToDone)); 973 986 patchBuffer.link(failure, failureLabel); … … 978 991 toCString(*exec->codeBlock()).data(), stubInfo.callReturnLocation.labelAtOffset( 979 992 stubInfo.patch.deltaCallToDone).executableAddress())); 993 994 return true; 980 995 } 981 996 … … 1214 1229 } 1215 1230 1216 LinkBuffer patchBuffer(*vm, stubJit, exec->codeBlock()); 1231 LinkBuffer patchBuffer(*vm, stubJit, exec->codeBlock(), JITCompilationCanFail); 1232 if (patchBuffer.didFailToAllocate()) 1233 return nullptr; 1234 1217 1235 patchBuffer.link(success, stubInfo.callReturnLocation.labelAtOffset(stubInfo.patch.deltaCallToDone)); 1218 1236 if (allocator.didReuseRegisters()) … … 1309 1327 list = PolymorphicPutByIdList::from(putKind, stubInfo); 1310 1328 1311 generateByIdStub(1329 bool result = generateByIdStub( 1312 1330 exec, kindFor(slot), ident, customFor(slot), stubInfo, prototypeChain, count, 1313 1331 offset, structure, false, nullptr, … … 1315 1333 stubInfo.callReturnLocation.labelAtOffset(stubInfo.patch.deltaCallToSlowCase), 1316 1334 stubRoutine); 1317 1335 if (!result) 1336 return GiveUpOnCache; 1337 1318 1338 list->addAccess(PutByIdAccess::setter( 1319 1339 *vm, codeBlock->ownerExecutable(), … … 1384 1404 1385 1405 // We're now committed to creating the stub. Mogrify the meta-data accordingly. 1386 emitPutReplaceStub(1406 bool result = emitPutReplaceStub( 1387 1407 exec, propertyName, slot, stubInfo, 1388 1408 structure, CodeLocationLabel(list->currentSlowPathTarget()), stubRoutine); 1389 1409 if (!result) 1410 return GiveUpOnCache; 1411 1390 1412 list->addAccess( 1391 1413 PutByIdAccess::replace( … … 1417 1439 list = PolymorphicPutByIdList::from(putKind, stubInfo); 1418 1440 1419 generateByIdStub(1441 bool result = generateByIdStub( 1420 1442 exec, kindFor(slot), propertyName, customFor(slot), stubInfo, prototypeChain, count, 1421 1443 offset, structure, false, nullptr, … … 1423 1445 CodeLocationLabel(list->currentSlowPathTarget()), 1424 1446 stubRoutine); 1425 1447 if (!result) 1448 return GiveUpOnCache; 1449 1426 1450 list->addAccess(PutByIdAccess::setter( 1427 1451 *vm, codeBlock->ownerExecutable(), … … 1549 1573 emitRestoreScratch(stubJit, needToRestoreScratch, scratchGPR, success, fail, failureCases); 1550 1574 1551 LinkBuffer patchBuffer(*vm, stubJit, exec->codeBlock()); 1552 1575 LinkBuffer patchBuffer(*vm, stubJit, exec->codeBlock(), JITCompilationCanFail); 1576 if (patchBuffer.didFailToAllocate()) 1577 return GiveUpOnCache; 1578 1553 1579 linkRestoreScratch(patchBuffer, needToRestoreScratch, success, fail, failureCases, successLabel, slowCaseLabel); 1554 1580 … … 1852 1878 AssemblyHelpers::Jump slow = stubJit.jump(); 1853 1879 1854 LinkBuffer patchBuffer(*vm, stubJit, callerCodeBlock); 1880 LinkBuffer patchBuffer(*vm, stubJit, callerCodeBlock, JITCompilationCanFail); 1881 if (patchBuffer.didFailToAllocate()) { 1882 linkVirtualFor(exec, callLinkInfo, CodeForCall, registers); 1883 return; 1884 } 1855 1885 1856 1886 RELEASE_ASSERT(callCases.size() == calls.size());
Note:
See TracChangeset
for help on using the changeset viewer.