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 3157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3168 if (rmode == RelocInfo::INTERNAL_REFERENCE) { | 3168 if (rmode == RelocInfo::INTERNAL_REFERENCE) { |
3169 byte* p = reinterpret_cast<byte*>(it.rinfo()->pc()); | 3169 byte* p = reinterpret_cast<byte*>(it.rinfo()->pc()); |
3170 RelocateInternalReference(rmode, p, pc_delta); | 3170 RelocateInternalReference(rmode, p, pc_delta); |
3171 } | 3171 } |
3172 } | 3172 } |
3173 DCHECK(!overflow()); | 3173 DCHECK(!overflow()); |
3174 } | 3174 } |
3175 | 3175 |
3176 | 3176 |
3177 void Assembler::db(uint8_t data) { | 3177 void Assembler::db(uint8_t data) { |
3178 CheckBuffer(); | 3178 CheckForEmitInForbiddenSlot(); |
3179 *reinterpret_cast<uint8_t*>(pc_) = data; | 3179 EmitHelper(data); |
3180 pc_ += sizeof(uint8_t); | |
3181 } | 3180 } |
3182 | 3181 |
3183 | 3182 |
3184 void Assembler::dd(uint32_t data) { | 3183 void Assembler::dd(uint32_t data) { |
3185 CheckBuffer(); | 3184 CheckForEmitInForbiddenSlot(); |
3186 *reinterpret_cast<uint32_t*>(pc_) = data; | 3185 EmitHelper(data); |
3187 pc_ += sizeof(uint32_t); | |
3188 } | 3186 } |
3189 | 3187 |
3190 | 3188 |
3191 void Assembler::dq(uint64_t data) { | 3189 void Assembler::dq(uint64_t data) { |
3192 CheckBuffer(); | 3190 CheckForEmitInForbiddenSlot(); |
3193 *reinterpret_cast<uint64_t*>(pc_) = data; | 3191 EmitHelper(data); |
3194 pc_ += sizeof(uint64_t); | |
3195 } | 3192 } |
3196 | 3193 |
3197 | 3194 |
3198 void Assembler::dd(Label* label) { | 3195 void Assembler::dd(Label* label) { |
3199 CheckBuffer(); | |
3200 RecordRelocInfo(RelocInfo::INTERNAL_REFERENCE); | |
3201 uint64_t data; | 3196 uint64_t data; |
| 3197 CheckForEmitInForbiddenSlot(); |
3202 if (label->is_bound()) { | 3198 if (label->is_bound()) { |
3203 data = reinterpret_cast<uint64_t>(buffer_ + label->pos()); | 3199 data = reinterpret_cast<uint64_t>(buffer_ + label->pos()); |
3204 } else { | 3200 } else { |
3205 data = jump_address(label); | 3201 data = jump_address(label); |
3206 internal_reference_positions_.insert(label->pos()); | 3202 internal_reference_positions_.insert(label->pos()); |
3207 } | 3203 } |
3208 *reinterpret_cast<uint64_t*>(pc_) = data; | 3204 RecordRelocInfo(RelocInfo::INTERNAL_REFERENCE); |
3209 pc_ += sizeof(uint64_t); | 3205 EmitHelper(data); |
3210 } | 3206 } |
3211 | 3207 |
3212 | 3208 |
3213 void Assembler::emit_code_stub_address(Code* stub) { | |
3214 CheckBuffer(); | |
3215 *reinterpret_cast<uint64_t*>(pc_) = | |
3216 reinterpret_cast<uint64_t>(stub->instruction_start()); | |
3217 pc_ += sizeof(uint64_t); | |
3218 } | |
3219 | |
3220 | |
3221 void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) { | 3209 void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) { |
3222 // We do not try to reuse pool constants. | 3210 // We do not try to reuse pool constants. |
3223 RelocInfo rinfo(isolate(), pc_, rmode, data, NULL); | 3211 RelocInfo rinfo(isolate(), pc_, rmode, data, NULL); |
3224 if (rmode >= RelocInfo::COMMENT && | 3212 if (rmode >= RelocInfo::COMMENT && |
3225 rmode <= RelocInfo::DEBUG_BREAK_SLOT_AT_CALL) { | 3213 rmode <= RelocInfo::DEBUG_BREAK_SLOT_AT_CALL) { |
3226 // Adjust code for new modes. | 3214 // Adjust code for new modes. |
3227 DCHECK(RelocInfo::IsDebugBreakSlot(rmode) | 3215 DCHECK(RelocInfo::IsDebugBreakSlot(rmode) |
3228 || RelocInfo::IsComment(rmode) | 3216 || RelocInfo::IsComment(rmode) |
3229 || RelocInfo::IsPosition(rmode)); | 3217 || RelocInfo::IsPosition(rmode)); |
3230 // These modes do not need an entry in the constant pool. | 3218 // These modes do not need an entry in the constant pool. |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3396 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { | 3384 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { |
3397 Assembler::FlushICache(isolate, pc, 4 * Assembler::kInstrSize); | 3385 Assembler::FlushICache(isolate, pc, 4 * Assembler::kInstrSize); |
3398 } | 3386 } |
3399 } | 3387 } |
3400 | 3388 |
3401 | 3389 |
3402 } // namespace internal | 3390 } // namespace internal |
3403 } // namespace v8 | 3391 } // namespace v8 |
3404 | 3392 |
3405 #endif // V8_TARGET_ARCH_MIPS64 | 3393 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |