Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: src/assembler-irregexp.h

Issue 11600: * Rename to Irregexp throughout.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/regexp2000/
Patch Set: Created 12 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:mergeinfo
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 2
3 // A light-weight assembler for the Regexp2000 byte code. 3 // A light-weight assembler for the Irregexp byte code.
4 4
5 #ifndef V8_ASSEMBLER_RE2K_H_ 5 #ifndef V8_ASSEMBLER_IRREGEXP_H_
6 #define V8_ASSEMBLER_RE2K_H_ 6 #define V8_ASSEMBLER_IRREGEXP_H_
7 7
8 namespace v8 { namespace internal { 8 namespace v8 { namespace internal {
9 9
10 10
11 class Re2kAssembler { 11 class IrregexpAssembler {
12 public: 12 public:
13 // Create an assembler. Instructions and relocation information are emitted 13 // Create an assembler. Instructions and relocation information are emitted
14 // into a buffer, with the instructions starting from the beginning and the 14 // into a buffer, with the instructions starting from the beginning and the
15 // relocation information starting from the end of the buffer. See CodeDesc 15 // relocation information starting from the end of the buffer. See CodeDesc
16 // for a detailed comment on the layout (globals.h). 16 // for a detailed comment on the layout (globals.h).
17 // 17 //
18 // If the provided buffer is NULL, the assembler allocates and grows its own 18 // If the provided buffer is NULL, the assembler allocates and grows its own
19 // buffer, and buffer_size determines the initial buffer size. The buffer is 19 // buffer, and buffer_size determines the initial buffer size. The buffer is
20 // owned by the assembler and deallocated upon destruction of the assembler. 20 // owned by the assembler and deallocated upon destruction of the assembler.
21 // 21 //
22 // If the provided buffer is not NULL, the assembler uses the provided buffer 22 // If the provided buffer is not NULL, the assembler uses the provided buffer
23 // for code generation and assumes its size to be buffer_size. If the buffer 23 // for code generation and assumes its size to be buffer_size. If the buffer
24 // is too small, a fatal error occurs. No deallocation of the buffer is done 24 // is too small, a fatal error occurs. No deallocation of the buffer is done
25 // upon destruction of the assembler. 25 // upon destruction of the assembler.
26 explicit Re2kAssembler(Vector<byte>); 26 explicit IrregexpAssembler(Vector<byte>);
27 ~Re2kAssembler(); 27 ~IrregexpAssembler();
28 28
29 // CP = current position in source. 29 // CP = current position in source.
30 // BT = backtrack label. 30 // BT = backtrack label.
31 31
32 // Stack. 32 // Stack.
33 void PushCurrentPosition(int cp_offset = 0); 33 void PushCurrentPosition(int cp_offset = 0);
34 void PushBacktrack(Label* l); 34 void PushBacktrack(Label* l);
35 void PushRegister(int index); 35 void PushRegister(int index);
36 void WriteCurrentPositionToRegister(int index, int cp_offset = 0); 36 void WriteCurrentPositionToRegister(int index, int cp_offset = 0);
37 void ReadCurrentPositionFromRegister(int index); 37 void ReadCurrentPositionFromRegister(int index);
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 inline void Emit16(uint32_t x); 107 inline void Emit16(uint32_t x);
108 inline void Emit(uint32_t x); 108 inline void Emit(uint32_t x);
109 109
110 // Bytecode buffer. 110 // Bytecode buffer.
111 int length(); 111 int length();
112 void Copy(Address a); 112 void Copy(Address a);
113 113
114 inline void EmitOrLink(Label* l); 114 inline void EmitOrLink(Label* l);
115 private: 115 private:
116 // Don't use this. 116 // Don't use this.
117 Re2kAssembler() { UNREACHABLE(); } 117 IrregexpAssembler() { UNREACHABLE(); }
118 // The buffer into which code and relocation info are generated. 118 // The buffer into which code and relocation info are generated.
119 Vector<byte> buffer_; 119 Vector<byte> buffer_;
120 120
121 inline void CheckRegister(int byte_code, 121 inline void CheckRegister(int byte_code,
122 int reg_index, 122 int reg_index,
123 uint16_t vs, 123 uint16_t vs,
124 Label* on_true); 124 Label* on_true);
125 // Code generation. 125 // Code generation.
126 int pc_; // The program counter; moves forward. 126 int pc_; // The program counter; moves forward.
127 127
128 // True if the assembler owns the buffer, false if buffer is external. 128 // True if the assembler owns the buffer, false if buffer is external.
129 bool own_buffer_; 129 bool own_buffer_;
130 130
131 void Expand(); 131 void Expand();
132 }; 132 };
133 133
134 134
135 } } // namespace v8::internal 135 } } // namespace v8::internal
136 136
137 #endif // V8_ASSEMBLER_RE2K_H_ 137 #endif // V8_ASSEMBLER_IRREGEXP_H_
OLDNEW
« no previous file with comments | « src/assembler.h ('k') | src/assembler-irregexp.cc » ('j') | src/runtime.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698