OLD | NEW |
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 #include "src/compiler.h" | 9 #include "src/compiler.h" |
10 #include "src/uri.h" | 10 #include "src/uri.h" |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 Variable var_num(assembler, MachineRepresentation::kTagged); | 114 Variable var_num(assembler, MachineRepresentation::kTagged); |
115 Label loop(assembler, &var_num); | 115 Label loop(assembler, &var_num); |
116 var_num.Bind(assembler->Parameter(1)); | 116 var_num.Bind(assembler->Parameter(1)); |
117 assembler->Goto(&loop); | 117 assembler->Goto(&loop); |
118 assembler->Bind(&loop); | 118 assembler->Bind(&loop); |
119 { | 119 { |
120 // Load the current {num} value. | 120 // Load the current {num} value. |
121 Node* num = var_num.value(); | 121 Node* num = var_num.value(); |
122 | 122 |
123 // Check if {num} is a Smi or a HeapObject. | 123 // Check if {num} is a Smi or a HeapObject. |
124 assembler->GotoIf(assembler->WordIsSmi(num), &return_true); | 124 assembler->GotoIf(assembler->TaggedIsSmi(num), &return_true); |
125 | 125 |
126 // Check if {num} is a HeapNumber. | 126 // Check if {num} is a HeapNumber. |
127 Label if_numisheapnumber(assembler), | 127 Label if_numisheapnumber(assembler), |
128 if_numisnotheapnumber(assembler, Label::kDeferred); | 128 if_numisnotheapnumber(assembler, Label::kDeferred); |
129 assembler->Branch(assembler->WordEqual(assembler->LoadMap(num), | 129 assembler->Branch(assembler->WordEqual(assembler->LoadMap(num), |
130 assembler->HeapNumberMapConstant()), | 130 assembler->HeapNumberMapConstant()), |
131 &if_numisheapnumber, &if_numisnotheapnumber); | 131 &if_numisheapnumber, &if_numisnotheapnumber); |
132 | 132 |
133 assembler->Bind(&if_numisheapnumber); | 133 assembler->Bind(&if_numisheapnumber); |
134 { | 134 { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 Variable var_num(assembler, MachineRepresentation::kTagged); | 169 Variable var_num(assembler, MachineRepresentation::kTagged); |
170 Label loop(assembler, &var_num); | 170 Label loop(assembler, &var_num); |
171 var_num.Bind(assembler->Parameter(1)); | 171 var_num.Bind(assembler->Parameter(1)); |
172 assembler->Goto(&loop); | 172 assembler->Goto(&loop); |
173 assembler->Bind(&loop); | 173 assembler->Bind(&loop); |
174 { | 174 { |
175 // Load the current {num} value. | 175 // Load the current {num} value. |
176 Node* num = var_num.value(); | 176 Node* num = var_num.value(); |
177 | 177 |
178 // Check if {num} is a Smi or a HeapObject. | 178 // Check if {num} is a Smi or a HeapObject. |
179 assembler->GotoIf(assembler->WordIsSmi(num), &return_false); | 179 assembler->GotoIf(assembler->TaggedIsSmi(num), &return_false); |
180 | 180 |
181 // Check if {num} is a HeapNumber. | 181 // Check if {num} is a HeapNumber. |
182 Label if_numisheapnumber(assembler), | 182 Label if_numisheapnumber(assembler), |
183 if_numisnotheapnumber(assembler, Label::kDeferred); | 183 if_numisnotheapnumber(assembler, Label::kDeferred); |
184 assembler->Branch(assembler->WordEqual(assembler->LoadMap(num), | 184 assembler->Branch(assembler->WordEqual(assembler->LoadMap(num), |
185 assembler->HeapNumberMapConstant()), | 185 assembler->HeapNumberMapConstant()), |
186 &if_numisheapnumber, &if_numisnotheapnumber); | 186 &if_numisheapnumber, &if_numisnotheapnumber); |
187 | 187 |
188 assembler->Bind(&if_numisheapnumber); | 188 assembler->Bind(&if_numisheapnumber); |
189 { | 189 { |
(...skipping 13 matching lines...) Expand all Loading... |
203 | 203 |
204 assembler->Bind(&return_true); | 204 assembler->Bind(&return_true); |
205 assembler->Return(assembler->BooleanConstant(true)); | 205 assembler->Return(assembler->BooleanConstant(true)); |
206 | 206 |
207 assembler->Bind(&return_false); | 207 assembler->Bind(&return_false); |
208 assembler->Return(assembler->BooleanConstant(false)); | 208 assembler->Return(assembler->BooleanConstant(false)); |
209 } | 209 } |
210 | 210 |
211 } // namespace internal | 211 } // namespace internal |
212 } // namespace v8 | 212 } // namespace v8 |
OLD | NEW |