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

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

Issue 986553005: Contribution of PowerPC port (continuation of 422063005) - serialize.cc cleanup (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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
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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 45
46 namespace v8 { 46 namespace v8 {
47 namespace internal { 47 namespace internal {
48 48
49 49
50 bool CpuFeatures::SupportsCrankshaft() { return true; } 50 bool CpuFeatures::SupportsCrankshaft() { return true; }
51 51
52 52
53 void RelocInfo::apply(intptr_t delta, ICacheFlushMode icache_flush_mode) { 53 void RelocInfo::apply(intptr_t delta, ICacheFlushMode icache_flush_mode) {
54 if (IsInternalReference(rmode_) || IsInternalReferenceEncoded(rmode_)) { 54 DCHECK(IsInternalReference(rmode_) || IsInternalReferenceEncoded(rmode_));
55 // absolute code pointer inside code object moves with the code object. 55 // absolute code pointer inside code object moves with the code object.
56 Assembler::RelocateInternalReference(pc_, delta, 0, rmode_, 56 set_target_internal_reference(target_internal_reference() + delta,
57 icache_flush_mode); 57 icache_flush_mode);
58 }
59
60
61 Address RelocInfo::target_internal_reference() {
62 if (IsInternalReference(rmode_)) {
63 // Jump table entry
64 return Memory::Address_at(pc_);
65 } else {
66 // mov sequence
67 DCHECK(IsInternalReferenceEncoded(rmode_));
68 return Assembler::target_address_at(pc_, host_);
58 } 69 }
59 } 70 }
60 71
72
73 void RelocInfo::set_target_internal_reference(
74 Address target, ICacheFlushMode icache_flush_mode) {
75 if (IsInternalReference(rmode_)) {
76 // Jump table entry
77 Memory::Address_at(pc_) = target;
78 } else {
79 // mov sequence
80 DCHECK(IsInternalReferenceEncoded(rmode_));
81 Assembler::set_target_address_at(pc_, host_, target, icache_flush_mode);
82 }
83 }
84
61 85
62 Address RelocInfo::target_address() { 86 Address RelocInfo::target_address() {
63 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_)); 87 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_));
64 return Assembler::target_address_at(pc_, host_); 88 return Assembler::target_address_at(pc_, host_);
65 } 89 }
66 90
67 91
68 Address RelocInfo::target_address_address() { 92 Address RelocInfo::target_address_address() {
69 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) || 93 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) ||
70 rmode_ == EMBEDDED_OBJECT || rmode_ == EXTERNAL_REFERENCE); 94 rmode_ == EMBEDDED_OBJECT || rmode_ == EXTERNAL_REFERENCE);
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 } 177 }
154 } 178 }
155 179
156 180
157 Address RelocInfo::target_external_reference() { 181 Address RelocInfo::target_external_reference() {
158 DCHECK(rmode_ == EXTERNAL_REFERENCE); 182 DCHECK(rmode_ == EXTERNAL_REFERENCE);
159 return Assembler::target_address_at(pc_, host_); 183 return Assembler::target_address_at(pc_, host_);
160 } 184 }
161 185
162 186
163 Address RelocInfo::target_internal_reference() {
164 DCHECK(rmode_ == INTERNAL_REFERENCE);
165 return Memory::Address_at(pc_);
166 }
167
168
169 void RelocInfo::set_target_internal_reference(Address target) {
170 DCHECK(rmode_ == INTERNAL_REFERENCE);
171 Memory::Address_at(pc_) = target;
172 }
173
174
175 Address RelocInfo::target_runtime_entry(Assembler* origin) { 187 Address RelocInfo::target_runtime_entry(Assembler* origin) {
176 DCHECK(IsRuntimeEntry(rmode_)); 188 DCHECK(IsRuntimeEntry(rmode_));
177 return target_address(); 189 return target_address();
178 } 190 }
179 191
180 192
181 void RelocInfo::set_target_runtime_entry(Address target, 193 void RelocInfo::set_target_runtime_entry(Address target,
182 WriteBarrierMode write_barrier_mode, 194 WriteBarrierMode write_barrier_mode,
183 ICacheFlushMode icache_flush_mode) { 195 ICacheFlushMode icache_flush_mode) {
184 DCHECK(IsRuntimeEntry(rmode_)); 196 DCHECK(IsRuntimeEntry(rmode_));
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 } 523 }
512 #endif 524 #endif
513 return; 525 return;
514 } 526 }
515 UNREACHABLE(); 527 UNREACHABLE();
516 } 528 }
517 } 529 }
518 } // namespace v8::internal 530 } // namespace v8::internal
519 531
520 #endif // V8_PPC_ASSEMBLER_PPC_INL_H_ 532 #endif // V8_PPC_ASSEMBLER_PPC_INL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698