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/jsregexp.h

Issue 247013002: Replaced empty handle checks with MaybeHandles (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Removed unnecessary assert. Created 6 years, 8 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/isolate.h ('k') | src/jsregexp.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 // generic data and choice of implementation - as well as what 69 // generic data and choice of implementation - as well as what
70 // the implementation wants to store in the data field. 70 // the implementation wants to store in the data field.
71 // Returns false if compilation fails. 71 // Returns false if compilation fails.
72 MUST_USE_RESULT static MaybeHandle<Object> Compile( 72 MUST_USE_RESULT static MaybeHandle<Object> Compile(
73 Handle<JSRegExp> re, 73 Handle<JSRegExp> re,
74 Handle<String> pattern, 74 Handle<String> pattern,
75 Handle<String> flags); 75 Handle<String> flags);
76 76
77 // See ECMA-262 section 15.10.6.2. 77 // See ECMA-262 section 15.10.6.2.
78 // This function calls the garbage collector if necessary. 78 // This function calls the garbage collector if necessary.
79 static Handle<Object> Exec(Handle<JSRegExp> regexp, 79 MUST_USE_RESULT static MaybeHandle<Object> Exec(
80 Handle<String> subject, 80 Handle<JSRegExp> regexp,
81 int index, 81 Handle<String> subject,
82 Handle<JSArray> lastMatchInfo); 82 int index,
83 Handle<JSArray> lastMatchInfo);
83 84
84 // Prepares a JSRegExp object with Irregexp-specific data. 85 // Prepares a JSRegExp object with Irregexp-specific data.
85 static void IrregexpInitialize(Handle<JSRegExp> re, 86 static void IrregexpInitialize(Handle<JSRegExp> re,
86 Handle<String> pattern, 87 Handle<String> pattern,
87 JSRegExp::Flags flags, 88 JSRegExp::Flags flags,
88 int capture_register_count); 89 int capture_register_count);
89 90
90 91
91 static void AtomCompile(Handle<JSRegExp> re, 92 static void AtomCompile(Handle<JSRegExp> re,
92 Handle<String> pattern, 93 Handle<String> pattern,
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 static int IrregexpExecRaw(Handle<JSRegExp> regexp, 128 static int IrregexpExecRaw(Handle<JSRegExp> regexp,
128 Handle<String> subject, 129 Handle<String> subject,
129 int index, 130 int index,
130 int32_t* output, 131 int32_t* output,
131 int output_size); 132 int output_size);
132 133
133 // Execute an Irregexp bytecode pattern. 134 // Execute an Irregexp bytecode pattern.
134 // On a successful match, the result is a JSArray containing 135 // On a successful match, the result is a JSArray containing
135 // captured positions. On a failure, the result is the null value. 136 // captured positions. On a failure, the result is the null value.
136 // Returns an empty handle in case of an exception. 137 // Returns an empty handle in case of an exception.
137 static Handle<Object> IrregexpExec(Handle<JSRegExp> regexp, 138 MUST_USE_RESULT static MaybeHandle<Object> IrregexpExec(
138 Handle<String> subject, 139 Handle<JSRegExp> regexp,
139 int index, 140 Handle<String> subject,
140 Handle<JSArray> lastMatchInfo); 141 int index,
142 Handle<JSArray> lastMatchInfo);
141 143
142 // Set last match info. If match is NULL, then setting captures is omitted. 144 // Set last match info. If match is NULL, then setting captures is omitted.
143 static Handle<JSArray> SetLastMatchInfo(Handle<JSArray> last_match_info, 145 static Handle<JSArray> SetLastMatchInfo(Handle<JSArray> last_match_info,
144 Handle<String> subject, 146 Handle<String> subject,
145 int capture_count, 147 int capture_count,
146 int32_t* match); 148 int32_t* match);
147 149
148 150
149 class GlobalCache { 151 class GlobalCache {
150 public: 152 public:
(...skipping 1486 matching lines...) Expand 10 before | Expand all | Expand 10 after
1637 Handle<String> sample_subject, 1639 Handle<String> sample_subject,
1638 bool is_ascii, Zone* zone); 1640 bool is_ascii, Zone* zone);
1639 1641
1640 static void DotPrint(const char* label, RegExpNode* node, bool ignore_case); 1642 static void DotPrint(const char* label, RegExpNode* node, bool ignore_case);
1641 }; 1643 };
1642 1644
1643 1645
1644 } } // namespace v8::internal 1646 } } // namespace v8::internal
1645 1647
1646 #endif // V8_JSREGEXP_H_ 1648 #endif // V8_JSREGEXP_H_
OLDNEW
« no previous file with comments | « src/isolate.h ('k') | src/jsregexp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698