| 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 are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 } | 155 } |
| 156 | 156 |
| 157 | 157 |
| 158 void RelocInfo::set_target_runtime_entry(Address target, | 158 void RelocInfo::set_target_runtime_entry(Address target, |
| 159 WriteBarrierMode mode) { | 159 WriteBarrierMode mode) { |
| 160 ASSERT(IsRuntimeEntry(rmode_)); | 160 ASSERT(IsRuntimeEntry(rmode_)); |
| 161 if (target_address() != target) set_target_address(target, mode); | 161 if (target_address() != target) set_target_address(target, mode); |
| 162 } | 162 } |
| 163 | 163 |
| 164 | 164 |
| 165 Handle<JSGlobalPropertyCell> RelocInfo::target_cell_handle() { | 165 Handle<Cell> RelocInfo::target_cell_handle() { |
| 166 ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL); | 166 ASSERT(rmode_ == RelocInfo::CELL); |
| 167 Address address = Memory::Address_at(pc_); | 167 Address address = Memory::Address_at(pc_); |
| 168 return Handle<JSGlobalPropertyCell>( | 168 return Handle<Cell>(reinterpret_cast<Cell**>(address)); |
| 169 reinterpret_cast<JSGlobalPropertyCell**>(address)); | |
| 170 } | 169 } |
| 171 | 170 |
| 172 | 171 |
| 173 JSGlobalPropertyCell* RelocInfo::target_cell() { | 172 Cell* RelocInfo::target_cell() { |
| 174 ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL); | 173 ASSERT(rmode_ == RelocInfo::CELL); |
| 175 return JSGlobalPropertyCell::FromValueAddress(Memory::Address_at(pc_)); | 174 return Cell::FromValueAddress(Memory::Address_at(pc_)); |
| 176 } | 175 } |
| 177 | 176 |
| 178 | 177 |
| 179 void RelocInfo::set_target_cell(JSGlobalPropertyCell* cell, | 178 void RelocInfo::set_target_cell(Cell* cell, WriteBarrierMode mode) { |
| 180 WriteBarrierMode mode) { | 179 ASSERT(rmode_ == RelocInfo::CELL); |
| 181 ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL); | 180 Address address = cell->address() + Cell::kValueOffset; |
| 182 Address address = cell->address() + JSGlobalPropertyCell::kValueOffset; | |
| 183 Memory::Address_at(pc_) = address; | 181 Memory::Address_at(pc_) = address; |
| 184 CPU::FlushICache(pc_, sizeof(Address)); | 182 CPU::FlushICache(pc_, sizeof(Address)); |
| 185 if (mode == UPDATE_WRITE_BARRIER && host() != NULL) { | 183 if (mode == UPDATE_WRITE_BARRIER && host() != NULL) { |
| 186 // TODO(1550) We are passing NULL as a slot because cell can never be on | 184 // TODO(1550) We are passing NULL as a slot because cell can never be on |
| 187 // evacuation candidate. | 185 // evacuation candidate. |
| 188 host()->GetHeap()->incremental_marking()->RecordWrite( | 186 host()->GetHeap()->incremental_marking()->RecordWrite( |
| 189 host(), NULL, cell); | 187 host(), NULL, cell); |
| 190 } | 188 } |
| 191 } | 189 } |
| 192 | 190 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 } | 250 } |
| 253 | 251 |
| 254 | 252 |
| 255 void RelocInfo::Visit(ObjectVisitor* visitor) { | 253 void RelocInfo::Visit(ObjectVisitor* visitor) { |
| 256 RelocInfo::Mode mode = rmode(); | 254 RelocInfo::Mode mode = rmode(); |
| 257 if (mode == RelocInfo::EMBEDDED_OBJECT) { | 255 if (mode == RelocInfo::EMBEDDED_OBJECT) { |
| 258 visitor->VisitEmbeddedPointer(this); | 256 visitor->VisitEmbeddedPointer(this); |
| 259 CPU::FlushICache(pc_, sizeof(Address)); | 257 CPU::FlushICache(pc_, sizeof(Address)); |
| 260 } else if (RelocInfo::IsCodeTarget(mode)) { | 258 } else if (RelocInfo::IsCodeTarget(mode)) { |
| 261 visitor->VisitCodeTarget(this); | 259 visitor->VisitCodeTarget(this); |
| 262 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { | 260 } else if (mode == RelocInfo::CELL) { |
| 263 visitor->VisitGlobalPropertyCell(this); | 261 visitor->VisitCell(this); |
| 264 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { | 262 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { |
| 265 visitor->VisitExternalReference(this); | 263 visitor->VisitExternalReference(this); |
| 266 CPU::FlushICache(pc_, sizeof(Address)); | 264 CPU::FlushICache(pc_, sizeof(Address)); |
| 267 } else if (RelocInfo::IsCodeAgeSequence(mode)) { | 265 } else if (RelocInfo::IsCodeAgeSequence(mode)) { |
| 268 visitor->VisitCodeAgeSequence(this); | 266 visitor->VisitCodeAgeSequence(this); |
| 269 #ifdef ENABLE_DEBUGGER_SUPPORT | 267 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 270 // TODO(isolates): Get a cached isolate below. | 268 // TODO(isolates): Get a cached isolate below. |
| 271 } else if (((RelocInfo::IsJSReturn(mode) && | 269 } else if (((RelocInfo::IsJSReturn(mode) && |
| 272 IsPatchedReturnSequence()) || | 270 IsPatchedReturnSequence()) || |
| 273 (RelocInfo::IsDebugBreakSlot(mode) && | 271 (RelocInfo::IsDebugBreakSlot(mode) && |
| 274 IsPatchedDebugBreakSlotSequence())) && | 272 IsPatchedDebugBreakSlotSequence())) && |
| 275 Isolate::Current()->debug()->has_break_points()) { | 273 Isolate::Current()->debug()->has_break_points()) { |
| 276 visitor->VisitDebugTarget(this); | 274 visitor->VisitDebugTarget(this); |
| 277 #endif | 275 #endif |
| 278 } else if (IsRuntimeEntry(mode)) { | 276 } else if (IsRuntimeEntry(mode)) { |
| 279 visitor->VisitRuntimeEntry(this); | 277 visitor->VisitRuntimeEntry(this); |
| 280 } | 278 } |
| 281 } | 279 } |
| 282 | 280 |
| 283 | 281 |
| 284 template<typename StaticVisitor> | 282 template<typename StaticVisitor> |
| 285 void RelocInfo::Visit(Heap* heap) { | 283 void RelocInfo::Visit(Heap* heap) { |
| 286 RelocInfo::Mode mode = rmode(); | 284 RelocInfo::Mode mode = rmode(); |
| 287 if (mode == RelocInfo::EMBEDDED_OBJECT) { | 285 if (mode == RelocInfo::EMBEDDED_OBJECT) { |
| 288 StaticVisitor::VisitEmbeddedPointer(heap, this); | 286 StaticVisitor::VisitEmbeddedPointer(heap, this); |
| 289 CPU::FlushICache(pc_, sizeof(Address)); | 287 CPU::FlushICache(pc_, sizeof(Address)); |
| 290 } else if (RelocInfo::IsCodeTarget(mode)) { | 288 } else if (RelocInfo::IsCodeTarget(mode)) { |
| 291 StaticVisitor::VisitCodeTarget(heap, this); | 289 StaticVisitor::VisitCodeTarget(heap, this); |
| 292 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { | 290 } else if (mode == RelocInfo::CELL) { |
| 293 StaticVisitor::VisitGlobalPropertyCell(heap, this); | 291 StaticVisitor::VisitCell(heap, this); |
| 294 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { | 292 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { |
| 295 StaticVisitor::VisitExternalReference(this); | 293 StaticVisitor::VisitExternalReference(this); |
| 296 CPU::FlushICache(pc_, sizeof(Address)); | 294 CPU::FlushICache(pc_, sizeof(Address)); |
| 297 } else if (RelocInfo::IsCodeAgeSequence(mode)) { | 295 } else if (RelocInfo::IsCodeAgeSequence(mode)) { |
| 298 StaticVisitor::VisitCodeAgeSequence(heap, this); | 296 StaticVisitor::VisitCodeAgeSequence(heap, this); |
| 299 #ifdef ENABLE_DEBUGGER_SUPPORT | 297 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 300 } else if (heap->isolate()->debug()->has_break_points() && | 298 } else if (heap->isolate()->debug()->has_break_points() && |
| 301 ((RelocInfo::IsJSReturn(mode) && | 299 ((RelocInfo::IsJSReturn(mode) && |
| 302 IsPatchedReturnSequence()) || | 300 IsPatchedReturnSequence()) || |
| 303 (RelocInfo::IsDebugBreakSlot(mode) && | 301 (RelocInfo::IsDebugBreakSlot(mode) && |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 | 518 |
| 521 Operand::Operand(int32_t disp, RelocInfo::Mode rmode) { | 519 Operand::Operand(int32_t disp, RelocInfo::Mode rmode) { |
| 522 // [disp/r] | 520 // [disp/r] |
| 523 set_modrm(0, ebp); | 521 set_modrm(0, ebp); |
| 524 set_dispr(disp, rmode); | 522 set_dispr(disp, rmode); |
| 525 } | 523 } |
| 526 | 524 |
| 527 } } // namespace v8::internal | 525 } } // namespace v8::internal |
| 528 | 526 |
| 529 #endif // V8_IA32_ASSEMBLER_IA32_INL_H_ | 527 #endif // V8_IA32_ASSEMBLER_IA32_INL_H_ |
| OLD | NEW |