Chromium Code Reviews| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 code->GetHeap()->incremental_marking()->RecordWrite( | 96 code->GetHeap()->incremental_marking()->RecordWrite( |
| 97 code, HeapObject::cast(target_code)); | 97 code, NULL, HeapObject::cast(target_code)); |
|
Erik Corry
2011/07/04 11:04:11
Is this 'NULL' OK because we cannot compact code s
Vyacheslav Egorov (Chromium)
2011/08/05 12:50:28
Done.
| |
| 98 } | 98 } |
| 99 } | 99 } |
| 100 | 100 |
| 101 | 101 |
| 102 Object* RelocInfo::target_object() { | 102 Object* RelocInfo::target_object() { |
| 103 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); | 103 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); |
| 104 return Memory::Object_at(pc_); | 104 return Memory::Object_at(pc_); |
| 105 } | 105 } |
| 106 | 106 |
| 107 | 107 |
| 108 Handle<Object> RelocInfo::target_object_handle(Assembler* origin) { | 108 Handle<Object> RelocInfo::target_object_handle(Assembler* origin) { |
| 109 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); | 109 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); |
| 110 return Memory::Object_Handle_at(pc_); | 110 return Memory::Object_Handle_at(pc_); |
| 111 } | 111 } |
| 112 | 112 |
| 113 | 113 |
| 114 Object** RelocInfo::target_object_address() { | 114 Object** RelocInfo::target_object_address() { |
| 115 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); | 115 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); |
| 116 return &Memory::Object_at(pc_); | 116 return &Memory::Object_at(pc_); |
| 117 } | 117 } |
| 118 | 118 |
| 119 | 119 |
| 120 void RelocInfo::set_target_object(Object* target, Code* code) { | 120 void RelocInfo::set_target_object(Object* target, Code* code) { |
| 121 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); | 121 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); |
| 122 Memory::Object_at(pc_) = target; | 122 Memory::Object_at(pc_) = target; |
| 123 CPU::FlushICache(pc_, sizeof(Address)); | 123 CPU::FlushICache(pc_, sizeof(Address)); |
| 124 if (code != NULL && target->IsHeapObject()) { | 124 if (code != NULL && target->IsHeapObject()) { |
| 125 code->GetHeap()->incremental_marking()->RecordWrite( | 125 code->GetHeap()->incremental_marking()->RecordWrite( |
| 126 code, HeapObject::cast(target)); | 126 code, &Memory::Object_at(pc_), HeapObject::cast(target)); |
| 127 } | 127 } |
| 128 } | 128 } |
| 129 | 129 |
| 130 | 130 |
| 131 Address* RelocInfo::target_reference_address() { | 131 Address* RelocInfo::target_reference_address() { |
| 132 ASSERT(rmode_ == RelocInfo::EXTERNAL_REFERENCE); | 132 ASSERT(rmode_ == RelocInfo::EXTERNAL_REFERENCE); |
| 133 return reinterpret_cast<Address*>(pc_); | 133 return reinterpret_cast<Address*>(pc_); |
| 134 } | 134 } |
| 135 | 135 |
| 136 | 136 |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 150 return reinterpret_cast<JSGlobalPropertyCell*>(object); | 150 return reinterpret_cast<JSGlobalPropertyCell*>(object); |
| 151 } | 151 } |
| 152 | 152 |
| 153 | 153 |
| 154 void RelocInfo::set_target_cell(JSGlobalPropertyCell* cell, Code* code) { | 154 void RelocInfo::set_target_cell(JSGlobalPropertyCell* cell, Code* code) { |
| 155 ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL); | 155 ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL); |
| 156 Address address = cell->address() + JSGlobalPropertyCell::kValueOffset; | 156 Address address = cell->address() + JSGlobalPropertyCell::kValueOffset; |
| 157 Memory::Address_at(pc_) = address; | 157 Memory::Address_at(pc_) = address; |
| 158 CPU::FlushICache(pc_, sizeof(Address)); | 158 CPU::FlushICache(pc_, sizeof(Address)); |
| 159 if (code != NULL) { | 159 if (code != NULL) { |
| 160 code->GetHeap()->incremental_marking()->RecordWrite(code, cell); | 160 // TODO(gc) We are not compacting cell space. |
| 161 code->GetHeap()->incremental_marking()->RecordWrite( | |
| 162 code, NULL, cell); | |
| 161 } | 163 } |
| 162 } | 164 } |
| 163 | 165 |
| 164 | 166 |
| 165 Address RelocInfo::call_address() { | 167 Address RelocInfo::call_address() { |
| 166 ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) || | 168 ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) || |
| 167 (IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence())); | 169 (IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence())); |
| 168 return Assembler::target_address_at(pc_ + 1); | 170 return Assembler::target_address_at(pc_ + 1); |
| 169 } | 171 } |
| 170 | 172 |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 449 | 451 |
| 450 Operand::Operand(int32_t disp, RelocInfo::Mode rmode) { | 452 Operand::Operand(int32_t disp, RelocInfo::Mode rmode) { |
| 451 // [disp/r] | 453 // [disp/r] |
| 452 set_modrm(0, ebp); | 454 set_modrm(0, ebp); |
| 453 set_dispr(disp, rmode); | 455 set_dispr(disp, rmode); |
| 454 } | 456 } |
| 455 | 457 |
| 456 } } // namespace v8::internal | 458 } } // namespace v8::internal |
| 457 | 459 |
| 458 #endif // V8_IA32_ASSEMBLER_IA32_INL_H_ | 460 #endif // V8_IA32_ASSEMBLER_IA32_INL_H_ |
| OLD | NEW |