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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 Handle<JSGlobalPropertyCell> RelocInfo::target_cell_handle() { | 134 Handle<JSGlobalPropertyCell> RelocInfo::target_cell_handle() { |
135 ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL); | 135 ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL); |
136 Address address = Memory::Address_at(pc_); | 136 Address address = Memory::Address_at(pc_); |
137 return Handle<JSGlobalPropertyCell>( | 137 return Handle<JSGlobalPropertyCell>( |
138 reinterpret_cast<JSGlobalPropertyCell**>(address)); | 138 reinterpret_cast<JSGlobalPropertyCell**>(address)); |
139 } | 139 } |
140 | 140 |
141 | 141 |
142 JSGlobalPropertyCell* RelocInfo::target_cell() { | 142 JSGlobalPropertyCell* RelocInfo::target_cell() { |
143 ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL); | 143 ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL); |
144 Address address = Memory::Address_at(pc_); | 144 return JSGlobalPropertyCell::FromValueAddress(Memory::Address_at(pc_)); |
145 Object* object = HeapObject::FromAddress( | |
146 address - JSGlobalPropertyCell::kValueOffset); | |
147 return reinterpret_cast<JSGlobalPropertyCell*>(object); | |
148 } | 145 } |
149 | 146 |
150 | 147 |
151 void RelocInfo::set_target_cell(JSGlobalPropertyCell* cell, | 148 void RelocInfo::set_target_cell(JSGlobalPropertyCell* cell, |
152 WriteBarrierMode mode) { | 149 WriteBarrierMode mode) { |
153 ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL); | 150 ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL); |
154 Address address = cell->address() + JSGlobalPropertyCell::kValueOffset; | 151 Address address = cell->address() + JSGlobalPropertyCell::kValueOffset; |
155 Memory::Address_at(pc_) = address; | 152 Memory::Address_at(pc_) = address; |
156 if (mode == UPDATE_WRITE_BARRIER && host() != NULL) { | 153 if (mode == UPDATE_WRITE_BARRIER && host() != NULL) { |
157 // TODO(1550) We are passing NULL as a slot because cell can never be on | 154 // TODO(1550) We are passing NULL as a slot because cell can never be on |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 // CPU::FlushICache(pc, sizeof(target)); | 380 // CPU::FlushICache(pc, sizeof(target)); |
384 // However, on ARM, no instruction was actually patched by the assignment | 381 // However, on ARM, no instruction was actually patched by the assignment |
385 // above; the target address is not part of an instruction, it is patched in | 382 // above; the target address is not part of an instruction, it is patched in |
386 // the constant pool and is read via a data access; the instruction accessing | 383 // the constant pool and is read via a data access; the instruction accessing |
387 // this address in the constant pool remains unchanged. | 384 // this address in the constant pool remains unchanged. |
388 } | 385 } |
389 | 386 |
390 } } // namespace v8::internal | 387 } } // namespace v8::internal |
391 | 388 |
392 #endif // V8_ARM_ASSEMBLER_ARM_INL_H_ | 389 #endif // V8_ARM_ASSEMBLER_ARM_INL_H_ |
OLD | NEW |