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

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

Issue 6997015: Limit the generation of regexp code with large inlined constants. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « src/mips/regexp-macro-assembler-mips.cc ('k') | src/regexp-macro-assembler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 } 123 }
124 // Check whether a standard/default character class matches the current 124 // Check whether a standard/default character class matches the current
125 // character. Returns false if the type of special character class does 125 // character. Returns false if the type of special character class does
126 // not have custom support. 126 // not have custom support.
127 // May clobber the current loaded character. 127 // May clobber the current loaded character.
128 virtual bool CheckSpecialCharacterClass(uc16 type, 128 virtual bool CheckSpecialCharacterClass(uc16 type,
129 Label* on_no_match) { 129 Label* on_no_match) {
130 return false; 130 return false;
131 } 131 }
132 virtual void Fail() = 0; 132 virtual void Fail() = 0;
133 virtual Handle<Object> GetCode(Handle<String> source) = 0; 133 virtual Handle<HeapObject> GetCode(Handle<String> source) = 0;
134 virtual void GoTo(Label* label) = 0; 134 virtual void GoTo(Label* label) = 0;
135 // Check whether a register is >= a given constant and go to a label if it 135 // Check whether a register is >= a given constant and go to a label if it
136 // is. Backtracks instead if the label is NULL. 136 // is. Backtracks instead if the label is NULL.
137 virtual void IfRegisterGE(int reg, int comparand, Label* if_ge) = 0; 137 virtual void IfRegisterGE(int reg, int comparand, Label* if_ge) = 0;
138 // Check whether a register is < a given constant and go to a label if it is. 138 // Check whether a register is < a given constant and go to a label if it is.
139 // Backtracks instead if the label is NULL. 139 // Backtracks instead if the label is NULL.
140 virtual void IfRegisterLT(int reg, int comparand, Label* if_lt) = 0; 140 virtual void IfRegisterLT(int reg, int comparand, Label* if_lt) = 0;
141 // Check whether a register is == to the current position and go to a 141 // Check whether a register is == to the current position and go to a
142 // label if it is. 142 // label if it is.
143 virtual void IfRegisterEqPos(int reg, Label* if_eq) = 0; 143 virtual void IfRegisterEqPos(int reg, Label* if_eq) = 0;
(...skipping 11 matching lines...) Expand all
155 virtual void PushRegister(int register_index, 155 virtual void PushRegister(int register_index,
156 StackCheckFlag check_stack_limit) = 0; 156 StackCheckFlag check_stack_limit) = 0;
157 virtual void ReadCurrentPositionFromRegister(int reg) = 0; 157 virtual void ReadCurrentPositionFromRegister(int reg) = 0;
158 virtual void ReadStackPointerFromRegister(int reg) = 0; 158 virtual void ReadStackPointerFromRegister(int reg) = 0;
159 virtual void SetCurrentPositionFromEnd(int by) = 0; 159 virtual void SetCurrentPositionFromEnd(int by) = 0;
160 virtual void SetRegister(int register_index, int to) = 0; 160 virtual void SetRegister(int register_index, int to) = 0;
161 virtual void Succeed() = 0; 161 virtual void Succeed() = 0;
162 virtual void WriteCurrentPositionToRegister(int reg, int cp_offset) = 0; 162 virtual void WriteCurrentPositionToRegister(int reg, int cp_offset) = 0;
163 virtual void ClearRegisters(int reg_from, int reg_to) = 0; 163 virtual void ClearRegisters(int reg_from, int reg_to) = 0;
164 virtual void WriteStackPointerToRegister(int reg) = 0; 164 virtual void WriteStackPointerToRegister(int reg) = 0;
165
166 // Controls the generation of large inlined constants in the code.
167 void set_slow_safe(bool ssc) { slow_safe_compiler_ = ssc; }
168 bool slow_safe() { return slow_safe_compiler_; }
169
170 private:
171 bool slow_safe_compiler_;
165 }; 172 };
166 173
167 174
168 #ifndef V8_INTERPRETED_REGEXP // Avoid compiling unused code. 175 #ifndef V8_INTERPRETED_REGEXP // Avoid compiling unused code.
169 176
170 class NativeRegExpMacroAssembler: public RegExpMacroAssembler { 177 class NativeRegExpMacroAssembler: public RegExpMacroAssembler {
171 public: 178 public:
172 // Type of input string to generate code for. 179 // Type of input string to generate code for.
173 enum Mode { ASCII = 1, UC16 = 2 }; 180 enum Mode { ASCII = 1, UC16 = 2 };
174 181
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 const byte* input_end, 234 const byte* input_end,
228 int* output, 235 int* output,
229 Isolate* isolate); 236 Isolate* isolate);
230 }; 237 };
231 238
232 #endif // V8_INTERPRETED_REGEXP 239 #endif // V8_INTERPRETED_REGEXP
233 240
234 } } // namespace v8::internal 241 } } // namespace v8::internal
235 242
236 #endif // V8_REGEXP_MACRO_ASSEMBLER_H_ 243 #endif // V8_REGEXP_MACRO_ASSEMBLER_H_
OLDNEW
« no previous file with comments | « src/mips/regexp-macro-assembler-mips.cc ('k') | src/regexp-macro-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698