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

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

Issue 11319: * Add support for positive lookahead assertions and negative... (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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 } 66 }
67 67
68 68
69 void Re2kAssembler::PushRegister(int index) { 69 void Re2kAssembler::PushRegister(int index) {
70 ASSERT(index >= 0); 70 ASSERT(index >= 0);
71 Emit(BC_PUSH_REGISTER); 71 Emit(BC_PUSH_REGISTER);
72 Emit(index); 72 Emit(index);
73 } 73 }
74 74
75 75
76 void Re2kAssembler::SetRegisterToCurrentPosition(int index, int cp_offset) { 76 void Re2kAssembler::WriteCurrentPositionToRegister(int index, int cp_offset) {
77 ASSERT(cp_offset >= 0); 77 ASSERT(cp_offset >= 0);
78 ASSERT(index >= 0); 78 ASSERT(index >= 0);
79 Emit(BC_SET_REGISTER_TO_CP); 79 Emit(BC_SET_REGISTER_TO_CP);
80 Emit(index); 80 Emit(index);
81 Emit32(cp_offset); 81 Emit32(cp_offset);
82 } 82 }
83 83
84 84
85 void Re2kAssembler::SetCurrentPositionFromRegister(int index) {
Lasse Reichstein 2008/11/20 10:32:11 You have "Write..To" but "Set..From". Wouldn't it
Erik Corry 2008/11/20 11:37:34 Done
86 ASSERT(index >= 0);
87 Emit(BC_SET_CP_TO_REGISTER);
88 Emit(index);
89 }
90
91
92 void Re2kAssembler::WriteStackPointerToRegister(int index) {
93 ASSERT(index >= 0);
94 Emit(BC_SET_REGISTER_TO_SP);
95 Emit(index);
96 }
97
98
99 void Re2kAssembler::SetStackPointerFromRegister(int index) {
100 ASSERT(index >= 0);
101 Emit(BC_SET_SP_TO_REGISTER);
102 Emit(index);
103 }
104
105
85 void Re2kAssembler::SetRegister(int index, int value) { 106 void Re2kAssembler::SetRegister(int index, int value) {
86 ASSERT(index >= 0); 107 ASSERT(index >= 0);
87 Emit(BC_SET_REGISTER); 108 Emit(BC_SET_REGISTER);
88 Emit(index); 109 Emit(index);
89 Emit32(value); 110 Emit32(value);
90 } 111 }
91 112
92 113
93 void Re2kAssembler::AdvanceRegister(int index, int by) { 114 void Re2kAssembler::AdvanceRegister(int index, int by) {
94 ASSERT(index >= 0); 115 ASSERT(index >= 0);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 } 176 }
156 177
157 178
158 void Re2kAssembler::LoadCurrentChar(int cp_offset, Label* on_end) { 179 void Re2kAssembler::LoadCurrentChar(int cp_offset, Label* on_end) {
159 Emit(BC_LOAD_CURRENT_CHAR); 180 Emit(BC_LOAD_CURRENT_CHAR);
160 Emit32(cp_offset); 181 Emit32(cp_offset);
161 EmitOrLink(on_end); 182 EmitOrLink(on_end);
162 } 183 }
163 184
164 185
165 void Re2kAssembler::CheckChar(uc16 c, Label* on_mismatch) { 186 void Re2kAssembler::CheckCharacter(uc16 c, Label* on_match) {
166 Emit(BC_CHECK_CHAR); 187 Emit(BC_CHECK_CHAR);
167 Emit16(c); 188 Emit16(c);
189 EmitOrLink(on_match);
190 }
191
192
193 void Re2kAssembler::CheckNotCharacter(uc16 c, Label* on_mismatch) {
194 Emit(BC_CHECK_NOT_CHAR);
195 Emit16(c);
168 EmitOrLink(on_mismatch); 196 EmitOrLink(on_mismatch);
169 } 197 }
170 198
171 199
172 void Re2kAssembler::CheckNotChar(uc16 c, Label* on_match) {
173 Emit(BC_CHECK_NOT_CHAR);
174 Emit16(c);
175 EmitOrLink(on_match);
176 }
177
178
179 void Re2kAssembler::CheckCharacterLT(uc16 limit, Label* on_less) { 200 void Re2kAssembler::CheckCharacterLT(uc16 limit, Label* on_less) {
180 Emit(BC_CHECK_LT); 201 Emit(BC_CHECK_LT);
181 Emit16(limit); 202 Emit16(limit);
182 EmitOrLink(on_less); 203 EmitOrLink(on_less);
183 } 204 }
184 205
185 206
186 void Re2kAssembler::CheckCharacterGT(uc16 limit, Label* on_greater) { 207 void Re2kAssembler::CheckCharacterGT(uc16 limit, Label* on_greater) {
187 Emit(BC_CHECK_GT); 208 Emit(BC_CHECK_GT);
188 Emit16(limit); 209 Emit16(limit);
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 buffer_ = Vector<byte>::New(old_buffer.length() * 2); 311 buffer_ = Vector<byte>::New(old_buffer.length() * 2);
291 own_buffer_ = true; 312 own_buffer_ = true;
292 memcpy(buffer_.start(), old_buffer.start(), old_buffer.length()); 313 memcpy(buffer_.start(), old_buffer.start(), old_buffer.length());
293 if (old_buffer_was_our_own) { 314 if (old_buffer_was_our_own) {
294 old_buffer.Dispose(); 315 old_buffer.Dispose();
295 } 316 }
296 } 317 }
297 318
298 319
299 } } // namespace v8::internal 320 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/assembler-re2k.h ('k') | src/bytecodes-re2k.h » ('j') | src/jsregexp.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698