 Chromium Code Reviews
 Chromium Code Reviews Issue 247013002:
  Replaced empty handle checks with MaybeHandles  (Closed) 
  Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
    
  
    Issue 247013002:
  Replaced empty handle checks with MaybeHandles  (Closed) 
  Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge| Index: src/jsregexp.cc | 
| diff --git a/src/jsregexp.cc b/src/jsregexp.cc | 
| index 5fa6cf49d7750689ece45a1dcf67aa36604e7ac9..313de538350cc9078d4f98595f61acb0c2c20207 100644 | 
| --- a/src/jsregexp.cc | 
| +++ b/src/jsregexp.cc | 
| @@ -236,23 +236,19 @@ MaybeHandle<Object> RegExpImpl::Compile(Handle<JSRegExp> re, | 
| } | 
| -Handle<Object> RegExpImpl::Exec(Handle<JSRegExp> regexp, | 
| - Handle<String> subject, | 
| - int index, | 
| - Handle<JSArray> last_match_info) { | 
| +MaybeHandle<Object> RegExpImpl::Exec(Handle<JSRegExp> regexp, | 
| + Handle<String> subject, | 
| + int index, | 
| + Handle<JSArray> last_match_info) { | 
| switch (regexp->TypeTag()) { | 
| case JSRegExp::ATOM: | 
| return AtomExec(regexp, subject, index, last_match_info); | 
| case JSRegExp::IRREGEXP: { | 
| - Handle<Object> result = | 
| - IrregexpExec(regexp, subject, index, last_match_info); | 
| - ASSERT(!result.is_null() || | 
| - regexp->GetIsolate()->has_pending_exception()); | 
| - return result; | 
| + return IrregexpExec(regexp, subject, index, last_match_info); | 
| } | 
| default: | 
| UNREACHABLE(); | 
| - return Handle<Object>::null(); | 
| + return MaybeHandle<Object>(); | 
| } | 
| } | 
| @@ -348,6 +344,7 @@ Handle<Object> RegExpImpl::AtomExec(Handle<JSRegExp> re, | 
| Handle<String> subject, | 
| int index, | 
| Handle<JSArray> last_match_info) { | 
| + ASSERT(!last_match_info.is_null()); | 
| 
Yang
2014/04/22 09:27:20
Kind of wonder why you have this. (Or at least, wh
 
mvstanton
2014/04/22 09:30:19
Indeed, it's unnecessary, thx!
 | 
| Isolate* isolate = re->GetIsolate(); | 
| static const int kNumRegisters = 2; | 
| @@ -641,10 +638,10 @@ int RegExpImpl::IrregexpExecRaw(Handle<JSRegExp> regexp, | 
| } | 
| -Handle<Object> RegExpImpl::IrregexpExec(Handle<JSRegExp> regexp, | 
| - Handle<String> subject, | 
| - int previous_index, | 
| - Handle<JSArray> last_match_info) { | 
| +MaybeHandle<Object> RegExpImpl::IrregexpExec(Handle<JSRegExp> regexp, | 
| + Handle<String> subject, | 
| + int previous_index, | 
| + Handle<JSArray> last_match_info) { | 
| Isolate* isolate = regexp->GetIsolate(); | 
| ASSERT_EQ(regexp->TypeTag(), JSRegExp::IRREGEXP); | 
| @@ -660,7 +657,7 @@ Handle<Object> RegExpImpl::IrregexpExec(Handle<JSRegExp> regexp, | 
| if (required_registers < 0) { | 
| // Compiling failed with an exception. | 
| ASSERT(isolate->has_pending_exception()); | 
| - return Handle<Object>::null(); | 
| + return MaybeHandle<Object>(); | 
| } | 
| int32_t* output_registers = NULL; | 
| @@ -682,7 +679,7 @@ Handle<Object> RegExpImpl::IrregexpExec(Handle<JSRegExp> regexp, | 
| } | 
| if (res == RE_EXCEPTION) { | 
| ASSERT(isolate->has_pending_exception()); | 
| - return Handle<Object>::null(); | 
| + return MaybeHandle<Object>(); | 
| } | 
| ASSERT(res == RE_FAILURE); | 
| return isolate->factory()->null_value(); |