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

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

Issue 8245007: Refactor how embedded pointers are visited. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments by Vyacheslav Egorov. Created 9 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/assembler.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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 208
209 bool RelocInfo::IsPatchedDebugBreakSlotSequence() { 209 bool RelocInfo::IsPatchedDebugBreakSlotSequence() {
210 Instr current_instr = Assembler::instr_at(pc_); 210 Instr current_instr = Assembler::instr_at(pc_);
211 return !Assembler::IsNop(current_instr, Assembler::DEBUG_BREAK_NOP); 211 return !Assembler::IsNop(current_instr, Assembler::DEBUG_BREAK_NOP);
212 } 212 }
213 213
214 214
215 void RelocInfo::Visit(ObjectVisitor* visitor) { 215 void RelocInfo::Visit(ObjectVisitor* visitor) {
216 RelocInfo::Mode mode = rmode(); 216 RelocInfo::Mode mode = rmode();
217 if (mode == RelocInfo::EMBEDDED_OBJECT) { 217 if (mode == RelocInfo::EMBEDDED_OBJECT) {
218 visitor->VisitEmbeddedPointer(host(), target_object_address()); 218 visitor->VisitEmbeddedPointer(this);
219 } else if (RelocInfo::IsCodeTarget(mode)) { 219 } else if (RelocInfo::IsCodeTarget(mode)) {
220 visitor->VisitCodeTarget(this); 220 visitor->VisitCodeTarget(this);
221 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { 221 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) {
222 visitor->VisitGlobalPropertyCell(this); 222 visitor->VisitGlobalPropertyCell(this);
223 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { 223 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
224 visitor->VisitExternalReference(target_reference_address()); 224 visitor->VisitExternalReference(target_reference_address());
225 #ifdef ENABLE_DEBUGGER_SUPPORT 225 #ifdef ENABLE_DEBUGGER_SUPPORT
226 // TODO(isolates): Get a cached isolate below. 226 // TODO(isolates): Get a cached isolate below.
227 } else if (((RelocInfo::IsJSReturn(mode) && 227 } else if (((RelocInfo::IsJSReturn(mode) &&
228 IsPatchedReturnSequence()) || 228 IsPatchedReturnSequence()) ||
229 (RelocInfo::IsDebugBreakSlot(mode) && 229 (RelocInfo::IsDebugBreakSlot(mode) &&
230 IsPatchedDebugBreakSlotSequence())) && 230 IsPatchedDebugBreakSlotSequence())) &&
231 Isolate::Current()->debug()->has_break_points()) { 231 Isolate::Current()->debug()->has_break_points()) {
232 visitor->VisitDebugTarget(this); 232 visitor->VisitDebugTarget(this);
233 #endif 233 #endif
234 } else if (mode == RelocInfo::RUNTIME_ENTRY) { 234 } else if (mode == RelocInfo::RUNTIME_ENTRY) {
235 visitor->VisitRuntimeEntry(this); 235 visitor->VisitRuntimeEntry(this);
236 } 236 }
237 } 237 }
238 238
239 239
240 template<typename StaticVisitor> 240 template<typename StaticVisitor>
241 void RelocInfo::Visit(Heap* heap) { 241 void RelocInfo::Visit(Heap* heap) {
242 RelocInfo::Mode mode = rmode(); 242 RelocInfo::Mode mode = rmode();
243 if (mode == RelocInfo::EMBEDDED_OBJECT) { 243 if (mode == RelocInfo::EMBEDDED_OBJECT) {
244 StaticVisitor::VisitEmbeddedPointer(heap, host(), target_object_address()); 244 StaticVisitor::VisitEmbeddedPointer(heap, this);
245 } else if (RelocInfo::IsCodeTarget(mode)) { 245 } else if (RelocInfo::IsCodeTarget(mode)) {
246 StaticVisitor::VisitCodeTarget(heap, this); 246 StaticVisitor::VisitCodeTarget(heap, this);
247 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { 247 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) {
248 StaticVisitor::VisitGlobalPropertyCell(heap, this); 248 StaticVisitor::VisitGlobalPropertyCell(heap, this);
249 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { 249 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
250 StaticVisitor::VisitExternalReference(target_reference_address()); 250 StaticVisitor::VisitExternalReference(target_reference_address());
251 #ifdef ENABLE_DEBUGGER_SUPPORT 251 #ifdef ENABLE_DEBUGGER_SUPPORT
252 } else if (heap->isolate()->debug()->has_break_points() && 252 } else if (heap->isolate()->debug()->has_break_points() &&
253 ((RelocInfo::IsJSReturn(mode) && 253 ((RelocInfo::IsJSReturn(mode) &&
254 IsPatchedReturnSequence()) || 254 IsPatchedReturnSequence()) ||
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 // CPU::FlushICache(pc, sizeof(target)); 364 // CPU::FlushICache(pc, sizeof(target));
365 // However, on ARM, no instruction was actually patched by the assignment 365 // However, on ARM, no instruction was actually patched by the assignment
366 // above; the target address is not part of an instruction, it is patched in 366 // above; the target address is not part of an instruction, it is patched in
367 // the constant pool and is read via a data access; the instruction accessing 367 // the constant pool and is read via a data access; the instruction accessing
368 // this address in the constant pool remains unchanged. 368 // this address in the constant pool remains unchanged.
369 } 369 }
370 370
371 } } // namespace v8::internal 371 } } // namespace v8::internal
372 372
373 #endif // V8_ARM_ASSEMBLER_ARM_INL_H_ 373 #endif // V8_ARM_ASSEMBLER_ARM_INL_H_
OLDNEW
« no previous file with comments | « no previous file | src/assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698