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

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

Issue 1868963002: [builtins] Migrate String.prototype.charCodeAt and String.prototype.charAt to TurboFan. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: src/compiler/code-stub-assembler.h
diff --git a/src/compiler/code-stub-assembler.h b/src/compiler/code-stub-assembler.h
index 7ad6fdfdbdf0218e9e0379e1ecafd509a30742d0..2523a8d1f107fe8c5d21aa0f4f8dbf4151a4969d 100644
--- a/src/compiler/code-stub-assembler.h
+++ b/src/compiler/code-stub-assembler.h
@@ -162,7 +162,10 @@ class CodeStubAssembler {
Node* ExternalConstant(ExternalReference address);
Node* Float64Constant(double value);
Node* BooleanMapConstant();
+ Node* EmptyStringConstant();
Node* HeapNumberMapConstant();
+ Node* NaNConstant();
+ Node* NoContextConstant();
Node* NullConstant();
Node* UndefinedConstant();
@@ -278,9 +281,11 @@ class CodeStubAssembler {
Node* SmiTag(Node* value);
// Untag a Smi value as a Word.
Node* SmiUntag(Node* value);
+ Node* SmiToWord(Node* value) { return SmiUntag(value); }
// Smi conversions.
Node* SmiToFloat64(Node* value);
+ Node* SmiFromWord32(Node* value);
Node* SmiToWord32(Node* value);
// Smi operations.
@@ -289,6 +294,7 @@ class CodeStubAssembler {
Node* SmiSub(Node* a, Node* b);
Node* SmiSubWithOverflow(Node* a, Node* b);
Node* SmiEqual(Node* a, Node* b);
+ Node* SmiAboveOrEqual(Node* a, Node* b);
Node* SmiLessThan(Node* a, Node* b);
Node* SmiLessThanOrEqual(Node* a, Node* b);
Node* SmiMin(Node* a, Node* b);
@@ -343,13 +349,19 @@ class CodeStubAssembler {
// Allocate an object of the given size.
Node* Allocate(int size, AllocationFlags flags = kNone);
+ Node* InnerAllocate(Node* previous, int offset);
// Allocate a HeapNumber without initializing its value.
Node* AllocateHeapNumber();
// Allocate a HeapNumber with a specific value.
Node* AllocateHeapNumberWithValue(Node* value);
- Node* InnerAllocate(Node* previous, int offset);
+ // Allocate a SeqOneByteString with the given length.
+ Node* AllocateSeqOneByteString(int length);
+ // Allocate a SeqTwoByteString with the given length.
+ Node* AllocateSeqTwoByteString(int length);
// Store an array element to a FixedArray.
+ Node* StoreFixedArrayElementInt32Index(Node* object, Node* index,
+ Node* value);
Node* StoreFixedArrayElementNoWriteBarrier(Node* object, Node* index,
Node* value);
// Load the Map of an HeapObject.
@@ -378,6 +390,17 @@ class CodeStubAssembler {
Node* TruncateTaggedToFloat64(Node* context, Node* value);
Node* TruncateTaggedToWord32(Node* context, Node* value);
+ // Type conversions.
+ // Throws a TypeError for {method_name} if {value} is not coercible to Object,
+ // or returns the {value} converted to a String otherwise.
+ Node* ToThisString(Node* context, Node* value, char const* method_name);
+
+ // String helpers.
+ // Load a character from a String (might flatten a ConsString).
+ Node* StringCharCodeAt(Node* string, Node* smi_index);
+ // Return the single character string with only {code}.
+ Node* StringFromCharCode(Node* code);
+
// Branching helpers.
// TODO(danno): Can we be more cleverish wrt. edge-split?
void BranchIf(Node* condition, Label* if_true, Label* if_false);

Powered by Google App Engine
This is Rietveld 408576698