OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/regexp_assembler.h" | 5 #include "vm/regexp_assembler.h" |
6 | 6 |
7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
8 #include "vm/compiler.h" | 8 #include "vm/compiler.h" |
9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
10 #include "vm/flow_graph_builder.h" | 10 #include "vm/flow_graph_builder.h" |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 StoreLocal(current_position_, Bind(Sub(start_index_push, length_push))); | 192 StoreLocal(current_position_, Bind(Sub(start_index_push, length_push))); |
193 | 193 |
194 // Generate a local list variable to represent "registers" and | 194 // Generate a local list variable to represent "registers" and |
195 // initialize capture registers (others remain garbage). | 195 // initialize capture registers (others remain garbage). |
196 StoreLocal(registers_, Bind(new(I) ConstantInstr(registers_array_))); | 196 StoreLocal(registers_, Bind(new(I) ConstantInstr(registers_array_))); |
197 ClearRegisters(0, saved_registers_count_ - 1); | 197 ClearRegisters(0, saved_registers_count_ - 1); |
198 | 198 |
199 // Generate a local list variable to represent the backtracking stack. | 199 // Generate a local list variable to represent the backtracking stack. |
200 StoreLocal(stack_, Bind(new(I) ConstantInstr(stack_array_))); | 200 StoreLocal(stack_, Bind(new(I) ConstantInstr(stack_array_))); |
201 PushArgumentInstr* stack_push = PushLocal(stack_); | 201 PushArgumentInstr* stack_push = PushLocal(stack_); |
202 Do(InstanceCall(InstanceCallDescriptor(Symbols::clear()), stack_push)); | 202 PushArgumentInstr* zero_push = PushArgument(Bind(Uint64Constant(0))); |
| 203 Do(InstanceCall(InstanceCallDescriptor( |
| 204 Library::PrivateCoreLibName(Symbols::_setLength())), |
| 205 stack_push, |
| 206 zero_push)); |
203 | 207 |
204 // Jump to the start block. | 208 // Jump to the start block. |
205 current_instruction_->Goto(start_block_); | 209 current_instruction_->Goto(start_block_); |
206 } | 210 } |
207 | 211 |
208 | 212 |
209 void IRRegExpMacroAssembler::GenerateBacktrackBlock() { | 213 void IRRegExpMacroAssembler::GenerateBacktrackBlock() { |
210 set_current_instruction(backtrack_block_); | 214 set_current_instruction(backtrack_block_); |
211 TAG(); | 215 TAG(); |
212 CheckPreemption(); | 216 CheckPreemption(); |
(...skipping 1648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1861 index_val, | 1865 index_val, |
1862 characters, | 1866 characters, |
1863 specialization_cid_, | 1867 specialization_cid_, |
1864 Scanner::kNoSourcePos)); | 1868 Scanner::kNoSourcePos)); |
1865 } | 1869 } |
1866 | 1870 |
1867 | 1871 |
1868 #undef __ | 1872 #undef __ |
1869 | 1873 |
1870 } // namespace dart | 1874 } // namespace dart |
OLD | NEW |