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

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

Issue 2700103002: [csa] SubString should enforce Stringness of first parameter. (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stub-assembler.cc
diff --git a/src/code-stub-assembler.cc b/src/code-stub-assembler.cc
index ade9cf5f661474d76a8950fc756e3ca8c5540644..53f3bb026aa4ec83ccb8b9f56f73231d3acc75a4 100644
--- a/src/code-stub-assembler.cc
+++ b/src/code-stub-assembler.cc
@@ -3292,17 +3292,13 @@ Node* CodeStubAssembler::SubString(Node* context, Node* string, Node* from,
Variable var_result(this, MachineRepresentation::kTagged); // String.
// Make sure first argument is a string.
-
- // Bailout if receiver is a Smi.
- GotoIf(TaggedIsSmi(string), &runtime);
+ CSA_ASSERT(this, TaggedIsNotSmi(string));
+ CSA_ASSERT(this, IsString(string));
// Load the instance type of the {string}.
Node* const instance_type = LoadInstanceType(string);
var_instance_type.Bind(instance_type);
- // Check if {string} is a String.
- GotoUnless(IsStringInstanceType(instance_type), &runtime);
-
// Make sure that both from and to are non-negative smis.
GotoUnless(TaggedIsPositiveSmi(from), &runtime);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698