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

Side by Side Diff: src/objects.cc

Issue 193111: Use GetCodeFromTargetAddress everywhere, uniformly. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 3 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 | « src/mark-compact.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 4949 matching lines...) Expand 10 before | Expand all | Expand 10 after
4960 // Convert relocatable targets from address to code object address. This is 4960 // Convert relocatable targets from address to code object address. This is
4961 // mainly IC call targets but for debugging straight-line code can be replaced 4961 // mainly IC call targets but for debugging straight-line code can be replaced
4962 // with a call instruction which also has to be relocated. 4962 // with a call instruction which also has to be relocated.
4963 void Code::ConvertICTargetsFromAddressToObject() { 4963 void Code::ConvertICTargetsFromAddressToObject() {
4964 ASSERT(ic_flag() == IC_TARGET_IS_ADDRESS); 4964 ASSERT(ic_flag() == IC_TARGET_IS_ADDRESS);
4965 4965
4966 for (RelocIterator it(this, RelocInfo::kCodeTargetMask); 4966 for (RelocIterator it(this, RelocInfo::kCodeTargetMask);
4967 !it.done(); it.next()) { 4967 !it.done(); it.next()) {
4968 Address ic_addr = it.rinfo()->target_address(); 4968 Address ic_addr = it.rinfo()->target_address();
4969 ASSERT(ic_addr != NULL); 4969 ASSERT(ic_addr != NULL);
4970 HeapObject* code = HeapObject::FromAddress(ic_addr - Code::kHeaderSize); 4970 HeapObject* code = Code::GetCodeFromTargetAddress(ic_addr);
4971 ASSERT(code->IsHeapObject()); 4971 ASSERT(code->IsHeapObject());
4972 it.rinfo()->set_target_object(code); 4972 it.rinfo()->set_target_object(code);
4973 } 4973 }
4974 4974
4975 #ifdef ENABLE_DEBUGGER_SUPPORT 4975 #ifdef ENABLE_DEBUGGER_SUPPORT
4976 if (Debug::has_break_points()) { 4976 if (Debug::has_break_points()) {
4977 for (RelocIterator it(this, RelocInfo::ModeMask(RelocInfo::JS_RETURN)); 4977 for (RelocIterator it(this, RelocInfo::ModeMask(RelocInfo::JS_RETURN));
4978 !it.done(); 4978 !it.done();
4979 it.next()) { 4979 it.next()) {
4980 if (it.rinfo()->IsCallInstruction()) { 4980 if (it.rinfo()->IsCallInstruction()) {
4981 Address addr = it.rinfo()->call_address(); 4981 Address addr = it.rinfo()->call_address();
4982 ASSERT(addr != NULL); 4982 ASSERT(addr != NULL);
4983 HeapObject* code = HeapObject::FromAddress(addr - Code::kHeaderSize); 4983 HeapObject* code = Code::GetCodeFromTargetAddress(addr);
4984 ASSERT(code->IsHeapObject()); 4984 ASSERT(code->IsHeapObject());
4985 it.rinfo()->set_call_object(code); 4985 it.rinfo()->set_call_object(code);
4986 } 4986 }
4987 } 4987 }
4988 } 4988 }
4989 #endif 4989 #endif
4990 set_ic_flag(IC_TARGET_IS_OBJECT); 4990 set_ic_flag(IC_TARGET_IS_OBJECT);
4991 } 4991 }
4992 4992
4993 4993
(...skipping 3021 matching lines...) Expand 10 before | Expand all | Expand 10 after
8015 if (break_point_objects()->IsUndefined()) return 0; 8015 if (break_point_objects()->IsUndefined()) return 0;
8016 // Single beak point. 8016 // Single beak point.
8017 if (!break_point_objects()->IsFixedArray()) return 1; 8017 if (!break_point_objects()->IsFixedArray()) return 1;
8018 // Multiple break points. 8018 // Multiple break points.
8019 return FixedArray::cast(break_point_objects())->length(); 8019 return FixedArray::cast(break_point_objects())->length();
8020 } 8020 }
8021 #endif 8021 #endif
8022 8022
8023 8023
8024 } } // namespace v8::internal 8024 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mark-compact.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698