| OLD | NEW |
| 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 Memory::Address_at(pc_) = address; | 159 Memory::Address_at(pc_) = address; |
| 160 if (mode == UPDATE_WRITE_BARRIER && host() != NULL) { | 160 if (mode == UPDATE_WRITE_BARRIER && host() != NULL) { |
| 161 // TODO(1550) We are passing NULL as a slot because cell can never be on | 161 // TODO(1550) We are passing NULL as a slot because cell can never be on |
| 162 // evacuation candidate. | 162 // evacuation candidate. |
| 163 host()->GetHeap()->incremental_marking()->RecordWrite( | 163 host()->GetHeap()->incremental_marking()->RecordWrite( |
| 164 host(), NULL, cell); | 164 host(), NULL, cell); |
| 165 } | 165 } |
| 166 } | 166 } |
| 167 | 167 |
| 168 | 168 |
| 169 static const int kNoCodeAgeSequenceLength = 3; |
| 170 |
| 171 Code* RelocInfo::code_age_stub() { |
| 172 ASSERT(rmode_ == RelocInfo::CODE_AGE_SEQUENCE); |
| 173 return Code::GetCodeFromTargetAddress( |
| 174 Memory::Address_at(pc_ + Assembler::kInstrSize * |
| 175 (kNoCodeAgeSequenceLength - 1))); |
| 176 } |
| 177 |
| 178 |
| 179 void RelocInfo::set_code_age_stub(Code* stub) { |
| 180 ASSERT(rmode_ == RelocInfo::CODE_AGE_SEQUENCE); |
| 181 Memory::Address_at(pc_ + Assembler::kInstrSize * |
| 182 (kNoCodeAgeSequenceLength - 1)) = |
| 183 stub->instruction_start(); |
| 184 } |
| 185 |
| 186 |
| 169 Address RelocInfo::call_address() { | 187 Address RelocInfo::call_address() { |
| 170 // The 2 instructions offset assumes patched debug break slot or return | 188 // The 2 instructions offset assumes patched debug break slot or return |
| 171 // sequence. | 189 // sequence. |
| 172 ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) || | 190 ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) || |
| 173 (IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence())); | 191 (IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence())); |
| 174 return Memory::Address_at(pc_ + 2 * Assembler::kInstrSize); | 192 return Memory::Address_at(pc_ + 2 * Assembler::kInstrSize); |
| 175 } | 193 } |
| 176 | 194 |
| 177 | 195 |
| 178 void RelocInfo::set_call_address(Address target) { | 196 void RelocInfo::set_call_address(Address target) { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 void RelocInfo::Visit(ObjectVisitor* visitor) { | 250 void RelocInfo::Visit(ObjectVisitor* visitor) { |
| 233 RelocInfo::Mode mode = rmode(); | 251 RelocInfo::Mode mode = rmode(); |
| 234 if (mode == RelocInfo::EMBEDDED_OBJECT) { | 252 if (mode == RelocInfo::EMBEDDED_OBJECT) { |
| 235 visitor->VisitEmbeddedPointer(this); | 253 visitor->VisitEmbeddedPointer(this); |
| 236 } else if (RelocInfo::IsCodeTarget(mode)) { | 254 } else if (RelocInfo::IsCodeTarget(mode)) { |
| 237 visitor->VisitCodeTarget(this); | 255 visitor->VisitCodeTarget(this); |
| 238 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { | 256 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { |
| 239 visitor->VisitGlobalPropertyCell(this); | 257 visitor->VisitGlobalPropertyCell(this); |
| 240 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { | 258 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { |
| 241 visitor->VisitExternalReference(this); | 259 visitor->VisitExternalReference(this); |
| 260 } else if (RelocInfo::IsCodeAgeSequence(mode)) { |
| 261 visitor->VisitCodeAgeSequence(this); |
| 242 #ifdef ENABLE_DEBUGGER_SUPPORT | 262 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 243 // TODO(isolates): Get a cached isolate below. | 263 // TODO(isolates): Get a cached isolate below. |
| 244 } else if (((RelocInfo::IsJSReturn(mode) && | 264 } else if (((RelocInfo::IsJSReturn(mode) && |
| 245 IsPatchedReturnSequence()) || | 265 IsPatchedReturnSequence()) || |
| 246 (RelocInfo::IsDebugBreakSlot(mode) && | 266 (RelocInfo::IsDebugBreakSlot(mode) && |
| 247 IsPatchedDebugBreakSlotSequence())) && | 267 IsPatchedDebugBreakSlotSequence())) && |
| 248 Isolate::Current()->debug()->has_break_points()) { | 268 Isolate::Current()->debug()->has_break_points()) { |
| 249 visitor->VisitDebugTarget(this); | 269 visitor->VisitDebugTarget(this); |
| 250 #endif | 270 #endif |
| 251 } else if (mode == RelocInfo::RUNTIME_ENTRY) { | 271 } else if (mode == RelocInfo::RUNTIME_ENTRY) { |
| 252 visitor->VisitRuntimeEntry(this); | 272 visitor->VisitRuntimeEntry(this); |
| 253 } | 273 } |
| 254 } | 274 } |
| 255 | 275 |
| 256 | 276 |
| 257 template<typename StaticVisitor> | 277 template<typename StaticVisitor> |
| 258 void RelocInfo::Visit(Heap* heap) { | 278 void RelocInfo::Visit(Heap* heap) { |
| 259 RelocInfo::Mode mode = rmode(); | 279 RelocInfo::Mode mode = rmode(); |
| 260 if (mode == RelocInfo::EMBEDDED_OBJECT) { | 280 if (mode == RelocInfo::EMBEDDED_OBJECT) { |
| 261 StaticVisitor::VisitEmbeddedPointer(heap, this); | 281 StaticVisitor::VisitEmbeddedPointer(heap, this); |
| 262 } else if (RelocInfo::IsCodeTarget(mode)) { | 282 } else if (RelocInfo::IsCodeTarget(mode)) { |
| 263 StaticVisitor::VisitCodeTarget(heap, this); | 283 StaticVisitor::VisitCodeTarget(heap, this); |
| 264 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { | 284 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { |
| 265 StaticVisitor::VisitGlobalPropertyCell(heap, this); | 285 StaticVisitor::VisitGlobalPropertyCell(heap, this); |
| 266 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { | 286 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { |
| 267 StaticVisitor::VisitExternalReference(this); | 287 StaticVisitor::VisitExternalReference(this); |
| 288 } else if (RelocInfo::IsCodeAgeSequence(mode)) { |
| 289 StaticVisitor::VisitCodeAgeSequence(heap, this); |
| 268 #ifdef ENABLE_DEBUGGER_SUPPORT | 290 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 269 } else if (heap->isolate()->debug()->has_break_points() && | 291 } else if (heap->isolate()->debug()->has_break_points() && |
| 270 ((RelocInfo::IsJSReturn(mode) && | 292 ((RelocInfo::IsJSReturn(mode) && |
| 271 IsPatchedReturnSequence()) || | 293 IsPatchedReturnSequence()) || |
| 272 (RelocInfo::IsDebugBreakSlot(mode) && | 294 (RelocInfo::IsDebugBreakSlot(mode) && |
| 273 IsPatchedDebugBreakSlotSequence()))) { | 295 IsPatchedDebugBreakSlotSequence()))) { |
| 274 StaticVisitor::VisitDebugTarget(heap, this); | 296 StaticVisitor::VisitDebugTarget(heap, this); |
| 275 #endif | 297 #endif |
| 276 } else if (mode == RelocInfo::RUNTIME_ENTRY) { | 298 } else if (mode == RelocInfo::RUNTIME_ENTRY) { |
| 277 StaticVisitor::VisitRuntimeEntry(this); | 299 StaticVisitor::VisitRuntimeEntry(this); |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 | 502 |
| 481 void Assembler::set_target_address_at(Address pc, Address target) { | 503 void Assembler::set_target_address_at(Address pc, Address target) { |
| 482 set_target_pointer_at(pc, reinterpret_cast<Address>( | 504 set_target_pointer_at(pc, reinterpret_cast<Address>( |
| 483 reinterpret_cast<intptr_t>(target) & ~3)); | 505 reinterpret_cast<intptr_t>(target) & ~3)); |
| 484 } | 506 } |
| 485 | 507 |
| 486 | 508 |
| 487 } } // namespace v8::internal | 509 } } // namespace v8::internal |
| 488 | 510 |
| 489 #endif // V8_ARM_ASSEMBLER_ARM_INL_H_ | 511 #endif // V8_ARM_ASSEMBLER_ARM_INL_H_ |
| OLD | NEW |