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

Side by Side Diff: src/s390/assembler-s390.cc

Issue 2732273003: Disentangle assembler from isolate. (Closed)
Patch Set: Address feedback. Created 3 years, 9 months 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
« no previous file with comments | « src/s390/assembler-s390.h ('k') | src/s390/assembler-s390-inl.h » ('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 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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 return Assembler::target_address_at(pc_, host_); 244 return Assembler::target_address_at(pc_, host_);
245 } 245 }
246 246
247 uint32_t RelocInfo::wasm_function_table_size_reference() { 247 uint32_t RelocInfo::wasm_function_table_size_reference() {
248 DCHECK(IsWasmFunctionTableSizeReference(rmode_)); 248 DCHECK(IsWasmFunctionTableSizeReference(rmode_));
249 return static_cast<uint32_t>( 249 return static_cast<uint32_t>(
250 reinterpret_cast<intptr_t>(Assembler::target_address_at(pc_, host_))); 250 reinterpret_cast<intptr_t>(Assembler::target_address_at(pc_, host_)));
251 } 251 }
252 252
253 void RelocInfo::unchecked_update_wasm_memory_reference( 253 void RelocInfo::unchecked_update_wasm_memory_reference(
254 Address address, ICacheFlushMode flush_mode) { 254 Isolate* isolate, Address address, ICacheFlushMode flush_mode) {
255 Assembler::set_target_address_at(isolate_, pc_, host_, address, flush_mode); 255 Assembler::set_target_address_at(isolate, pc_, host_, address, flush_mode);
256 } 256 }
257 257
258 void RelocInfo::unchecked_update_wasm_size(uint32_t size, 258 void RelocInfo::unchecked_update_wasm_size(Isolate* isolate, uint32_t size,
259 ICacheFlushMode flush_mode) { 259 ICacheFlushMode flush_mode) {
260 Assembler::set_target_address_at(isolate_, pc_, host_, 260 Assembler::set_target_address_at(isolate, pc_, host_,
261 reinterpret_cast<Address>(size), flush_mode); 261 reinterpret_cast<Address>(size), flush_mode);
262 } 262 }
263 263
264 // ----------------------------------------------------------------------------- 264 // -----------------------------------------------------------------------------
265 // Implementation of Operand and MemOperand 265 // Implementation of Operand and MemOperand
266 // See assembler-s390-inl.h for inlined constructors 266 // See assembler-s390-inl.h for inlined constructors
267 267
268 Operand::Operand(Handle<Object> handle) { 268 Operand::Operand(Handle<Object> handle) {
269 AllowDeferredHandleDereference using_raw_address; 269 AllowDeferredHandleDereference using_raw_address;
270 rm_ = no_reg; 270 rm_ = no_reg;
(...skipping 17 matching lines...) Expand all
288 288
289 MemOperand::MemOperand(Register rx, Register rb, int32_t offset) { 289 MemOperand::MemOperand(Register rx, Register rb, int32_t offset) {
290 baseRegister = rb; 290 baseRegister = rb;
291 indexRegister = rx; 291 indexRegister = rx;
292 offset_ = offset; 292 offset_ = offset;
293 } 293 }
294 294
295 // ----------------------------------------------------------------------------- 295 // -----------------------------------------------------------------------------
296 // Specific instructions, constants, and masks. 296 // Specific instructions, constants, and masks.
297 297
298 Assembler::Assembler(Isolate* isolate, void* buffer, int buffer_size) 298 Assembler::Assembler(IsolateData isolate_data, void* buffer, int buffer_size)
299 : AssemblerBase(isolate, buffer, buffer_size), 299 : AssemblerBase(isolate_data, buffer, buffer_size),
300 recorded_ast_id_(TypeFeedbackId::None()), 300 recorded_ast_id_(TypeFeedbackId::None()),
301 code_targets_(100) { 301 code_targets_(100) {
302 reloc_info_writer.Reposition(buffer_ + buffer_size_, pc_); 302 reloc_info_writer.Reposition(buffer_ + buffer_size_, pc_);
303 303
304 last_bound_pos_ = 0; 304 last_bound_pos_ = 0;
305 ClearRecordedAstId(); 305 ClearRecordedAstId();
306 relocations_.reserve(128); 306 relocations_.reserve(128);
307 } 307 }
308 308
309 void Assembler::GetCode(CodeDesc* desc) { 309 void Assembler::GetCode(CodeDesc* desc) {
(...skipping 1830 matching lines...) Expand 10 before | Expand all | Expand 10 after
2140 } 2140 }
2141 2141
2142 void Assembler::EmitRelocations() { 2142 void Assembler::EmitRelocations() {
2143 EnsureSpaceFor(relocations_.size() * kMaxRelocSize); 2143 EnsureSpaceFor(relocations_.size() * kMaxRelocSize);
2144 2144
2145 for (std::vector<DeferredRelocInfo>::iterator it = relocations_.begin(); 2145 for (std::vector<DeferredRelocInfo>::iterator it = relocations_.begin();
2146 it != relocations_.end(); it++) { 2146 it != relocations_.end(); it++) {
2147 RelocInfo::Mode rmode = it->rmode(); 2147 RelocInfo::Mode rmode = it->rmode();
2148 Address pc = buffer_ + it->position(); 2148 Address pc = buffer_ + it->position();
2149 Code* code = NULL; 2149 Code* code = NULL;
2150 RelocInfo rinfo(isolate(), pc, rmode, it->data(), code); 2150 RelocInfo rinfo(pc, rmode, it->data(), code);
2151 2151
2152 // Fix up internal references now that they are guaranteed to be bound. 2152 // Fix up internal references now that they are guaranteed to be bound.
2153 if (RelocInfo::IsInternalReference(rmode)) { 2153 if (RelocInfo::IsInternalReference(rmode)) {
2154 // Jump table entry 2154 // Jump table entry
2155 intptr_t pos = reinterpret_cast<intptr_t>(Memory::Address_at(pc)); 2155 intptr_t pos = reinterpret_cast<intptr_t>(Memory::Address_at(pc));
2156 Memory::Address_at(pc) = buffer_ + pos; 2156 Memory::Address_at(pc) = buffer_ + pos;
2157 } else if (RelocInfo::IsInternalReferenceEncoded(rmode)) { 2157 } else if (RelocInfo::IsInternalReferenceEncoded(rmode)) {
2158 // mov sequence 2158 // mov sequence
2159 intptr_t pos = reinterpret_cast<intptr_t>(target_address_at(pc, code)); 2159 intptr_t pos = reinterpret_cast<intptr_t>(target_address_at(pc, code));
2160 set_target_address_at(isolate(), pc, code, buffer_ + pos, 2160 set_target_address_at(nullptr, pc, code, buffer_ + pos,
2161 SKIP_ICACHE_FLUSH); 2161 SKIP_ICACHE_FLUSH);
2162 } 2162 }
2163 2163
2164 reloc_info_writer.Write(&rinfo); 2164 reloc_info_writer.Write(&rinfo);
2165 } 2165 }
2166 } 2166 }
2167 2167
2168 } // namespace internal 2168 } // namespace internal
2169 } // namespace v8 2169 } // namespace v8
2170 #endif // V8_TARGET_ARCH_S390 2170 #endif // V8_TARGET_ARCH_S390
OLDNEW
« no previous file with comments | « src/s390/assembler-s390.h ('k') | src/s390/assembler-s390-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698