Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/s390/assembler-s390-inl.h

Issue 2739813002: PPC/s390: Make explicit that RelocInfo's target_object is always a HeapObject. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ppc/assembler-ppc-inl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 return pc + kCallTargetAddressOffset; 145 return pc + kCallTargetAddressOffset;
146 } 146 }
147 147
148 Handle<Object> Assembler::code_target_object_handle_at(Address pc) { 148 Handle<Object> Assembler::code_target_object_handle_at(Address pc) {
149 SixByteInstr instr = 149 SixByteInstr instr =
150 Instruction::InstructionBits(reinterpret_cast<const byte*>(pc)); 150 Instruction::InstructionBits(reinterpret_cast<const byte*>(pc));
151 int index = instr & 0xFFFFFFFF; 151 int index = instr & 0xFFFFFFFF;
152 return code_targets_[index]; 152 return code_targets_[index];
153 } 153 }
154 154
155 Object* RelocInfo::target_object() { 155 HeapObject* RelocInfo::target_object() {
156 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); 156 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
157 return reinterpret_cast<Object*>(Assembler::target_address_at(pc_, host_)); 157 return HeapObject::cast(
158 reinterpret_cast<Object*>(Assembler::target_address_at(pc_, host_)));
158 } 159 }
159 160
160 Handle<Object> RelocInfo::target_object_handle(Assembler* origin) { 161 Handle<HeapObject> RelocInfo::target_object_handle(Assembler* origin) {
161 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); 162 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
162 if (rmode_ == EMBEDDED_OBJECT) { 163 if (rmode_ == EMBEDDED_OBJECT) {
163 return Handle<Object>( 164 return Handle<HeapObject>(reinterpret_cast<HeapObject**>(
164 reinterpret_cast<Object**>(Assembler::target_address_at(pc_, host_))); 165 Assembler::target_address_at(pc_, host_)));
165 } else { 166 } else {
166 return origin->code_target_object_handle_at(pc_); 167 return Handle<HeapObject>::cast(origin->code_target_object_handle_at(pc_));
167 } 168 }
168 } 169 }
169 170
170 void RelocInfo::set_target_object(Object* target, 171 void RelocInfo::set_target_object(HeapObject* target,
171 WriteBarrierMode write_barrier_mode, 172 WriteBarrierMode write_barrier_mode,
172 ICacheFlushMode icache_flush_mode) { 173 ICacheFlushMode icache_flush_mode) {
173 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); 174 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
174 Assembler::set_target_address_at(isolate_, pc_, host_, 175 Assembler::set_target_address_at(isolate_, pc_, host_,
175 reinterpret_cast<Address>(target), 176 reinterpret_cast<Address>(target),
176 icache_flush_mode); 177 icache_flush_mode);
177 if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != NULL && 178 if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != NULL &&
178 target->IsHeapObject()) { 179 target->IsHeapObject()) {
179 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode( 180 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode(
180 host(), this, HeapObject::cast(target)); 181 host(), this, HeapObject::cast(target));
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 static const int kNoCodeAgeSequenceLength = 30; 239 static const int kNoCodeAgeSequenceLength = 30;
239 #else 240 #else
240 // NOP + LAY + ST + IILF + BASR 241 // NOP + LAY + ST + IILF + BASR
241 static const int kCodeAgingSequenceLength = 20; 242 static const int kCodeAgingSequenceLength = 20;
242 static const int kCodeAgingTargetDelta = 12; // Jump past NOP to IILF 243 static const int kCodeAgingTargetDelta = 12; // Jump past NOP to IILF
243 // LAY + 4 * ST + LA 244 // LAY + 4 * ST + LA
244 static const int kNoCodeAgeSequenceLength = 26; 245 static const int kNoCodeAgeSequenceLength = 26;
245 #endif 246 #endif
246 #endif 247 #endif
247 248
248 Handle<Object> RelocInfo::code_age_stub_handle(Assembler* origin) { 249 Handle<Code> RelocInfo::code_age_stub_handle(Assembler* origin) {
249 UNREACHABLE(); // This should never be reached on S390. 250 UNREACHABLE(); // This should never be reached on S390.
250 return Handle<Object>(); 251 return Handle<Code>();
251 } 252 }
252 253
253 Code* RelocInfo::code_age_stub() { 254 Code* RelocInfo::code_age_stub() {
254 DCHECK(rmode_ == RelocInfo::CODE_AGE_SEQUENCE); 255 DCHECK(rmode_ == RelocInfo::CODE_AGE_SEQUENCE);
255 return Code::GetCodeFromTargetAddress( 256 return Code::GetCodeFromTargetAddress(
256 Assembler::target_address_at(pc_ + kCodeAgingTargetDelta, host_)); 257 Assembler::target_address_at(pc_ + kCodeAgingTargetDelta, host_));
257 } 258 }
258 259
259 void RelocInfo::set_code_age_stub(Code* stub, 260 void RelocInfo::set_code_age_stub(Code* stub,
260 ICacheFlushMode icache_flush_mode) { 261 ICacheFlushMode icache_flush_mode) {
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 } 570 }
570 #endif 571 #endif
571 } 572 }
572 if (!patched) UNREACHABLE(); 573 if (!patched) UNREACHABLE();
573 } 574 }
574 575
575 } // namespace internal 576 } // namespace internal
576 } // namespace v8 577 } // namespace v8
577 578
578 #endif // V8_S390_ASSEMBLER_S390_INL_H_ 579 #endif // V8_S390_ASSEMBLER_S390_INL_H_
OLDNEW
« no previous file with comments | « src/ppc/assembler-ppc-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698