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; |
145 __ add(current_input_offset(), | 146 __ add(current_input_offset(), |
146 current_input_offset(), Operand(by * char_size())); | 147 current_input_offset(), Operand(by * char_size())); |
147 } | 148 } |
148 } | 149 } |
149 | 150 |
150 | 151 |
151 void RegExpMacroAssemblerARM::AdvanceRegister(int reg, int by) { | 152 void RegExpMacroAssemblerARM::AdvanceRegister(int reg, int by) { |
152 ASSERT(reg >= 0); | 153 ASSERT(reg >= 0); |
153 ASSERT(reg < num_registers_); | 154 ASSERT(reg < num_registers_); |
154 if (by != 0) { | 155 if (by != 0) { |
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
919 } | 920 } |
920 | 921 |
921 | 922 |
922 void RegExpMacroAssemblerARM::ReadStackPointerFromRegister(int reg) { | 923 void RegExpMacroAssemblerARM::ReadStackPointerFromRegister(int reg) { |
923 __ ldr(backtrack_stackpointer(), register_location(reg)); | 924 __ ldr(backtrack_stackpointer(), register_location(reg)); |
924 __ ldr(r0, MemOperand(frame_pointer(), kStackHighEnd)); | 925 __ ldr(r0, MemOperand(frame_pointer(), kStackHighEnd)); |
925 __ add(backtrack_stackpointer(), backtrack_stackpointer(), Operand(r0)); | 926 __ add(backtrack_stackpointer(), backtrack_stackpointer(), Operand(r0)); |
926 } | 927 } |
927 | 928 |
928 | 929 |
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 | |
942 void RegExpMacroAssemblerARM::SetRegister(int register_index, int to) { | 930 void RegExpMacroAssemblerARM::SetRegister(int register_index, int to) { |
943 ASSERT(register_index >= num_saved_registers_); // Reserved for positions! | 931 ASSERT(register_index >= num_saved_registers_); // Reserved for positions! |
944 __ mov(r0, Operand(to)); | 932 __ mov(r0, Operand(to)); |
945 __ str(r0, register_location(register_index)); | 933 __ str(r0, register_location(register_index)); |
946 } | 934 } |
947 | 935 |
948 | 936 |
949 void RegExpMacroAssemblerARM::Succeed() { | 937 void RegExpMacroAssemblerARM::Succeed() { |
950 __ jmp(&success_label_); | 938 __ jmp(&success_label_); |
951 } | 939 } |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1262 __ ldr(pc, MemOperand(sp, stack_alignment, PostIndex)); | 1250 __ ldr(pc, MemOperand(sp, stack_alignment, PostIndex)); |
1263 } | 1251 } |
1264 | 1252 |
1265 #undef __ | 1253 #undef __ |
1266 | 1254 |
1267 #endif // V8_INTERPRETED_REGEXP | 1255 #endif // V8_INTERPRETED_REGEXP |
1268 | 1256 |
1269 }} // namespace v8::internal | 1257 }} // namespace v8::internal |
1270 | 1258 |
1271 #endif // V8_TARGET_ARCH_ARM | 1259 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |