| 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 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |