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

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

Issue 2543873003: [stubs] Use CSA::IsHeapNumberMap() instead of manual map comparing. (Closed)
Patch Set: Created 4 years 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/builtins/builtins-string.cc
diff --git a/src/builtins/builtins-string.cc b/src/builtins/builtins-string.cc
index 7799b288e51842fbe773b0634ca077f524606b28..6aeab6b04f23c60c6560efe134bf2b1dabf13730 100644
--- a/src/builtins/builtins-string.cc
+++ b/src/builtins/builtins-string.cc
@@ -1031,8 +1031,7 @@ void Builtins::Generate_StringPrototypeSubstr(
// two cases according to the spec: if it is negative, "" is returned; if
// it is positive, then length is set to {string_length} - {start}.
- CSA_ASSERT(&a, a.WordEqual(a.LoadMap(var_length.value()),
- a.HeapNumberMapConstant()));
+ CSA_ASSERT(&a, a.IsHeapNumberMap(a.LoadMap(var_length.value())));
Label if_isnegative(&a), if_ispositive(&a);
Node* const float_zero = a.Float64Constant(0.);
@@ -1101,8 +1100,7 @@ compiler::Node* ToSmiBetweenZeroAnd(CodeStubAssembler* a,
a->Bind(&if_isnotsmi);
{
// {value} is a heap number - in this case, it is definitely out of bounds.
- CSA_ASSERT(a,
- a->WordEqual(a->LoadMap(value_int), a->HeapNumberMapConstant()));
+ CSA_ASSERT(a, a->IsHeapNumberMap(a->LoadMap(value_int)));
Node* const float_zero = a->Float64Constant(0.);
Node* const smi_zero = a->SmiConstant(Smi::kZero);

Powered by Google App Engine
This is Rietveld 408576698