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

Side by Side Diff: src/builtins/builtins-math.cc

Issue 2407303002: [stubs] Renames WordIsSmi to TaggedIsSmi, introducing an appropriate bitcast of the parameter. (Closed)
Patch Set: Renamed TaggedValueIsSmi to TaggedIsSmi. Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « src/builtins/builtins-global.cc ('k') | src/builtins/builtins-number.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/builtins/builtins.h" 5 #include "src/builtins/builtins.h"
6 #include "src/builtins/builtins-utils.h" 6 #include "src/builtins/builtins-utils.h"
7 7
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 Label loop(assembler, &var_x); 126 Label loop(assembler, &var_x);
127 var_x.Bind(assembler->Parameter(1)); 127 var_x.Bind(assembler->Parameter(1));
128 assembler->Goto(&loop); 128 assembler->Goto(&loop);
129 assembler->Bind(&loop); 129 assembler->Bind(&loop);
130 { 130 {
131 // Load the current {x} value. 131 // Load the current {x} value.
132 Node* x = var_x.value(); 132 Node* x = var_x.value();
133 133
134 // Check if {x} is a Smi or a HeapObject. 134 // Check if {x} is a Smi or a HeapObject.
135 Label if_xissmi(assembler), if_xisnotsmi(assembler); 135 Label if_xissmi(assembler), if_xisnotsmi(assembler);
136 assembler->Branch(assembler->WordIsSmi(x), &if_xissmi, &if_xisnotsmi); 136 assembler->Branch(assembler->TaggedIsSmi(x), &if_xissmi, &if_xisnotsmi);
137 137
138 assembler->Bind(&if_xissmi); 138 assembler->Bind(&if_xissmi);
139 { 139 {
140 // Nothing to do when {x} is a Smi. 140 // Nothing to do when {x} is a Smi.
141 assembler->Return(x); 141 assembler->Return(x);
142 } 142 }
143 143
144 assembler->Bind(&if_xisnotsmi); 144 assembler->Bind(&if_xisnotsmi);
145 { 145 {
146 // Check if {x} is a HeapNumber. 146 // Check if {x} is a HeapNumber.
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 Label loop(assembler, &var_x); 207 Label loop(assembler, &var_x);
208 var_x.Bind(assembler->Parameter(1)); 208 var_x.Bind(assembler->Parameter(1));
209 assembler->Goto(&loop); 209 assembler->Goto(&loop);
210 assembler->Bind(&loop); 210 assembler->Bind(&loop);
211 { 211 {
212 // Load the current {x} value. 212 // Load the current {x} value.
213 Node* x = var_x.value(); 213 Node* x = var_x.value();
214 214
215 // Check if {x} is a Smi or a HeapObject. 215 // Check if {x} is a Smi or a HeapObject.
216 Label if_xissmi(assembler), if_xisnotsmi(assembler); 216 Label if_xissmi(assembler), if_xisnotsmi(assembler);
217 assembler->Branch(assembler->WordIsSmi(x), &if_xissmi, &if_xisnotsmi); 217 assembler->Branch(assembler->TaggedIsSmi(x), &if_xissmi, &if_xisnotsmi);
218 218
219 assembler->Bind(&if_xissmi); 219 assembler->Bind(&if_xissmi);
220 { 220 {
221 var_clz32_x.Bind(assembler->SmiToWord32(x)); 221 var_clz32_x.Bind(assembler->SmiToWord32(x));
222 assembler->Goto(&do_clz32); 222 assembler->Goto(&do_clz32);
223 } 223 }
224 224
225 assembler->Bind(&if_xisnotsmi); 225 assembler->Bind(&if_xisnotsmi);
226 { 226 {
227 // Check if {x} is a HeapNumber. 227 // Check if {x} is a HeapNumber.
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 void Builtins::Generate_MathMax(MacroAssembler* masm) { 592 void Builtins::Generate_MathMax(MacroAssembler* masm) {
593 Generate_MathMaxMin(masm, MathMaxMinKind::kMax); 593 Generate_MathMaxMin(masm, MathMaxMinKind::kMax);
594 } 594 }
595 595
596 void Builtins::Generate_MathMin(MacroAssembler* masm) { 596 void Builtins::Generate_MathMin(MacroAssembler* masm) {
597 Generate_MathMaxMin(masm, MathMaxMinKind::kMin); 597 Generate_MathMaxMin(masm, MathMaxMinKind::kMin);
598 } 598 }
599 599
600 } // namespace internal 600 } // namespace internal
601 } // namespace v8 601 } // namespace v8
OLDNEW
« no previous file with comments | « src/builtins/builtins-global.cc ('k') | src/builtins/builtins-number.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698