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

Side by Side Diff: src/regexp-macro-assembler-irregexp.cc

Issue 17416: * Move irregexp backtrack stack to external memory area, instead of the system stack. (Closed)
Patch Set: Added explicit stack check requests to push operations. Created 11 years, 11 months 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
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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 } 82 }
83 } 83 }
84 84
85 85
86 void RegExpMacroAssemblerIrregexp::PopRegister(int register_index) { 86 void RegExpMacroAssemblerIrregexp::PopRegister(int register_index) {
87 Emit(BC_POP_REGISTER); 87 Emit(BC_POP_REGISTER);
88 Emit(register_index); 88 Emit(register_index);
89 } 89 }
90 90
91 91
92 void RegExpMacroAssemblerIrregexp::PushRegister(int register_index) { 92 void RegExpMacroAssemblerIrregexp::PushRegister(
93 int register_index,
94 StackCheckFlag check_stack_limit) {
93 ASSERT(register_index >= 0); 95 ASSERT(register_index >= 0);
94 Emit(BC_PUSH_REGISTER); 96 Emit(BC_PUSH_REGISTER);
95 Emit(register_index); 97 Emit(register_index);
96 } 98 }
97 99
98 100
99 void RegExpMacroAssemblerIrregexp::WriteCurrentPositionToRegister( 101 void RegExpMacroAssemblerIrregexp::WriteCurrentPositionToRegister(
100 int register_index, int cp_offset) { 102 int register_index, int cp_offset) {
101 ASSERT(register_index >= 0); 103 ASSERT(register_index >= 0);
102 Emit(BC_SET_REGISTER_TO_CP); 104 Emit(BC_SET_REGISTER_TO_CP);
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 Emit(register_index); 145 Emit(register_index);
144 Emit32(by); 146 Emit32(by);
145 } 147 }
146 148
147 149
148 void RegExpMacroAssemblerIrregexp::PopCurrentPosition() { 150 void RegExpMacroAssemblerIrregexp::PopCurrentPosition() {
149 Emit(BC_POP_CP); 151 Emit(BC_POP_CP);
150 } 152 }
151 153
152 154
153 void RegExpMacroAssemblerIrregexp::PushCurrentPosition() { 155 void RegExpMacroAssemblerIrregexp::PushCurrentPosition(
156 StackCheckFlag check_stack_limit) {
154 Emit(BC_PUSH_CP); 157 Emit(BC_PUSH_CP);
155 Emit32(0); // Current position offset. 158 Emit32(0); // Current position offset.
156 } 159 }
157 160
158 161
159 void RegExpMacroAssemblerIrregexp::Backtrack() { 162 void RegExpMacroAssemblerIrregexp::Backtrack() {
160 Emit(BC_POP_BT); 163 Emit(BC_POP_BT);
161 } 164 }
162 165
163 166
164 void RegExpMacroAssemblerIrregexp::GoTo(Label* l) { 167 void RegExpMacroAssemblerIrregexp::GoTo(Label* l) {
165 Emit(BC_GOTO); 168 Emit(BC_GOTO);
166 EmitOrLink(l); 169 EmitOrLink(l);
167 } 170 }
168 171
169 172
170 void RegExpMacroAssemblerIrregexp::PushBacktrack(Label* l) { 173 void RegExpMacroAssemblerIrregexp::PushBacktrack(
174 Label* l,
175 StackCheckFlag check_stack_limit) {
171 Emit(BC_PUSH_BT); 176 Emit(BC_PUSH_BT);
172 EmitOrLink(l); 177 EmitOrLink(l);
173 } 178 }
174 179
175 180
176 void RegExpMacroAssemblerIrregexp::Succeed() { 181 void RegExpMacroAssemblerIrregexp::Succeed() {
177 Emit(BC_SUCCEED); 182 Emit(BC_SUCCEED);
178 } 183 }
179 184
180 185
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 buffer_ = Vector<byte>::New(old_buffer.length() * 2); 439 buffer_ = Vector<byte>::New(old_buffer.length() * 2);
435 own_buffer_ = true; 440 own_buffer_ = true;
436 memcpy(buffer_.start(), old_buffer.start(), old_buffer.length()); 441 memcpy(buffer_.start(), old_buffer.start(), old_buffer.length());
437 if (old_buffer_was_our_own) { 442 if (old_buffer_was_our_own) {
438 old_buffer.Dispose(); 443 old_buffer.Dispose();
439 } 444 }
440 } 445 }
441 446
442 447
443 } } // namespace v8::internal 448 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698