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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 | 278 |
279 trampoline_emitted_ = FLAG_force_long_branches; | 279 trampoline_emitted_ = FLAG_force_long_branches; |
280 unbound_labels_count_ = 0; | 280 unbound_labels_count_ = 0; |
281 block_buffer_growth_ = false; | 281 block_buffer_growth_ = false; |
282 | 282 |
283 ClearRecordedAstId(); | 283 ClearRecordedAstId(); |
284 } | 284 } |
285 | 285 |
286 | 286 |
287 void Assembler::GetCode(CodeDesc* desc) { | 287 void Assembler::GetCode(CodeDesc* desc) { |
288 if (IsPrevInstrCompactBranch()) { | 288 EmitForbiddenSlotInstruction(); |
289 nop(); | |
290 ClearCompactBranchState(); | |
291 } | |
292 DCHECK(pc_ <= reloc_info_writer.pos()); // No overlap. | 289 DCHECK(pc_ <= reloc_info_writer.pos()); // No overlap. |
293 // Set up code descriptor. | 290 // Set up code descriptor. |
294 desc->buffer = buffer_; | 291 desc->buffer = buffer_; |
295 desc->buffer_size = buffer_size_; | 292 desc->buffer_size = buffer_size_; |
296 desc->instr_size = pc_offset(); | 293 desc->instr_size = pc_offset(); |
297 desc->reloc_size = (buffer_ + buffer_size_) - reloc_info_writer.pos(); | 294 desc->reloc_size = (buffer_ + buffer_size_) - reloc_info_writer.pos(); |
298 desc->origin = this; | 295 desc->origin = this; |
299 desc->constant_pool_size = 0; | 296 desc->constant_pool_size = 0; |
300 } | 297 } |
301 | 298 |
302 | 299 |
303 void Assembler::Align(int m) { | 300 void Assembler::Align(int m) { |
304 DCHECK(m >= 4 && base::bits::IsPowerOfTwo32(m)); | 301 DCHECK(m >= 4 && base::bits::IsPowerOfTwo32(m)); |
305 if (IsPrevInstrCompactBranch()) { | 302 EmitForbiddenSlotInstruction(); |
306 nop(); | |
307 ClearCompactBranchState(); | |
308 } | |
309 while ((pc_offset() & (m - 1)) != 0) { | 303 while ((pc_offset() & (m - 1)) != 0) { |
310 nop(); | 304 nop(); |
311 } | 305 } |
312 } | 306 } |
313 | 307 |
314 | 308 |
315 void Assembler::CodeTargetAlign() { | 309 void Assembler::CodeTargetAlign() { |
316 // No advantage to aligning branch/call targets to more than | 310 // No advantage to aligning branch/call targets to more than |
317 // single instruction, that I am aware of. | 311 // single instruction, that I am aware of. |
318 Align(4); | 312 Align(4); |
(...skipping 2732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3051 | 3045 |
3052 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { | 3046 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { |
3053 Assembler::FlushICache(isolate, pc, 2 * sizeof(int32_t)); | 3047 Assembler::FlushICache(isolate, pc, 2 * sizeof(int32_t)); |
3054 } | 3048 } |
3055 } | 3049 } |
3056 | 3050 |
3057 } // namespace internal | 3051 } // namespace internal |
3058 } // namespace v8 | 3052 } // namespace v8 |
3059 | 3053 |
3060 #endif // V8_TARGET_ARCH_MIPS | 3054 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |