OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 } | 135 } |
136 | 136 |
137 | 137 |
138 int RegExpMacroAssemblerARM::stack_limit_slack() { | 138 int RegExpMacroAssemblerARM::stack_limit_slack() { |
139 return RegExpStack::kStackLimitSlack; | 139 return RegExpStack::kStackLimitSlack; |
140 } | 140 } |
141 | 141 |
142 | 142 |
143 void RegExpMacroAssemblerARM::AdvanceCurrentPosition(int by) { | 143 void RegExpMacroAssemblerARM::AdvanceCurrentPosition(int by) { |
144 if (by != 0) { | 144 if (by != 0) { |
145 Label inside_string; | |
146 __ add(current_input_offset(), | 145 __ add(current_input_offset(), |
147 current_input_offset(), Operand(by * char_size())); | 146 current_input_offset(), Operand(by * char_size())); |
148 } | 147 } |
149 } | 148 } |
150 | 149 |
151 | 150 |
152 void RegExpMacroAssemblerARM::AdvanceRegister(int reg, int by) { | 151 void RegExpMacroAssemblerARM::AdvanceRegister(int reg, int by) { |
153 ASSERT(reg >= 0); | 152 ASSERT(reg >= 0); |
154 ASSERT(reg < num_registers_); | 153 ASSERT(reg < num_registers_); |
155 if (by != 0) { | 154 if (by != 0) { |
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
920 } | 919 } |
921 | 920 |
922 | 921 |
923 void RegExpMacroAssemblerARM::ReadStackPointerFromRegister(int reg) { | 922 void RegExpMacroAssemblerARM::ReadStackPointerFromRegister(int reg) { |
924 __ ldr(backtrack_stackpointer(), register_location(reg)); | 923 __ ldr(backtrack_stackpointer(), register_location(reg)); |
925 __ ldr(r0, MemOperand(frame_pointer(), kStackHighEnd)); | 924 __ ldr(r0, MemOperand(frame_pointer(), kStackHighEnd)); |
926 __ add(backtrack_stackpointer(), backtrack_stackpointer(), Operand(r0)); | 925 __ add(backtrack_stackpointer(), backtrack_stackpointer(), Operand(r0)); |
927 } | 926 } |
928 | 927 |
929 | 928 |
| 929 void RegExpMacroAssemblerARM::SetCurrentPositionFromEnd(int by) { |
| 930 NearLabel after_position; |
| 931 __ cmp(current_input_offset(), Operand(by * char_size())); |
| 932 __ b(hs, &after_position); |
| 933 __ mov(current_input_offset(), Operand(by * char_size())); |
| 934 // On RegExp code entry (where this operation is used), the character before |
| 935 // the current position is expected to be already loaded. |
| 936 // We have advenced the position, so it's safe to read backwards. |
| 937 LoadCurrentCharacterUnchecked(-1, 1); |
| 938 __ bind(&after_position); |
| 939 } |
| 940 |
| 941 |
930 void RegExpMacroAssemblerARM::SetRegister(int register_index, int to) { | 942 void RegExpMacroAssemblerARM::SetRegister(int register_index, int to) { |
931 ASSERT(register_index >= num_saved_registers_); // Reserved for positions! | 943 ASSERT(register_index >= num_saved_registers_); // Reserved for positions! |
932 __ mov(r0, Operand(to)); | 944 __ mov(r0, Operand(to)); |
933 __ str(r0, register_location(register_index)); | 945 __ str(r0, register_location(register_index)); |
934 } | 946 } |
935 | 947 |
936 | 948 |
937 void RegExpMacroAssemblerARM::Succeed() { | 949 void RegExpMacroAssemblerARM::Succeed() { |
938 __ jmp(&success_label_); | 950 __ jmp(&success_label_); |
939 } | 951 } |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1250 __ ldr(pc, MemOperand(sp, stack_alignment, PostIndex)); | 1262 __ ldr(pc, MemOperand(sp, stack_alignment, PostIndex)); |
1251 } | 1263 } |
1252 | 1264 |
1253 #undef __ | 1265 #undef __ |
1254 | 1266 |
1255 #endif // V8_INTERPRETED_REGEXP | 1267 #endif // V8_INTERPRETED_REGEXP |
1256 | 1268 |
1257 }} // namespace v8::internal | 1269 }} // namespace v8::internal |
1258 | 1270 |
1259 #endif // V8_TARGET_ARCH_ARM | 1271 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |