| 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 VM_REGEXP_ASSEMBLER_H_ | 5 #ifndef VM_REGEXP_ASSEMBLER_H_ |
| 6 #define VM_REGEXP_ASSEMBLER_H_ | 6 #define VM_REGEXP_ASSEMBLER_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 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 // Loads and binds a local variable. | 532 // Loads and binds a local variable. |
| 533 Value* BindLoadLocal(const LocalVariable& local); | 533 Value* BindLoadLocal(const LocalVariable& local); |
| 534 | 534 |
| 535 // Appends the definition. | 535 // Appends the definition. |
| 536 void Do(Definition* definition); | 536 void Do(Definition* definition); |
| 537 // Closes the current block with a jump to the specified block. | 537 // Closes the current block with a jump to the specified block. |
| 538 void GoTo(JoinEntryInstr* to); | 538 void GoTo(JoinEntryInstr* to); |
| 539 | 539 |
| 540 // Accessors for our local stack_. | 540 // Accessors for our local stack_. |
| 541 void PushStack(Definition* definition); | 541 void PushStack(Definition* definition); |
| 542 Value* PopStack(); | 542 Definition* PopStack(); |
| 543 Definition* PeekStack(); |
| 544 void CheckStackLimit(); |
| 545 void GrowStack(); |
| 543 | 546 |
| 544 // Prints the specified argument. Used for debugging. | 547 // Prints the specified argument. Used for debugging. |
| 545 void Print(PushArgumentInstr* argument); | 548 void Print(PushArgumentInstr* argument); |
| 546 | 549 |
| 547 // A utility class tracking ids of various objects such as blocks, temps, etc. | 550 // A utility class tracking ids of various objects such as blocks, temps, etc. |
| 548 class IdAllocator : public ValueObject { | 551 class IdAllocator : public ValueObject { |
| 549 public: | 552 public: |
| 550 IdAllocator() : next_id(0) { } | 553 IdAllocator() : next_id(0) { } |
| 551 | 554 |
| 552 intptr_t Count() const { return next_id; } | 555 intptr_t Count() const { return next_id; } |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 // All created blocks are contained within this set. Used for printing | 591 // All created blocks are contained within this set. Used for printing |
| 589 // the generated code. | 592 // the generated code. |
| 590 GrowableArray<BlockEntryInstr*> blocks_; | 593 GrowableArray<BlockEntryInstr*> blocks_; |
| 591 | 594 |
| 592 // The current instruction to link to when new code is emitted. | 595 // The current instruction to link to when new code is emitted. |
| 593 Instruction* current_instruction_; | 596 Instruction* current_instruction_; |
| 594 | 597 |
| 595 // A list, acting as the runtime stack for both backtrack locations and | 598 // A list, acting as the runtime stack for both backtrack locations and |
| 596 // stored positions within the string. | 599 // stored positions within the string. |
| 597 LocalVariable* stack_; | 600 LocalVariable* stack_; |
| 601 LocalVariable* stack_pointer_; |
| 598 | 602 |
| 599 // Stores the current character within the string. | 603 // Stores the current character within the string. |
| 600 LocalVariable* current_character_; | 604 LocalVariable* current_character_; |
| 601 | 605 |
| 602 // Stores the current location within the string as a negative offset | 606 // Stores the current location within the string as a negative offset |
| 603 // from the end of the string. | 607 // from the end of the string. |
| 604 LocalVariable* current_position_; | 608 LocalVariable* current_position_; |
| 605 | 609 |
| 606 // The string being processed, passed as a function parameter. | 610 // The string being processed, passed as a function parameter. |
| 607 LocalVariable* string_param_; | 611 LocalVariable* string_param_; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 622 LocalVariable* index_temp_; | 626 LocalVariable* index_temp_; |
| 623 | 627 |
| 624 LocalVariable* result_; | 628 LocalVariable* result_; |
| 625 | 629 |
| 626 // Stored positions containing group bounds. Generated as needed. | 630 // Stored positions containing group bounds. Generated as needed. |
| 627 LocalVariable* registers_; | 631 LocalVariable* registers_; |
| 628 intptr_t registers_count_; | 632 intptr_t registers_count_; |
| 629 const intptr_t saved_registers_count_; | 633 const intptr_t saved_registers_count_; |
| 630 | 634 |
| 631 // The actual array objects used for the stack and registers. | 635 // The actual array objects used for the stack and registers. |
| 632 GrowableObjectArray& stack_array_; | 636 Array& stack_array_cell_; |
| 633 TypedData& registers_array_; | 637 TypedData& registers_array_; |
| 634 | 638 |
| 635 IdAllocator block_id_; | 639 IdAllocator block_id_; |
| 636 IdAllocator temp_id_; | 640 IdAllocator temp_id_; |
| 637 IdAllocator arg_id_; | 641 IdAllocator arg_id_; |
| 638 IdAllocator local_id_; | 642 IdAllocator local_id_; |
| 639 IdAllocator indirect_id_; | 643 IdAllocator indirect_id_; |
| 640 }; | 644 }; |
| 641 | 645 |
| 642 | 646 |
| 643 } // namespace dart | 647 } // namespace dart |
| 644 | 648 |
| 645 #endif // VM_REGEXP_ASSEMBLER_H_ | 649 #endif // VM_REGEXP_ASSEMBLER_H_ |
| OLD | NEW |