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 are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 #if(defined(__mips_hard_float) && __mips_hard_float != 0) | 67 #if(defined(__mips_hard_float) && __mips_hard_float != 0) |
68 answer |= 1u << FPU; | 68 answer |= 1u << FPU; |
69 #endif // defined(__mips_hard_float) && __mips_hard_float != 0 | 69 #endif // defined(__mips_hard_float) && __mips_hard_float != 0 |
70 #endif // def __mips__ | 70 #endif // def __mips__ |
71 | 71 |
72 return answer; | 72 return answer; |
73 } | 73 } |
74 | 74 |
75 | 75 |
76 void CpuFeatures::Probe() { | 76 void CpuFeatures::Probe() { |
77 ASSERT(!initialized_); | 77 unsigned standard_features = (OS::CpuFeaturesImpliedByPlatform() | |
| 78 CpuFeaturesImpliedByCompiler()); |
| 79 ASSERT(supported_ == 0 || supported_ == standard_features); |
78 #ifdef DEBUG | 80 #ifdef DEBUG |
79 initialized_ = true; | 81 initialized_ = true; |
80 #endif | 82 #endif |
81 | 83 |
82 // Get the features implied by the OS and the compiler settings. This is the | 84 // Get the features implied by the OS and the compiler settings. This is the |
83 // minimal set of features which is also allowed for generated code in the | 85 // minimal set of features which is also allowed for generated code in the |
84 // snapshot. | 86 // snapshot. |
85 supported_ |= OS::CpuFeaturesImpliedByPlatform(); | 87 supported_ |= standard_features; |
86 supported_ |= CpuFeaturesImpliedByCompiler(); | |
87 | 88 |
88 if (Serializer::enabled()) { | 89 if (Serializer::enabled()) { |
89 // No probing for features if we might serialize (generate snapshot). | 90 // No probing for features if we might serialize (generate snapshot). |
90 return; | 91 return; |
91 } | 92 } |
92 | 93 |
93 // If the compiler is allowed to use fpu then we can use fpu too in our | 94 // If the compiler is allowed to use fpu then we can use fpu too in our |
94 // code generation. | 95 // code generation. |
95 #if !defined(__mips__) | 96 #if !defined(__mips__) |
96 // For the simulator=mips build, use FPU when FLAG_enable_fpu is enabled. | 97 // For the simulator=mips build, use FPU when FLAG_enable_fpu is enabled. |
(...skipping 1914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2011 | 2012 |
2012 | 2013 |
2013 void Assembler::dd(uint32_t data) { | 2014 void Assembler::dd(uint32_t data) { |
2014 CheckBuffer(); | 2015 CheckBuffer(); |
2015 *reinterpret_cast<uint32_t*>(pc_) = data; | 2016 *reinterpret_cast<uint32_t*>(pc_) = data; |
2016 pc_ += sizeof(uint32_t); | 2017 pc_ += sizeof(uint32_t); |
2017 } | 2018 } |
2018 | 2019 |
2019 | 2020 |
2020 void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) { | 2021 void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) { |
2021 RelocInfo rinfo(pc_, rmode, data); // We do not try to reuse pool constants. | 2022 // We do not try to reuse pool constants. |
| 2023 RelocInfo rinfo(pc_, rmode, data, NULL); |
2022 if (rmode >= RelocInfo::JS_RETURN && rmode <= RelocInfo::DEBUG_BREAK_SLOT) { | 2024 if (rmode >= RelocInfo::JS_RETURN && rmode <= RelocInfo::DEBUG_BREAK_SLOT) { |
2023 // Adjust code for new modes. | 2025 // Adjust code for new modes. |
2024 ASSERT(RelocInfo::IsDebugBreakSlot(rmode) | 2026 ASSERT(RelocInfo::IsDebugBreakSlot(rmode) |
2025 || RelocInfo::IsJSReturn(rmode) | 2027 || RelocInfo::IsJSReturn(rmode) |
2026 || RelocInfo::IsComment(rmode) | 2028 || RelocInfo::IsComment(rmode) |
2027 || RelocInfo::IsPosition(rmode)); | 2029 || RelocInfo::IsPosition(rmode)); |
2028 // These modes do not need an entry in the constant pool. | 2030 // These modes do not need an entry in the constant pool. |
2029 } | 2031 } |
2030 if (rinfo.rmode() != RelocInfo::NONE) { | 2032 if (rinfo.rmode() != RelocInfo::NONE) { |
2031 // Don't record external references unless the heap will be serialized. | 2033 // Don't record external references unless the heap will be serialized. |
2032 if (rmode == RelocInfo::EXTERNAL_REFERENCE) { | 2034 if (rmode == RelocInfo::EXTERNAL_REFERENCE) { |
2033 #ifdef DEBUG | 2035 #ifdef DEBUG |
2034 if (!Serializer::enabled()) { | 2036 if (!Serializer::enabled()) { |
2035 Serializer::TooLateToEnableNow(); | 2037 Serializer::TooLateToEnableNow(); |
2036 } | 2038 } |
2037 #endif | 2039 #endif |
2038 if (!Serializer::enabled() && !emit_debug_code()) { | 2040 if (!Serializer::enabled() && !emit_debug_code()) { |
2039 return; | 2041 return; |
2040 } | 2042 } |
2041 } | 2043 } |
2042 ASSERT(buffer_space() >= kMaxRelocSize); // Too late to grow buffer here. | 2044 ASSERT(buffer_space() >= kMaxRelocSize); // Too late to grow buffer here. |
2043 if (rmode == RelocInfo::CODE_TARGET_WITH_ID) { | 2045 if (rmode == RelocInfo::CODE_TARGET_WITH_ID) { |
2044 RelocInfo reloc_info_with_ast_id(pc_, rmode, RecordedAstId()); | 2046 RelocInfo reloc_info_with_ast_id(pc_, rmode, RecordedAstId(), NULL); |
2045 ClearRecordedAstId(); | 2047 ClearRecordedAstId(); |
2046 reloc_info_writer.Write(&reloc_info_with_ast_id); | 2048 reloc_info_writer.Write(&reloc_info_with_ast_id); |
2047 } else { | 2049 } else { |
2048 reloc_info_writer.Write(&rinfo); | 2050 reloc_info_writer.Write(&rinfo); |
2049 } | 2051 } |
2050 } | 2052 } |
2051 } | 2053 } |
2052 | 2054 |
2053 | 2055 |
2054 void Assembler::BlockTrampolinePoolFor(int instructions) { | 2056 void Assembler::BlockTrampolinePoolFor(int instructions) { |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2265 } | 2267 } |
2266 | 2268 |
2267 if (patched) { | 2269 if (patched) { |
2268 CPU::FlushICache(pc+2, sizeof(Address)); | 2270 CPU::FlushICache(pc+2, sizeof(Address)); |
2269 } | 2271 } |
2270 } | 2272 } |
2271 | 2273 |
2272 } } // namespace v8::internal | 2274 } } // namespace v8::internal |
2273 | 2275 |
2274 #endif // V8_TARGET_ARCH_MIPS | 2276 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |