OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/ast.h" | 7 #include "src/ast.h" |
8 #include "src/compiler.h" | 8 #include "src/compiler.h" |
9 #include "src/execution.h" | 9 #include "src/execution.h" |
10 #include "src/factory.h" | 10 #include "src/factory.h" |
(...skipping 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1201 } | 1201 } |
1202 return max_register; | 1202 return max_register; |
1203 } | 1203 } |
1204 | 1204 |
1205 | 1205 |
1206 void Trace::RestoreAffectedRegisters(RegExpMacroAssembler* assembler, | 1206 void Trace::RestoreAffectedRegisters(RegExpMacroAssembler* assembler, |
1207 int max_register, | 1207 int max_register, |
1208 const OutSet& registers_to_pop, | 1208 const OutSet& registers_to_pop, |
1209 const OutSet& registers_to_clear) { | 1209 const OutSet& registers_to_clear) { |
1210 for (int reg = max_register; reg >= 0; reg--) { | 1210 for (int reg = max_register; reg >= 0; reg--) { |
1211 if (registers_to_pop.Get(reg)) assembler->PopRegister(reg); | 1211 if (registers_to_pop.Get(reg)) { |
1212 else if (registers_to_clear.Get(reg)) { | 1212 assembler->PopRegister(reg); |
| 1213 } else if (registers_to_clear.Get(reg)) { |
1213 int clear_to = reg; | 1214 int clear_to = reg; |
1214 while (reg > 0 && registers_to_clear.Get(reg - 1)) { | 1215 while (reg > 0 && registers_to_clear.Get(reg - 1)) { |
1215 reg--; | 1216 reg--; |
1216 } | 1217 } |
1217 assembler->ClearRegisters(reg, clear_to); | 1218 assembler->ClearRegisters(reg, clear_to); |
1218 } | 1219 } |
1219 } | 1220 } |
1220 } | 1221 } |
1221 | 1222 |
1222 | 1223 |
(...skipping 4883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6106 } | 6107 } |
6107 | 6108 |
6108 return compiler.Assemble(¯o_assembler, | 6109 return compiler.Assemble(¯o_assembler, |
6109 node, | 6110 node, |
6110 data->capture_count, | 6111 data->capture_count, |
6111 pattern); | 6112 pattern); |
6112 } | 6113 } |
6113 | 6114 |
6114 | 6115 |
6115 }} // namespace v8::internal | 6116 }} // namespace v8::internal |
OLD | NEW |