説明を見る。00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef V8_JSREGEXP_H_
00029 #define V8_JSREGEXP_H_
00030
00031 namespace v8 { namespace internal {
00032
00033 class RegExpImpl {
00034 public:
00035
00036
00037 static Handle<Object> CreateRegExpLiteral(Handle<JSFunction> constructor,
00038 Handle<String> pattern,
00039 Handle<String> flags,
00040 bool* has_pending_exception);
00041
00042
00043
00044
00045 static Handle<String> ToString(Handle<Object> value);
00046
00047 static Handle<Object> Compile(Handle<JSRegExp> re,
00048 Handle<String> pattern,
00049 Handle<String> flags);
00050
00051
00052
00053
00054 static Handle<Object> Exec(Handle<JSRegExp> regexp,
00055 Handle<String> subject,
00056 Handle<Object> index);
00057
00058
00059
00060
00061 static Handle<Object> ExecGlobal(Handle<JSRegExp> regexp,
00062 Handle<String> subject);
00063
00064 static Handle<Object> AtomCompile(Handle<JSRegExp> re,
00065 Handle<String> pattern,
00066 JSRegExp::Flags flags);
00067
00068 static Handle<Object> AtomExec(Handle<JSRegExp> regexp,
00069 Handle<String> subject,
00070 Handle<Object> index);
00071
00072 static Handle<Object> AtomExecGlobal(Handle<JSRegExp> regexp,
00073 Handle<String> subject);
00074
00075 static Handle<Object> JsreCompile(Handle<JSRegExp> re,
00076 Handle<String> pattern,
00077 JSRegExp::Flags flags);
00078
00079 static Handle<Object> JsreExec(Handle<JSRegExp> regexp,
00080 Handle<String> subject,
00081 Handle<Object> index);
00082
00083 static Handle<Object> JsreExecGlobal(Handle<JSRegExp> regexp,
00084 Handle<String> subject);
00085
00086 static void NewSpaceCollectionPrologue();
00087 static void OldSpaceCollectionPrologue();
00088
00089 private:
00090
00091
00092
00093 static Handle<String> StringToTwoByte(Handle<String> pattern);
00094 static Handle<String> CachedStringToTwoByte(Handle<String> pattern);
00095
00096 static String* last_ascii_string_;
00097 static String* two_byte_cached_string_;
00098
00099
00100 static int JsreCapture(Handle<JSRegExp> re);
00101 static ByteArray* JsreInternal(Handle<JSRegExp> re);
00102
00103
00104 static Handle<Object> JsreExecOnce(Handle<JSRegExp> regexp,
00105 int num_captures,
00106 Handle<String> subject,
00107 int previous_index,
00108 const uc16* utf8_subject,
00109 int* ovector,
00110 int ovector_length);
00111
00112
00113
00114 static void SetSubjectCache(String* subject, char* utf8_subject,
00115 int uft8_length, int character_position,
00116 int utf8_position);
00117
00118
00119
00120
00121 static char* utf8_subject_cache_;
00122 static int utf8_length_cache_;
00123 static int utf8_position_;
00124 static int character_position_;
00125 };
00126
00127
00128 } }
00129
00130 #endif // V8_JSREGEXP_H_