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/builtins/builtins-math.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-math.cc
diff --git a/src/builtins/builtins-math.cc b/src/builtins/builtins-math.cc
index 3cf0d90d30cd6a3347266164ade849329f0fafc5..82c489476841ed70440a68c73b7d72b7984f1f3d 100644
--- a/src/builtins/builtins-math.cc
+++ b/src/builtins/builtins-math.cc
@@ -81,8 +81,7 @@ void Builtins::Generate_MathAbs(compiler::CodeAssemblerState* state) {
// Check if {x} is a HeapNumber.
Label if_xisheapnumber(&assembler),
if_xisnotheapnumber(&assembler, Label::kDeferred);
- assembler.Branch(assembler.WordEqual(assembler.LoadMap(x),
- assembler.HeapNumberMapConstant()),
+ assembler.Branch(assembler.IsHeapNumberMap(assembler.LoadMap(x)),
&if_xisheapnumber, &if_xisnotheapnumber);
assembler.Bind(&if_xisheapnumber);
@@ -140,10 +139,8 @@ void Generate_MathRoundingOperation(
// Check if {x} is a HeapNumber.
Label if_xisheapnumber(assembler),
if_xisnotheapnumber(assembler, Label::kDeferred);
- assembler->Branch(
- assembler->WordEqual(assembler->LoadMap(x),
- assembler->HeapNumberMapConstant()),
- &if_xisheapnumber, &if_xisnotheapnumber);
+ assembler->Branch(assembler->IsHeapNumberMap(assembler->LoadMap(x)),
+ &if_xisheapnumber, &if_xisnotheapnumber);
assembler->Bind(&if_xisheapnumber);
{
@@ -281,8 +278,7 @@ void Builtins::Generate_MathClz32(compiler::CodeAssemblerState* state) {
// Check if {x} is a HeapNumber.
Label if_xisheapnumber(&assembler),
if_xisnotheapnumber(&assembler, Label::kDeferred);
- assembler.Branch(assembler.WordEqual(assembler.LoadMap(x),
- assembler.HeapNumberMapConstant()),
+ assembler.Branch(assembler.IsHeapNumberMap(assembler.LoadMap(x)),
&if_xisheapnumber, &if_xisnotheapnumber);
assembler.Bind(&if_xisheapnumber);

Powered by Google App Engine
This is Rietveld 408576698