OLD | NEW |
| 1 |
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 2 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
2 // All Rights Reserved. | 3 // All Rights Reserved. |
3 // | 4 // |
4 // Redistribution and use in source and binary forms, with or without | 5 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 6 // modification, are permitted provided that the following conditions are |
6 // met: | 7 // met: |
7 // | 8 // |
8 // - Redistributions of source code must retain the above copyright notice, | 9 // - Redistributions of source code must retain the above copyright notice, |
9 // this list of conditions and the following disclaimer. | 10 // this list of conditions and the following disclaimer. |
10 // | 11 // |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 Memory::Address_at(pc_) = address; | 225 Memory::Address_at(pc_) = address; |
225 if (mode == UPDATE_WRITE_BARRIER && host() != NULL) { | 226 if (mode == UPDATE_WRITE_BARRIER && host() != NULL) { |
226 // TODO(1550) We are passing NULL as a slot because cell can never be on | 227 // TODO(1550) We are passing NULL as a slot because cell can never be on |
227 // evacuation candidate. | 228 // evacuation candidate. |
228 host()->GetHeap()->incremental_marking()->RecordWrite( | 229 host()->GetHeap()->incremental_marking()->RecordWrite( |
229 host(), NULL, cell); | 230 host(), NULL, cell); |
230 } | 231 } |
231 } | 232 } |
232 | 233 |
233 | 234 |
| 235 static const int kNoCodeAgeSequenceLength = 7; |
| 236 |
| 237 Code* RelocInfo::code_age_stub() { |
| 238 ASSERT(rmode_ == RelocInfo::CODE_AGE_SEQUENCE); |
| 239 return Code::GetCodeFromTargetAddress( |
| 240 Memory::Address_at(pc_ + Assembler::kInstrSize * |
| 241 (kNoCodeAgeSequenceLength - 1))); |
| 242 } |
| 243 |
| 244 |
| 245 void RelocInfo::set_code_age_stub(Code* stub) { |
| 246 ASSERT(rmode_ == RelocInfo::CODE_AGE_SEQUENCE); |
| 247 Memory::Address_at(pc_ + Assembler::kInstrSize * |
| 248 (kNoCodeAgeSequenceLength - 1)) = |
| 249 stub->instruction_start(); |
| 250 } |
| 251 |
| 252 |
234 Address RelocInfo::call_address() { | 253 Address RelocInfo::call_address() { |
235 ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) || | 254 ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) || |
236 (IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence())); | 255 (IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence())); |
237 // The pc_ offset of 0 assumes mips patched return sequence per | 256 // The pc_ offset of 0 assumes mips patched return sequence per |
238 // debug-mips.cc BreakLocationIterator::SetDebugBreakAtReturn(), or | 257 // debug-mips.cc BreakLocationIterator::SetDebugBreakAtReturn(), or |
239 // debug break slot per BreakLocationIterator::SetDebugBreakAtSlot(). | 258 // debug break slot per BreakLocationIterator::SetDebugBreakAtSlot(). |
240 return Assembler::target_address_at(pc_); | 259 return Assembler::target_address_at(pc_); |
241 } | 260 } |
242 | 261 |
243 | 262 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 return patched_return; | 304 return patched_return; |
286 } | 305 } |
287 | 306 |
288 | 307 |
289 bool RelocInfo::IsPatchedDebugBreakSlotSequence() { | 308 bool RelocInfo::IsPatchedDebugBreakSlotSequence() { |
290 Instr current_instr = Assembler::instr_at(pc_); | 309 Instr current_instr = Assembler::instr_at(pc_); |
291 return !Assembler::IsNop(current_instr, Assembler::DEBUG_BREAK_NOP); | 310 return !Assembler::IsNop(current_instr, Assembler::DEBUG_BREAK_NOP); |
292 } | 311 } |
293 | 312 |
294 | 313 |
295 Code* RelocInfo::code_age_stub() { | |
296 UNIMPLEMENTED(); | |
297 return NULL; | |
298 } | |
299 | |
300 | |
301 void RelocInfo::set_code_age_stub(Code* stub) { | |
302 UNIMPLEMENTED(); | |
303 } | |
304 | |
305 | |
306 void RelocInfo::Visit(ObjectVisitor* visitor) { | 314 void RelocInfo::Visit(ObjectVisitor* visitor) { |
307 RelocInfo::Mode mode = rmode(); | 315 RelocInfo::Mode mode = rmode(); |
308 if (mode == RelocInfo::EMBEDDED_OBJECT) { | 316 if (mode == RelocInfo::EMBEDDED_OBJECT) { |
309 visitor->VisitEmbeddedPointer(this); | 317 visitor->VisitEmbeddedPointer(this); |
310 } else if (RelocInfo::IsCodeTarget(mode)) { | 318 } else if (RelocInfo::IsCodeTarget(mode)) { |
311 visitor->VisitCodeTarget(this); | 319 visitor->VisitCodeTarget(this); |
312 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { | 320 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { |
313 visitor->VisitGlobalPropertyCell(this); | 321 visitor->VisitGlobalPropertyCell(this); |
314 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { | 322 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { |
315 visitor->VisitExternalReference(this); | 323 visitor->VisitExternalReference(this); |
| 324 } else if (RelocInfo::IsCodeAgeSequence(mode)) { |
| 325 visitor->VisitCodeAgeSequence(this); |
316 #ifdef ENABLE_DEBUGGER_SUPPORT | 326 #ifdef ENABLE_DEBUGGER_SUPPORT |
317 // TODO(isolates): Get a cached isolate below. | 327 // TODO(isolates): Get a cached isolate below. |
318 } else if (((RelocInfo::IsJSReturn(mode) && | 328 } else if (((RelocInfo::IsJSReturn(mode) && |
319 IsPatchedReturnSequence()) || | 329 IsPatchedReturnSequence()) || |
320 (RelocInfo::IsDebugBreakSlot(mode) && | 330 (RelocInfo::IsDebugBreakSlot(mode) && |
321 IsPatchedDebugBreakSlotSequence())) && | 331 IsPatchedDebugBreakSlotSequence())) && |
322 Isolate::Current()->debug()->has_break_points()) { | 332 Isolate::Current()->debug()->has_break_points()) { |
323 visitor->VisitDebugTarget(this); | 333 visitor->VisitDebugTarget(this); |
324 #endif | 334 #endif |
325 } else if (mode == RelocInfo::RUNTIME_ENTRY) { | 335 } else if (mode == RelocInfo::RUNTIME_ENTRY) { |
326 visitor->VisitRuntimeEntry(this); | 336 visitor->VisitRuntimeEntry(this); |
327 } | 337 } |
328 } | 338 } |
329 | 339 |
330 | 340 |
331 template<typename StaticVisitor> | 341 template<typename StaticVisitor> |
332 void RelocInfo::Visit(Heap* heap) { | 342 void RelocInfo::Visit(Heap* heap) { |
333 RelocInfo::Mode mode = rmode(); | 343 RelocInfo::Mode mode = rmode(); |
334 if (mode == RelocInfo::EMBEDDED_OBJECT) { | 344 if (mode == RelocInfo::EMBEDDED_OBJECT) { |
335 StaticVisitor::VisitEmbeddedPointer(heap, this); | 345 StaticVisitor::VisitEmbeddedPointer(heap, this); |
336 } else if (RelocInfo::IsCodeTarget(mode)) { | 346 } else if (RelocInfo::IsCodeTarget(mode)) { |
337 StaticVisitor::VisitCodeTarget(heap, this); | 347 StaticVisitor::VisitCodeTarget(heap, this); |
338 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { | 348 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { |
339 StaticVisitor::VisitGlobalPropertyCell(heap, this); | 349 StaticVisitor::VisitGlobalPropertyCell(heap, this); |
340 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { | 350 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { |
341 StaticVisitor::VisitExternalReference(this); | 351 StaticVisitor::VisitExternalReference(this); |
| 352 } else if (RelocInfo::IsCodeAgeSequence(mode)) { |
| 353 StaticVisitor::VisitCodeAgeSequence(heap, this); |
342 #ifdef ENABLE_DEBUGGER_SUPPORT | 354 #ifdef ENABLE_DEBUGGER_SUPPORT |
343 } else if (heap->isolate()->debug()->has_break_points() && | 355 } else if (heap->isolate()->debug()->has_break_points() && |
344 ((RelocInfo::IsJSReturn(mode) && | 356 ((RelocInfo::IsJSReturn(mode) && |
345 IsPatchedReturnSequence()) || | 357 IsPatchedReturnSequence()) || |
346 (RelocInfo::IsDebugBreakSlot(mode) && | 358 (RelocInfo::IsDebugBreakSlot(mode) && |
347 IsPatchedDebugBreakSlotSequence()))) { | 359 IsPatchedDebugBreakSlotSequence()))) { |
348 StaticVisitor::VisitDebugTarget(heap, this); | 360 StaticVisitor::VisitDebugTarget(heap, this); |
349 #endif | 361 #endif |
350 } else if (mode == RelocInfo::RUNTIME_ENTRY) { | 362 } else if (mode == RelocInfo::RUNTIME_ENTRY) { |
351 StaticVisitor::VisitRuntimeEntry(this); | 363 StaticVisitor::VisitRuntimeEntry(this); |
(...skipping 25 matching lines...) Expand all Loading... |
377 } | 389 } |
378 *reinterpret_cast<Instr*>(pc_) = x; | 390 *reinterpret_cast<Instr*>(pc_) = x; |
379 pc_ += kInstrSize; | 391 pc_ += kInstrSize; |
380 CheckTrampolinePoolQuick(); | 392 CheckTrampolinePoolQuick(); |
381 } | 393 } |
382 | 394 |
383 | 395 |
384 } } // namespace v8::internal | 396 } } // namespace v8::internal |
385 | 397 |
386 #endif // V8_MIPS_ASSEMBLER_MIPS_INL_H_ | 398 #endif // V8_MIPS_ASSEMBLER_MIPS_INL_H_ |
OLD | NEW |