OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 int byte_offset = cp_offset * char_size(); | 255 int byte_offset = cp_offset * char_size(); |
256 __ Addu(a0, a0, Operand(byte_offset)); | 256 __ Addu(a0, a0, Operand(byte_offset)); |
257 } | 257 } |
258 | 258 |
259 // a0 : Address of characters to match against str. | 259 // a0 : Address of characters to match against str. |
260 int stored_high_byte = 0; | 260 int stored_high_byte = 0; |
261 for (int i = 0; i < str.length(); i++) { | 261 for (int i = 0; i < str.length(); i++) { |
262 if (mode_ == ASCII) { | 262 if (mode_ == ASCII) { |
263 __ lbu(a1, MemOperand(a0, 0)); | 263 __ lbu(a1, MemOperand(a0, 0)); |
264 __ addiu(a0, a0, char_size()); | 264 __ addiu(a0, a0, char_size()); |
265 ASSERT(str[i] <= String::kMaxAsciiCharCode); | 265 ASSERT(str[i] <= String::kMaxOneByteCharCode); |
266 BranchOrBacktrack(on_failure, ne, a1, Operand(str[i])); | 266 BranchOrBacktrack(on_failure, ne, a1, Operand(str[i])); |
267 } else { | 267 } else { |
268 __ lhu(a1, MemOperand(a0, 0)); | 268 __ lhu(a1, MemOperand(a0, 0)); |
269 __ addiu(a0, a0, char_size()); | 269 __ addiu(a0, a0, char_size()); |
270 uc16 match_char = str[i]; | 270 uc16 match_char = str[i]; |
271 int match_high_byte = (match_char >> 8); | 271 int match_high_byte = (match_char >> 8); |
272 if (match_high_byte == 0) { | 272 if (match_high_byte == 0) { |
273 BranchOrBacktrack(on_failure, ne, a1, Operand(str[i])); | 273 BranchOrBacktrack(on_failure, ne, a1, Operand(str[i])); |
274 } else { | 274 } else { |
275 if (match_high_byte != stored_high_byte) { | 275 if (match_high_byte != stored_high_byte) { |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 __ Subu(a0, current_character(), Operand(from)); | 504 __ Subu(a0, current_character(), Operand(from)); |
505 // Unsigned higher condition. | 505 // Unsigned higher condition. |
506 BranchOrBacktrack(on_not_in_range, hi, a0, Operand(to - from)); | 506 BranchOrBacktrack(on_not_in_range, hi, a0, Operand(to - from)); |
507 } | 507 } |
508 | 508 |
509 | 509 |
510 void RegExpMacroAssemblerMIPS::CheckBitInTable( | 510 void RegExpMacroAssemblerMIPS::CheckBitInTable( |
511 Handle<ByteArray> table, | 511 Handle<ByteArray> table, |
512 Label* on_bit_set) { | 512 Label* on_bit_set) { |
513 __ li(a0, Operand(table)); | 513 __ li(a0, Operand(table)); |
514 if (mode_ != ASCII || kTableMask != String::kMaxAsciiCharCode) { | 514 if (mode_ != ASCII || kTableMask != String::kMaxOneByteCharCode) { |
515 __ And(a1, current_character(), Operand(kTableSize - 1)); | 515 __ And(a1, current_character(), Operand(kTableSize - 1)); |
516 __ Addu(a0, a0, a1); | 516 __ Addu(a0, a0, a1); |
517 } else { | 517 } else { |
518 __ Addu(a0, a0, current_character()); | 518 __ Addu(a0, a0, current_character()); |
519 } | 519 } |
520 | 520 |
521 __ lbu(a0, FieldMemOperand(a0, ByteArray::kHeaderSize)); | 521 __ lbu(a0, FieldMemOperand(a0, ByteArray::kHeaderSize)); |
522 BranchOrBacktrack(on_bit_set, ne, a0, Operand(zero_reg)); | 522 BranchOrBacktrack(on_bit_set, ne, a0, Operand(zero_reg)); |
523 } | 523 } |
524 | 524 |
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1378 } | 1378 } |
1379 | 1379 |
1380 | 1380 |
1381 #undef __ | 1381 #undef __ |
1382 | 1382 |
1383 #endif // V8_INTERPRETED_REGEXP | 1383 #endif // V8_INTERPRETED_REGEXP |
1384 | 1384 |
1385 }} // namespace v8::internal | 1385 }} // namespace v8::internal |
1386 | 1386 |
1387 #endif // V8_TARGET_ARCH_MIPS | 1387 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |