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

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

Issue 146021: X64 implementation: Change argument to relocator to take a 64-bit delta. Cha... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 6 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/x64/assembler-x64.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 2009 the V8 project authors. All rights reserved. 1 // Copyright 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 void Assembler::set_target_address_at(Address pc, Address target) { 140 void Assembler::set_target_address_at(Address pc, Address target) {
141 Memory::Address_at(pc) = target; 141 Memory::Address_at(pc) = target;
142 CPU::FlushICache(pc, sizeof(intptr_t)); 142 CPU::FlushICache(pc, sizeof(intptr_t));
143 } 143 }
144 144
145 145
146 // ----------------------------------------------------------------------------- 146 // -----------------------------------------------------------------------------
147 // Implementation of RelocInfo 147 // Implementation of RelocInfo
148 148
149 // The modes possibly affected by apply must be in kApplyMask. 149 // The modes possibly affected by apply must be in kApplyMask.
150 void RelocInfo::apply(int delta) { 150 void RelocInfo::apply(intptr_t delta) {
151 if (rmode_ == RUNTIME_ENTRY || IsCodeTarget(rmode_)) { 151 if (IsInternalReference(rmode_)) {
152 intptr_t* p = reinterpret_cast<intptr_t*>(pc_);
153 *p -= delta; // relocate entry
154 } else if (IsInternalReference(rmode_)) {
155 // absolute code pointer inside code object moves with the code object. 152 // absolute code pointer inside code object moves with the code object.
156 intptr_t* p = reinterpret_cast<intptr_t*>(pc_); 153 intptr_t* p = reinterpret_cast<intptr_t*>(pc_);
157 *p += delta; // relocate entry 154 *p += delta; // relocate entry
158 } 155 }
159 } 156 }
160 157
161 158
162 Address RelocInfo::target_address() { 159 Address RelocInfo::target_address() {
163 ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY); 160 ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY);
164 return Assembler::target_address_at(pc_); 161 return Assembler::target_address_at(pc_);
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 ASSERT(len_ == 1 || len_ == 2); 272 ASSERT(len_ == 1 || len_ == 2);
276 int32_t* p = reinterpret_cast<int32_t*>(&buf_[len_]); 273 int32_t* p = reinterpret_cast<int32_t*>(&buf_[len_]);
277 *p = disp; 274 *p = disp;
278 len_ += sizeof(int32_t); 275 len_ += sizeof(int32_t);
279 } 276 }
280 277
281 278
282 } } // namespace v8::internal 279 } } // namespace v8::internal
283 280
284 #endif // V8_X64_ASSEMBLER_X64_INL_H_ 281 #endif // V8_X64_ASSEMBLER_X64_INL_H_
OLDNEW
« no previous file with comments | « src/x64/assembler-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698