Chromium Code Reviews

Side by Side Diff: src/builtins/builtins-regexp.cc

Issue 2415993003: Remove RETURN_RESULT macro (Closed)
Patch Set: Remove RETURN_RESULT macro Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « no previous file | src/isolate.h » ('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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/builtins/builtins-utils.h" 5 #include "src/builtins/builtins-utils.h"
6 #include "src/builtins/builtins.h" 6 #include "src/builtins/builtins.h"
7 7
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/regexp/jsregexp.h" 9 #include "src/regexp/jsregexp.h"
10 #include "src/regexp/regexp-utils.h" 10 #include "src/regexp/regexp-utils.h"
(...skipping 42 matching lines...)
53 53
54 Handle<String> flags_string; 54 Handle<String> flags_string;
55 if (flags->IsUndefined(isolate)) { 55 if (flags->IsUndefined(isolate)) {
56 flags_string = isolate->factory()->empty_string(); 56 flags_string = isolate->factory()->empty_string();
57 } else { 57 } else {
58 ASSIGN_RETURN_ON_EXCEPTION(isolate, flags_string, 58 ASSIGN_RETURN_ON_EXCEPTION(isolate, flags_string,
59 Object::ToString(isolate, flags), JSRegExp); 59 Object::ToString(isolate, flags), JSRegExp);
60 } 60 }
61 61
62 // TODO(jgruber): We could avoid the flags back and forth conversions. 62 // TODO(jgruber): We could avoid the flags back and forth conversions.
63 RETURN_RESULT(isolate, 63 return JSRegExp::Initialize(regexp, pattern_string, flags_string);
64 JSRegExp::Initialize(regexp, pattern_string, flags_string),
65 JSRegExp);
66 } 64 }
67 65
68 } // namespace 66 } // namespace
69 67
70 // ES#sec-regexp-pattern-flags 68 // ES#sec-regexp-pattern-flags
71 // RegExp ( pattern, flags ) 69 // RegExp ( pattern, flags )
72 BUILTIN(RegExpConstructor) { 70 BUILTIN(RegExpConstructor) {
73 HandleScope scope(isolate); 71 HandleScope scope(isolate);
74 72
75 Handle<HeapObject> new_target = args.new_target(); 73 Handle<HeapObject> new_target = args.new_target();
(...skipping 1632 matching lines...)
1708 { 1706 {
1709 Node* const match_elements = a->LoadElements(match_indices); 1707 Node* const match_elements = a->LoadElements(match_indices);
1710 Node* result = ConstructNewResultFromMatchInfo(isolate, a, context, 1708 Node* result = ConstructNewResultFromMatchInfo(isolate, a, context,
1711 match_elements, string); 1709 match_elements, string);
1712 a->Return(result); 1710 a->Return(result);
1713 } 1711 }
1714 } 1712 }
1715 1713
1716 } // namespace internal 1714 } // namespace internal
1717 } // namespace v8 1715 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine