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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
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 2882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2893 } | 2893 } |
2894 j(cc, condition_met, condition_met_distance); | 2894 j(cc, condition_met, condition_met_distance); |
2895 } | 2895 } |
2896 | 2896 |
2897 | 2897 |
2898 void MacroAssembler::JumpIfBlack(Register object, | 2898 void MacroAssembler::JumpIfBlack(Register object, |
2899 Register scratch0, | 2899 Register scratch0, |
2900 Register scratch1, | 2900 Register scratch1, |
2901 Label* on_black, | 2901 Label* on_black, |
2902 Label::Distance on_black_near) { | 2902 Label::Distance on_black_near) { |
2903 HasColor(object, scratch0, scratch1, | 2903 HasColor(object, scratch0, scratch1, on_black, on_black_near, 1, |
2904 on_black, on_black_near, | 2904 1); // kBlackBitPattern. |
2905 1, 0); // kBlackBitPattern. | 2905 DCHECK(strcmp(Marking::kBlackBitPattern, "11") == 0); |
2906 DCHECK(strcmp(Marking::kBlackBitPattern, "10") == 0); | |
2907 } | 2906 } |
2908 | 2907 |
2909 | 2908 |
2910 void MacroAssembler::HasColor(Register object, | 2909 void MacroAssembler::HasColor(Register object, |
2911 Register bitmap_scratch, | 2910 Register bitmap_scratch, |
2912 Register mask_scratch, | 2911 Register mask_scratch, |
2913 Label* has_color, | 2912 Label* has_color, |
2914 Label::Distance has_color_distance, | 2913 Label::Distance has_color_distance, |
2915 int first_bit, | 2914 int first_bit, |
2916 int second_bit) { | 2915 int second_bit) { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2958 | 2957 |
2959 | 2958 |
2960 void MacroAssembler::JumpIfWhite(Register value, Register bitmap_scratch, | 2959 void MacroAssembler::JumpIfWhite(Register value, Register bitmap_scratch, |
2961 Register mask_scratch, Label* value_is_white, | 2960 Register mask_scratch, Label* value_is_white, |
2962 Label::Distance distance) { | 2961 Label::Distance distance) { |
2963 DCHECK(!AreAliased(value, bitmap_scratch, mask_scratch, ecx)); | 2962 DCHECK(!AreAliased(value, bitmap_scratch, mask_scratch, ecx)); |
2964 GetMarkBits(value, bitmap_scratch, mask_scratch); | 2963 GetMarkBits(value, bitmap_scratch, mask_scratch); |
2965 | 2964 |
2966 // If the value is black or grey we don't need to do anything. | 2965 // If the value is black or grey we don't need to do anything. |
2967 DCHECK(strcmp(Marking::kWhiteBitPattern, "00") == 0); | 2966 DCHECK(strcmp(Marking::kWhiteBitPattern, "00") == 0); |
2968 DCHECK(strcmp(Marking::kBlackBitPattern, "10") == 0); | 2967 DCHECK(strcmp(Marking::kBlackBitPattern, "11") == 0); |
2969 DCHECK(strcmp(Marking::kGreyBitPattern, "11") == 0); | 2968 DCHECK(strcmp(Marking::kGreyBitPattern, "10") == 0); |
2970 DCHECK(strcmp(Marking::kImpossibleBitPattern, "01") == 0); | 2969 DCHECK(strcmp(Marking::kImpossibleBitPattern, "01") == 0); |
2971 | 2970 |
2972 // Since both black and grey have a 1 in the first position and white does | 2971 // Since both black and grey have a 1 in the first position and white does |
2973 // not have a 1 there we only need to check one bit. | 2972 // not have a 1 there we only need to check one bit. |
2974 test(mask_scratch, Operand(bitmap_scratch, MemoryChunk::kHeaderSize)); | 2973 test(mask_scratch, Operand(bitmap_scratch, MemoryChunk::kHeaderSize)); |
2975 j(zero, value_is_white, Label::kNear); | 2974 j(zero, value_is_white, Label::kNear); |
2976 } | 2975 } |
2977 | 2976 |
2978 | 2977 |
2979 void MacroAssembler::EnumLength(Register dst, Register map) { | 2978 void MacroAssembler::EnumLength(Register dst, Register map) { |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3096 mov(eax, dividend); | 3095 mov(eax, dividend); |
3097 shr(eax, 31); | 3096 shr(eax, 31); |
3098 add(edx, eax); | 3097 add(edx, eax); |
3099 } | 3098 } |
3100 | 3099 |
3101 | 3100 |
3102 } // namespace internal | 3101 } // namespace internal |
3103 } // namespace v8 | 3102 } // namespace v8 |
3104 | 3103 |
3105 #endif // V8_TARGET_ARCH_IA32 | 3104 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |