OLD | NEW |
---|---|
1 // Copyright 2011 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 |
11 // with the distribution. | 11 // with the distribution. |
(...skipping 2720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2732 // Value is a smi. convert to a double and store. | 2732 // Value is a smi. convert to a double and store. |
2733 // Preserve original value. | 2733 // Preserve original value. |
2734 SmiToInteger32(kScratchRegister, maybe_number); | 2734 SmiToInteger32(kScratchRegister, maybe_number); |
2735 cvtlsi2sd(xmm_scratch, kScratchRegister); | 2735 cvtlsi2sd(xmm_scratch, kScratchRegister); |
2736 movsd(FieldOperand(elements, index, times_8, FixedDoubleArray::kHeaderSize), | 2736 movsd(FieldOperand(elements, index, times_8, FixedDoubleArray::kHeaderSize), |
2737 xmm_scratch); | 2737 xmm_scratch); |
2738 bind(&done); | 2738 bind(&done); |
2739 } | 2739 } |
2740 | 2740 |
2741 | 2741 |
2742 void MacroAssembler::CompareMap(Register obj, | |
2743 Handle<Map> map, | |
2744 Label* early_success, | |
2745 CompareMapMode mode) { | |
2746 Cmp(FieldOperand(obj, HeapObject::kMapOffset), map); | |
2747 if (mode == ALLOW_ELEMENT_TRANSITION_MAPS) { | |
2748 bool ignore; | |
2749 Map* transitioned_fast_element_map( | |
fschneider
2012/01/04 12:17:51
Handle<Map>
danno
2012/01/05 13:41:57
Done.
| |
2750 map->LookupElementsTransitionMap(FAST_ELEMENTS, &ignore)); | |
2751 ASSERT(transitioned_fast_element_map == NULL || | |
2752 map->elements_kind() != FAST_ELEMENTS); | |
2753 if (transitioned_fast_element_map != NULL) { | |
2754 j(equal, early_success, Label::kNear); | |
2755 Cmp(FieldOperand(obj, HeapObject::kMapOffset), | |
2756 Handle<Map>(transitioned_fast_element_map)); | |
2757 } | |
2758 | |
2759 Map* transitioned_double_map( | |
fschneider
2012/01/04 12:17:51
Handle<Map>
danno
2012/01/05 13:41:57
Done.
| |
2760 map->LookupElementsTransitionMap(FAST_DOUBLE_ELEMENTS, &ignore)); | |
2761 ASSERT(transitioned_double_map == NULL || | |
2762 map->elements_kind() == FAST_SMI_ONLY_ELEMENTS); | |
2763 if (transitioned_double_map != NULL) { | |
2764 j(equal, early_success, Label::kNear); | |
2765 Cmp(FieldOperand(obj, HeapObject::kMapOffset), | |
2766 Handle<Map>(transitioned_double_map)); | |
2767 } | |
2768 } | |
2769 } | |
2770 | |
2771 | |
2742 void MacroAssembler::CheckMap(Register obj, | 2772 void MacroAssembler::CheckMap(Register obj, |
2743 Handle<Map> map, | 2773 Handle<Map> map, |
2744 Label* fail, | 2774 Label* fail, |
2745 SmiCheckType smi_check_type) { | 2775 SmiCheckType smi_check_type, |
2776 CompareMapMode mode) { | |
2746 if (smi_check_type == DO_SMI_CHECK) { | 2777 if (smi_check_type == DO_SMI_CHECK) { |
2747 JumpIfSmi(obj, fail); | 2778 JumpIfSmi(obj, fail); |
2748 } | 2779 } |
2749 Cmp(FieldOperand(obj, HeapObject::kMapOffset), map); | 2780 |
2781 Label success; | |
2782 CompareMap(obj, map, &success, mode); | |
2750 j(not_equal, fail); | 2783 j(not_equal, fail); |
2784 bind(&success); | |
2751 } | 2785 } |
2752 | 2786 |
2753 | 2787 |
2754 void MacroAssembler::ClampUint8(Register reg) { | 2788 void MacroAssembler::ClampUint8(Register reg) { |
2755 Label done; | 2789 Label done; |
2756 testl(reg, Immediate(0xFFFFFF00)); | 2790 testl(reg, Immediate(0xFFFFFF00)); |
2757 j(zero, &done, Label::kNear); | 2791 j(zero, &done, Label::kNear); |
2758 setcc(negative, reg); // 1 if negative, 0 if positive. | 2792 setcc(negative, reg); // 1 if negative, 0 if positive. |
2759 decb(reg); // 0 if negative, 255 if positive. | 2793 decb(reg); // 0 if negative, 255 if positive. |
2760 bind(&done); | 2794 bind(&done); |
(...skipping 1518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4279 | 4313 |
4280 and_(bitmap_scratch, Immediate(~Page::kPageAlignmentMask)); | 4314 and_(bitmap_scratch, Immediate(~Page::kPageAlignmentMask)); |
4281 addl(Operand(bitmap_scratch, MemoryChunk::kLiveBytesOffset), length); | 4315 addl(Operand(bitmap_scratch, MemoryChunk::kLiveBytesOffset), length); |
4282 | 4316 |
4283 bind(&done); | 4317 bind(&done); |
4284 } | 4318 } |
4285 | 4319 |
4286 } } // namespace v8::internal | 4320 } } // namespace v8::internal |
4287 | 4321 |
4288 #endif // V8_TARGET_ARCH_X64 | 4322 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |