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 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 | 161 |
162 Label is_number(assembler); | 162 Label is_number(assembler); |
163 Label runtime(assembler); | 163 Label runtime(assembler); |
164 | 164 |
165 assembler->GotoIf(assembler->WordIsSmi(input), &is_number); | 165 assembler->GotoIf(assembler->WordIsSmi(input), &is_number); |
166 | 166 |
167 Node* input_map = assembler->LoadMap(input); | 167 Node* input_map = assembler->LoadMap(input); |
168 Node* input_instance_type = assembler->LoadMapInstanceType(input_map); | 168 Node* input_instance_type = assembler->LoadMapInstanceType(input_map); |
169 | 169 |
170 Label not_string(assembler); | 170 Label not_string(assembler); |
171 assembler->GotoIf( | 171 assembler->GotoUnless(assembler->IsStringInstanceType(input_instance_type), |
172 assembler->Int32GreaterThanOrEqual( | 172 ¬_string); |
173 input_instance_type, assembler->Int32Constant(FIRST_NONSTRING_TYPE)), | |
174 ¬_string); | |
175 assembler->Return(input); | 173 assembler->Return(input); |
176 | 174 |
177 Label not_heap_number(assembler); | 175 Label not_heap_number(assembler); |
178 | 176 |
179 assembler->Bind(¬_string); | 177 assembler->Bind(¬_string); |
180 { | 178 { |
181 assembler->GotoUnless( | 179 assembler->GotoUnless( |
182 assembler->WordEqual(input_map, assembler->HeapNumberMapConstant()), | 180 assembler->WordEqual(input_map, assembler->HeapNumberMapConstant()), |
183 ¬_heap_number); | 181 ¬_heap_number); |
184 assembler->Goto(&is_number); | 182 assembler->Goto(&is_number); |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 | 314 |
317 assembler->Bind(&return_true); | 315 assembler->Bind(&return_true); |
318 assembler->Return(assembler->BooleanConstant(true)); | 316 assembler->Return(assembler->BooleanConstant(true)); |
319 | 317 |
320 assembler->Bind(&return_false); | 318 assembler->Bind(&return_false); |
321 assembler->Return(assembler->BooleanConstant(false)); | 319 assembler->Return(assembler->BooleanConstant(false)); |
322 } | 320 } |
323 | 321 |
324 } // namespace internal | 322 } // namespace internal |
325 } // namespace v8 | 323 } // namespace v8 |
OLD | NEW |