Changeset 39061 in webkit for trunk/JavaScriptCore
- Timestamp:
- Dec 5, 2008, 7:25:23 PM (16 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r39058 r39061 1 2008-12-05 Gavin Barraclough <[email protected]> 2 3 Reviewed by Oliver Hunt. 4 5 Ordering of branch operands in MacroAssembler in unnecessarily inconsistent. 6 7 je, jg etc take an immediate operand as the second argument, but for the 8 equality branches (je, jne) the immediate operand was the first argument. This 9 was unnecessarily inconsistent. Change je, jne methods to take the immediate 10 as the second argument. 11 12 https://bugs.webkit.org/show_bug.cgi?id=22703 13 14 * assembler/MacroAssembler.h: 15 (JSC::MacroAssembler::je32): 16 (JSC::MacroAssembler::jne32): 17 * jit/JIT.cpp: 18 (JSC::JIT::compileOpStrictEq): 19 * wrec/WRECGenerator.cpp: 20 (JSC::WREC::Generator::generateEnter): 21 (JSC::WREC::Generator::generateNonGreedyQuantifier): 22 (JSC::WREC::Generator::generateGreedyQuantifier): 23 (JSC::WREC::Generator::generatePatternCharacterPair): 24 (JSC::WREC::Generator::generatePatternCharacter): 25 (JSC::WREC::Generator::generateCharacterClassInvertedRange): 26 (JSC::WREC::Generator::generateCharacterClassInverted): 27 (JSC::WREC::Generator::generateAssertionBOL): 28 (JSC::WREC::Generator::generateAssertionWordBoundary): 29 1 30 2008-12-05 Gavin Barraclough <[email protected]> 2 31 -
trunk/JavaScriptCore/assembler/MacroAssembler.h
r39058 r39061 579 579 } 580 580 581 Jump je32( Imm32 imm, RegisterID reg)581 Jump je32(RegisterID reg, Imm32 imm) 582 582 { 583 583 compareImm32ForBranchEquality(reg, imm.m_value); … … 651 651 } 652 652 653 Jump jne32( Imm32 imm, RegisterID reg)653 Jump jne32(RegisterID reg, Imm32 imm) 654 654 { 655 655 compareImm32ForBranchEquality(reg, imm.m_value); … … 703 703 // jne32(reg1, reg2).linkTo(topOfLoop); 704 704 705 void je32( Imm32 imm, RegisterID op2, Label target)706 { 707 je32( imm, op2).linkTo(target, this);705 void je32(RegisterID op1, Imm32 imm, Label target) 706 { 707 je32(op1, imm).linkTo(target, this); 708 708 } 709 709 … … 728 728 } 729 729 730 void jne32( Imm32 imm, RegisterID op2, Label target)731 { 732 jne32( imm, op2).linkTo(target, this);730 void jne32(RegisterID op1, Imm32 imm, Label target) 731 { 732 jne32(op1, imm).linkTo(target, this); 733 733 } 734 734 -
trunk/JavaScriptCore/jit/JIT.cpp
r39058 r39061 236 236 firstNotImmediate.link(this); 237 237 emitJumpSlowCaseIfJSCell(X86::edx, i); 238 m_slowCases.append(SlowCaseEntry(je32( Imm32(asInteger(JSImmediate::zeroImmediate())), X86::edx), i));238 m_slowCases.append(SlowCaseEntry(je32(X86::edx, Imm32(asInteger(JSImmediate::zeroImmediate()))), i)); 239 239 Jump firstWasNotImmediate = jump(); 240 240 … … 242 242 // If eax is 0 jump to a slow case, otherwise these values are not equal. 243 243 secondNotImmediate.link(this); 244 m_slowCases.append(SlowCaseEntry(je32( Imm32(asInteger(JSImmediate::zeroImmediate())), X86::eax), i));244 m_slowCases.append(SlowCaseEntry(je32(X86::eax, Imm32(asInteger(JSImmediate::zeroImmediate()))), i)); 245 245 246 246 // We get here if the two values are different immediates, or one is 0 and the other is a JSCell. -
trunk/JavaScriptCore/wrec/WRECGenerator.cpp
r39043 r39061 71 71 #ifndef NDEBUG 72 72 // ASSERT that the output register is not null. 73 Jump outputNotNull = jne32( Imm32(0), output);73 Jump outputNotNull = jne32(output, Imm32(0)); 74 74 breakpoint(); 75 75 outputNotNull.link(this); … … 182 182 // (3.2) if there is a limit, and we have reached it, game over. 183 183 if (max != Quantifier::noMaxSpecified) { 184 je32( Imm32(max), repeatCount, quantifierFailed);184 je32(repeatCount, Imm32(max), quantifierFailed); 185 185 } 186 186 … … 236 236 doneReadingAtoms.append(jump()); 237 237 else { 238 jne32( Imm32(max), repeatCount, readAnAtom);238 jne32(repeatCount, Imm32(max), readAnAtom); 239 239 doneReadingAtoms.append(jump()); 240 240 } … … 322 322 int pair = ch1 | (ch2 << 16); 323 323 324 failures.append(jne32( Imm32(pair), character));324 failures.append(jne32(character, Imm32(pair))); 325 325 return true; 326 326 } … … 344 344 } else if (!isASCII(ch) && ((lower = Unicode::toLower(ch)) != (upper = Unicode::toUpper(ch)))) { 345 345 // handle unicode case sentitive characters - branch to success on upper 346 isUpper = je32( Imm32(upper), character);346 isUpper = je32(character, Imm32(upper)); 347 347 hasUpper = true; 348 348 ch = lower; … … 351 351 352 352 // checks for ch, or lower case version of ch, if insensitive 353 failures.append(jne32( Imm32((unsigned short)ch), character));353 failures.append(jne32(character, Imm32((unsigned short)ch))); 354 354 355 355 if (m_parser.ignoreCase() && hasUpper) { … … 380 380 381 381 do { 382 matchDest.append(je32( Imm32((unsigned short)matches[*matchIndex]), character));382 matchDest.append(je32(character, Imm32((unsigned short)matches[*matchIndex]))); 383 383 ++*matchIndex; 384 384 } while ((*matchIndex < matchCount) && (matches[*matchIndex] < lo)); … … 418 418 for (unsigned i = 0; i < charClass.numMatchesUnicode; ++i) { 419 419 UChar ch = charClass.matchesUnicode[i]; 420 matchDest.append(je32( Imm32(ch), character));420 matchDest.append(je32(character, Imm32(ch))); 421 421 } 422 422 } … … 442 442 generateCharacterClassInvertedRange(failures, matchDest, charClass.ranges, charClass.numRanges, &matchIndex, charClass.matches, charClass.numMatches); 443 443 while (matchIndex < charClass.numMatches) 444 matchDest.append(je32( Imm32((unsigned short)charClass.matches[matchIndex++]), character));444 matchDest.append(je32(character, Imm32((unsigned short)charClass.matches[matchIndex++]))); 445 445 446 446 failures.link(this); … … 459 459 continue; 460 460 } 461 matchDest.append(je32( Imm32((unsigned short)ch), character));461 matchDest.append(je32(character, Imm32((unsigned short)ch))); 462 462 } 463 463 … … 465 465 or32(Imm32(32), character); 466 466 for (unsigned i = 0; i < countAZaz; ++i) 467 matchDest.append(je32( Imm32(matchesAZaz[i]), character));467 matchDest.append(je32(character, Imm32(matchesAZaz[i]))); 468 468 } 469 469 } … … 549 549 550 550 // begin of input == success 551 previousIsNewline.append(je32( Imm32(0), index));551 previousIsNewline.append(je32(index, Imm32(0))); 552 552 553 553 // now check prev char against newline characters. … … 559 559 previousIsNewline.link(this); 560 560 } else 561 failures.append(jne32( Imm32(0), index));561 failures.append(jne32(index, Imm32(0))); 562 562 } 563 563 … … 584 584 585 585 // (1.1) check for begin of input 586 Jump atBegin = je32( Imm32(0), index);586 Jump atBegin = je32(index, Imm32(0)); 587 587 // (1.2) load the last char, and chck if is word character 588 588 load16(BaseIndex(input, index, TimesTwo, -2), character);
Note:
See TracChangeset
for help on using the changeset viewer.