OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 4574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4585 STATIC_ASSERT(kAsciiStringTag == 4); | 4585 STATIC_ASSERT(kAsciiStringTag == 4); |
4586 STATIC_ASSERT(kTwoByteStringTag == 0); | 4586 STATIC_ASSERT(kTwoByteStringTag == 0); |
4587 // Find the code object based on the assumptions above. | 4587 // Find the code object based on the assumptions above. |
4588 __ And(a0, a0, Operand(kStringEncodingMask)); // Non-zero for ascii. | 4588 __ And(a0, a0, Operand(kStringEncodingMask)); // Non-zero for ascii. |
4589 __ lw(t9, FieldMemOperand(regexp_data, JSRegExp::kDataAsciiCodeOffset)); | 4589 __ lw(t9, FieldMemOperand(regexp_data, JSRegExp::kDataAsciiCodeOffset)); |
4590 __ sra(a3, a0, 2); // a3 is 1 for ascii, 0 for UC16 (usyed below). | 4590 __ sra(a3, a0, 2); // a3 is 1 for ascii, 0 for UC16 (usyed below). |
4591 __ lw(t0, FieldMemOperand(regexp_data, JSRegExp::kDataUC16CodeOffset)); | 4591 __ lw(t0, FieldMemOperand(regexp_data, JSRegExp::kDataUC16CodeOffset)); |
4592 __ movz(t9, t0, a0); // If UC16 (a0 is 0), replace t9 w/kDataUC16CodeOffset. | 4592 __ movz(t9, t0, a0); // If UC16 (a0 is 0), replace t9 w/kDataUC16CodeOffset. |
4593 | 4593 |
4594 // Check that the irregexp code has been generated for the actual string | 4594 // Check that the irregexp code has been generated for the actual string |
4595 // encoding. If it has, the field contains a code object otherwise it | 4595 // encoding. If it has, the field contains a code object otherwise it contains |
4596 // contains the hole. | 4596 // a smi (code flushing support). |
4597 __ GetObjectType(t9, a0, a0); | 4597 __ JumpIfSmi(t9, &runtime); |
4598 __ Branch(&runtime, ne, a0, Operand(CODE_TYPE)); | |
4599 | 4598 |
4600 // a3: encoding of subject string (1 if ASCII, 0 if two_byte); | 4599 // a3: encoding of subject string (1 if ASCII, 0 if two_byte); |
4601 // t9: code | 4600 // t9: code |
4602 // subject: Subject string | 4601 // subject: Subject string |
4603 // regexp_data: RegExp data (FixedArray) | 4602 // regexp_data: RegExp data (FixedArray) |
4604 // Load used arguments before starting to push arguments for call to native | 4603 // Load used arguments before starting to push arguments for call to native |
4605 // RegExp code to avoid handling changing stack height. | 4604 // RegExp code to avoid handling changing stack height. |
4606 __ lw(a1, MemOperand(sp, kPreviousIndexOffset)); | 4605 __ lw(a1, MemOperand(sp, kPreviousIndexOffset)); |
4607 __ sra(a1, a1, kSmiTagSize); // Untag the Smi. | 4606 __ sra(a1, a1, kSmiTagSize); // Untag the Smi. |
4608 | 4607 |
(...skipping 2271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6880 __ mov(result, zero_reg); | 6879 __ mov(result, zero_reg); |
6881 __ Ret(); | 6880 __ Ret(); |
6882 } | 6881 } |
6883 | 6882 |
6884 | 6883 |
6885 #undef __ | 6884 #undef __ |
6886 | 6885 |
6887 } } // namespace v8::internal | 6886 } } // namespace v8::internal |
6888 | 6887 |
6889 #endif // V8_TARGET_ARCH_MIPS | 6888 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |