| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 | 97 |
| 98 | 98 |
| 99 void RegExpMacroAssemblerIrregexp::WriteCurrentPositionToRegister( | 99 void RegExpMacroAssemblerIrregexp::WriteCurrentPositionToRegister( |
| 100 int register_index, int cp_offset) { | 100 int register_index, int cp_offset) { |
| 101 ASSERT(register_index >= 0); | 101 ASSERT(register_index >= 0); |
| 102 Emit(BC_SET_REGISTER_TO_CP, register_index); | 102 Emit(BC_SET_REGISTER_TO_CP, register_index); |
| 103 Emit32(cp_offset); // Current position offset. | 103 Emit32(cp_offset); // Current position offset. |
| 104 } | 104 } |
| 105 | 105 |
| 106 | 106 |
| 107 void RegExpMacroAssemblerIrregexp::ClearRegister(int reg) { | 107 void RegExpMacroAssemblerIrregexp::ClearRegisters(int reg_from, int reg_to) { |
| 108 SetRegister(reg, -1); | 108 ASSERT(reg_from <= reg_to); |
| 109 for (int reg = reg_from; reg <= reg_to; reg++) { |
| 110 SetRegister(reg, -1); |
| 111 } |
| 109 } | 112 } |
| 110 | 113 |
| 111 | 114 |
| 112 void RegExpMacroAssemblerIrregexp::ReadCurrentPositionFromRegister( | 115 void RegExpMacroAssemblerIrregexp::ReadCurrentPositionFromRegister( |
| 113 int register_index) { | 116 int register_index) { |
| 114 ASSERT(register_index >= 0); | 117 ASSERT(register_index >= 0); |
| 115 Emit(BC_SET_CP_TO_REGISTER, register_index); | 118 Emit(BC_SET_CP_TO_REGISTER, register_index); |
| 116 } | 119 } |
| 117 | 120 |
| 118 | 121 |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 buffer_ = Vector<byte>::New(old_buffer.length() * 2); | 443 buffer_ = Vector<byte>::New(old_buffer.length() * 2); |
| 441 own_buffer_ = true; | 444 own_buffer_ = true; |
| 442 memcpy(buffer_.start(), old_buffer.start(), old_buffer.length()); | 445 memcpy(buffer_.start(), old_buffer.start(), old_buffer.length()); |
| 443 if (old_buffer_was_our_own) { | 446 if (old_buffer_was_our_own) { |
| 444 old_buffer.Dispose(); | 447 old_buffer.Dispose(); |
| 445 } | 448 } |
| 446 } | 449 } |
| 447 | 450 |
| 448 | 451 |
| 449 } } // namespace v8::internal | 452 } } // namespace v8::internal |
| OLD | NEW |