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

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

Issue 8467010: Refactor embedded pointer visitors for the serializer (Closed)
Patch Set: Rebased on r9943, updated based on code review comments Created 9 years, 1 month 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/arm/assembler-arm-inl.h ('k') | src/mark-compact.cc » ('j') | 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 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 } 71 }
72 72
73 73
74 Address RelocInfo::target_address() { 74 Address RelocInfo::target_address() {
75 ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY); 75 ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY);
76 return Assembler::target_address_at(pc_); 76 return Assembler::target_address_at(pc_);
77 } 77 }
78 78
79 79
80 Address RelocInfo::target_address_address() { 80 Address RelocInfo::target_address_address() {
81 ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY); 81 ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY
82 || rmode_ == EMBEDDED_OBJECT
83 || rmode_ == EXTERNAL_REFERENCE);
82 return reinterpret_cast<Address>(pc_); 84 return reinterpret_cast<Address>(pc_);
83 } 85 }
84 86
85 87
86 int RelocInfo::target_address_size() { 88 int RelocInfo::target_address_size() {
87 return Assembler::kExternalTargetSize; 89 return Assembler::kExternalTargetSize;
88 } 90 }
89 91
90 92
91 void RelocInfo::set_target_address(Address target, WriteBarrierMode mode) { 93 void RelocInfo::set_target_address(Address target, WriteBarrierMode mode) {
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 void RelocInfo::Visit(ObjectVisitor* visitor) { 219 void RelocInfo::Visit(ObjectVisitor* visitor) {
218 RelocInfo::Mode mode = rmode(); 220 RelocInfo::Mode mode = rmode();
219 if (mode == RelocInfo::EMBEDDED_OBJECT) { 221 if (mode == RelocInfo::EMBEDDED_OBJECT) {
220 visitor->VisitEmbeddedPointer(this); 222 visitor->VisitEmbeddedPointer(this);
221 CPU::FlushICache(pc_, sizeof(Address)); 223 CPU::FlushICache(pc_, sizeof(Address));
222 } else if (RelocInfo::IsCodeTarget(mode)) { 224 } else if (RelocInfo::IsCodeTarget(mode)) {
223 visitor->VisitCodeTarget(this); 225 visitor->VisitCodeTarget(this);
224 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { 226 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) {
225 visitor->VisitGlobalPropertyCell(this); 227 visitor->VisitGlobalPropertyCell(this);
226 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { 228 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
227 visitor->VisitExternalReference(target_reference_address()); 229 visitor->VisitExternalReference(this);
228 CPU::FlushICache(pc_, sizeof(Address)); 230 CPU::FlushICache(pc_, sizeof(Address));
229 #ifdef ENABLE_DEBUGGER_SUPPORT 231 #ifdef ENABLE_DEBUGGER_SUPPORT
230 // TODO(isolates): Get a cached isolate below. 232 // TODO(isolates): Get a cached isolate below.
231 } else if (((RelocInfo::IsJSReturn(mode) && 233 } else if (((RelocInfo::IsJSReturn(mode) &&
232 IsPatchedReturnSequence()) || 234 IsPatchedReturnSequence()) ||
233 (RelocInfo::IsDebugBreakSlot(mode) && 235 (RelocInfo::IsDebugBreakSlot(mode) &&
234 IsPatchedDebugBreakSlotSequence())) && 236 IsPatchedDebugBreakSlotSequence())) &&
235 Isolate::Current()->debug()->has_break_points()) { 237 Isolate::Current()->debug()->has_break_points()) {
236 visitor->VisitDebugTarget(this); 238 visitor->VisitDebugTarget(this);
237 #endif 239 #endif
238 } else if (mode == RelocInfo::RUNTIME_ENTRY) { 240 } else if (mode == RelocInfo::RUNTIME_ENTRY) {
239 visitor->VisitRuntimeEntry(this); 241 visitor->VisitRuntimeEntry(this);
240 } 242 }
241 } 243 }
242 244
243 245
244 template<typename StaticVisitor> 246 template<typename StaticVisitor>
245 void RelocInfo::Visit(Heap* heap) { 247 void RelocInfo::Visit(Heap* heap) {
246 RelocInfo::Mode mode = rmode(); 248 RelocInfo::Mode mode = rmode();
247 if (mode == RelocInfo::EMBEDDED_OBJECT) { 249 if (mode == RelocInfo::EMBEDDED_OBJECT) {
248 StaticVisitor::VisitEmbeddedPointer(heap, this); 250 StaticVisitor::VisitEmbeddedPointer(heap, this);
249 CPU::FlushICache(pc_, sizeof(Address)); 251 CPU::FlushICache(pc_, sizeof(Address));
250 } else if (RelocInfo::IsCodeTarget(mode)) { 252 } else if (RelocInfo::IsCodeTarget(mode)) {
251 StaticVisitor::VisitCodeTarget(heap, this); 253 StaticVisitor::VisitCodeTarget(heap, this);
252 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { 254 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) {
253 StaticVisitor::VisitGlobalPropertyCell(heap, this); 255 StaticVisitor::VisitGlobalPropertyCell(heap, this);
254 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { 256 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
255 StaticVisitor::VisitExternalReference(target_reference_address()); 257 StaticVisitor::VisitExternalReference(this);
256 CPU::FlushICache(pc_, sizeof(Address)); 258 CPU::FlushICache(pc_, sizeof(Address));
257 #ifdef ENABLE_DEBUGGER_SUPPORT 259 #ifdef ENABLE_DEBUGGER_SUPPORT
258 } else if (heap->isolate()->debug()->has_break_points() && 260 } else if (heap->isolate()->debug()->has_break_points() &&
259 ((RelocInfo::IsJSReturn(mode) && 261 ((RelocInfo::IsJSReturn(mode) &&
260 IsPatchedReturnSequence()) || 262 IsPatchedReturnSequence()) ||
261 (RelocInfo::IsDebugBreakSlot(mode) && 263 (RelocInfo::IsDebugBreakSlot(mode) &&
262 IsPatchedDebugBreakSlotSequence()))) { 264 IsPatchedDebugBreakSlotSequence()))) {
263 StaticVisitor::VisitDebugTarget(heap, this); 265 StaticVisitor::VisitDebugTarget(heap, this);
264 #endif 266 #endif
265 } else if (mode == RelocInfo::RUNTIME_ENTRY) { 267 } else if (mode == RelocInfo::RUNTIME_ENTRY) {
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 462
461 Operand::Operand(int32_t disp, RelocInfo::Mode rmode) { 463 Operand::Operand(int32_t disp, RelocInfo::Mode rmode) {
462 // [disp/r] 464 // [disp/r]
463 set_modrm(0, ebp); 465 set_modrm(0, ebp);
464 set_dispr(disp, rmode); 466 set_dispr(disp, rmode);
465 } 467 }
466 468
467 } } // namespace v8::internal 469 } } // namespace v8::internal
468 470
469 #endif // V8_IA32_ASSEMBLER_IA32_INL_H_ 471 #endif // V8_IA32_ASSEMBLER_IA32_INL_H_
OLDNEW
« no previous file with comments | « src/arm/assembler-arm-inl.h ('k') | src/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698