OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 // explained in the section below. | 697 // explained in the section below. |
698 // | 698 // |
699 // Execution state virtualization. | 699 // Execution state virtualization. |
700 // | 700 // |
701 // Instead of emitting code, nodes that manipulate the state can record their | 701 // Instead of emitting code, nodes that manipulate the state can record their |
702 // manipulation in an object called the Trace. The Trace object can record a | 702 // manipulation in an object called the Trace. The Trace object can record a |
703 // current position offset, an optional backtrack code location on the top of | 703 // current position offset, an optional backtrack code location on the top of |
704 // the virtualized backtrack stack and some register changes. When a node is | 704 // the virtualized backtrack stack and some register changes. When a node is |
705 // to be emitted it can flush the Trace or update it. Flushing the Trace | 705 // to be emitted it can flush the Trace or update it. Flushing the Trace |
706 // will emit code to bring the actual state into line with the virtual state. | 706 // will emit code to bring the actual state into line with the virtual state. |
707 // Avoiding flushing the state can postpone some work (eg updates of capture | 707 // Avoiding flushing the state can postpone some work (e.g. updates of capture |
708 // registers). Postponing work can save time when executing the regular | 708 // registers). Postponing work can save time when executing the regular |
709 // expression since it may be found that the work never has to be done as a | 709 // expression since it may be found that the work never has to be done as a |
710 // failure to match can occur. In addition it is much faster to jump to a | 710 // failure to match can occur. In addition it is much faster to jump to a |
711 // known backtrack code location than it is to pop an unknown backtrack | 711 // known backtrack code location than it is to pop an unknown backtrack |
712 // location from the stack and jump there. | 712 // location from the stack and jump there. |
713 // | 713 // |
714 // The virtual state found in the Trace affects code generation. For example | 714 // The virtual state found in the Trace affects code generation. For example |
715 // the virtual state contains the difference between the actual current | 715 // the virtual state contains the difference between the actual current |
716 // position and the virtual current position, and matching code needs to use | 716 // position and the virtual current position, and matching code needs to use |
717 // this offset to attempt a match in the correct location of the input | 717 // this offset to attempt a match in the correct location of the input |
(...skipping 4616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5334 } | 5334 } |
5335 | 5335 |
5336 return compiler.Assemble(¯o_assembler, | 5336 return compiler.Assemble(¯o_assembler, |
5337 node, | 5337 node, |
5338 data->capture_count, | 5338 data->capture_count, |
5339 pattern); | 5339 pattern); |
5340 } | 5340 } |
5341 | 5341 |
5342 | 5342 |
5343 }} // namespace v8::internal | 5343 }} // namespace v8::internal |
OLD | NEW |