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

Side by Side Diff: src/assembler-re2k.cc

Issue 9457: Fix lint issues.... (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
OLDNEW
1 // Copyright 2008 the V8 project authors. All rights reserved. 1 // Copyright 2008 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 Emit32(cp_offset); 57 Emit32(cp_offset);
58 } 58 }
59 59
60 60
61 void Re2kAssembler::PushBacktrack(Label* l) { 61 void Re2kAssembler::PushBacktrack(Label* l) {
62 Emit(BC_PUSH_BT); 62 Emit(BC_PUSH_BT);
63 EmitOrLink(l); 63 EmitOrLink(l);
64 } 64 }
65 65
66 66
67 void Re2kAssembler::PushCapture(int index) { 67 void Re2kAssembler::PushRegister(int index) {
68 ASSERT(index >= 0); 68 ASSERT(index >= 0);
69 Emit(BC_PUSH_CAPTURE); 69 Emit(BC_PUSH_REGISTER);
70 Emit(index); 70 Emit(index);
71 } 71 }
72 72
73 73
74 void Re2kAssembler::SetCapture(int index, int cp_offset) { 74 void Re2kAssembler::SetRegister(int index, int cp_offset) {
75 ASSERT(cp_offset >= 0); 75 ASSERT(cp_offset >= 0);
76 ASSERT(index >= 0); 76 ASSERT(index >= 0);
77 Emit(BC_SET_CAPTURE); 77 Emit(BC_SET_REGISTER);
78 Emit(index); 78 Emit(index);
79 Emit32(cp_offset); 79 Emit32(cp_offset);
80 } 80 }
81 81
82 82
83 void Re2kAssembler::PopCurrentPosition() { 83 void Re2kAssembler::PopCurrentPosition() {
84 Emit(BC_POP_CP); 84 Emit(BC_POP_CP);
85 } 85 }
86 86
87 87
88 void Re2kAssembler::PopBacktrack() { 88 void Re2kAssembler::PopBacktrack() {
89 Emit(BC_POP_BT); 89 Emit(BC_POP_BT);
90 } 90 }
91 91
92 92
93 void Re2kAssembler::PopCapture(int index) { 93 void Re2kAssembler::PopRegister(int index) {
94 Emit(BC_POP_CAPTURE); 94 Emit(BC_POP_REGISTER);
95 Emit(index); 95 Emit(index);
96 } 96 }
97 97
98 98
99 void Re2kAssembler::Fail() { 99 void Re2kAssembler::Fail() {
100 Emit(BC_FAIL); 100 Emit(BC_FAIL);
101 } 101 }
102 102
103 103
104 void Re2kAssembler::FailIfWithin(int distance_from_end) { 104 void Re2kAssembler::FailIfWithin(int distance_from_end) {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 167
168 168
169 void Re2kAssembler::CheckNotRange(uc16 start, uc16 end, Label* on_match) { 169 void Re2kAssembler::CheckNotRange(uc16 start, uc16 end, Label* on_match) {
170 Emit(BC_CHECK_NOT_RANGE); 170 Emit(BC_CHECK_NOT_RANGE);
171 Emit16(start); 171 Emit16(start);
172 Emit16(end); 172 Emit16(end);
173 EmitOrLink(on_match); 173 EmitOrLink(on_match);
174 } 174 }
175 175
176 176
177 void Re2kAssembler::CheckBackref(int capture_index, Label* on_mismatch, int cp_o ffset) { 177 void Re2kAssembler::CheckBackref(int capture_index,
178 Label* on_mismatch,
179 int cp_offset) {
178 Emit(BC_CHECK_BACKREF); 180 Emit(BC_CHECK_BACKREF);
179 Emit32(cp_offset); 181 Emit32(cp_offset);
180 Emit(capture_index); 182 Emit(capture_index);
181 EmitOrLink(on_mismatch); 183 EmitOrLink(on_mismatch);
182 } 184 }
183 185
184 186
185 void Re2kAssembler::CheckNotBackref(int capture_index, Label* on_match, int cp_o ffset) { 187 void Re2kAssembler::CheckNotBackref(int capture_index,
188 Label* on_match,
189 int cp_offset) {
186 Emit(BC_CHECK_NOT_BACKREF); 190 Emit(BC_CHECK_NOT_BACKREF);
187 Emit32(cp_offset); 191 Emit32(cp_offset);
188 Emit(capture_index); 192 Emit(capture_index);
189 EmitOrLink(on_match); 193 EmitOrLink(on_match);
190 } 194 }
191 195
192 196
197 void Re2kAssembler::CheckRegister(int byte_code,
198 int reg_index,
199 uint16_t vs,
200 Label* on_true) {
201 Emit(byte_code);
202 Emit(reg_index);
203 Emit16(vs);
204 EmitOrLink(on_true);
205 }
206
207
208 void Re2kAssembler::CheckRegisterEq(int reg_index,
209 uint16_t vs,
210 Label* on_equal) {
211 CheckRegister(BC_CHECK_REGISTER_EQ, reg_index, vs, on_equal);
212 }
213
214
215 void Re2kAssembler::CheckRegisterLe(int reg_index,
216 uint16_t vs,
217 Label* on_less_than_equal) {
218 CheckRegister(BC_CHECK_REGISTER_LE, reg_index, vs, on_less_than_equal);
219 }
220
221
222 void Re2kAssembler::CheckRegisterLt(int reg_index,
223 uint16_t vs,
224 Label* on_less_than) {
225 CheckRegister(BC_CHECK_REGISTER_LT, reg_index, vs, on_less_than);
226 }
227
228
229 void Re2kAssembler::CheckRegisterGe(int reg_index,
230 uint16_t vs,
231 Label* on_greater_than_equal) {
232 CheckRegister(BC_CHECK_REGISTER_GE, reg_index, vs, on_greater_than_equal);
233 }
234
235
236 void Re2kAssembler::CheckRegisterGt(int reg_index,
237 uint16_t vs,
238 Label* on_greater_than) {
239 CheckRegister(BC_CHECK_REGISTER_GT, reg_index, vs, on_greater_than);
240 }
241
242
243 void Re2kAssembler::CheckRegisterNe(int reg_index,
244 uint16_t vs,
245 Label* on_not_equal) {
246 CheckRegister(BC_CHECK_REGISTER_NE, reg_index, vs, on_not_equal);
247 }
248
249
193 int Re2kAssembler::length() { 250 int Re2kAssembler::length() {
194 return pc_; 251 return pc_;
195 } 252 }
196 253
197 254
198 void Re2kAssembler::Copy(Address a) { 255 void Re2kAssembler::Copy(Address a) {
199 memcpy(a, buffer_.start(), length()); 256 memcpy(a, buffer_.start(), length());
200 } 257 }
201 258
202 } } // namespace v8::internal 259 } } // namespace v8::internal
OLDNEW
« src/assembler-re2k.h ('K') | « src/assembler-re2k.h ('k') | src/bytecodes-re2k.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698