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

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

Issue 2705193002: [string] Unpack external strings in String.prototype.indexOf (Closed)
Patch Set: Add private helpers for string instance types Created 3 years, 10 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/code-stub-assembler.h
diff --git a/src/code-stub-assembler.h b/src/code-stub-assembler.h
index c68ff947ff7eaf2393f02b80f0eee27a09280ced..16eeced8863ec4b347d821864f8421d3233689bd 100644
--- a/src/code-stub-assembler.h
+++ b/src/code-stub-assembler.h
@@ -728,6 +728,16 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
Node* StringAdd(Node* context, Node* first, Node* second,
AllocationFlags flags = kNone);
+ // Unpack the external string, returning a pointer that (offset-wise) looks
+ // like a sequential string.
+ // Note that this pointer is not tagged and does not point to a real
+ // sequential string instance, and may only be used to access the string
+ // data. The pointer is GC-safe as long as a reference to the container
+ // ExternalString is live.
+ // |string| must be an external string. Bailout for short external strings.
+ Node* TryDerefExternalString(Node* const string, Node* const instance_type,
+ Label* if_bailout);
+
// Check if |var_string| has an indirect (thin or flat cons) string type,
// and unpack it if so.
void MaybeDerefIndirectString(Variable* var_string, Node* instance_type,

Powered by Google App Engine
This is Rietveld 408576698