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

Side by Side Diff: src/ia32/regexp-macro-assembler-ia32.h

Issue 173567: ARM native regexps. (Closed)
Patch Set: Created 11 years, 3 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-2009 the V8 project authors. All rights reserved. 1 // Copyright 2008-2009 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 virtual void PushRegister(int register_index, 100 virtual void PushRegister(int register_index,
101 StackCheckFlag check_stack_limit); 101 StackCheckFlag check_stack_limit);
102 virtual void ReadCurrentPositionFromRegister(int reg); 102 virtual void ReadCurrentPositionFromRegister(int reg);
103 virtual void ReadStackPointerFromRegister(int reg); 103 virtual void ReadStackPointerFromRegister(int reg);
104 virtual void SetRegister(int register_index, int to); 104 virtual void SetRegister(int register_index, int to);
105 virtual void Succeed(); 105 virtual void Succeed();
106 virtual void WriteCurrentPositionToRegister(int reg, int cp_offset); 106 virtual void WriteCurrentPositionToRegister(int reg, int cp_offset);
107 virtual void ClearRegisters(int reg_from, int reg_to); 107 virtual void ClearRegisters(int reg_from, int reg_to);
108 virtual void WriteStackPointerToRegister(int reg); 108 virtual void WriteStackPointerToRegister(int reg);
109 109
110 // Called from RegExp if the stack-guard is triggered.
111 // If the code object is relocated, the return address is fixed before
112 // returning.
113 static int CheckStackGuardState(Address* return_address,
114 Code* re_code,
115 Address re_frame);
116
110 private: 117 private:
111 // Offsets from ebp of function parameters and stored registers. 118 // Offsets from ebp of function parameters and stored registers.
112 static const int kFramePointer = 0; 119 static const int kFramePointer = 0;
113 // Above the frame pointer - function parameters and return address. 120 // Above the frame pointer - function parameters and return address.
114 static const int kReturn_eip = kFramePointer + kPointerSize; 121 static const int kReturn_eip = kFramePointer + kPointerSize;
115 static const int kFrameAlign = kReturn_eip + kPointerSize; 122 static const int kFrameAlign = kReturn_eip + kPointerSize;
116 // Parameters. 123 // Parameters.
117 static const int kInputString = kFrameAlign; 124 static const int kInputString = kFrameAlign;
118 static const int kStartIndex = kInputString + kPointerSize; 125 static const int kStartIndex = kInputString + kPointerSize;
119 static const int kInputStart = kStartIndex + kPointerSize; 126 static const int kInputStart = kStartIndex + kPointerSize;
(...skipping 17 matching lines...) Expand all
137 // Load a number of characters at the given offset from the 144 // Load a number of characters at the given offset from the
138 // current position, into the current-character register. 145 // current position, into the current-character register.
139 void LoadCurrentCharacterUnchecked(int cp_offset, int character_count); 146 void LoadCurrentCharacterUnchecked(int cp_offset, int character_count);
140 147
141 // Check whether preemption has been requested. 148 // Check whether preemption has been requested.
142 void CheckPreemption(); 149 void CheckPreemption();
143 150
144 // Check whether we are exceeding the stack limit on the backtrack stack. 151 // Check whether we are exceeding the stack limit on the backtrack stack.
145 void CheckStackLimit(); 152 void CheckStackLimit();
146 153
147 // Called from RegExp if the stack-guard is triggered.
148 // If the code object is relocated, the return address is fixed before
149 // returning.
150 static int CheckStackGuardState(Address* return_address,
151 Code* re_code,
152 Address re_frame);
153
154 // Generate a call to CheckStackGuardState. 154 // Generate a call to CheckStackGuardState.
155 void CallCheckStackGuardState(Register scratch); 155 void CallCheckStackGuardState(Register scratch);
156 156
157 // Called from RegExp if the backtrack stack limit is hit.
158 // Tries to expand the stack. Returns the new stack-pointer if
159 // successful, and updates the stack_top address, or returns 0 if unable
160 // to grow the stack.
161 // This function must not trigger a garbage collection.
162 static Address GrowStack(Address stack_pointer, Address* stack_top);
163
164 // The ebp-relative location of a regexp register. 157 // The ebp-relative location of a regexp register.
165 Operand register_location(int register_index); 158 Operand register_location(int register_index);
166 159
167 // The register containing the current character after LoadCurrentCharacter. 160 // The register containing the current character after LoadCurrentCharacter.
168 inline Register current_character() { return edx; } 161 inline Register current_character() { return edx; }
169 162
170 // The register containing the backtrack stack top. Provides a meaningful 163 // The register containing the backtrack stack top. Provides a meaningful
171 // name to the register. 164 // name to the register.
172 inline Register backtrack_stackpointer() { return ecx; } 165 inline Register backtrack_stackpointer() { return ecx; }
173 166
(...skipping 28 matching lines...) Expand all
202 // Some compilers/platforms require the stack to be aligned when calling 195 // Some compilers/platforms require the stack to be aligned when calling
203 // C++ code. 196 // C++ code.
204 // Needs a scratch register to do some arithmetic. This register will be 197 // Needs a scratch register to do some arithmetic. This register will be
205 // trashed. 198 // trashed.
206 inline void FrameAlign(int num_arguments, Register scratch); 199 inline void FrameAlign(int num_arguments, Register scratch);
207 200
208 // Calls a C function and cleans up the space for arguments allocated 201 // Calls a C function and cleans up the space for arguments allocated
209 // by FrameAlign. The called function is not allowed to trigger a garbage 202 // by FrameAlign. The called function is not allowed to trigger a garbage
210 // collection, since that might move the code and invalidate the return 203 // collection, since that might move the code and invalidate the return
211 // address (unless this is somehow accounted for). 204 // address (unless this is somehow accounted for).
212 inline void CallCFunction(Address function_address, int num_arguments); 205 inline void CallCFunction(ExternalReference function, int num_arguments);
213 206
214 MacroAssembler* masm_; 207 MacroAssembler* masm_;
215 208
216 // Which mode to generate code for (ASCII or UC16). 209 // Which mode to generate code for (ASCII or UC16).
217 Mode mode_; 210 Mode mode_;
218 211
219 // One greater than maximal register index actually used. 212 // One greater than maximal register index actually used.
220 int num_registers_; 213 int num_registers_;
221 214
222 // Number of registers to output at the end (the saved registers 215 // Number of registers to output at the end (the saved registers
223 // are always 0..num_saved_registers_-1) 216 // are always 0..num_saved_registers_-1)
224 int num_saved_registers_; 217 int num_saved_registers_;
225 218
226 // Labels used internally. 219 // Labels used internally.
227 Label entry_label_; 220 Label entry_label_;
228 Label start_label_; 221 Label start_label_;
229 Label success_label_; 222 Label success_label_;
230 Label backtrack_label_; 223 Label backtrack_label_;
231 Label exit_label_; 224 Label exit_label_;
232 Label check_preempt_label_; 225 Label check_preempt_label_;
233 Label stack_overflow_label_; 226 Label stack_overflow_label_;
234 }; 227 };
235 #endif // V8_NATIVE_REGEXP 228 #endif // V8_NATIVE_REGEXP
236 229
237 }} // namespace v8::internal 230 }} // namespace v8::internal
238 231
239 #endif // V8_IA32_REGEXP_MACRO_ASSEMBLER_IA32_H_ 232 #endif // V8_IA32_REGEXP_MACRO_ASSEMBLER_IA32_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698