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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 | 177 |
178 Label not_string(&assembler); | 178 Label not_string(&assembler); |
179 assembler.GotoUnless(assembler.IsStringInstanceType(input_instance_type), | 179 assembler.GotoUnless(assembler.IsStringInstanceType(input_instance_type), |
180 ¬_string); | 180 ¬_string); |
181 assembler.Return(input); | 181 assembler.Return(input); |
182 | 182 |
183 Label not_heap_number(&assembler); | 183 Label not_heap_number(&assembler); |
184 | 184 |
185 assembler.Bind(¬_string); | 185 assembler.Bind(¬_string); |
186 { | 186 { |
187 assembler.GotoUnless( | 187 assembler.GotoUnless(assembler.IsHeapNumberMap(input_map), |
188 assembler.WordEqual(input_map, assembler.HeapNumberMapConstant()), | 188 ¬_heap_number); |
189 ¬_heap_number); | |
190 assembler.Goto(&is_number); | 189 assembler.Goto(&is_number); |
191 } | 190 } |
192 | 191 |
193 assembler.Bind(&is_number); | 192 assembler.Bind(&is_number); |
194 { assembler.Return(assembler.NumberToString(context, input)); } | 193 { assembler.Return(assembler.NumberToString(context, input)); } |
195 | 194 |
196 assembler.Bind(¬_heap_number); | 195 assembler.Bind(¬_heap_number); |
197 { | 196 { |
198 assembler.GotoIf( | 197 assembler.GotoIf( |
199 assembler.Word32NotEqual(input_instance_type, | 198 assembler.Word32NotEqual(input_instance_type, |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 CodeStubAssembler assembler(state); | 481 CodeStubAssembler assembler(state); |
483 | 482 |
484 Node* object = assembler.Parameter(Descriptor::kObject); | 483 Node* object = assembler.Parameter(Descriptor::kObject); |
485 Node* context = assembler.Parameter(Descriptor::kContext); | 484 Node* context = assembler.Parameter(Descriptor::kContext); |
486 | 485 |
487 assembler.Return(assembler.Typeof(object, context)); | 486 assembler.Return(assembler.Typeof(object, context)); |
488 } | 487 } |
489 | 488 |
490 } // namespace internal | 489 } // namespace internal |
491 } // namespace v8 | 490 } // namespace v8 |
OLD | NEW |