OLD | NEW |
1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 BranchOrBacktrack(equal, on_equal); | 167 BranchOrBacktrack(equal, on_equal); |
168 } | 168 } |
169 | 169 |
170 | 170 |
171 void RegExpMacroAssemblerIA32::CheckCharacterGT(uc16 limit, Label* on_greater) { | 171 void RegExpMacroAssemblerIA32::CheckCharacterGT(uc16 limit, Label* on_greater) { |
172 __ cmp(current_character(), limit); | 172 __ cmp(current_character(), limit); |
173 BranchOrBacktrack(greater, on_greater); | 173 BranchOrBacktrack(greater, on_greater); |
174 } | 174 } |
175 | 175 |
176 | 176 |
| 177 void RegExpMacroAssemblerIA32::CheckAtStart(Label* on_at_start) { |
| 178 Label ok; |
| 179 // Did we start the match at the start of the string at all? |
| 180 __ cmp(Operand(ebp, kAtStart), Immediate(0)); |
| 181 BranchOrBacktrack(equal, &ok); |
| 182 // If we did, are we still at the start of the input? |
| 183 __ mov(eax, Operand(ebp, kInputEndOffset)); |
| 184 __ add(eax, Operand(edi)); |
| 185 __ cmp(eax, Operand(ebp, kInputStartOffset)); |
| 186 BranchOrBacktrack(equal, on_at_start); |
| 187 __ bind(&ok); |
| 188 } |
| 189 |
| 190 |
177 void RegExpMacroAssemblerIA32::CheckNotAtStart(Label* on_not_at_start) { | 191 void RegExpMacroAssemblerIA32::CheckNotAtStart(Label* on_not_at_start) { |
178 // Did we start the match at the start of the string at all? | 192 // Did we start the match at the start of the string at all? |
179 __ cmp(Operand(ebp, kAtStart), Immediate(0)); | 193 __ cmp(Operand(ebp, kAtStart), Immediate(0)); |
180 BranchOrBacktrack(equal, on_not_at_start); | 194 BranchOrBacktrack(equal, on_not_at_start); |
181 // If we did, are we still at the start of the input? | 195 // If we did, are we still at the start of the input? |
182 __ mov(eax, Operand(ebp, kInputEndOffset)); | 196 __ mov(eax, Operand(ebp, kInputEndOffset)); |
183 __ add(eax, Operand(edi)); | 197 __ add(eax, Operand(edi)); |
184 __ cmp(eax, Operand(ebp, kInputStartOffset)); | 198 __ cmp(eax, Operand(ebp, kInputStartOffset)); |
185 BranchOrBacktrack(not_equal, on_not_at_start); | 199 BranchOrBacktrack(not_equal, on_not_at_start); |
186 } | 200 } |
(...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1209 | 1223 |
1210 | 1224 |
1211 void RegExpMacroAssemblerIA32::LoadConstantBufferAddress(Register reg, | 1225 void RegExpMacroAssemblerIA32::LoadConstantBufferAddress(Register reg, |
1212 ArraySlice* buffer) { | 1226 ArraySlice* buffer) { |
1213 __ mov(reg, buffer->array()); | 1227 __ mov(reg, buffer->array()); |
1214 __ add(Operand(reg), Immediate(buffer->base_offset())); | 1228 __ add(Operand(reg), Immediate(buffer->base_offset())); |
1215 } | 1229 } |
1216 | 1230 |
1217 #undef __ | 1231 #undef __ |
1218 }} // namespace v8::internal | 1232 }} // namespace v8::internal |
OLD | NEW |