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

Unified Diff: src/ic-inl.h

Issue 13285: Refactor the convertion of a target address into a code object from the debug... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/disassembler.cc ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic-inl.h
===================================================================
--- src/ic-inl.h (revision 950)
+++ src/ic-inl.h (working copy)
@@ -59,14 +59,11 @@
Code* IC::GetTargetAtAddress(Address address) {
+ // Get the target address of the IC.
Address target = Assembler::target_address_at(address);
- HeapObject* code = HeapObject::FromAddress(target - Code::kHeaderSize);
- // GetTargetAtAddress is called from IC::Clear which in turn is
- // called when marking objects during mark sweep. reinterpret_cast
- // is therefore used instead of the more appropriate
- // Code::cast. Code::cast does not work when the object's map is
- // marked.
- Code* result = reinterpret_cast<Code*>(code);
+ // Convert target address to the code object. Code::GetCodeFromTargetAddress
+ // is safe for use during GC where the map might be marked.
+ Code* result = Code::GetCodeFromTargetAddress(target);
ASSERT(result->is_inline_cache_stub());
return result;
}
« no previous file with comments | « src/disassembler.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698