| 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 13 matching lines...) Expand all Loading... |
| 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | 27 |
| 28 // A light-weight assembler for the Regexp2000 byte code. | 28 // A light-weight assembler for the Regexp2000 byte code. |
| 29 | 29 |
| 30 | 30 |
| 31 #include "v8.h" | 31 #include "v8.h" |
| 32 #include "ast.h" | 32 #include "ast.h" |
| 33 #include "bytecodes-re2k.h" | 33 #include "bytecodes-re2k.h" |
| 34 #include "regexp-codegen.h" | |
| 35 #include "assembler-re2k.h" | 34 #include "assembler-re2k.h" |
| 36 | 35 |
| 37 | 36 |
| 38 namespace v8 { namespace internal { | 37 namespace v8 { namespace internal { |
| 39 | 38 |
| 40 | 39 |
| 41 void Re2kAssembler::Emit(uint32_t byte) { | 40 void Re2kAssembler::Emit(uint32_t byte) { |
| 42 buffer_[pc_++] = byte; | 41 buffer_[pc_++] = byte; |
| 43 } | 42 } |
| 44 | 43 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 58 void Re2kAssembler::EmitOrLink(Label* l) { | 57 void Re2kAssembler::EmitOrLink(Label* l) { |
| 59 if (l->is_bound()) { | 58 if (l->is_bound()) { |
| 60 Emit32(l->pos()); | 59 Emit32(l->pos()); |
| 61 } else { | 60 } else { |
| 62 int pos = 0; | 61 int pos = 0; |
| 63 if (l->is_linked()) { | 62 if (l->is_linked()) { |
| 64 pos = l->pos(); | 63 pos = l->pos(); |
| 65 } | 64 } |
| 66 l->link_to(pc_); | 65 l->link_to(pc_); |
| 67 Emit32(pos); | 66 Emit32(pos); |
| 68 pc_ += 4; | |
| 69 } | 67 } |
| 70 } | 68 } |
| 71 | 69 |
| 72 } } // namespace v8::internal | 70 } } // namespace v8::internal |
| OLD | NEW |