| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #ifndef V8_REGEXP_MACRO_ASSEMBLER_IRREGEXP_H_ | 5 #ifndef V8_REGEXP_MACRO_ASSEMBLER_IRREGEXP_H_ |
| 6 #define V8_REGEXP_MACRO_ASSEMBLER_IRREGEXP_H_ | 6 #define V8_REGEXP_MACRO_ASSEMBLER_IRREGEXP_H_ |
| 7 | 7 |
| 8 #include "src/regexp-macro-assembler.h" | 8 #include "src/regexp-macro-assembler.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| 11 namespace internal { | 11 namespace internal { |
| 12 | 12 |
| 13 #ifdef V8_INTERPRETED_REGEXP | 13 #ifdef V8_INTERPRETED_REGEXP |
| 14 | 14 |
| 15 class RegExpMacroAssemblerIrregexp: public RegExpMacroAssembler { | 15 class RegExpMacroAssemblerIrregexp: public RegExpMacroAssembler { |
| 16 public: | 16 public: |
| 17 // Create an assembler. Instructions and relocation information are emitted | 17 // Create an assembler. Instructions and relocation information are emitted |
| 18 // into a buffer, with the instructions starting from the beginning and the | 18 // into a buffer, with the instructions starting from the beginning and the |
| 19 // relocation information starting from the end of the buffer. See CodeDesc | 19 // relocation information starting from the end of the buffer. See CodeDesc |
| 20 // for a detailed comment on the layout (globals.h). | 20 // for a detailed comment on the layout (globals.h). |
| 21 // | 21 // |
| 22 // If the provided buffer is NULL, the assembler allocates and grows its own | 22 // If the provided buffer is NULL, the assembler allocates and grows its own |
| 23 // buffer, and buffer_size determines the initial buffer size. The buffer is | 23 // buffer, and buffer_size determines the initial buffer size. The buffer is |
| 24 // owned by the assembler and deallocated upon destruction of the assembler. | 24 // owned by the assembler and deallocated upon destruction of the assembler. |
| 25 // | 25 // |
| 26 // If the provided buffer is not NULL, the assembler uses the provided buffer | 26 // If the provided buffer is not NULL, the assembler uses the provided buffer |
| 27 // for code generation and assumes its size to be buffer_size. If the buffer | 27 // for code generation and assumes its size to be buffer_size. If the buffer |
| 28 // is too small, a fatal error occurs. No deallocation of the buffer is done | 28 // is too small, a fatal error occurs. No deallocation of the buffer is done |
| 29 // upon destruction of the assembler. | 29 // upon destruction of the assembler. |
| 30 RegExpMacroAssemblerIrregexp(Vector<byte>, Zone* zone); | 30 RegExpMacroAssemblerIrregexp(Isolate* isolate, Vector<byte> buffer, |
| 31 Zone* zone); |
| 31 virtual ~RegExpMacroAssemblerIrregexp(); | 32 virtual ~RegExpMacroAssemblerIrregexp(); |
| 32 // The byte-code interpreter checks on each push anyway. | 33 // The byte-code interpreter checks on each push anyway. |
| 33 virtual int stack_limit_slack() { return 1; } | 34 virtual int stack_limit_slack() { return 1; } |
| 34 virtual bool CanReadUnaligned() { return false; } | 35 virtual bool CanReadUnaligned() { return false; } |
| 35 virtual void Bind(Label* label); | 36 virtual void Bind(Label* label); |
| 36 virtual void AdvanceCurrentPosition(int by); // Signed cp change. | 37 virtual void AdvanceCurrentPosition(int by); // Signed cp change. |
| 37 virtual void PopCurrentPosition(); | 38 virtual void PopCurrentPosition(); |
| 38 virtual void PushCurrentPosition(); | 39 virtual void PushCurrentPosition(); |
| 39 virtual void Backtrack(); | 40 virtual void Backtrack(); |
| 40 virtual void GoTo(Label* label); | 41 virtual void GoTo(Label* label); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 static const int kInvalidPC = -1; | 120 static const int kInvalidPC = -1; |
| 120 | 121 |
| 121 DISALLOW_IMPLICIT_CONSTRUCTORS(RegExpMacroAssemblerIrregexp); | 122 DISALLOW_IMPLICIT_CONSTRUCTORS(RegExpMacroAssemblerIrregexp); |
| 122 }; | 123 }; |
| 123 | 124 |
| 124 #endif // V8_INTERPRETED_REGEXP | 125 #endif // V8_INTERPRETED_REGEXP |
| 125 | 126 |
| 126 } } // namespace v8::internal | 127 } } // namespace v8::internal |
| 127 | 128 |
| 128 #endif // V8_REGEXP_MACRO_ASSEMBLER_IRREGEXP_H_ | 129 #endif // V8_REGEXP_MACRO_ASSEMBLER_IRREGEXP_H_ |
| OLD | NEW |