| 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 #ifndef RUNTIME_VM_REGEXP_ASSEMBLER_IR_H_ | 5 #ifndef RUNTIME_VM_REGEXP_ASSEMBLER_IR_H_ |
| 6 #define RUNTIME_VM_REGEXP_ASSEMBLER_IR_H_ | 6 #define RUNTIME_VM_REGEXP_ASSEMBLER_IR_H_ |
| 7 | 7 |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/intermediate_language.h" | 9 #include "vm/intermediate_language.h" |
| 10 #include "vm/object.h" | 10 #include "vm/object.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // throw the exception. | 25 // throw the exception. |
| 26 // FAILURE: Matching failed. | 26 // FAILURE: Matching failed. |
| 27 // SUCCESS: Matching succeeded, and the output array has been filled with | 27 // SUCCESS: Matching succeeded, and the output array has been filled with |
| 28 // capture positions. | 28 // capture positions. |
| 29 enum Result { RETRY = -2, EXCEPTION = -1, FAILURE = 0, SUCCESS = 1 }; | 29 enum Result { RETRY = -2, EXCEPTION = -1, FAILURE = 0, SUCCESS = 1 }; |
| 30 | 30 |
| 31 IRRegExpMacroAssembler(intptr_t specialization_cid, | 31 IRRegExpMacroAssembler(intptr_t specialization_cid, |
| 32 intptr_t capture_count, | 32 intptr_t capture_count, |
| 33 const ParsedFunction* parsed_function, | 33 const ParsedFunction* parsed_function, |
| 34 const ZoneGrowableArray<const ICData*>& ic_data_array, | 34 const ZoneGrowableArray<const ICData*>& ic_data_array, |
| 35 intptr_t osr_id, | |
| 36 Zone* zone); | 35 Zone* zone); |
| 37 virtual ~IRRegExpMacroAssembler(); | 36 virtual ~IRRegExpMacroAssembler(); |
| 38 | 37 |
| 39 virtual bool CanReadUnaligned(); | 38 virtual bool CanReadUnaligned(); |
| 40 | 39 |
| 41 static RawArray* Execute(const RegExp& regexp, | 40 static RawArray* Execute(const RegExp& regexp, |
| 42 const String& input, | 41 const String& input, |
| 43 const Smi& start_offset, | 42 const Smi& start_offset, |
| 44 bool sticky, | 43 bool sticky, |
| 45 Zone* zone); | 44 Zone* zone); |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 // current position, into the current-character register. | 277 // current position, into the current-character register. |
| 279 void LoadCurrentCharacterUnchecked(intptr_t cp_offset, | 278 void LoadCurrentCharacterUnchecked(intptr_t cp_offset, |
| 280 intptr_t character_count); | 279 intptr_t character_count); |
| 281 | 280 |
| 282 // Returns the character within the passed string at the specified index. | 281 // Returns the character within the passed string at the specified index. |
| 283 Value* CharacterAt(LocalVariable* index); | 282 Value* CharacterAt(LocalVariable* index); |
| 284 | 283 |
| 285 // Load a number of characters starting from index in the pattern string. | 284 // Load a number of characters starting from index in the pattern string. |
| 286 Value* LoadCodeUnitsAt(LocalVariable* index, intptr_t character_count); | 285 Value* LoadCodeUnitsAt(LocalVariable* index, intptr_t character_count); |
| 287 | 286 |
| 288 // Check whether preemption has been requested. Also serves as an OSR entry. | 287 // Check whether preemption has been requested. |
| 289 void CheckPreemption(bool is_backtrack); | 288 void CheckPreemption(); |
| 290 | 289 |
| 291 // Byte size of chars in the string to match (decided by the Mode argument) | 290 // Byte size of chars in the string to match (decided by the Mode argument) |
| 292 inline intptr_t char_size() { return static_cast<int>(mode_); } | 291 inline intptr_t char_size() { return static_cast<int>(mode_); } |
| 293 | 292 |
| 294 // Equivalent to a conditional branch to the label, unless the label | 293 // Equivalent to a conditional branch to the label, unless the label |
| 295 // is NULL, in which case it is a conditional Backtrack. | 294 // is NULL, in which case it is a conditional Backtrack. |
| 296 void BranchOrBacktrack(ComparisonInstr* comparison, | 295 void BranchOrBacktrack(ComparisonInstr* comparison, |
| 297 BlockLabel* true_successor); | 296 BlockLabel* true_successor); |
| 298 | 297 |
| 299 // Set up all local variables and parameters. | 298 // Set up all local variables and parameters. |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 IdAllocator temp_id_; | 435 IdAllocator temp_id_; |
| 437 IdAllocator arg_id_; | 436 IdAllocator arg_id_; |
| 438 IdAllocator local_id_; | 437 IdAllocator local_id_; |
| 439 IdAllocator indirect_id_; | 438 IdAllocator indirect_id_; |
| 440 }; | 439 }; |
| 441 | 440 |
| 442 | 441 |
| 443 } // namespace dart | 442 } // namespace dart |
| 444 | 443 |
| 445 #endif // RUNTIME_VM_REGEXP_ASSEMBLER_IR_H_ | 444 #endif // RUNTIME_VM_REGEXP_ASSEMBLER_IR_H_ |
| OLD | NEW |