Changeset 215908 in webkit for trunk/Source/JavaScriptCore/b3/testb3.cpp
- Timestamp:
- Apr 27, 2017, 4:52:41 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/b3/testb3.cpp
r215533 r215908 10292 10292 void testCallFunctionWithHellaArguments() 10293 10293 { 10294 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=171392 10295 return; 10296 10294 10297 Procedure proc; 10295 10298 BasicBlock* root = proc.addBlock(); … … 10747 10750 CHECK(!invoke<int32_t>(*code, degree * gap, 42, 11)); 10748 10751 CHECK(!invoke<int32_t>(*code, degree * gap + 1, 42, 11)); 10752 } 10753 10754 void testSwitchSameCaseAsDefault() 10755 { 10756 Procedure proc; 10757 BasicBlock* root = proc.addBlock(); 10758 10759 BasicBlock* return10 = proc.addBlock(); 10760 return10->appendNewControlValue( 10761 proc, Return, Origin(), 10762 return10->appendNew<Const32Value>(proc, Origin(), 10)); 10763 10764 Value* switchOperand = root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0); 10765 10766 BasicBlock* caseAndDefault = proc.addBlock(); 10767 caseAndDefault->appendNewControlValue( 10768 proc, Return, Origin(), 10769 caseAndDefault->appendNew<Value>( 10770 proc, Equal, Origin(), 10771 switchOperand, caseAndDefault->appendNew<ConstPtrValue>(proc, Origin(), 0))); 10772 10773 SwitchValue* switchValue = root->appendNew<SwitchValue>(proc, Origin(), switchOperand); 10774 10775 switchValue->appendCase(SwitchCase(100, FrequentedBlock(return10))); 10776 10777 // Because caseAndDefault is reached both as default case, and when it's 0, 10778 // we should not incorrectly optimize and assume that switchOperand==0. 10779 switchValue->appendCase(SwitchCase(0, FrequentedBlock(caseAndDefault))); 10780 switchValue->setFallThrough(FrequentedBlock(caseAndDefault)); 10781 10782 auto code = compileProc(proc); 10783 10784 CHECK(invoke<int32_t>(*code, 100) == 10); 10785 CHECK(invoke<int32_t>(*code, 0) == 1); 10786 CHECK(invoke<int32_t>(*code, 1) == 0); 10787 CHECK(invoke<int32_t>(*code, 2) == 0); 10788 CHECK(invoke<int32_t>(*code, 99) == 0); 10789 CHECK(invoke<int32_t>(*code, 0xbaadbeef) == 0); 10749 10790 } 10750 10791 … … 15167 15208 void testWasmBoundsCheck(unsigned offset) 15168 15209 { 15210 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=171392 15211 return; 15212 15169 15213 Procedure proc; 15170 15214 GPRReg pinned = GPRInfo::argumentGPR1; … … 16317 16361 RUN(testSwitch(100, 1)); 16318 16362 RUN(testSwitch(100, 100)); 16363 16364 RUN(testSwitchSameCaseAsDefault()); 16319 16365 16320 16366 RUN(testSwitchChillDiv(0, 1));
Note:
See TracChangeset
for help on using the changeset viewer.