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

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

Issue 10837037: Age code to allow reclaiming old unexecuted functions (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback Created 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/arm/builtins-arm.cc » ('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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 Memory::Address_at(pc_) = address; 158 Memory::Address_at(pc_) = address;
159 if (mode == UPDATE_WRITE_BARRIER && host() != NULL) { 159 if (mode == UPDATE_WRITE_BARRIER && host() != NULL) {
160 // TODO(1550) We are passing NULL as a slot because cell can never be on 160 // TODO(1550) We are passing NULL as a slot because cell can never be on
161 // evacuation candidate. 161 // evacuation candidate.
162 host()->GetHeap()->incremental_marking()->RecordWrite( 162 host()->GetHeap()->incremental_marking()->RecordWrite(
163 host(), NULL, cell); 163 host(), NULL, cell);
164 } 164 }
165 } 165 }
166 166
167 167
168 static const int kNoCodeAgeSequenceLength = 3;
169
170 Code* RelocInfo::code_age_stub() {
171 ASSERT(rmode_ == RelocInfo::CODE_AGE_SEQUENCE);
172 return Code::GetCodeFromTargetAddress(
173 Memory::Address_at(pc_ + Assembler::kInstrSize *
174 (kNoCodeAgeSequenceLength - 1)));
175 }
176
177
178 void RelocInfo::set_code_age_stub(Code* stub) {
179 ASSERT(rmode_ == RelocInfo::CODE_AGE_SEQUENCE);
180 Memory::Address_at(pc_ + Assembler::kInstrSize *
181 (kNoCodeAgeSequenceLength - 1)) =
182 stub->instruction_start();
183 }
184
185
168 Address RelocInfo::call_address() { 186 Address RelocInfo::call_address() {
169 // The 2 instructions offset assumes patched debug break slot or return 187 // The 2 instructions offset assumes patched debug break slot or return
170 // sequence. 188 // sequence.
171 ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) || 189 ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) ||
172 (IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence())); 190 (IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence()));
173 return Memory::Address_at(pc_ + 2 * Assembler::kInstrSize); 191 return Memory::Address_at(pc_ + 2 * Assembler::kInstrSize);
174 } 192 }
175 193
176 194
177 void RelocInfo::set_call_address(Address target) { 195 void RelocInfo::set_call_address(Address target) {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 void RelocInfo::Visit(ObjectVisitor* visitor) { 249 void RelocInfo::Visit(ObjectVisitor* visitor) {
232 RelocInfo::Mode mode = rmode(); 250 RelocInfo::Mode mode = rmode();
233 if (mode == RelocInfo::EMBEDDED_OBJECT) { 251 if (mode == RelocInfo::EMBEDDED_OBJECT) {
234 visitor->VisitEmbeddedPointer(this); 252 visitor->VisitEmbeddedPointer(this);
235 } else if (RelocInfo::IsCodeTarget(mode)) { 253 } else if (RelocInfo::IsCodeTarget(mode)) {
236 visitor->VisitCodeTarget(this); 254 visitor->VisitCodeTarget(this);
237 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { 255 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) {
238 visitor->VisitGlobalPropertyCell(this); 256 visitor->VisitGlobalPropertyCell(this);
239 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { 257 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
240 visitor->VisitExternalReference(this); 258 visitor->VisitExternalReference(this);
259 } else if (RelocInfo::IsCodeAgeSequence(mode)) {
260 visitor->VisitCodeAgeSequence(this);
241 #ifdef ENABLE_DEBUGGER_SUPPORT 261 #ifdef ENABLE_DEBUGGER_SUPPORT
242 // TODO(isolates): Get a cached isolate below. 262 // TODO(isolates): Get a cached isolate below.
243 } else if (((RelocInfo::IsJSReturn(mode) && 263 } else if (((RelocInfo::IsJSReturn(mode) &&
244 IsPatchedReturnSequence()) || 264 IsPatchedReturnSequence()) ||
245 (RelocInfo::IsDebugBreakSlot(mode) && 265 (RelocInfo::IsDebugBreakSlot(mode) &&
246 IsPatchedDebugBreakSlotSequence())) && 266 IsPatchedDebugBreakSlotSequence())) &&
247 Isolate::Current()->debug()->has_break_points()) { 267 Isolate::Current()->debug()->has_break_points()) {
248 visitor->VisitDebugTarget(this); 268 visitor->VisitDebugTarget(this);
249 #endif 269 #endif
250 } else if (mode == RelocInfo::RUNTIME_ENTRY) { 270 } else if (mode == RelocInfo::RUNTIME_ENTRY) {
251 visitor->VisitRuntimeEntry(this); 271 visitor->VisitRuntimeEntry(this);
252 } 272 }
253 } 273 }
254 274
255 275
256 template<typename StaticVisitor> 276 template<typename StaticVisitor>
257 void RelocInfo::Visit(Heap* heap) { 277 void RelocInfo::Visit(Heap* heap) {
258 RelocInfo::Mode mode = rmode(); 278 RelocInfo::Mode mode = rmode();
259 if (mode == RelocInfo::EMBEDDED_OBJECT) { 279 if (mode == RelocInfo::EMBEDDED_OBJECT) {
260 StaticVisitor::VisitEmbeddedPointer(heap, this); 280 StaticVisitor::VisitEmbeddedPointer(heap, this);
261 } else if (RelocInfo::IsCodeTarget(mode)) { 281 } else if (RelocInfo::IsCodeTarget(mode)) {
262 StaticVisitor::VisitCodeTarget(heap, this); 282 StaticVisitor::VisitCodeTarget(heap, this);
263 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { 283 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) {
264 StaticVisitor::VisitGlobalPropertyCell(heap, this); 284 StaticVisitor::VisitGlobalPropertyCell(heap, this);
265 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { 285 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
266 StaticVisitor::VisitExternalReference(this); 286 StaticVisitor::VisitExternalReference(this);
287 } else if (RelocInfo::IsCodeAgeSequence(mode)) {
288 StaticVisitor::VisitCodeAgeSequence(heap, this);
267 #ifdef ENABLE_DEBUGGER_SUPPORT 289 #ifdef ENABLE_DEBUGGER_SUPPORT
268 } else if (heap->isolate()->debug()->has_break_points() && 290 } else if (heap->isolate()->debug()->has_break_points() &&
269 ((RelocInfo::IsJSReturn(mode) && 291 ((RelocInfo::IsJSReturn(mode) &&
270 IsPatchedReturnSequence()) || 292 IsPatchedReturnSequence()) ||
271 (RelocInfo::IsDebugBreakSlot(mode) && 293 (RelocInfo::IsDebugBreakSlot(mode) &&
272 IsPatchedDebugBreakSlotSequence()))) { 294 IsPatchedDebugBreakSlotSequence()))) {
273 StaticVisitor::VisitDebugTarget(heap, this); 295 StaticVisitor::VisitDebugTarget(heap, this);
274 #endif 296 #endif
275 } else if (mode == RelocInfo::RUNTIME_ENTRY) { 297 } else if (mode == RelocInfo::RUNTIME_ENTRY) {
276 StaticVisitor::VisitRuntimeEntry(this); 298 StaticVisitor::VisitRuntimeEntry(this);
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 499
478 500
479 void Assembler::set_target_address_at(Address pc, Address target) { 501 void Assembler::set_target_address_at(Address pc, Address target) {
480 set_target_pointer_at(pc, target); 502 set_target_pointer_at(pc, target);
481 } 503 }
482 504
483 505
484 } } // namespace v8::internal 506 } } // namespace v8::internal
485 507
486 #endif // V8_ARM_ASSEMBLER_ARM_INL_H_ 508 #endif // V8_ARM_ASSEMBLER_ARM_INL_H_
OLDNEW
« no previous file with comments | « no previous file | src/arm/builtins-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698