OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1947 Label ok, fail; | 1947 Label ok, fail; |
1948 CheckMap(map, scratch, Heap::kMetaMapRootIndex, &fail, false); | 1948 CheckMap(map, scratch, Heap::kMetaMapRootIndex, &fail, false); |
1949 b(&ok); | 1949 b(&ok); |
1950 bind(&fail); | 1950 bind(&fail); |
1951 Abort("Global functions must have initial map"); | 1951 Abort("Global functions must have initial map"); |
1952 bind(&ok); | 1952 bind(&ok); |
1953 } | 1953 } |
1954 } | 1954 } |
1955 | 1955 |
1956 | 1956 |
| 1957 void MacroAssembler::JumpIfNotPowerOfTwoOrZero( |
| 1958 Register reg, |
| 1959 Register scratch, |
| 1960 Label* not_power_of_two_or_zero) { |
| 1961 sub(scratch, reg, Operand(1), SetCC); |
| 1962 b(mi, not_power_of_two_or_zero); |
| 1963 tst(scratch, reg); |
| 1964 b(ne, not_power_of_two_or_zero); |
| 1965 } |
| 1966 |
| 1967 |
1957 void MacroAssembler::JumpIfNotBothSmi(Register reg1, | 1968 void MacroAssembler::JumpIfNotBothSmi(Register reg1, |
1958 Register reg2, | 1969 Register reg2, |
1959 Label* on_not_both_smi) { | 1970 Label* on_not_both_smi) { |
1960 STATIC_ASSERT(kSmiTag == 0); | 1971 STATIC_ASSERT(kSmiTag == 0); |
1961 tst(reg1, Operand(kSmiTagMask)); | 1972 tst(reg1, Operand(kSmiTagMask)); |
1962 tst(reg2, Operand(kSmiTagMask), eq); | 1973 tst(reg2, Operand(kSmiTagMask), eq); |
1963 b(ne, on_not_both_smi); | 1974 b(ne, on_not_both_smi); |
1964 } | 1975 } |
1965 | 1976 |
1966 | 1977 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2095 for (int i = 0; i < field_count; i++) { | 2106 for (int i = 0; i < field_count; i++) { |
2096 ldr(tmp, FieldMemOperand(src, i * kPointerSize)); | 2107 ldr(tmp, FieldMemOperand(src, i * kPointerSize)); |
2097 str(tmp, FieldMemOperand(dst, i * kPointerSize)); | 2108 str(tmp, FieldMemOperand(dst, i * kPointerSize)); |
2098 } | 2109 } |
2099 } | 2110 } |
2100 | 2111 |
2101 | 2112 |
2102 void MacroAssembler::CountLeadingZeros(Register zeros, // Answer. | 2113 void MacroAssembler::CountLeadingZeros(Register zeros, // Answer. |
2103 Register source, // Input. | 2114 Register source, // Input. |
2104 Register scratch) { | 2115 Register scratch) { |
2105 ASSERT(!zeros.is(source) || !source.is(zeros)); | 2116 ASSERT(!zeros.is(source) || !source.is(scratch)); |
2106 ASSERT(!zeros.is(scratch)); | 2117 ASSERT(!zeros.is(scratch)); |
2107 ASSERT(!scratch.is(ip)); | 2118 ASSERT(!scratch.is(ip)); |
2108 ASSERT(!source.is(ip)); | 2119 ASSERT(!source.is(ip)); |
2109 ASSERT(!zeros.is(ip)); | 2120 ASSERT(!zeros.is(ip)); |
2110 #ifdef CAN_USE_ARMV5_INSTRUCTIONS | 2121 #ifdef CAN_USE_ARMV5_INSTRUCTIONS |
2111 clz(zeros, source); // This instruction is only supported after ARM5. | 2122 clz(zeros, source); // This instruction is only supported after ARM5. |
2112 #else | 2123 #else |
2113 mov(zeros, Operand(0, RelocInfo::NONE)); | 2124 mov(zeros, Operand(0, RelocInfo::NONE)); |
2114 Move(scratch, source); | 2125 Move(scratch, source); |
2115 // Top 16. | 2126 // Top 16. |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2274 | 2285 |
2275 void CodePatcher::Emit(Address addr) { | 2286 void CodePatcher::Emit(Address addr) { |
2276 masm()->emit(reinterpret_cast<Instr>(addr)); | 2287 masm()->emit(reinterpret_cast<Instr>(addr)); |
2277 } | 2288 } |
2278 #endif // ENABLE_DEBUGGER_SUPPORT | 2289 #endif // ENABLE_DEBUGGER_SUPPORT |
2279 | 2290 |
2280 | 2291 |
2281 } } // namespace v8::internal | 2292 } } // namespace v8::internal |
2282 | 2293 |
2283 #endif // V8_TARGET_ARCH_ARM | 2294 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |