| OLD | NEW |
| 1 // Copyright 2008-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2008-2009 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 20 matching lines...) Expand all Loading... |
| 31 #include "regexp-macro-assembler.h" | 31 #include "regexp-macro-assembler.h" |
| 32 #include "regexp-macro-assembler-irregexp.h" | 32 #include "regexp-macro-assembler-irregexp.h" |
| 33 #include "regexp-macro-assembler-irregexp-inl.h" | 33 #include "regexp-macro-assembler-irregexp-inl.h" |
| 34 | 34 |
| 35 | 35 |
| 36 namespace v8 { | 36 namespace v8 { |
| 37 namespace internal { | 37 namespace internal { |
| 38 | 38 |
| 39 #ifdef V8_INTERPRETED_REGEXP | 39 #ifdef V8_INTERPRETED_REGEXP |
| 40 | 40 |
| 41 RegExpMacroAssemblerIrregexp::RegExpMacroAssemblerIrregexp(Vector<byte> buffer) | 41 RegExpMacroAssemblerIrregexp::RegExpMacroAssemblerIrregexp(Vector<byte> buffer, |
| 42 : buffer_(buffer), | 42 Zone* zone) |
| 43 : RegExpMacroAssembler(zone), |
| 44 buffer_(buffer), |
| 43 pc_(0), | 45 pc_(0), |
| 44 own_buffer_(false), | 46 own_buffer_(false), |
| 45 advance_current_end_(kInvalidPC) { | 47 advance_current_end_(kInvalidPC) { |
| 46 } | 48 } |
| 47 | 49 |
| 48 | 50 |
| 49 RegExpMacroAssemblerIrregexp::~RegExpMacroAssemblerIrregexp() { | 51 RegExpMacroAssemblerIrregexp::~RegExpMacroAssemblerIrregexp() { |
| 50 if (backtrack_.is_linked()) backtrack_.Unuse(); | 52 if (backtrack_.is_linked()) backtrack_.Unuse(); |
| 51 if (own_buffer_) buffer_.Dispose(); | 53 if (own_buffer_) buffer_.Dispose(); |
| 52 } | 54 } |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 own_buffer_ = true; | 490 own_buffer_ = true; |
| 489 memcpy(buffer_.start(), old_buffer.start(), old_buffer.length()); | 491 memcpy(buffer_.start(), old_buffer.start(), old_buffer.length()); |
| 490 if (old_buffer_was_our_own) { | 492 if (old_buffer_was_our_own) { |
| 491 old_buffer.Dispose(); | 493 old_buffer.Dispose(); |
| 492 } | 494 } |
| 493 } | 495 } |
| 494 | 496 |
| 495 #endif // V8_INTERPRETED_REGEXP | 497 #endif // V8_INTERPRETED_REGEXP |
| 496 | 498 |
| 497 } } // namespace v8::internal | 499 } } // namespace v8::internal |
| OLD | NEW |