| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-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 26 matching lines...) Expand all Loading... |
| 37 static Handle<Object> CreateRegExpLiteral(Handle<JSFunction> constructor, | 37 static Handle<Object> CreateRegExpLiteral(Handle<JSFunction> constructor, |
| 38 Handle<String> pattern, | 38 Handle<String> pattern, |
| 39 Handle<String> flags, | 39 Handle<String> flags, |
| 40 bool* has_pending_exception); | 40 bool* has_pending_exception); |
| 41 | 41 |
| 42 // Returns a string representation of a regular expression. | 42 // Returns a string representation of a regular expression. |
| 43 // Implements RegExp.prototype.toString, see ECMA-262 section 15.10.6.4. | 43 // Implements RegExp.prototype.toString, see ECMA-262 section 15.10.6.4. |
| 44 // This function calls the garbage collector if necessary. | 44 // This function calls the garbage collector if necessary. |
| 45 static Handle<String> ToString(Handle<Object> value); | 45 static Handle<String> ToString(Handle<Object> value); |
| 46 | 46 |
| 47 static Handle<Object> Compile(Handle<JSRegExp> re, |
| 48 Handle<String> pattern, |
| 49 Handle<String> flags); |
| 50 |
| 51 // Implements RegExp.prototype.exec(string) function. |
| 52 // See ECMA-262 section 15.10.6.2. |
| 53 // This function calls the garbage collector if necessary. |
| 54 static Handle<Object> Exec(Handle<JSRegExp> regexp, |
| 55 Handle<String> subject, |
| 56 Handle<Object> index); |
| 57 |
| 58 // Call RegExp.prototyp.exec(string) in a loop. |
| 59 // Used by String.prototype.match and String.prototype.replace. |
| 60 // This function calls the garbage collector if necessary. |
| 61 static Handle<Object> ExecGlobal(Handle<JSRegExp> regexp, |
| 62 Handle<String> subject); |
| 63 |
| 64 static Handle<Object> AtomCompile(Handle<JSRegExp> re, |
| 65 Handle<String> pattern); |
| 66 |
| 67 static Handle<Object> AtomExec(Handle<JSRegExp> regexp, |
| 68 Handle<String> subject, |
| 69 Handle<Object> index); |
| 70 |
| 71 static Handle<Object> AtomExecGlobal(Handle<JSRegExp> regexp, |
| 72 Handle<String> subject); |
| 73 |
| 47 static Handle<Object> JsreCompile(Handle<JSRegExp> re, | 74 static Handle<Object> JsreCompile(Handle<JSRegExp> re, |
| 48 Handle<String> pattern, | 75 Handle<String> pattern, |
| 49 Handle<String> flags); | 76 Handle<String> flags); |
| 50 | 77 |
| 51 // Implements RegExp.prototype.exec(string) function. | |
| 52 // See ECMA-262 section 15.10.6.2. | |
| 53 // This function calls the garbage collector if necessary. | |
| 54 static Handle<Object> JsreExec(Handle<JSRegExp> regexp, | 78 static Handle<Object> JsreExec(Handle<JSRegExp> regexp, |
| 55 Handle<String> subject, | 79 Handle<String> subject, |
| 56 Handle<Object> index); | 80 Handle<Object> index); |
| 57 | 81 |
| 58 // Call RegExp.prototyp.exec(string) in a loop. | |
| 59 // Used by String.prototype.match and String.prototype.replace. | |
| 60 // This function calls the garbage collector if necessary. | |
| 61 static Handle<Object> JsreExecGlobal(Handle<JSRegExp> regexp, | 82 static Handle<Object> JsreExecGlobal(Handle<JSRegExp> regexp, |
| 62 Handle<String> subject); | 83 Handle<String> subject); |
| 63 | 84 |
| 64 static void NewSpaceCollectionPrologue(); | 85 static void NewSpaceCollectionPrologue(); |
| 65 static void OldSpaceCollectionPrologue(); | 86 static void OldSpaceCollectionPrologue(); |
| 66 | 87 |
| 67 private: | 88 private: |
| 68 // Converts a source string to a 16 bit flat string. The string | 89 // Converts a source string to a 16 bit flat string. The string |
| 69 // will be either sequential or it will be a SlicedString backed | 90 // will be either sequential or it will be a SlicedString backed |
| 70 // by a flat string. | 91 // by a flat string. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 99 static char* utf8_subject_cache_; | 120 static char* utf8_subject_cache_; |
| 100 static int utf8_length_cache_; | 121 static int utf8_length_cache_; |
| 101 static int utf8_position_; | 122 static int utf8_position_; |
| 102 static int character_position_; | 123 static int character_position_; |
| 103 }; | 124 }; |
| 104 | 125 |
| 105 | 126 |
| 106 } } // namespace v8::internal | 127 } } // namespace v8::internal |
| 107 | 128 |
| 108 #endif // V8_JSREGEXP_H_ | 129 #endif // V8_JSREGEXP_H_ |
| OLD | NEW |