OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
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 2820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2831 cvtlsi2sd(xmm_scratch, kScratchRegister); | 2831 cvtlsi2sd(xmm_scratch, kScratchRegister); |
2832 movsd(FieldOperand(elements, index, times_8, | 2832 movsd(FieldOperand(elements, index, times_8, |
2833 FixedDoubleArray::kHeaderSize - elements_offset), | 2833 FixedDoubleArray::kHeaderSize - elements_offset), |
2834 xmm_scratch); | 2834 xmm_scratch); |
2835 bind(&done); | 2835 bind(&done); |
2836 } | 2836 } |
2837 | 2837 |
2838 | 2838 |
2839 void MacroAssembler::CompareMap(Register obj, | 2839 void MacroAssembler::CompareMap(Register obj, |
2840 Handle<Map> map, | 2840 Handle<Map> map, |
2841 Label* early_success, | 2841 Label* early_success) { |
2842 CompareMapMode mode) { | |
2843 Cmp(FieldOperand(obj, HeapObject::kMapOffset), map); | 2842 Cmp(FieldOperand(obj, HeapObject::kMapOffset), map); |
2844 if (mode == ALLOW_ELEMENT_TRANSITION_MAPS) { | |
2845 ElementsKind kind = map->elements_kind(); | |
2846 if (IsFastElementsKind(kind)) { | |
2847 bool packed = IsFastPackedElementsKind(kind); | |
2848 Map* current_map = *map; | |
2849 while (CanTransitionToMoreGeneralFastElementsKind(kind, packed)) { | |
2850 kind = GetNextMoreGeneralFastElementsKind(kind, packed); | |
2851 current_map = current_map->LookupElementsTransitionMap(kind); | |
2852 if (!current_map) break; | |
2853 j(equal, early_success, Label::kNear); | |
2854 Cmp(FieldOperand(obj, HeapObject::kMapOffset), | |
2855 Handle<Map>(current_map)); | |
2856 } | |
2857 } | |
2858 } | |
2859 } | 2843 } |
2860 | 2844 |
2861 | 2845 |
2862 void MacroAssembler::CheckMap(Register obj, | 2846 void MacroAssembler::CheckMap(Register obj, |
2863 Handle<Map> map, | 2847 Handle<Map> map, |
2864 Label* fail, | 2848 Label* fail, |
2865 SmiCheckType smi_check_type, | 2849 SmiCheckType smi_check_type) { |
2866 CompareMapMode mode) { | |
2867 if (smi_check_type == DO_SMI_CHECK) { | 2850 if (smi_check_type == DO_SMI_CHECK) { |
2868 JumpIfSmi(obj, fail); | 2851 JumpIfSmi(obj, fail); |
2869 } | 2852 } |
2870 | 2853 |
2871 Label success; | 2854 Label success; |
2872 CompareMap(obj, map, &success, mode); | 2855 CompareMap(obj, map, &success); |
2873 j(not_equal, fail); | 2856 j(not_equal, fail); |
2874 bind(&success); | 2857 bind(&success); |
2875 } | 2858 } |
2876 | 2859 |
2877 | 2860 |
2878 void MacroAssembler::ClampUint8(Register reg) { | 2861 void MacroAssembler::ClampUint8(Register reg) { |
2879 Label done; | 2862 Label done; |
2880 testl(reg, Immediate(0xFFFFFF00)); | 2863 testl(reg, Immediate(0xFFFFFF00)); |
2881 j(zero, &done, Label::kNear); | 2864 j(zero, &done, Label::kNear); |
2882 setcc(negative, reg); // 1 if negative, 0 if positive. | 2865 setcc(negative, reg); // 1 if negative, 0 if positive. |
(...skipping 1748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4631 j(greater, &no_info_available); | 4614 j(greater, &no_info_available); |
4632 CompareRoot(MemOperand(scratch_reg, -AllocationSiteInfo::kSize), | 4615 CompareRoot(MemOperand(scratch_reg, -AllocationSiteInfo::kSize), |
4633 Heap::kAllocationSiteInfoMapRootIndex); | 4616 Heap::kAllocationSiteInfoMapRootIndex); |
4634 bind(&no_info_available); | 4617 bind(&no_info_available); |
4635 } | 4618 } |
4636 | 4619 |
4637 | 4620 |
4638 } } // namespace v8::internal | 4621 } } // namespace v8::internal |
4639 | 4622 |
4640 #endif // V8_TARGET_ARCH_X64 | 4623 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |