| 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 ConstantPoolEntry::Access access; | 168 ConstantPoolEntry::Access access; |
| 169 if (FLAG_enable_embedded_constant_pool && | 169 if (FLAG_enable_embedded_constant_pool && |
| 170 IsConstantPoolLoadStart(pc, &access)) { | 170 IsConstantPoolLoadStart(pc, &access)) { |
| 171 len = (access == ConstantPoolEntry::OVERFLOWED) ? 2 : 1; | 171 len = (access == ConstantPoolEntry::OVERFLOWED) ? 2 : 1; |
| 172 } else { | 172 } else { |
| 173 len = kMovInstructionsNoConstantPool; | 173 len = kMovInstructionsNoConstantPool; |
| 174 } | 174 } |
| 175 return pc + (len + 2) * kInstrSize; | 175 return pc + (len + 2) * kInstrSize; |
| 176 } | 176 } |
| 177 | 177 |
| 178 Object* RelocInfo::target_object() { | 178 HeapObject* RelocInfo::target_object() { |
| 179 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); | 179 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); |
| 180 return reinterpret_cast<Object*>(Assembler::target_address_at(pc_, host_)); | 180 return HeapObject::cast( |
| 181 reinterpret_cast<Object*>(Assembler::target_address_at(pc_, host_))); |
| 181 } | 182 } |
| 182 | 183 |
| 183 | 184 Handle<HeapObject> RelocInfo::target_object_handle(Assembler* origin) { |
| 184 Handle<Object> RelocInfo::target_object_handle(Assembler* origin) { | |
| 185 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); | 185 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); |
| 186 return Handle<Object>( | 186 return Handle<HeapObject>( |
| 187 reinterpret_cast<Object**>(Assembler::target_address_at(pc_, host_))); | 187 reinterpret_cast<HeapObject**>(Assembler::target_address_at(pc_, host_))); |
| 188 } | 188 } |
| 189 | 189 |
| 190 | 190 void RelocInfo::set_target_object(HeapObject* target, |
| 191 void RelocInfo::set_target_object(Object* target, | |
| 192 WriteBarrierMode write_barrier_mode, | 191 WriteBarrierMode write_barrier_mode, |
| 193 ICacheFlushMode icache_flush_mode) { | 192 ICacheFlushMode icache_flush_mode) { |
| 194 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); | 193 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); |
| 195 Assembler::set_target_address_at(isolate_, pc_, host_, | 194 Assembler::set_target_address_at(isolate_, pc_, host_, |
| 196 reinterpret_cast<Address>(target), | 195 reinterpret_cast<Address>(target), |
| 197 icache_flush_mode); | 196 icache_flush_mode); |
| 198 if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != NULL && | 197 if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != NULL && |
| 199 target->IsHeapObject()) { | 198 target->IsHeapObject()) { |
| 200 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode( | 199 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode( |
| 201 host(), this, HeapObject::cast(target)); | 200 host(), this, HeapObject::cast(target)); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 ? kNoCodeAgeInstructions | 258 ? kNoCodeAgeInstructions |
| 260 : kCodeAgingInstructions); | 259 : kCodeAgingInstructions); |
| 261 static const int kNoCodeAgeSequenceNops = | 260 static const int kNoCodeAgeSequenceNops = |
| 262 (kNoCodeAgeSequenceInstructions - kNoCodeAgeInstructions); | 261 (kNoCodeAgeSequenceInstructions - kNoCodeAgeInstructions); |
| 263 static const int kCodeAgingSequenceNops = | 262 static const int kCodeAgingSequenceNops = |
| 264 (kNoCodeAgeSequenceInstructions - kCodeAgingInstructions); | 263 (kNoCodeAgeSequenceInstructions - kCodeAgingInstructions); |
| 265 static const int kCodeAgingTargetDelta = 1 * Assembler::kInstrSize; | 264 static const int kCodeAgingTargetDelta = 1 * Assembler::kInstrSize; |
| 266 static const int kNoCodeAgeSequenceLength = | 265 static const int kNoCodeAgeSequenceLength = |
| 267 (kNoCodeAgeSequenceInstructions * Assembler::kInstrSize); | 266 (kNoCodeAgeSequenceInstructions * Assembler::kInstrSize); |
| 268 | 267 |
| 269 | 268 Handle<Code> RelocInfo::code_age_stub_handle(Assembler* origin) { |
| 270 Handle<Object> RelocInfo::code_age_stub_handle(Assembler* origin) { | |
| 271 UNREACHABLE(); // This should never be reached on PPC. | 269 UNREACHABLE(); // This should never be reached on PPC. |
| 272 return Handle<Object>(); | 270 return Handle<Code>(); |
| 273 } | 271 } |
| 274 | 272 |
| 275 | 273 |
| 276 Code* RelocInfo::code_age_stub() { | 274 Code* RelocInfo::code_age_stub() { |
| 277 DCHECK(rmode_ == RelocInfo::CODE_AGE_SEQUENCE); | 275 DCHECK(rmode_ == RelocInfo::CODE_AGE_SEQUENCE); |
| 278 return Code::GetCodeFromTargetAddress( | 276 return Code::GetCodeFromTargetAddress( |
| 279 Assembler::target_address_at(pc_ + kCodeAgingTargetDelta, host_)); | 277 Assembler::target_address_at(pc_ + kCodeAgingTargetDelta, host_)); |
| 280 } | 278 } |
| 281 | 279 |
| 282 | 280 |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 } | 680 } |
| 683 #endif | 681 #endif |
| 684 return; | 682 return; |
| 685 } | 683 } |
| 686 UNREACHABLE(); | 684 UNREACHABLE(); |
| 687 } | 685 } |
| 688 } // namespace internal | 686 } // namespace internal |
| 689 } // namespace v8 | 687 } // namespace v8 |
| 690 | 688 |
| 691 #endif // V8_PPC_ASSEMBLER_PPC_INL_H_ | 689 #endif // V8_PPC_ASSEMBLER_PPC_INL_H_ |
| OLD | NEW |