| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 int RelocInfo::target_address_size() { | 86 int RelocInfo::target_address_size() { |
| 87 return Assembler::kExternalTargetSize; | 87 return Assembler::kExternalTargetSize; |
| 88 } | 88 } |
| 89 | 89 |
| 90 | 90 |
| 91 void RelocInfo::set_target_address(Address target, Code* code) { | 91 void RelocInfo::set_target_address(Address target, Code* code) { |
| 92 Assembler::set_target_address_at(pc_, target); | 92 Assembler::set_target_address_at(pc_, target); |
| 93 ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY); | 93 ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY); |
| 94 if (code != NULL && IsCodeTarget(rmode_)) { | 94 if (code != NULL && IsCodeTarget(rmode_)) { |
| 95 Object* target_code = Code::GetCodeFromTargetAddress(target); | 95 Object* target_code = Code::GetCodeFromTargetAddress(target); |
| 96 |
| 97 // TODO(gc) We are not compacting code space. |
| 96 code->GetHeap()->incremental_marking()->RecordWrite( | 98 code->GetHeap()->incremental_marking()->RecordWrite( |
| 97 code, HeapObject::cast(target_code)); | 99 code, NULL, HeapObject::cast(target_code)); |
| 98 } | 100 } |
| 99 } | 101 } |
| 100 | 102 |
| 101 | 103 |
| 102 Object* RelocInfo::target_object() { | 104 Object* RelocInfo::target_object() { |
| 103 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); | 105 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); |
| 104 return Memory::Object_at(pc_); | 106 return Memory::Object_at(pc_); |
| 105 } | 107 } |
| 106 | 108 |
| 107 | 109 |
| 108 Handle<Object> RelocInfo::target_object_handle(Assembler* origin) { | 110 Handle<Object> RelocInfo::target_object_handle(Assembler* origin) { |
| 109 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); | 111 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); |
| 110 return Memory::Object_Handle_at(pc_); | 112 return Memory::Object_Handle_at(pc_); |
| 111 } | 113 } |
| 112 | 114 |
| 113 | 115 |
| 114 Object** RelocInfo::target_object_address() { | 116 Object** RelocInfo::target_object_address() { |
| 115 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); | 117 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); |
| 116 return &Memory::Object_at(pc_); | 118 return &Memory::Object_at(pc_); |
| 117 } | 119 } |
| 118 | 120 |
| 119 | 121 |
| 120 void RelocInfo::set_target_object(Object* target, Code* code) { | 122 void RelocInfo::set_target_object(Object* target, Code* code) { |
| 121 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); | 123 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); |
| 122 Memory::Object_at(pc_) = target; | 124 Memory::Object_at(pc_) = target; |
| 123 CPU::FlushICache(pc_, sizeof(Address)); | 125 CPU::FlushICache(pc_, sizeof(Address)); |
| 124 if (code != NULL && target->IsHeapObject()) { | 126 if (code != NULL && target->IsHeapObject()) { |
| 125 code->GetHeap()->incremental_marking()->RecordWrite( | 127 code->GetHeap()->incremental_marking()->RecordWrite( |
| 126 code, HeapObject::cast(target)); | 128 code, &Memory::Object_at(pc_), HeapObject::cast(target)); |
| 127 } | 129 } |
| 128 } | 130 } |
| 129 | 131 |
| 130 | 132 |
| 131 Address* RelocInfo::target_reference_address() { | 133 Address* RelocInfo::target_reference_address() { |
| 132 ASSERT(rmode_ == RelocInfo::EXTERNAL_REFERENCE); | 134 ASSERT(rmode_ == RelocInfo::EXTERNAL_REFERENCE); |
| 133 return reinterpret_cast<Address*>(pc_); | 135 return reinterpret_cast<Address*>(pc_); |
| 134 } | 136 } |
| 135 | 137 |
| 136 | 138 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 150 return reinterpret_cast<JSGlobalPropertyCell*>(object); | 152 return reinterpret_cast<JSGlobalPropertyCell*>(object); |
| 151 } | 153 } |
| 152 | 154 |
| 153 | 155 |
| 154 void RelocInfo::set_target_cell(JSGlobalPropertyCell* cell, Code* code) { | 156 void RelocInfo::set_target_cell(JSGlobalPropertyCell* cell, Code* code) { |
| 155 ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL); | 157 ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL); |
| 156 Address address = cell->address() + JSGlobalPropertyCell::kValueOffset; | 158 Address address = cell->address() + JSGlobalPropertyCell::kValueOffset; |
| 157 Memory::Address_at(pc_) = address; | 159 Memory::Address_at(pc_) = address; |
| 158 CPU::FlushICache(pc_, sizeof(Address)); | 160 CPU::FlushICache(pc_, sizeof(Address)); |
| 159 if (code != NULL) { | 161 if (code != NULL) { |
| 160 code->GetHeap()->incremental_marking()->RecordWrite(code, cell); | 162 // TODO(gc) We are not compacting cell space. |
| 163 code->GetHeap()->incremental_marking()->RecordWrite( |
| 164 code, NULL, cell); |
| 161 } | 165 } |
| 162 } | 166 } |
| 163 | 167 |
| 164 | 168 |
| 165 Address RelocInfo::call_address() { | 169 Address RelocInfo::call_address() { |
| 166 ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) || | 170 ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) || |
| 167 (IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence())); | 171 (IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence())); |
| 168 return Assembler::target_address_at(pc_ + 1); | 172 return Assembler::target_address_at(pc_ + 1); |
| 169 } | 173 } |
| 170 | 174 |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 | 453 |
| 450 Operand::Operand(int32_t disp, RelocInfo::Mode rmode) { | 454 Operand::Operand(int32_t disp, RelocInfo::Mode rmode) { |
| 451 // [disp/r] | 455 // [disp/r] |
| 452 set_modrm(0, ebp); | 456 set_modrm(0, ebp); |
| 453 set_dispr(disp, rmode); | 457 set_dispr(disp, rmode); |
| 454 } | 458 } |
| 455 | 459 |
| 456 } } // namespace v8::internal | 460 } } // namespace v8::internal |
| 457 | 461 |
| 458 #endif // V8_IA32_ASSEMBLER_IA32_INL_H_ | 462 #endif // V8_IA32_ASSEMBLER_IA32_INL_H_ |
| OLD | NEW |