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

Unified Diff: src/code-stub-assembler.h

Issue 2398423002: [regexp] Port RegExp.prototype[@@replace] (Closed)
Patch Set: Smi::kZero Created 4 years, 2 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 | « src/builtins/builtins-regexp.cc ('k') | src/code-stub-assembler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stub-assembler.h
diff --git a/src/code-stub-assembler.h b/src/code-stub-assembler.h
index e008a07a7452e7a00bc74008ccf9783d61178278..b5642d4badeaf3c73174e7788f1d37c2088c9108 100644
--- a/src/code-stub-assembler.h
+++ b/src/code-stub-assembler.h
@@ -360,6 +360,19 @@ class CodeStubAssembler : public compiler::CodeAssembler {
compiler::Node* parent,
compiler::Node* offset);
+ // Allocate a one-byte ConsString with the given length, first and second
+ // parts. |length| is expected to be tagged, and |first| and |second| are
+ // expected to be one-byte strings.
+ compiler::Node* AllocateOneByteConsString(compiler::Node* length,
+ compiler::Node* first,
+ compiler::Node* second);
+ // Allocate a two-byte ConsString with the given length, first and second
+ // parts. |length| is expected to be tagged, and |first| and |second| are
+ // expected to be two-byte strings.
+ compiler::Node* AllocateTwoByteConsString(compiler::Node* length,
+ compiler::Node* first,
+ compiler::Node* second);
+
// Allocate a RegExpResult with the given length (the number of captures,
// including the match itself), index (the index where the match starts),
// and input string. |length| and |index| are expected to be tagged, and
@@ -420,12 +433,16 @@ class CodeStubAssembler : public compiler::CodeAssembler {
ParameterMode mode = INTEGER_PARAMETERS);
// Copies |character_count| elements from |from_string| to |to_string|
- // starting at the |from_index|'th character. |from_index| and
- // |character_count| must be Smis s.t.
- // 0 <= |from_index| <= |from_index| + |character_count| < from_string.length.
+ // starting at the |from_index|'th character. |from_string| and |to_string|
+ // must be either both one-byte strings or both two-byte strings.
+ // |from_index|, |to_index| and |character_count| must be Smis s.t.
+ // 0 <= |from_index| <= |from_index| + |character_count| <= from_string.length
+ // and
+ // 0 <= |to_index| <= |to_index| + |character_count| <= to_string.length.
void CopyStringCharacters(compiler::Node* from_string,
compiler::Node* to_string,
compiler::Node* from_index,
+ compiler::Node* to_index,
compiler::Node* character_count,
String::Encoding encoding);
@@ -516,6 +533,19 @@ class CodeStubAssembler : public compiler::CodeAssembler {
compiler::Node* SubString(compiler::Node* context, compiler::Node* string,
compiler::Node* from, compiler::Node* to);
+ // Return a new string object produced by concatenating |first| with |second|.
+ compiler::Node* StringConcat(compiler::Node* context, compiler::Node* first,
+ compiler::Node* second);
+
+ // Return the first index >= {from} at which {needle_char} was found in
+ // {string}, or -1 if such an index does not exist. The returned value is
+ // a Smi, {string} is expected to be a String, {needle_char} is an intptr,
+ // and {from} is expected to be tagged.
+ compiler::Node* StringIndexOfChar(compiler::Node* context,
+ compiler::Node* string,
+ compiler::Node* needle_char,
+ compiler::Node* from);
+
compiler::Node* StringFromCodePoint(compiler::Node* codepoint,
UnicodeEncoding encoding);
« no previous file with comments | « src/builtins/builtins-regexp.cc ('k') | src/code-stub-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698