| 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 5563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5574 __ JumpIfSmi(input, false_label); | 5574 __ JumpIfSmi(input, false_label); |
| 5575 // Check for undetectable objects => true. | 5575 // Check for undetectable objects => true. |
| 5576 __ lw(input, FieldMemOperand(input, HeapObject::kMapOffset)); | 5576 __ lw(input, FieldMemOperand(input, HeapObject::kMapOffset)); |
| 5577 __ lbu(at, FieldMemOperand(input, Map::kBitFieldOffset)); | 5577 __ lbu(at, FieldMemOperand(input, Map::kBitFieldOffset)); |
| 5578 __ And(at, at, 1 << Map::kIsUndetectable); | 5578 __ And(at, at, 1 << Map::kIsUndetectable); |
| 5579 *cmp1 = at; | 5579 *cmp1 = at; |
| 5580 *cmp2 = Operand(zero_reg); | 5580 *cmp2 = Operand(zero_reg); |
| 5581 final_branch_condition = ne; | 5581 final_branch_condition = ne; |
| 5582 | 5582 |
| 5583 } else if (String::Equals(type_name, factory->function_string())) { | 5583 } else if (String::Equals(type_name, factory->function_string())) { |
| 5584 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); | |
| 5585 __ JumpIfSmi(input, false_label); | 5584 __ JumpIfSmi(input, false_label); |
| 5586 __ GetObjectType(input, scratch, input); | 5585 __ lw(scratch, FieldMemOperand(input, HeapObject::kMapOffset)); |
| 5587 __ Branch(true_label, eq, input, Operand(JS_FUNCTION_TYPE)); | 5586 __ lbu(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset)); |
| 5588 *cmp1 = input; | 5587 __ And(scratch, scratch, |
| 5589 *cmp2 = Operand(JS_FUNCTION_PROXY_TYPE); | 5588 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); |
| 5589 *cmp1 = scratch; |
| 5590 *cmp2 = Operand(1 << Map::kIsCallable); |
| 5590 final_branch_condition = eq; | 5591 final_branch_condition = eq; |
| 5591 | 5592 |
| 5592 } else if (String::Equals(type_name, factory->object_string())) { | 5593 } else if (String::Equals(type_name, factory->object_string())) { |
| 5593 __ JumpIfSmi(input, false_label); | 5594 __ JumpIfSmi(input, false_label); |
| 5594 __ LoadRoot(at, Heap::kNullValueRootIndex); | 5595 __ LoadRoot(at, Heap::kNullValueRootIndex); |
| 5595 __ Branch(USE_DELAY_SLOT, true_label, eq, at, Operand(input)); | 5596 __ Branch(USE_DELAY_SLOT, true_label, eq, at, Operand(input)); |
| 5596 Register map = input; | 5597 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); |
| 5597 __ GetObjectType(input, map, scratch); | 5598 __ GetObjectType(input, scratch, scratch1()); |
| 5598 __ Branch(false_label, | 5599 __ Branch(false_label, lt, scratch1(), Operand(FIRST_SPEC_OBJECT_TYPE)); |
| 5599 lt, scratch, Operand(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); | 5600 // Check for callable or undetectable objects => false. |
| 5600 __ Branch(USE_DELAY_SLOT, false_label, | 5601 __ lbu(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset)); |
| 5601 gt, scratch, Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE)); | 5602 __ And(at, scratch, |
| 5602 // map is still valid, so the BitField can be loaded in delay slot. | 5603 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable))); |
| 5603 // Check for undetectable objects => false. | |
| 5604 __ lbu(at, FieldMemOperand(map, Map::kBitFieldOffset)); | |
| 5605 __ And(at, at, 1 << Map::kIsUndetectable); | |
| 5606 *cmp1 = at; | 5604 *cmp1 = at; |
| 5607 *cmp2 = Operand(zero_reg); | 5605 *cmp2 = Operand(zero_reg); |
| 5608 final_branch_condition = eq; | 5606 final_branch_condition = eq; |
| 5609 | 5607 |
| 5610 // clang-format off | 5608 // clang-format off |
| 5611 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ | 5609 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ |
| 5612 } else if (String::Equals(type_name, factory->type##_string())) { \ | 5610 } else if (String::Equals(type_name, factory->type##_string())) { \ |
| 5613 __ JumpIfSmi(input, false_label); \ | 5611 __ JumpIfSmi(input, false_label); \ |
| 5614 __ lw(input, FieldMemOperand(input, HeapObject::kMapOffset)); \ | 5612 __ lw(input, FieldMemOperand(input, HeapObject::kMapOffset)); \ |
| 5615 __ LoadRoot(at, Heap::k##Type##MapRootIndex); \ | 5613 __ LoadRoot(at, Heap::k##Type##MapRootIndex); \ |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5931 __ Push(at, ToRegister(instr->function())); | 5929 __ Push(at, ToRegister(instr->function())); |
| 5932 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5930 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 5933 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5931 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5934 } | 5932 } |
| 5935 | 5933 |
| 5936 | 5934 |
| 5937 #undef __ | 5935 #undef __ |
| 5938 | 5936 |
| 5939 } // namespace internal | 5937 } // namespace internal |
| 5940 } // namespace v8 | 5938 } // namespace v8 |
| OLD | NEW |