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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 shift_imm_ = shift_imm & 31; | 231 shift_imm_ = shift_imm & 31; |
232 am_ = am; | 232 am_ = am; |
233 } | 233 } |
234 | 234 |
235 | 235 |
236 // ----------------------------------------------------------------------------- | 236 // ----------------------------------------------------------------------------- |
237 // Specific instructions, constants, and masks. | 237 // Specific instructions, constants, and masks. |
238 | 238 |
239 // add(sp, sp, 4) instruction (aka Pop()) | 239 // add(sp, sp, 4) instruction (aka Pop()) |
240 const Instr kPopInstruction = | 240 const Instr kPopInstruction = |
241 al | PostIndex | 4 | LeaveCC | I | sp.code() * B16 | sp.code() * B12; | 241 al | PostIndex | 4 | LeaveCC | I | kRegister_sp_Code * B16 | |
| 242 kRegister_sp_Code * B12; |
242 // str(r, MemOperand(sp, 4, NegPreIndex), al) instruction (aka push(r)) | 243 // str(r, MemOperand(sp, 4, NegPreIndex), al) instruction (aka push(r)) |
243 // register r is not encoded. | 244 // register r is not encoded. |
244 const Instr kPushRegPattern = | 245 const Instr kPushRegPattern = |
245 al | B26 | 4 | NegPreIndex | sp.code() * B16; | 246 al | B26 | 4 | NegPreIndex | kRegister_sp_Code * B16; |
246 // ldr(r, MemOperand(sp, 4, PostIndex), al) instruction (aka pop(r)) | 247 // ldr(r, MemOperand(sp, 4, PostIndex), al) instruction (aka pop(r)) |
247 // register r is not encoded. | 248 // register r is not encoded. |
248 const Instr kPopRegPattern = | 249 const Instr kPopRegPattern = |
249 al | B26 | L | 4 | PostIndex | sp.code() * B16; | 250 al | B26 | L | 4 | PostIndex | kRegister_sp_Code * B16; |
250 // mov lr, pc | 251 // mov lr, pc |
251 const Instr kMovLrPc = al | MOV | pc.code() | lr.code() * B12; | 252 const Instr kMovLrPc = al | MOV | kRegister_pc_Code | kRegister_lr_Code * B12; |
252 // ldr rd, [pc, #offset] | 253 // ldr rd, [pc, #offset] |
253 const Instr kLdrPCMask = kCondMask | 15 * B24 | 7 * B20 | 15 * B16; | 254 const Instr kLdrPCMask = kCondMask | 15 * B24 | 7 * B20 | 15 * B16; |
254 const Instr kLdrPCPattern = al | 5 * B24 | L | pc.code() * B16; | 255 const Instr kLdrPCPattern = al | 5 * B24 | L | kRegister_pc_Code * B16; |
255 // blxcc rm | 256 // blxcc rm |
256 const Instr kBlxRegMask = | 257 const Instr kBlxRegMask = |
257 15 * B24 | 15 * B20 | 15 * B16 | 15 * B12 | 15 * B8 | 15 * B4; | 258 15 * B24 | 15 * B20 | 15 * B16 | 15 * B12 | 15 * B8 | 15 * B4; |
258 const Instr kBlxRegPattern = | 259 const Instr kBlxRegPattern = |
259 B24 | B21 | 15 * B16 | 15 * B12 | 15 * B8 | BLX; | 260 B24 | B21 | 15 * B16 | 15 * B12 | 15 * B8 | BLX; |
260 const Instr kMovMvnMask = 0x6d * B21 | 0xf * B16; | 261 const Instr kMovMvnMask = 0x6d * B21 | 0xf * B16; |
261 const Instr kMovMvnPattern = 0xd * B21; | 262 const Instr kMovMvnPattern = 0xd * B21; |
262 const Instr kMovMvnFlip = B22; | 263 const Instr kMovMvnFlip = B22; |
263 const Instr kMovLeaveCCMask = 0xdff * B16; | 264 const Instr kMovLeaveCCMask = 0xdff * B16; |
264 const Instr kMovLeaveCCPattern = 0x1a0 * B16; | 265 const Instr kMovLeaveCCPattern = 0x1a0 * B16; |
265 const Instr kMovwMask = 0xff * B20; | 266 const Instr kMovwMask = 0xff * B20; |
266 const Instr kMovwPattern = 0x30 * B20; | 267 const Instr kMovwPattern = 0x30 * B20; |
267 const Instr kMovwLeaveCCFlip = 0x5 * B21; | 268 const Instr kMovwLeaveCCFlip = 0x5 * B21; |
268 const Instr kCmpCmnMask = 0xdd * B20 | 0xf * B12; | 269 const Instr kCmpCmnMask = 0xdd * B20 | 0xf * B12; |
269 const Instr kCmpCmnPattern = 0x15 * B20; | 270 const Instr kCmpCmnPattern = 0x15 * B20; |
270 const Instr kCmpCmnFlip = B21; | 271 const Instr kCmpCmnFlip = B21; |
271 const Instr kAddSubFlip = 0x6 * B21; | 272 const Instr kAddSubFlip = 0x6 * B21; |
272 const Instr kAndBicFlip = 0xe * B21; | 273 const Instr kAndBicFlip = 0xe * B21; |
273 | 274 |
274 // A mask for the Rd register for push, pop, ldr, str instructions. | 275 // A mask for the Rd register for push, pop, ldr, str instructions. |
275 const Instr kLdrRegFpOffsetPattern = | 276 const Instr kLdrRegFpOffsetPattern = |
276 al | B26 | L | Offset | fp.code() * B16; | 277 al | B26 | L | Offset | kRegister_fp_Code * B16; |
277 const Instr kStrRegFpOffsetPattern = | 278 const Instr kStrRegFpOffsetPattern = |
278 al | B26 | Offset | fp.code() * B16; | 279 al | B26 | Offset | kRegister_fp_Code * B16; |
279 const Instr kLdrRegFpNegOffsetPattern = | 280 const Instr kLdrRegFpNegOffsetPattern = |
280 al | B26 | L | NegOffset | fp.code() * B16; | 281 al | B26 | L | NegOffset | kRegister_fp_Code * B16; |
281 const Instr kStrRegFpNegOffsetPattern = | 282 const Instr kStrRegFpNegOffsetPattern = |
282 al | B26 | NegOffset | fp.code() * B16; | 283 al | B26 | NegOffset | kRegister_fp_Code * B16; |
283 const Instr kLdrStrInstrTypeMask = 0xffff0000; | 284 const Instr kLdrStrInstrTypeMask = 0xffff0000; |
284 const Instr kLdrStrInstrArgumentMask = 0x0000ffff; | 285 const Instr kLdrStrInstrArgumentMask = 0x0000ffff; |
285 const Instr kLdrStrOffsetMask = 0x00000fff; | 286 const Instr kLdrStrOffsetMask = 0x00000fff; |
286 | 287 |
287 | 288 |
288 // Spare buffer. | 289 // Spare buffer. |
289 static const int kMinimalBufferSize = 4*KB; | 290 static const int kMinimalBufferSize = 4*KB; |
290 | 291 |
291 | 292 |
292 Assembler::Assembler(Isolate* arg_isolate, void* buffer, int buffer_size) | 293 Assembler::Assembler(Isolate* arg_isolate, void* buffer, int buffer_size) |
(...skipping 2363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2656 | 2657 |
2657 // Since a constant pool was just emitted, move the check offset forward by | 2658 // Since a constant pool was just emitted, move the check offset forward by |
2658 // the standard interval. | 2659 // the standard interval. |
2659 next_buffer_check_ = pc_offset() + kCheckPoolInterval; | 2660 next_buffer_check_ = pc_offset() + kCheckPoolInterval; |
2660 } | 2661 } |
2661 | 2662 |
2662 | 2663 |
2663 } } // namespace v8::internal | 2664 } } // namespace v8::internal |
2664 | 2665 |
2665 #endif // V8_TARGET_ARCH_ARM | 2666 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |