Changeset 40562 in webkit for trunk/JavaScriptCore/wrec/WRECGenerator.cpp
- Timestamp:
- Feb 3, 2009, 6:02:32 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/wrec/WRECGenerator.cpp
r40522 r40562 68 68 #endif 69 69 #endif 70 71 #ifndef NDEBUG72 // ASSERT that the output register is not null.73 Jump outputNotNull = jnzPtr(output);74 breakpoint();75 outputNotNull.link(this);76 #endif77 70 } 78 71 … … 101 94 peek(index); 102 95 if (failure) 103 *failure = je32(length, index);96 *failure = branch32(Equal, length, index); 104 97 add32(Imm32(1), index); 105 98 poke(index); … … 108 101 void Generator::generateLoadCharacter(JumpList& failures) 109 102 { 110 failures.append( je32(length, index));103 failures.append(branch32(Equal, length, index)); 111 104 load16(BaseIndex(input, index, TimesTwo), character); 112 105 } … … 116 109 void Generator::generateJumpIfNotEndOfInput(Label target) 117 110 { 118 jle32(index, length, target);111 branch32(LessThanOrEqual, index, length, target); 119 112 } 120 113 … … 146 139 147 140 load32(Address(output, (2 * subpatternId) * sizeof(int)), character); 148 Jump skipIfEmpty = je32(Address(output, ((2 * subpatternId) + 1) * sizeof(int)), character);141 Jump skipIfEmpty = branch32(Equal, Address(output, ((2 * subpatternId) + 1) * sizeof(int)), character); 149 142 150 143 ASSERT(quantifierType == Quantifier::Greedy || quantifierType == Quantifier::NonGreedy); … … 176 169 pop(index); 177 170 if (max != Quantifier::Infinity) 178 je32(repeatCount, Imm32(max), quantifierFailed);171 branch32(Equal, repeatCount, Imm32(max), quantifierFailed); 179 172 180 173 // (1) Read an atom. … … 188 181 // (2) Keep reading if we're under the minimum. 189 182 if (min > 1) 190 jl32(repeatCount, Imm32(min), readAtom);183 branch32(LessThan, repeatCount, Imm32(min), readAtom); 191 184 192 185 // (3) Test the rest of the alternative. … … 222 215 doneReadingAtomsList.append(jump()); 223 216 else { 224 jne32(repeatCount, Imm32(max), readAtom);217 branch32(NotEqual, repeatCount, Imm32(max), readAtom); 225 218 doneReadingAtomsList.append(jump()); 226 219 } … … 239 232 // (2) Verify that we have enough atoms. 240 233 doneReadingAtomsList.link(this); 241 jl32(repeatCount, Imm32(min), quantifierFailed);234 branch32(LessThan, repeatCount, Imm32(min), quantifierFailed); 242 235 243 236 // (3) Test the rest of the alternative. … … 278 271 // Optimistically consume 2 characters. 279 272 add32(Imm32(2), index); 280 failures.append( jg32(index, length));273 failures.append(branch32(GreaterThan, index, length)); 281 274 282 275 // Load the characters we just consumed, offset -2 characters from index. … … 307 300 int pair = ch1 | (ch2 << 16); 308 301 309 failures.append( jne32(character, Imm32(pair)));302 failures.append(branch32(NotEqual, character, Imm32(pair))); 310 303 return true; 311 304 } … … 329 322 } else if (!isASCII(ch) && ((lower = Unicode::toLower(ch)) != (upper = Unicode::toUpper(ch)))) { 330 323 // handle unicode case sentitive characters - branch to success on upper 331 isUpper = je32(character, Imm32(upper));324 isUpper = branch32(Equal, character, Imm32(upper)); 332 325 hasUpper = true; 333 326 ch = lower; … … 336 329 337 330 // checks for ch, or lower case version of ch, if insensitive 338 failures.append( jne32(character, Imm32((unsigned short)ch)));331 failures.append(branch32(NotEqual, character, Imm32((unsigned short)ch))); 339 332 340 333 if (m_parser.ignoreCase() && hasUpper) { … … 358 351 // if there is anything else to check, check that first, if it falls through jmp to failure. 359 352 if ((*matchIndex < matchCount) && (matches[*matchIndex] < lo)) { 360 Jump loOrAbove = jge32(character, Imm32((unsigned short)lo));353 Jump loOrAbove = branch32(GreaterThanOrEqual, character, Imm32((unsigned short)lo)); 361 354 362 355 // generate code for all ranges before this one … … 365 358 366 359 while ((*matchIndex < matchCount) && (matches[*matchIndex] < lo)) { 367 matchDest.append( je32(character, Imm32((unsigned short)matches[*matchIndex])));360 matchDest.append(branch32(Equal, character, Imm32((unsigned short)matches[*matchIndex]))); 368 361 ++*matchIndex; 369 362 } … … 372 365 loOrAbove.link(this); 373 366 } else if (which) { 374 Jump loOrAbove = jge32(character, Imm32((unsigned short)lo));367 Jump loOrAbove = branch32(GreaterThanOrEqual, character, Imm32((unsigned short)lo)); 375 368 376 369 generateCharacterClassInvertedRange(failures, matchDest, ranges, which, matchIndex, matches, matchCount); … … 379 372 loOrAbove.link(this); 380 373 } else 381 failures.append( jl32(character, Imm32((unsigned short)lo)));374 failures.append(branch32(LessThan, character, Imm32((unsigned short)lo))); 382 375 383 376 while ((*matchIndex < matchCount) && (matches[*matchIndex] <= hi)) 384 377 ++*matchIndex; 385 378 386 matchDest.append( jle32(character, Imm32((unsigned short)hi)));379 matchDest.append(branch32(LessThanOrEqual, character, Imm32((unsigned short)hi))); 387 380 // fall through to here, the value is above hi. 388 381 … … 398 391 Jump unicodeFail; 399 392 if (charClass.numMatchesUnicode || charClass.numRangesUnicode) { 400 Jump isAscii = jle32(character, Imm32(0x7f));393 Jump isAscii = branch32(LessThanOrEqual, character, Imm32(0x7f)); 401 394 402 395 if (charClass.numMatchesUnicode) { 403 396 for (unsigned i = 0; i < charClass.numMatchesUnicode; ++i) { 404 397 UChar ch = charClass.matchesUnicode[i]; 405 matchDest.append( je32(character, Imm32(ch)));398 matchDest.append(branch32(Equal, character, Imm32(ch))); 406 399 } 407 400 } … … 412 405 UChar hi = charClass.rangesUnicode[i].end; 413 406 414 Jump below = jl32(character, Imm32(lo));415 matchDest.append( jle32(character, Imm32(hi)));407 Jump below = branch32(LessThan, character, Imm32(lo)); 408 matchDest.append(branch32(LessThanOrEqual, character, Imm32(hi))); 416 409 below.link(this); 417 410 } … … 427 420 generateCharacterClassInvertedRange(failures, matchDest, charClass.ranges, charClass.numRanges, &matchIndex, charClass.matches, charClass.numMatches); 428 421 while (matchIndex < charClass.numMatches) 429 matchDest.append( je32(character, Imm32((unsigned short)charClass.matches[matchIndex++])));422 matchDest.append(branch32(Equal, character, Imm32((unsigned short)charClass.matches[matchIndex++]))); 430 423 431 424 failures.link(this); … … 444 437 continue; 445 438 } 446 matchDest.append( je32(character, Imm32((unsigned short)ch)));439 matchDest.append(branch32(Equal, character, Imm32((unsigned short)ch))); 447 440 } 448 441 … … 450 443 or32(Imm32(32), character); 451 444 for (unsigned i = 0; i < countAZaz; ++i) 452 matchDest.append( je32(character, Imm32(matchesAZaz[i])));445 matchDest.append(branch32(Equal, character, Imm32(matchesAZaz[i]))); 453 446 } 454 447 } … … 534 527 535 528 // begin of input == success 536 previousIsNewline.append( je32(index, Imm32(0)));529 previousIsNewline.append(branch32(Equal, index, Imm32(0))); 537 530 538 531 // now check prev char against newline characters. … … 544 537 previousIsNewline.link(this); 545 538 } else 546 failures.append( jne32(index, Imm32(0)));539 failures.append(branch32(NotEqual, index, Imm32(0))); 547 540 } 548 541 … … 557 550 nextIsNewline.link(this); 558 551 } else { 559 failures.append( jne32(length, index));552 failures.append(branch32(NotEqual, length, index)); 560 553 } 561 554 } … … 569 562 570 563 // (1.1) check for begin of input 571 Jump atBegin = je32(index, Imm32(0));564 Jump atBegin = branch32(Equal, index, Imm32(0)); 572 565 // (1.2) load the last char, and chck if is word character 573 566 load16(BaseIndex(input, index, TimesTwo, -2), character); … … 626 619 627 620 // check if we're at the end of backref (if we are, success!) 628 Jump endOfBackRef = je32(Address(output, ((2 * subpatternId) + 1) * sizeof(int)), repeatCount);621 Jump endOfBackRef = branch32(Equal, Address(output, ((2 * subpatternId) + 1) * sizeof(int)), repeatCount); 629 622 630 623 load16(BaseIndex(input, repeatCount, MacroAssembler::TimesTwo), character); 631 624 632 625 // check if we've run out of input (this would be a can o'fail) 633 Jump endOfInput = je32(length, index);634 635 je16(character, BaseIndex(input, index, TimesTwo), topOfLoop);626 Jump endOfInput = branch32(Equal, length, index); 627 628 branch16(Equal, BaseIndex(input, index, TimesTwo), character, topOfLoop); 636 629 637 630 endOfInput.link(this);
Note:
See TracChangeset
for help on using the changeset viewer.