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 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
| 5 #ifdef V8_INTERPRETED_REGEXP |
| 6 |
5 #include "src/regexp/regexp-macro-assembler-irregexp.h" | 7 #include "src/regexp/regexp-macro-assembler-irregexp.h" |
6 | 8 |
7 #include "src/ast/ast.h" | 9 #include "src/ast/ast.h" |
8 #include "src/regexp/bytecodes-irregexp.h" | 10 #include "src/regexp/bytecodes-irregexp.h" |
9 #include "src/regexp/regexp-macro-assembler.h" | 11 #include "src/regexp/regexp-macro-assembler.h" |
10 #include "src/regexp/regexp-macro-assembler-irregexp-inl.h" | 12 #include "src/regexp/regexp-macro-assembler-irregexp-inl.h" |
11 | 13 |
12 | |
13 namespace v8 { | 14 namespace v8 { |
14 namespace internal { | 15 namespace internal { |
15 | 16 |
16 #ifdef V8_INTERPRETED_REGEXP | |
17 | |
18 RegExpMacroAssemblerIrregexp::RegExpMacroAssemblerIrregexp(Isolate* isolate, | 17 RegExpMacroAssemblerIrregexp::RegExpMacroAssemblerIrregexp(Isolate* isolate, |
19 Vector<byte> buffer, | 18 Vector<byte> buffer, |
20 Zone* zone) | 19 Zone* zone) |
21 : RegExpMacroAssembler(isolate, zone), | 20 : RegExpMacroAssembler(isolate, zone), |
22 buffer_(buffer), | 21 buffer_(buffer), |
23 pc_(0), | 22 pc_(0), |
24 own_buffer_(false), | 23 own_buffer_(false), |
25 advance_current_end_(kInvalidPC), | 24 advance_current_end_(kInvalidPC), |
26 isolate_(isolate) {} | 25 isolate_(isolate) {} |
27 | 26 |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 bool old_buffer_was_our_own = own_buffer_; | 446 bool old_buffer_was_our_own = own_buffer_; |
448 Vector<byte> old_buffer = buffer_; | 447 Vector<byte> old_buffer = buffer_; |
449 buffer_ = Vector<byte>::New(old_buffer.length() * 2); | 448 buffer_ = Vector<byte>::New(old_buffer.length() * 2); |
450 own_buffer_ = true; | 449 own_buffer_ = true; |
451 MemCopy(buffer_.start(), old_buffer.start(), old_buffer.length()); | 450 MemCopy(buffer_.start(), old_buffer.start(), old_buffer.length()); |
452 if (old_buffer_was_our_own) { | 451 if (old_buffer_was_our_own) { |
453 old_buffer.Dispose(); | 452 old_buffer.Dispose(); |
454 } | 453 } |
455 } | 454 } |
456 | 455 |
457 #endif // V8_INTERPRETED_REGEXP | |
458 | |
459 } // namespace internal | 456 } // namespace internal |
460 } // namespace v8 | 457 } // namespace v8 |
| 458 |
| 459 #endif // V8_INTERPRETED_REGEXP |
OLD | NEW |