| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #if V8_TARGET_ARCH_X87 | 5 #if V8_TARGET_ARCH_X87 |
| 6 | 6 |
| 7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
| 8 #include "src/base/division-by-constant.h" | 8 #include "src/base/division-by-constant.h" |
| 9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 2754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2765 } | 2765 } |
| 2766 j(cc, condition_met, condition_met_distance); | 2766 j(cc, condition_met, condition_met_distance); |
| 2767 } | 2767 } |
| 2768 | 2768 |
| 2769 | 2769 |
| 2770 void MacroAssembler::JumpIfBlack(Register object, | 2770 void MacroAssembler::JumpIfBlack(Register object, |
| 2771 Register scratch0, | 2771 Register scratch0, |
| 2772 Register scratch1, | 2772 Register scratch1, |
| 2773 Label* on_black, | 2773 Label* on_black, |
| 2774 Label::Distance on_black_near) { | 2774 Label::Distance on_black_near) { |
| 2775 HasColor(object, scratch0, scratch1, | 2775 HasColor(object, scratch0, scratch1, on_black, on_black_near, 1, |
| 2776 on_black, on_black_near, | 2776 1); // kBlackBitPattern. |
| 2777 1, 0); // kBlackBitPattern. | 2777 DCHECK(strcmp(Marking::kBlackBitPattern, "11") == 0); |
| 2778 DCHECK(strcmp(Marking::kBlackBitPattern, "10") == 0); | |
| 2779 } | 2778 } |
| 2780 | 2779 |
| 2781 | 2780 |
| 2782 void MacroAssembler::HasColor(Register object, | 2781 void MacroAssembler::HasColor(Register object, |
| 2783 Register bitmap_scratch, | 2782 Register bitmap_scratch, |
| 2784 Register mask_scratch, | 2783 Register mask_scratch, |
| 2785 Label* has_color, | 2784 Label* has_color, |
| 2786 Label::Distance has_color_distance, | 2785 Label::Distance has_color_distance, |
| 2787 int first_bit, | 2786 int first_bit, |
| 2788 int second_bit) { | 2787 int second_bit) { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2830 | 2829 |
| 2831 | 2830 |
| 2832 void MacroAssembler::JumpIfWhite(Register value, Register bitmap_scratch, | 2831 void MacroAssembler::JumpIfWhite(Register value, Register bitmap_scratch, |
| 2833 Register mask_scratch, Label* value_is_white, | 2832 Register mask_scratch, Label* value_is_white, |
| 2834 Label::Distance distance) { | 2833 Label::Distance distance) { |
| 2835 DCHECK(!AreAliased(value, bitmap_scratch, mask_scratch, ecx)); | 2834 DCHECK(!AreAliased(value, bitmap_scratch, mask_scratch, ecx)); |
| 2836 GetMarkBits(value, bitmap_scratch, mask_scratch); | 2835 GetMarkBits(value, bitmap_scratch, mask_scratch); |
| 2837 | 2836 |
| 2838 // If the value is black or grey we don't need to do anything. | 2837 // If the value is black or grey we don't need to do anything. |
| 2839 DCHECK(strcmp(Marking::kWhiteBitPattern, "00") == 0); | 2838 DCHECK(strcmp(Marking::kWhiteBitPattern, "00") == 0); |
| 2840 DCHECK(strcmp(Marking::kBlackBitPattern, "10") == 0); | 2839 DCHECK(strcmp(Marking::kBlackBitPattern, "11") == 0); |
| 2841 DCHECK(strcmp(Marking::kGreyBitPattern, "11") == 0); | 2840 DCHECK(strcmp(Marking::kGreyBitPattern, "10") == 0); |
| 2842 DCHECK(strcmp(Marking::kImpossibleBitPattern, "01") == 0); | 2841 DCHECK(strcmp(Marking::kImpossibleBitPattern, "01") == 0); |
| 2843 | 2842 |
| 2844 // Since both black and grey have a 1 in the first position and white does | 2843 // Since both black and grey have a 1 in the first position and white does |
| 2845 // not have a 1 there we only need to check one bit. | 2844 // not have a 1 there we only need to check one bit. |
| 2846 test(mask_scratch, Operand(bitmap_scratch, MemoryChunk::kHeaderSize)); | 2845 test(mask_scratch, Operand(bitmap_scratch, MemoryChunk::kHeaderSize)); |
| 2847 j(zero, value_is_white, Label::kNear); | 2846 j(zero, value_is_white, Label::kNear); |
| 2848 } | 2847 } |
| 2849 | 2848 |
| 2850 | 2849 |
| 2851 void MacroAssembler::EnumLength(Register dst, Register map) { | 2850 void MacroAssembler::EnumLength(Register dst, Register map) { |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2968 mov(eax, dividend); | 2967 mov(eax, dividend); |
| 2969 shr(eax, 31); | 2968 shr(eax, 31); |
| 2970 add(edx, eax); | 2969 add(edx, eax); |
| 2971 } | 2970 } |
| 2972 | 2971 |
| 2973 | 2972 |
| 2974 } // namespace internal | 2973 } // namespace internal |
| 2975 } // namespace v8 | 2974 } // namespace v8 |
| 2976 | 2975 |
| 2977 #endif // V8_TARGET_ARCH_X87 | 2976 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |