| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 2007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2018 __ bind(¬_string); | 2018 __ bind(¬_string); |
| 2019 } | 2019 } |
| 2020 | 2020 |
| 2021 if (expected & ToBooleanHint::kSymbol) { | 2021 if (expected & ToBooleanHint::kSymbol) { |
| 2022 // Symbol value -> true. | 2022 // Symbol value -> true. |
| 2023 const Register scratch = scratch1(); | 2023 const Register scratch = scratch1(); |
| 2024 __ lbu(scratch, FieldMemOperand(map, Map::kInstanceTypeOffset)); | 2024 __ lbu(scratch, FieldMemOperand(map, Map::kInstanceTypeOffset)); |
| 2025 __ Branch(instr->TrueLabel(chunk_), eq, scratch, Operand(SYMBOL_TYPE)); | 2025 __ Branch(instr->TrueLabel(chunk_), eq, scratch, Operand(SYMBOL_TYPE)); |
| 2026 } | 2026 } |
| 2027 | 2027 |
| 2028 if (expected & ToBooleanHint::kSimdValue) { |
| 2029 // SIMD value -> true. |
| 2030 const Register scratch = scratch1(); |
| 2031 __ lbu(scratch, FieldMemOperand(map, Map::kInstanceTypeOffset)); |
| 2032 __ Branch(instr->TrueLabel(chunk_), eq, scratch, |
| 2033 Operand(SIMD128_VALUE_TYPE)); |
| 2034 } |
| 2035 |
| 2028 if (expected & ToBooleanHint::kHeapNumber) { | 2036 if (expected & ToBooleanHint::kHeapNumber) { |
| 2029 // heap number -> false iff +0, -0, or NaN. | 2037 // heap number -> false iff +0, -0, or NaN. |
| 2030 DoubleRegister dbl_scratch = double_scratch0(); | 2038 DoubleRegister dbl_scratch = double_scratch0(); |
| 2031 Label not_heap_number; | 2039 Label not_heap_number; |
| 2032 __ LoadRoot(at, Heap::kHeapNumberMapRootIndex); | 2040 __ LoadRoot(at, Heap::kHeapNumberMapRootIndex); |
| 2033 __ Branch(¬_heap_number, ne, map, Operand(at)); | 2041 __ Branch(¬_heap_number, ne, map, Operand(at)); |
| 2034 __ ldc1(dbl_scratch, FieldMemOperand(reg, HeapNumber::kValueOffset)); | 2042 __ ldc1(dbl_scratch, FieldMemOperand(reg, HeapNumber::kValueOffset)); |
| 2035 __ BranchF(instr->TrueLabel(chunk_), instr->FalseLabel(chunk_), | 2043 __ BranchF(instr->TrueLabel(chunk_), instr->FalseLabel(chunk_), |
| 2036 ne, dbl_scratch, kDoubleRegZero); | 2044 ne, dbl_scratch, kDoubleRegZero); |
| 2037 // Falls through if dbl_scratch == 0. | 2045 // Falls through if dbl_scratch == 0. |
| (...skipping 3117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5155 __ GetObjectType(input, scratch, scratch1()); | 5163 __ GetObjectType(input, scratch, scratch1()); |
| 5156 __ Branch(false_label, lt, scratch1(), Operand(FIRST_JS_RECEIVER_TYPE)); | 5164 __ Branch(false_label, lt, scratch1(), Operand(FIRST_JS_RECEIVER_TYPE)); |
| 5157 // Check for callable or undetectable objects => false. | 5165 // Check for callable or undetectable objects => false. |
| 5158 __ lbu(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset)); | 5166 __ lbu(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset)); |
| 5159 __ And(at, scratch, | 5167 __ And(at, scratch, |
| 5160 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); | 5168 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); |
| 5161 *cmp1 = at; | 5169 *cmp1 = at; |
| 5162 *cmp2 = Operand(zero_reg); | 5170 *cmp2 = Operand(zero_reg); |
| 5163 final_branch_condition = eq; | 5171 final_branch_condition = eq; |
| 5164 | 5172 |
| 5173 // clang-format off |
| 5174 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ |
| 5175 } else if (String::Equals(type_name, factory->type##_string())) { \ |
| 5176 __ JumpIfSmi(input, false_label); \ |
| 5177 __ lw(input, FieldMemOperand(input, HeapObject::kMapOffset)); \ |
| 5178 __ LoadRoot(at, Heap::k##Type##MapRootIndex); \ |
| 5179 *cmp1 = input; \ |
| 5180 *cmp2 = Operand(at); \ |
| 5181 final_branch_condition = eq; |
| 5182 SIMD128_TYPES(SIMD128_TYPE) |
| 5183 #undef SIMD128_TYPE |
| 5184 // clang-format on |
| 5185 |
| 5165 } else { | 5186 } else { |
| 5166 *cmp1 = at; | 5187 *cmp1 = at; |
| 5167 *cmp2 = Operand(zero_reg); // Set to valid regs, to avoid caller assertion. | 5188 *cmp2 = Operand(zero_reg); // Set to valid regs, to avoid caller assertion. |
| 5168 __ Branch(false_label); | 5189 __ Branch(false_label); |
| 5169 } | 5190 } |
| 5170 | 5191 |
| 5171 return final_branch_condition; | 5192 return final_branch_condition; |
| 5172 } | 5193 } |
| 5173 | 5194 |
| 5174 | 5195 |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5417 __ lw(result, FieldMemOperand(scratch, | 5438 __ lw(result, FieldMemOperand(scratch, |
| 5418 FixedArray::kHeaderSize - kPointerSize)); | 5439 FixedArray::kHeaderSize - kPointerSize)); |
| 5419 __ bind(deferred->exit()); | 5440 __ bind(deferred->exit()); |
| 5420 __ bind(&done); | 5441 __ bind(&done); |
| 5421 } | 5442 } |
| 5422 | 5443 |
| 5423 #undef __ | 5444 #undef __ |
| 5424 | 5445 |
| 5425 } // namespace internal | 5446 } // namespace internal |
| 5426 } // namespace v8 | 5447 } // namespace v8 |
| OLD | NEW |