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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X87 | 7 #if V8_TARGET_ARCH_X87 |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 2912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2923 | 2923 |
2924 call(function); | 2924 call(function); |
2925 if (base::OS::ActivationFrameAlignment() != 0) { | 2925 if (base::OS::ActivationFrameAlignment() != 0) { |
2926 mov(esp, Operand(esp, num_arguments * kPointerSize)); | 2926 mov(esp, Operand(esp, num_arguments * kPointerSize)); |
2927 } else { | 2927 } else { |
2928 add(esp, Immediate(num_arguments * kPointerSize)); | 2928 add(esp, Immediate(num_arguments * kPointerSize)); |
2929 } | 2929 } |
2930 } | 2930 } |
2931 | 2931 |
2932 | 2932 |
2933 bool AreAliased(Register r1, Register r2, Register r3, Register r4) { | 2933 #ifdef DEBUG |
2934 if (r1.is(r2)) return true; | 2934 bool AreAliased(Register reg1, |
2935 if (r1.is(r3)) return true; | 2935 Register reg2, |
2936 if (r1.is(r4)) return true; | 2936 Register reg3, |
2937 if (r2.is(r3)) return true; | 2937 Register reg4, |
2938 if (r2.is(r4)) return true; | 2938 Register reg5, |
2939 if (r3.is(r4)) return true; | 2939 Register reg6, |
2940 return false; | 2940 Register reg7, |
| 2941 Register reg8) { |
| 2942 int n_of_valid_regs = reg1.is_valid() + reg2.is_valid() + |
| 2943 reg3.is_valid() + reg4.is_valid() + reg5.is_valid() + reg6.is_valid() + |
| 2944 reg7.is_valid() + reg8.is_valid(); |
| 2945 |
| 2946 RegList regs = 0; |
| 2947 if (reg1.is_valid()) regs |= reg1.bit(); |
| 2948 if (reg2.is_valid()) regs |= reg2.bit(); |
| 2949 if (reg3.is_valid()) regs |= reg3.bit(); |
| 2950 if (reg4.is_valid()) regs |= reg4.bit(); |
| 2951 if (reg5.is_valid()) regs |= reg5.bit(); |
| 2952 if (reg6.is_valid()) regs |= reg6.bit(); |
| 2953 if (reg7.is_valid()) regs |= reg7.bit(); |
| 2954 if (reg8.is_valid()) regs |= reg8.bit(); |
| 2955 int n_of_non_aliasing_regs = NumRegs(regs); |
| 2956 |
| 2957 return n_of_valid_regs != n_of_non_aliasing_regs; |
2941 } | 2958 } |
| 2959 #endif |
2942 | 2960 |
2943 | 2961 |
2944 CodePatcher::CodePatcher(byte* address, int size) | 2962 CodePatcher::CodePatcher(byte* address, int size) |
2945 : address_(address), | 2963 : address_(address), |
2946 size_(size), | 2964 size_(size), |
2947 masm_(NULL, address, size + Assembler::kGap) { | 2965 masm_(NULL, address, size + Assembler::kGap) { |
2948 // Create a new macro assembler pointing to the address of the code to patch. | 2966 // Create a new macro assembler pointing to the address of the code to patch. |
2949 // The size is adjusted with kGap on order for the assembler to generate size | 2967 // The size is adjusted with kGap on order for the assembler to generate size |
2950 // bytes of instructions without failing with buffer size constraints. | 2968 // bytes of instructions without failing with buffer size constraints. |
2951 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 2969 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3296 if (ms.shift() > 0) sar(edx, ms.shift()); | 3314 if (ms.shift() > 0) sar(edx, ms.shift()); |
3297 mov(eax, dividend); | 3315 mov(eax, dividend); |
3298 shr(eax, 31); | 3316 shr(eax, 31); |
3299 add(edx, eax); | 3317 add(edx, eax); |
3300 } | 3318 } |
3301 | 3319 |
3302 | 3320 |
3303 } } // namespace v8::internal | 3321 } } // namespace v8::internal |
3304 | 3322 |
3305 #endif // V8_TARGET_ARCH_X87 | 3323 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |