Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(654)

Unified Diff: src/builtins/builtins-regexp.cc

Issue 2657533003: [stubs] Add initializing constructor to CSA::Variable (Closed)
Patch Set: Address comments Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/code-stub-assembler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/builtins-regexp.cc
diff --git a/src/builtins/builtins-regexp.cc b/src/builtins/builtins-regexp.cc
index 2191268441c92687715ff86cbfecd9774b770ebc..eba57aa0168a92b9a223ef4ec60b5d9c43a78bb1 100644
--- a/src/builtins/builtins-regexp.cc
+++ b/src/builtins/builtins-regexp.cc
@@ -170,11 +170,11 @@ Node* RegExpBuiltinsAssembler::ConstructNewResultFromMatchInfo(Node* context,
Node* const limit = IntPtrAdd(
IntPtrConstant(RegExpMatchInfo::kFirstCaptureIndex), num_indices);
- Variable var_from_cursor(this, MachineType::PointerRepresentation());
- Variable var_to_cursor(this, MachineType::PointerRepresentation());
-
- var_from_cursor.Bind(IntPtrConstant(RegExpMatchInfo::kFirstCaptureIndex + 2));
- var_to_cursor.Bind(IntPtrConstant(1));
+ Variable var_from_cursor(
+ this, MachineType::PointerRepresentation(),
+ IntPtrConstant(RegExpMatchInfo::kFirstCaptureIndex + 2));
+ Variable var_to_cursor(this, MachineType::PointerRepresentation(),
+ IntPtrConstant(1));
Variable* vars[] = {&var_from_cursor, &var_to_cursor};
Label loop(this, 2, vars);
@@ -492,14 +492,12 @@ Node* RegExpBuiltinsAssembler::FlagsGetter(Node* const context,
Node* const int_zero = IntPtrConstant(0);
Node* const int_one = IntPtrConstant(1);
- Variable var_length(this, MachineType::PointerRepresentation());
+ Variable var_length(this, MachineType::PointerRepresentation(), int_zero);
Variable var_flags(this, MachineType::PointerRepresentation());
// First, count the number of characters we will need and check which flags
// are set.
- var_length.Bind(int_zero);
-
if (is_fastpath) {
// Refer to JSRegExp's flag property on the fast-path.
Node* const flags_smi = LoadObjectField(regexp, JSRegExp::kFlagsOffset);
@@ -559,8 +557,8 @@ Node* RegExpBuiltinsAssembler::FlagsGetter(Node* const context,
Node* const result = AllocateSeqOneByteString(context, var_length.value());
Node* const flags_intptr = var_flags.value();
- Variable var_offset(this, MachineType::PointerRepresentation());
- var_offset.Bind(
+ Variable var_offset(
+ this, MachineType::PointerRepresentation(),
IntPtrConstant(SeqOneByteString::kHeaderSize - kHeapObjectTag));
#define CASE_FOR_FLAG(FLAG, CHAR) \
@@ -591,8 +589,7 @@ Node* RegExpBuiltinsAssembler::IsRegExp(Node* const context,
Node* const maybe_receiver) {
Label out(this), if_isregexp(this);
- Variable var_result(this, MachineRepresentation::kWord32);
- var_result.Bind(Int32Constant(0));
+ Variable var_result(this, MachineRepresentation::kWord32, Int32Constant(0));
GotoIf(TaggedIsSmi(maybe_receiver), &out);
GotoUnless(IsJSReceiver(maybe_receiver), &out);
@@ -676,13 +673,9 @@ TF_BUILTIN(RegExpConstructor, RegExpBuiltinsAssembler) {
Isolate* isolate = this->isolate();
- Variable var_flags(this, MachineRepresentation::kTagged);
- Variable var_pattern(this, MachineRepresentation::kTagged);
- Variable var_new_target(this, MachineRepresentation::kTagged);
-
- var_flags.Bind(flags);
- var_pattern.Bind(pattern);
- var_new_target.Bind(new_target);
+ Variable var_flags(this, MachineRepresentation::kTagged, flags);
+ Variable var_pattern(this, MachineRepresentation::kTagged, pattern);
+ Variable var_new_target(this, MachineRepresentation::kTagged, new_target);
Node* const native_context = LoadNativeContext(context);
Node* const regexp_function =
@@ -814,11 +807,8 @@ TF_BUILTIN(RegExpPrototypeCompile, RegExpBuiltinsAssembler) {
"RegExp.prototype.compile");
Node* const receiver = maybe_receiver;
- Variable var_flags(this, MachineRepresentation::kTagged);
- Variable var_pattern(this, MachineRepresentation::kTagged);
-
- var_flags.Bind(maybe_flags);
- var_pattern.Bind(maybe_pattern);
+ Variable var_flags(this, MachineRepresentation::kTagged, maybe_flags);
+ Variable var_pattern(this, MachineRepresentation::kTagged, maybe_pattern);
// Handle a JSRegExp pattern.
{
@@ -1306,11 +1296,9 @@ TF_BUILTIN(RegExpPrototypeTest, RegExpBuiltinsAssembler) {
Node* RegExpBuiltinsAssembler::AdvanceStringIndex(Node* const string,
Node* const index,
Node* const is_unicode) {
- Variable var_result(this, MachineRepresentation::kTagged);
-
// Default to last_index + 1.
Node* const index_plus_one = SmiAdd(index, SmiConstant(1));
- var_result.Bind(index_plus_one);
+ Variable var_result(this, MachineRepresentation::kTagged, index_plus_one);
Label if_isunicode(this), out(this);
Branch(is_unicode, &if_isunicode, &out);
« no previous file with comments | « no previous file | src/code-stub-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698