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

Side by Side Diff: src/arm/assembler-arm-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 | « no previous file | src/ia32/assembler-ia32-inl.h » ('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 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 } 57 }
58 58
59 59
60 Address RelocInfo::target_address() { 60 Address RelocInfo::target_address() {
61 ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY); 61 ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY);
62 return Assembler::target_address_at(pc_); 62 return Assembler::target_address_at(pc_);
63 } 63 }
64 64
65 65
66 Address RelocInfo::target_address_address() { 66 Address RelocInfo::target_address_address() {
67 ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY); 67 ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY
68 || rmode_ == EMBEDDED_OBJECT
69 || rmode_ == EXTERNAL_REFERENCE);
68 return reinterpret_cast<Address>(Assembler::target_address_address_at(pc_)); 70 return reinterpret_cast<Address>(Assembler::target_address_address_at(pc_));
69 } 71 }
70 72
71 73
72 int RelocInfo::target_address_size() { 74 int RelocInfo::target_address_size() {
73 return Assembler::kExternalTargetSize; 75 return Assembler::kExternalTargetSize;
74 } 76 }
75 77
76 78
77 void RelocInfo::set_target_address(Address target, WriteBarrierMode mode) { 79 void RelocInfo::set_target_address(Address target, WriteBarrierMode mode) {
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 219
218 void RelocInfo::Visit(ObjectVisitor* visitor) { 220 void RelocInfo::Visit(ObjectVisitor* visitor) {
219 RelocInfo::Mode mode = rmode(); 221 RelocInfo::Mode mode = rmode();
220 if (mode == RelocInfo::EMBEDDED_OBJECT) { 222 if (mode == RelocInfo::EMBEDDED_OBJECT) {
221 visitor->VisitEmbeddedPointer(this); 223 visitor->VisitEmbeddedPointer(this);
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 #ifdef ENABLE_DEBUGGER_SUPPORT 230 #ifdef ENABLE_DEBUGGER_SUPPORT
229 // TODO(isolates): Get a cached isolate below. 231 // TODO(isolates): Get a cached isolate below.
230 } else if (((RelocInfo::IsJSReturn(mode) && 232 } else if (((RelocInfo::IsJSReturn(mode) &&
231 IsPatchedReturnSequence()) || 233 IsPatchedReturnSequence()) ||
232 (RelocInfo::IsDebugBreakSlot(mode) && 234 (RelocInfo::IsDebugBreakSlot(mode) &&
233 IsPatchedDebugBreakSlotSequence())) && 235 IsPatchedDebugBreakSlotSequence())) &&
234 Isolate::Current()->debug()->has_break_points()) { 236 Isolate::Current()->debug()->has_break_points()) {
235 visitor->VisitDebugTarget(this); 237 visitor->VisitDebugTarget(this);
236 #endif 238 #endif
237 } else if (mode == RelocInfo::RUNTIME_ENTRY) { 239 } else if (mode == RelocInfo::RUNTIME_ENTRY) {
238 visitor->VisitRuntimeEntry(this); 240 visitor->VisitRuntimeEntry(this);
239 } 241 }
240 } 242 }
241 243
242 244
243 template<typename StaticVisitor> 245 template<typename StaticVisitor>
244 void RelocInfo::Visit(Heap* heap) { 246 void RelocInfo::Visit(Heap* heap) {
245 RelocInfo::Mode mode = rmode(); 247 RelocInfo::Mode mode = rmode();
246 if (mode == RelocInfo::EMBEDDED_OBJECT) { 248 if (mode == RelocInfo::EMBEDDED_OBJECT) {
247 StaticVisitor::VisitEmbeddedPointer(heap, this); 249 StaticVisitor::VisitEmbeddedPointer(heap, this);
248 } else if (RelocInfo::IsCodeTarget(mode)) { 250 } else if (RelocInfo::IsCodeTarget(mode)) {
249 StaticVisitor::VisitCodeTarget(heap, this); 251 StaticVisitor::VisitCodeTarget(heap, this);
250 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { 252 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) {
251 StaticVisitor::VisitGlobalPropertyCell(heap, this); 253 StaticVisitor::VisitGlobalPropertyCell(heap, this);
252 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { 254 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
253 StaticVisitor::VisitExternalReference(target_reference_address()); 255 StaticVisitor::VisitExternalReference(this);
254 #ifdef ENABLE_DEBUGGER_SUPPORT 256 #ifdef ENABLE_DEBUGGER_SUPPORT
255 } else if (heap->isolate()->debug()->has_break_points() && 257 } else if (heap->isolate()->debug()->has_break_points() &&
256 ((RelocInfo::IsJSReturn(mode) && 258 ((RelocInfo::IsJSReturn(mode) &&
257 IsPatchedReturnSequence()) || 259 IsPatchedReturnSequence()) ||
258 (RelocInfo::IsDebugBreakSlot(mode) && 260 (RelocInfo::IsDebugBreakSlot(mode) &&
259 IsPatchedDebugBreakSlotSequence()))) { 261 IsPatchedDebugBreakSlotSequence()))) {
260 StaticVisitor::VisitDebugTarget(heap, this); 262 StaticVisitor::VisitDebugTarget(heap, this);
261 #endif 263 #endif
262 } else if (mode == RelocInfo::RUNTIME_ENTRY) { 264 } else if (mode == RelocInfo::RUNTIME_ENTRY) {
263 StaticVisitor::VisitRuntimeEntry(this); 265 StaticVisitor::VisitRuntimeEntry(this);
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 // CPU::FlushICache(pc, sizeof(target)); 369 // CPU::FlushICache(pc, sizeof(target));
368 // However, on ARM, no instruction was actually patched by the assignment 370 // However, on ARM, no instruction was actually patched by the assignment
369 // above; the target address is not part of an instruction, it is patched in 371 // above; the target address is not part of an instruction, it is patched in
370 // the constant pool and is read via a data access; the instruction accessing 372 // the constant pool and is read via a data access; the instruction accessing
371 // this address in the constant pool remains unchanged. 373 // this address in the constant pool remains unchanged.
372 } 374 }
373 375
374 } } // namespace v8::internal 376 } } // namespace v8::internal
375 377
376 #endif // V8_ARM_ASSEMBLER_ARM_INL_H_ 378 #endif // V8_ARM_ASSEMBLER_ARM_INL_H_
OLDNEW
« no previous file with comments | « no previous file | src/ia32/assembler-ia32-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698