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 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1133 ldr(ip, MemOperand(topaddr)); | 1133 ldr(ip, MemOperand(topaddr)); |
1134 cmp(result, ip); | 1134 cmp(result, ip); |
1135 Check(eq, "Unexpected allocation top"); | 1135 Check(eq, "Unexpected allocation top"); |
1136 } | 1136 } |
1137 // Load allocation limit into ip. Result already contains allocation top. | 1137 // Load allocation limit into ip. Result already contains allocation top. |
1138 ldr(ip, MemOperand(topaddr, limit - top)); | 1138 ldr(ip, MemOperand(topaddr, limit - top)); |
1139 } | 1139 } |
1140 | 1140 |
1141 // Calculate new top and bail out if new space is exhausted. Use result | 1141 // Calculate new top and bail out if new space is exhausted. Use result |
1142 // to calculate the new top. | 1142 // to calculate the new top. |
1143 add(scratch2, result, Operand(obj_size_reg)); | 1143 add(scratch2, result, Operand(obj_size_reg), SetCC); |
| 1144 b(cs, gc_required); |
1144 cmp(scratch2, Operand(ip)); | 1145 cmp(scratch2, Operand(ip)); |
1145 b(hi, gc_required); | 1146 b(hi, gc_required); |
1146 str(scratch2, MemOperand(topaddr)); | 1147 str(scratch2, MemOperand(topaddr)); |
1147 | 1148 |
1148 // Tag object if requested. | 1149 // Tag object if requested. |
1149 if ((flags & TAG_OBJECT) != 0) { | 1150 if ((flags & TAG_OBJECT) != 0) { |
1150 add(result, result, Operand(kHeapObjectTag)); | 1151 add(result, result, Operand(kHeapObjectTag)); |
1151 } | 1152 } |
1152 } | 1153 } |
1153 | 1154 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1212 Check(eq, "Unexpected allocation top"); | 1213 Check(eq, "Unexpected allocation top"); |
1213 } | 1214 } |
1214 // Load allocation limit into ip. Result already contains allocation top. | 1215 // Load allocation limit into ip. Result already contains allocation top. |
1215 ldr(ip, MemOperand(topaddr, limit - top)); | 1216 ldr(ip, MemOperand(topaddr, limit - top)); |
1216 } | 1217 } |
1217 | 1218 |
1218 // Calculate new top and bail out if new space is exhausted. Use result | 1219 // Calculate new top and bail out if new space is exhausted. Use result |
1219 // to calculate the new top. Object size may be in words so a shift is | 1220 // to calculate the new top. Object size may be in words so a shift is |
1220 // required to get the number of bytes. | 1221 // required to get the number of bytes. |
1221 if ((flags & SIZE_IN_WORDS) != 0) { | 1222 if ((flags & SIZE_IN_WORDS) != 0) { |
1222 add(scratch2, result, Operand(object_size, LSL, kPointerSizeLog2)); | 1223 add(scratch2, result, Operand(object_size, LSL, kPointerSizeLog2), SetCC); |
1223 } else { | 1224 } else { |
1224 add(scratch2, result, Operand(object_size)); | 1225 add(scratch2, result, Operand(object_size), SetCC); |
1225 } | 1226 } |
| 1227 b(cs, gc_required); |
1226 cmp(scratch2, Operand(ip)); | 1228 cmp(scratch2, Operand(ip)); |
1227 b(hi, gc_required); | 1229 b(hi, gc_required); |
1228 | 1230 |
1229 // Update allocation top. result temporarily holds the new top. | 1231 // Update allocation top. result temporarily holds the new top. |
1230 if (FLAG_debug_code) { | 1232 if (FLAG_debug_code) { |
1231 tst(scratch2, Operand(kObjectAlignmentMask)); | 1233 tst(scratch2, Operand(kObjectAlignmentMask)); |
1232 Check(eq, "Unaligned allocation in new space"); | 1234 Check(eq, "Unaligned allocation in new space"); |
1233 } | 1235 } |
1234 str(scratch2, MemOperand(topaddr)); | 1236 str(scratch2, MemOperand(topaddr)); |
1235 | 1237 |
(...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2256 | 2258 |
2257 void CodePatcher::Emit(Address addr) { | 2259 void CodePatcher::Emit(Address addr) { |
2258 masm()->emit(reinterpret_cast<Instr>(addr)); | 2260 masm()->emit(reinterpret_cast<Instr>(addr)); |
2259 } | 2261 } |
2260 #endif // ENABLE_DEBUGGER_SUPPORT | 2262 #endif // ENABLE_DEBUGGER_SUPPORT |
2261 | 2263 |
2262 | 2264 |
2263 } } // namespace v8::internal | 2265 } } // namespace v8::internal |
2264 | 2266 |
2265 #endif // V8_TARGET_ARCH_ARM | 2267 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |