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 29 matching lines...) Expand all Loading... |
40 RegExpMacroAssemblerIrregexp::RegExpMacroAssemblerIrregexp(Vector<byte> buffer) | 40 RegExpMacroAssemblerIrregexp::RegExpMacroAssemblerIrregexp(Vector<byte> buffer) |
41 : buffer_(buffer), | 41 : buffer_(buffer), |
42 pc_(0), | 42 pc_(0), |
43 own_buffer_(false), | 43 own_buffer_(false), |
44 advance_current_end_(kInvalidPC) { | 44 advance_current_end_(kInvalidPC) { |
45 } | 45 } |
46 | 46 |
47 | 47 |
48 RegExpMacroAssemblerIrregexp::~RegExpMacroAssemblerIrregexp() { | 48 RegExpMacroAssemblerIrregexp::~RegExpMacroAssemblerIrregexp() { |
49 if (backtrack_.is_linked()) backtrack_.Unuse(); | 49 if (backtrack_.is_linked()) backtrack_.Unuse(); |
| 50 if (own_buffer_) buffer_.Dispose(); |
50 } | 51 } |
51 | 52 |
52 | 53 |
53 RegExpMacroAssemblerIrregexp::IrregexpImplementation | 54 RegExpMacroAssemblerIrregexp::IrregexpImplementation |
54 RegExpMacroAssemblerIrregexp::Implementation() { | 55 RegExpMacroAssemblerIrregexp::Implementation() { |
55 return kBytecodeImplementation; | 56 return kBytecodeImplementation; |
56 } | 57 } |
57 | 58 |
58 | 59 |
59 void RegExpMacroAssemblerIrregexp::Bind(Label* l) { | 60 void RegExpMacroAssemblerIrregexp::Bind(Label* l) { |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 buffer_ = Vector<byte>::New(old_buffer.length() * 2); | 484 buffer_ = Vector<byte>::New(old_buffer.length() * 2); |
484 own_buffer_ = true; | 485 own_buffer_ = true; |
485 memcpy(buffer_.start(), old_buffer.start(), old_buffer.length()); | 486 memcpy(buffer_.start(), old_buffer.start(), old_buffer.length()); |
486 if (old_buffer_was_our_own) { | 487 if (old_buffer_was_our_own) { |
487 old_buffer.Dispose(); | 488 old_buffer.Dispose(); |
488 } | 489 } |
489 } | 490 } |
490 | 491 |
491 | 492 |
492 } } // namespace v8::internal | 493 } } // namespace v8::internal |
OLD | NEW |