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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 #include "src/counters.h" | 46 #include "src/counters.h" |
47 #include "src/cpu-profiler.h" | 47 #include "src/cpu-profiler.h" |
48 #include "src/debug/debug.h" | 48 #include "src/debug/debug.h" |
49 #include "src/deoptimizer.h" | 49 #include "src/deoptimizer.h" |
50 #include "src/execution.h" | 50 #include "src/execution.h" |
51 #include "src/ic/ic.h" | 51 #include "src/ic/ic.h" |
52 #include "src/ic/stub-cache.h" | 52 #include "src/ic/stub-cache.h" |
53 #include "src/regexp/jsregexp.h" | 53 #include "src/regexp/jsregexp.h" |
54 #include "src/regexp/regexp-macro-assembler.h" | 54 #include "src/regexp/regexp-macro-assembler.h" |
55 #include "src/regexp/regexp-stack.h" | 55 #include "src/regexp/regexp-stack.h" |
| 56 #include "src/register-configuration.h" |
56 #include "src/runtime/runtime.h" | 57 #include "src/runtime/runtime.h" |
57 #include "src/snapshot/serialize.h" | 58 #include "src/snapshot/serialize.h" |
58 #include "src/token.h" | 59 #include "src/token.h" |
59 | 60 |
60 #if V8_TARGET_ARCH_IA32 | 61 #if V8_TARGET_ARCH_IA32 |
61 #include "src/ia32/assembler-ia32-inl.h" // NOLINT | 62 #include "src/ia32/assembler-ia32-inl.h" // NOLINT |
62 #elif V8_TARGET_ARCH_X64 | 63 #elif V8_TARGET_ARCH_X64 |
63 #include "src/x64/assembler-x64-inl.h" // NOLINT | 64 #include "src/x64/assembler-x64-inl.h" // NOLINT |
64 #elif V8_TARGET_ARCH_ARM64 | 65 #elif V8_TARGET_ARCH_ARM64 |
65 #include "src/arm64/assembler-arm64-inl.h" // NOLINT | 66 #include "src/arm64/assembler-arm64-inl.h" // NOLINT |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 #include "src/regexp/x87/regexp-macro-assembler-x87.h" // NOLINT | 98 #include "src/regexp/x87/regexp-macro-assembler-x87.h" // NOLINT |
98 #else // Unknown architecture. | 99 #else // Unknown architecture. |
99 #error "Unknown architecture." | 100 #error "Unknown architecture." |
100 #endif // Target architecture. | 101 #endif // Target architecture. |
101 #endif // V8_INTERPRETED_REGEXP | 102 #endif // V8_INTERPRETED_REGEXP |
102 | 103 |
103 namespace v8 { | 104 namespace v8 { |
104 namespace internal { | 105 namespace internal { |
105 | 106 |
106 // ----------------------------------------------------------------------------- | 107 // ----------------------------------------------------------------------------- |
| 108 // Common register code. |
| 109 |
| 110 const char* Register::ToString() { |
| 111 // This is the mapping of allocation indices to registers. |
| 112 DCHECK(reg_code >= 0 && reg_code < kNumRegisters); |
| 113 return RegisterConfiguration::ArchDefault()->GetGeneralRegisterName(reg_code); |
| 114 } |
| 115 |
| 116 |
| 117 bool Register::IsAllocatable() const { |
| 118 return ((1 << reg_code) & |
| 119 RegisterConfiguration::ArchDefault() |
| 120 ->allocatable_general_codes_mask()) != 0; |
| 121 } |
| 122 |
| 123 |
| 124 const char* DoubleRegister::ToString() { |
| 125 // This is the mapping of allocation indices to registers. |
| 126 DCHECK(reg_code >= 0 && reg_code < kMaxNumRegisters); |
| 127 return RegisterConfiguration::ArchDefault()->GetDoubleRegisterName(reg_code); |
| 128 } |
| 129 |
| 130 |
| 131 bool DoubleRegister::IsAllocatable() const { |
| 132 return ((1 << reg_code) & |
| 133 RegisterConfiguration::ArchDefault() |
| 134 ->allocatable_double_codes_mask()) != 0; |
| 135 } |
| 136 |
| 137 |
| 138 // ----------------------------------------------------------------------------- |
107 // Common double constants. | 139 // Common double constants. |
108 | 140 |
109 struct DoubleConstant BASE_EMBEDDED { | 141 struct DoubleConstant BASE_EMBEDDED { |
110 double min_int; | 142 double min_int; |
111 double one_half; | 143 double one_half; |
112 double minus_one_half; | 144 double minus_one_half; |
113 double negative_infinity; | 145 double negative_infinity; |
114 double the_hole_nan; | 146 double the_hole_nan; |
115 double uint32_bias; | 147 double uint32_bias; |
116 }; | 148 }; |
(...skipping 1703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1820 | 1852 |
1821 | 1853 |
1822 void Assembler::DataAlign(int m) { | 1854 void Assembler::DataAlign(int m) { |
1823 DCHECK(m >= 2 && base::bits::IsPowerOfTwo32(m)); | 1855 DCHECK(m >= 2 && base::bits::IsPowerOfTwo32(m)); |
1824 while ((pc_offset() & (m - 1)) != 0) { | 1856 while ((pc_offset() & (m - 1)) != 0) { |
1825 db(0); | 1857 db(0); |
1826 } | 1858 } |
1827 } | 1859 } |
1828 } // namespace internal | 1860 } // namespace internal |
1829 } // namespace v8 | 1861 } // namespace v8 |
OLD | NEW |