Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Side by Side Diff: src/mips/assembler-mips-inl.h

Issue 8404030: Version 3.7.1 (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/mips/assembler-mips.h ('k') | src/mips/builtins-mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY); 109 ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY);
110 return reinterpret_cast<Address>(pc_); 110 return reinterpret_cast<Address>(pc_);
111 } 111 }
112 112
113 113
114 int RelocInfo::target_address_size() { 114 int RelocInfo::target_address_size() {
115 return Assembler::kExternalTargetSize; 115 return Assembler::kExternalTargetSize;
116 } 116 }
117 117
118 118
119 void RelocInfo::set_target_address(Address target) { 119 void RelocInfo::set_target_address(Address target, WriteBarrierMode mode) {
120 ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY); 120 ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY);
121 Assembler::set_target_address_at(pc_, target); 121 Assembler::set_target_address_at(pc_, target);
122 if (host() != NULL && IsCodeTarget(rmode_)) { 122 if (mode == UPDATE_WRITE_BARRIER && host() != NULL && IsCodeTarget(rmode_)) {
123 Object* target_code = Code::GetCodeFromTargetAddress(target); 123 Object* target_code = Code::GetCodeFromTargetAddress(target);
124 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode( 124 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode(
125 host(), this, HeapObject::cast(target_code)); 125 host(), this, HeapObject::cast(target_code));
126 } 126 }
127 } 127 }
128 128
129 129
130 Object* RelocInfo::target_object() { 130 Object* RelocInfo::target_object() {
131 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); 131 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
132 return reinterpret_cast<Object*>(Assembler::target_address_at(pc_)); 132 return reinterpret_cast<Object*>(Assembler::target_address_at(pc_));
(...skipping 10 matching lines...) Expand all
143 Object** RelocInfo::target_object_address() { 143 Object** RelocInfo::target_object_address() {
144 // Provide a "natural pointer" to the embedded object, 144 // Provide a "natural pointer" to the embedded object,
145 // which can be de-referenced during heap iteration. 145 // which can be de-referenced during heap iteration.
146 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); 146 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
147 reconstructed_obj_ptr_ = 147 reconstructed_obj_ptr_ =
148 reinterpret_cast<Object*>(Assembler::target_address_at(pc_)); 148 reinterpret_cast<Object*>(Assembler::target_address_at(pc_));
149 return &reconstructed_obj_ptr_; 149 return &reconstructed_obj_ptr_;
150 } 150 }
151 151
152 152
153 void RelocInfo::set_target_object(Object* target) { 153 void RelocInfo::set_target_object(Object* target, WriteBarrierMode mode) {
154 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); 154 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
155 Assembler::set_target_address_at(pc_, reinterpret_cast<Address>(target)); 155 Assembler::set_target_address_at(pc_, reinterpret_cast<Address>(target));
156 if (host() != NULL && target->IsHeapObject()) { 156 if (mode == UPDATE_WRITE_BARRIER &&
157 host() != NULL &&
158 target->IsHeapObject()) {
157 host()->GetHeap()->incremental_marking()->RecordWrite( 159 host()->GetHeap()->incremental_marking()->RecordWrite(
158 host(), &Memory::Object_at(pc_), HeapObject::cast(target)); 160 host(), &Memory::Object_at(pc_), HeapObject::cast(target));
159 } 161 }
160 } 162 }
161 163
162 164
163 Address* RelocInfo::target_reference_address() { 165 Address* RelocInfo::target_reference_address() {
164 ASSERT(rmode_ == EXTERNAL_REFERENCE); 166 ASSERT(rmode_ == EXTERNAL_REFERENCE);
165 reconstructed_adr_ptr_ = Assembler::target_address_at(pc_); 167 reconstructed_adr_ptr_ = Assembler::target_address_at(pc_);
166 return &reconstructed_adr_ptr_; 168 return &reconstructed_adr_ptr_;
(...skipping 10 matching lines...) Expand all
177 179
178 JSGlobalPropertyCell* RelocInfo::target_cell() { 180 JSGlobalPropertyCell* RelocInfo::target_cell() {
179 ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL); 181 ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL);
180 Address address = Memory::Address_at(pc_); 182 Address address = Memory::Address_at(pc_);
181 Object* object = HeapObject::FromAddress( 183 Object* object = HeapObject::FromAddress(
182 address - JSGlobalPropertyCell::kValueOffset); 184 address - JSGlobalPropertyCell::kValueOffset);
183 return reinterpret_cast<JSGlobalPropertyCell*>(object); 185 return reinterpret_cast<JSGlobalPropertyCell*>(object);
184 } 186 }
185 187
186 188
187 void RelocInfo::set_target_cell(JSGlobalPropertyCell* cell) { 189 void RelocInfo::set_target_cell(JSGlobalPropertyCell* cell,
190 WriteBarrierMode mode) {
188 ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL); 191 ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL);
189 Address address = cell->address() + JSGlobalPropertyCell::kValueOffset; 192 Address address = cell->address() + JSGlobalPropertyCell::kValueOffset;
190 Memory::Address_at(pc_) = address; 193 Memory::Address_at(pc_) = address;
191 if (host() != NULL) { 194 if (mode == UPDATE_WRITE_BARRIER && host() != NULL) {
192 // TODO(1550) We are passing NULL as a slot because cell can never be on 195 // TODO(1550) We are passing NULL as a slot because cell can never be on
193 // evacuation candidate. 196 // evacuation candidate.
194 host()->GetHeap()->incremental_marking()->RecordWrite( 197 host()->GetHeap()->incremental_marking()->RecordWrite(
195 host(), NULL, cell); 198 host(), NULL, cell);
196 } 199 }
197 } 200 }
198 201
199 202
200 Address RelocInfo::call_address() { 203 Address RelocInfo::call_address() {
201 ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) || 204 ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) ||
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 } 335 }
333 *reinterpret_cast<Instr*>(pc_) = x; 336 *reinterpret_cast<Instr*>(pc_) = x;
334 pc_ += kInstrSize; 337 pc_ += kInstrSize;
335 CheckTrampolinePoolQuick(); 338 CheckTrampolinePoolQuick();
336 } 339 }
337 340
338 341
339 } } // namespace v8::internal 342 } } // namespace v8::internal
340 343
341 #endif // V8_MIPS_ASSEMBLER_MIPS_INL_H_ 344 #endif // V8_MIPS_ASSEMBLER_MIPS_INL_H_
OLDNEW
« no previous file with comments | « src/mips/assembler-mips.h ('k') | src/mips/builtins-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698