| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 } | 172 } |
| 173 | 173 |
| 174 | 174 |
| 175 void RelocInfo::set_target_runtime_entry(Address target, | 175 void RelocInfo::set_target_runtime_entry(Address target, |
| 176 WriteBarrierMode mode) { | 176 WriteBarrierMode mode) { |
| 177 ASSERT(IsRuntimeEntry(rmode_)); | 177 ASSERT(IsRuntimeEntry(rmode_)); |
| 178 if (target_address() != target) set_target_address(target, mode); | 178 if (target_address() != target) set_target_address(target, mode); |
| 179 } | 179 } |
| 180 | 180 |
| 181 | 181 |
| 182 Handle<JSGlobalPropertyCell> RelocInfo::target_cell_handle() { | 182 Handle<Cell> RelocInfo::target_cell_handle() { |
| 183 ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL); | 183 ASSERT(rmode_ == RelocInfo::CELL); |
| 184 Address address = Memory::Address_at(pc_); | 184 Address address = Memory::Address_at(pc_); |
| 185 return Handle<JSGlobalPropertyCell>( | 185 return Handle<Cell>(reinterpret_cast<Cell**>(address)); |
| 186 reinterpret_cast<JSGlobalPropertyCell**>(address)); | |
| 187 } | 186 } |
| 188 | 187 |
| 189 | 188 |
| 190 JSGlobalPropertyCell* RelocInfo::target_cell() { | 189 Cell* RelocInfo::target_cell() { |
| 191 ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL); | 190 ASSERT(rmode_ == RelocInfo::CELL); |
| 192 return JSGlobalPropertyCell::FromValueAddress(Memory::Address_at(pc_)); | 191 return Cell::FromValueAddress(Memory::Address_at(pc_)); |
| 193 } | 192 } |
| 194 | 193 |
| 195 | 194 |
| 196 void RelocInfo::set_target_cell(JSGlobalPropertyCell* cell, | 195 void RelocInfo::set_target_cell(Cell* cell, WriteBarrierMode mode) { |
| 197 WriteBarrierMode mode) { | 196 ASSERT(rmode_ == RelocInfo::CELL); |
| 198 ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL); | 197 Address address = cell->address() + Cell::kValueOffset; |
| 199 Address address = cell->address() + JSGlobalPropertyCell::kValueOffset; | |
| 200 Memory::Address_at(pc_) = address; | 198 Memory::Address_at(pc_) = address; |
| 201 if (mode == UPDATE_WRITE_BARRIER && host() != NULL) { | 199 if (mode == UPDATE_WRITE_BARRIER && host() != NULL) { |
| 202 // TODO(1550) We are passing NULL as a slot because cell can never be on | 200 // TODO(1550) We are passing NULL as a slot because cell can never be on |
| 203 // evacuation candidate. | 201 // evacuation candidate. |
| 204 host()->GetHeap()->incremental_marking()->RecordWrite( | 202 host()->GetHeap()->incremental_marking()->RecordWrite( |
| 205 host(), NULL, cell); | 203 host(), NULL, cell); |
| 206 } | 204 } |
| 207 } | 205 } |
| 208 | 206 |
| 209 | 207 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 return !Assembler::IsNop(current_instr, Assembler::DEBUG_BREAK_NOP); | 277 return !Assembler::IsNop(current_instr, Assembler::DEBUG_BREAK_NOP); |
| 280 } | 278 } |
| 281 | 279 |
| 282 | 280 |
| 283 void RelocInfo::Visit(ObjectVisitor* visitor) { | 281 void RelocInfo::Visit(ObjectVisitor* visitor) { |
| 284 RelocInfo::Mode mode = rmode(); | 282 RelocInfo::Mode mode = rmode(); |
| 285 if (mode == RelocInfo::EMBEDDED_OBJECT) { | 283 if (mode == RelocInfo::EMBEDDED_OBJECT) { |
| 286 visitor->VisitEmbeddedPointer(this); | 284 visitor->VisitEmbeddedPointer(this); |
| 287 } else if (RelocInfo::IsCodeTarget(mode)) { | 285 } else if (RelocInfo::IsCodeTarget(mode)) { |
| 288 visitor->VisitCodeTarget(this); | 286 visitor->VisitCodeTarget(this); |
| 289 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { | 287 } else if (mode == RelocInfo::CELL) { |
| 290 visitor->VisitGlobalPropertyCell(this); | 288 visitor->VisitCell(this); |
| 291 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { | 289 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { |
| 292 visitor->VisitExternalReference(this); | 290 visitor->VisitExternalReference(this); |
| 293 } else if (RelocInfo::IsCodeAgeSequence(mode)) { | 291 } else if (RelocInfo::IsCodeAgeSequence(mode)) { |
| 294 visitor->VisitCodeAgeSequence(this); | 292 visitor->VisitCodeAgeSequence(this); |
| 295 #ifdef ENABLE_DEBUGGER_SUPPORT | 293 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 296 // TODO(isolates): Get a cached isolate below. | 294 // TODO(isolates): Get a cached isolate below. |
| 297 } else if (((RelocInfo::IsJSReturn(mode) && | 295 } else if (((RelocInfo::IsJSReturn(mode) && |
| 298 IsPatchedReturnSequence()) || | 296 IsPatchedReturnSequence()) || |
| 299 (RelocInfo::IsDebugBreakSlot(mode) && | 297 (RelocInfo::IsDebugBreakSlot(mode) && |
| 300 IsPatchedDebugBreakSlotSequence())) && | 298 IsPatchedDebugBreakSlotSequence())) && |
| 301 Isolate::Current()->debug()->has_break_points()) { | 299 Isolate::Current()->debug()->has_break_points()) { |
| 302 visitor->VisitDebugTarget(this); | 300 visitor->VisitDebugTarget(this); |
| 303 #endif | 301 #endif |
| 304 } else if (RelocInfo::IsRuntimeEntry(mode)) { | 302 } else if (RelocInfo::IsRuntimeEntry(mode)) { |
| 305 visitor->VisitRuntimeEntry(this); | 303 visitor->VisitRuntimeEntry(this); |
| 306 } | 304 } |
| 307 } | 305 } |
| 308 | 306 |
| 309 | 307 |
| 310 template<typename StaticVisitor> | 308 template<typename StaticVisitor> |
| 311 void RelocInfo::Visit(Heap* heap) { | 309 void RelocInfo::Visit(Heap* heap) { |
| 312 RelocInfo::Mode mode = rmode(); | 310 RelocInfo::Mode mode = rmode(); |
| 313 if (mode == RelocInfo::EMBEDDED_OBJECT) { | 311 if (mode == RelocInfo::EMBEDDED_OBJECT) { |
| 314 StaticVisitor::VisitEmbeddedPointer(heap, this); | 312 StaticVisitor::VisitEmbeddedPointer(heap, this); |
| 315 } else if (RelocInfo::IsCodeTarget(mode)) { | 313 } else if (RelocInfo::IsCodeTarget(mode)) { |
| 316 StaticVisitor::VisitCodeTarget(heap, this); | 314 StaticVisitor::VisitCodeTarget(heap, this); |
| 317 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { | 315 } else if (mode == RelocInfo::CELL) { |
| 318 StaticVisitor::VisitGlobalPropertyCell(heap, this); | 316 StaticVisitor::VisitCell(heap, this); |
| 319 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { | 317 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { |
| 320 StaticVisitor::VisitExternalReference(this); | 318 StaticVisitor::VisitExternalReference(this); |
| 321 } else if (RelocInfo::IsCodeAgeSequence(mode)) { | 319 } else if (RelocInfo::IsCodeAgeSequence(mode)) { |
| 322 StaticVisitor::VisitCodeAgeSequence(heap, this); | 320 StaticVisitor::VisitCodeAgeSequence(heap, this); |
| 323 #ifdef ENABLE_DEBUGGER_SUPPORT | 321 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 324 } else if (heap->isolate()->debug()->has_break_points() && | 322 } else if (heap->isolate()->debug()->has_break_points() && |
| 325 ((RelocInfo::IsJSReturn(mode) && | 323 ((RelocInfo::IsJSReturn(mode) && |
| 326 IsPatchedReturnSequence()) || | 324 IsPatchedReturnSequence()) || |
| 327 (RelocInfo::IsDebugBreakSlot(mode) && | 325 (RelocInfo::IsDebugBreakSlot(mode) && |
| 328 IsPatchedDebugBreakSlotSequence()))) { | 326 IsPatchedDebugBreakSlotSequence()))) { |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 | 516 |
| 519 | 517 |
| 520 void Assembler::set_target_address_at(Address pc, Address target) { | 518 void Assembler::set_target_address_at(Address pc, Address target) { |
| 521 set_target_pointer_at(pc, target); | 519 set_target_pointer_at(pc, target); |
| 522 } | 520 } |
| 523 | 521 |
| 524 | 522 |
| 525 } } // namespace v8::internal | 523 } } // namespace v8::internal |
| 526 | 524 |
| 527 #endif // V8_ARM_ASSEMBLER_ARM_INL_H_ | 525 #endif // V8_ARM_ASSEMBLER_ARM_INL_H_ |
| OLD | NEW |