| OLD | NEW |
| 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
| 2 // All Rights Reserved. | 2 // All Rights Reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions | 5 // modification, are permitted provided that the following conditions |
| 6 // are met: | 6 // are met: |
| 7 // | 7 // |
| 8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
| 9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
| 10 // | 10 // |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 // ----------------------------------------------------------------------------- | 48 // ----------------------------------------------------------------------------- |
| 49 // Implementation of CpuFeatures | 49 // Implementation of CpuFeatures |
| 50 | 50 |
| 51 #ifdef DEBUG | 51 #ifdef DEBUG |
| 52 bool CpuFeatures::initialized_ = false; | 52 bool CpuFeatures::initialized_ = false; |
| 53 #endif | 53 #endif |
| 54 uint64_t CpuFeatures::supported_ = 0; | 54 uint64_t CpuFeatures::supported_ = 0; |
| 55 uint64_t CpuFeatures::found_by_runtime_probing_ = 0; | 55 uint64_t CpuFeatures::found_by_runtime_probing_ = 0; |
| 56 | 56 |
| 57 | 57 |
| 58 int IntelDoubleRegister::NumAllocatableRegisters() { |
| 59 if (CpuFeatures::IsSupported(SSE2)) { |
| 60 return XMMRegister::kNumAllocatableRegisters; |
| 61 } else { |
| 62 return X87TopOfStackRegister::kNumAllocatableRegisters; |
| 63 } |
| 64 } |
| 65 |
| 66 |
| 67 int IntelDoubleRegister::NumRegisters() { |
| 68 if (CpuFeatures::IsSupported(SSE2)) { |
| 69 return XMMRegister::kNumRegisters; |
| 70 } else { |
| 71 return X87TopOfStackRegister::kNumRegisters; |
| 72 } |
| 73 } |
| 74 |
| 75 |
| 76 const char* IntelDoubleRegister::AllocationIndexToString(int index) { |
| 77 if (CpuFeatures::IsSupported(SSE2)) { |
| 78 return XMMRegister::AllocationIndexToString(index); |
| 79 } else { |
| 80 return X87TopOfStackRegister::AllocationIndexToString(index); |
| 81 } |
| 82 } |
| 83 |
| 84 |
| 58 // The Probe method needs executable memory, so it uses Heap::CreateCode. | 85 // The Probe method needs executable memory, so it uses Heap::CreateCode. |
| 59 // Allocation failure is silent and leads to safe default. | 86 // Allocation failure is silent and leads to safe default. |
| 60 void CpuFeatures::Probe() { | 87 void CpuFeatures::Probe() { |
| 61 ASSERT(!initialized_); | 88 ASSERT(!initialized_); |
| 62 ASSERT(supported_ == 0); | 89 ASSERT(supported_ == 0); |
| 63 #ifdef DEBUG | 90 #ifdef DEBUG |
| 64 initialized_ = true; | 91 initialized_ = true; |
| 65 #endif | 92 #endif |
| 66 if (Serializer::enabled()) { | 93 if (Serializer::enabled()) { |
| 67 supported_ |= OS::CpuFeaturesImpliedByPlatform(); | 94 supported_ |= OS::CpuFeaturesImpliedByPlatform(); |
| (...skipping 2124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2192 EMIT(0xE7); | 2219 EMIT(0xE7); |
| 2193 emit_sse_operand(src, dst); | 2220 emit_sse_operand(src, dst); |
| 2194 } | 2221 } |
| 2195 | 2222 |
| 2196 | 2223 |
| 2197 void Assembler::prefetch(const Operand& src, int level) { | 2224 void Assembler::prefetch(const Operand& src, int level) { |
| 2198 ASSERT(is_uint2(level)); | 2225 ASSERT(is_uint2(level)); |
| 2199 EnsureSpace ensure_space(this); | 2226 EnsureSpace ensure_space(this); |
| 2200 EMIT(0x0F); | 2227 EMIT(0x0F); |
| 2201 EMIT(0x18); | 2228 EMIT(0x18); |
| 2202 XMMRegister code = { level }; // Emit hint number in Reg position of RegR/M. | 2229 // Emit hint number in Reg position of RegR/M. |
| 2230 XMMRegister code = XMMRegister(level); |
| 2203 emit_sse_operand(code, src); | 2231 emit_sse_operand(code, src); |
| 2204 } | 2232 } |
| 2205 | 2233 |
| 2206 | 2234 |
| 2207 void Assembler::movdbl(XMMRegister dst, const Operand& src) { | 2235 void Assembler::movdbl(XMMRegister dst, const Operand& src) { |
| 2208 EnsureSpace ensure_space(this); | 2236 EnsureSpace ensure_space(this); |
| 2209 movsd(dst, src); | 2237 movsd(dst, src); |
| 2210 } | 2238 } |
| 2211 | 2239 |
| 2212 | 2240 |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2644 fprintf(coverage_log, "%s\n", file_line); | 2672 fprintf(coverage_log, "%s\n", file_line); |
| 2645 fflush(coverage_log); | 2673 fflush(coverage_log); |
| 2646 } | 2674 } |
| 2647 } | 2675 } |
| 2648 | 2676 |
| 2649 #endif | 2677 #endif |
| 2650 | 2678 |
| 2651 } } // namespace v8::internal | 2679 } } // namespace v8::internal |
| 2652 | 2680 |
| 2653 #endif // V8_TARGET_ARCH_IA32 | 2681 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |