| OLD | NEW |
| 1 // Copyright 2008-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2008-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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 } | 126 } |
| 127 | 127 |
| 128 | 128 |
| 129 int RegExpMacroAssemblerIA32::stack_limit_slack() { | 129 int RegExpMacroAssemblerIA32::stack_limit_slack() { |
| 130 return RegExpStack::kStackLimitSlack; | 130 return RegExpStack::kStackLimitSlack; |
| 131 } | 131 } |
| 132 | 132 |
| 133 | 133 |
| 134 void RegExpMacroAssemblerIA32::AdvanceCurrentPosition(int by) { | 134 void RegExpMacroAssemblerIA32::AdvanceCurrentPosition(int by) { |
| 135 if (by != 0) { | 135 if (by != 0) { |
| 136 Label inside_string; |
| 136 __ add(Operand(edi), Immediate(by * char_size())); | 137 __ add(Operand(edi), Immediate(by * char_size())); |
| 137 } | 138 } |
| 138 } | 139 } |
| 139 | 140 |
| 140 | 141 |
| 141 void RegExpMacroAssemblerIA32::AdvanceRegister(int reg, int by) { | 142 void RegExpMacroAssemblerIA32::AdvanceRegister(int reg, int by) { |
| 142 ASSERT(reg >= 0); | 143 ASSERT(reg >= 0); |
| 143 ASSERT(reg < num_registers_); | 144 ASSERT(reg < num_registers_); |
| 144 if (by != 0) { | 145 if (by != 0) { |
| 145 __ add(register_location(reg), Immediate(by)); | 146 __ add(register_location(reg), Immediate(by)); |
| (...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 956 void RegExpMacroAssemblerIA32::ReadCurrentPositionFromRegister(int reg) { | 957 void RegExpMacroAssemblerIA32::ReadCurrentPositionFromRegister(int reg) { |
| 957 __ mov(edi, register_location(reg)); | 958 __ mov(edi, register_location(reg)); |
| 958 } | 959 } |
| 959 | 960 |
| 960 | 961 |
| 961 void RegExpMacroAssemblerIA32::ReadStackPointerFromRegister(int reg) { | 962 void RegExpMacroAssemblerIA32::ReadStackPointerFromRegister(int reg) { |
| 962 __ mov(backtrack_stackpointer(), register_location(reg)); | 963 __ mov(backtrack_stackpointer(), register_location(reg)); |
| 963 __ add(backtrack_stackpointer(), Operand(ebp, kStackHighEnd)); | 964 __ add(backtrack_stackpointer(), Operand(ebp, kStackHighEnd)); |
| 964 } | 965 } |
| 965 | 966 |
| 966 void RegExpMacroAssemblerIA32::SetCurrentPositionFromEnd(int by) { | |
| 967 NearLabel after_position; | |
| 968 __ cmp(edi, -by * char_size()); | |
| 969 __ j(above_equal, &after_position); | |
| 970 __ mov(edi, -by * char_size()); | |
| 971 // On RegExp code entry (where this operation is used), the character before | |
| 972 // the current position is expected to be already loaded. | |
| 973 // We have advenced the position, so it's safe to read backwards. | |
| 974 LoadCurrentCharacterUnchecked(-1, 1); | |
| 975 __ bind(&after_position); | |
| 976 } | |
| 977 | 967 |
| 978 void RegExpMacroAssemblerIA32::SetRegister(int register_index, int to) { | 968 void RegExpMacroAssemblerIA32::SetRegister(int register_index, int to) { |
| 979 ASSERT(register_index >= num_saved_registers_); // Reserved for positions! | 969 ASSERT(register_index >= num_saved_registers_); // Reserved for positions! |
| 980 __ mov(register_location(register_index), Immediate(to)); | 970 __ mov(register_location(register_index), Immediate(to)); |
| 981 } | 971 } |
| 982 | 972 |
| 983 | 973 |
| 984 void RegExpMacroAssemblerIA32::Succeed() { | 974 void RegExpMacroAssemblerIA32::Succeed() { |
| 985 __ jmp(&success_label_); | 975 __ jmp(&success_label_); |
| 986 } | 976 } |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1246 } | 1236 } |
| 1247 | 1237 |
| 1248 | 1238 |
| 1249 #undef __ | 1239 #undef __ |
| 1250 | 1240 |
| 1251 #endif // V8_INTERPRETED_REGEXP | 1241 #endif // V8_INTERPRETED_REGEXP |
| 1252 | 1242 |
| 1253 }} // namespace v8::internal | 1243 }} // namespace v8::internal |
| 1254 | 1244 |
| 1255 #endif // V8_TARGET_ARCH_IA32 | 1245 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |