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

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

Issue 1759873002: Assembler changes for enabling GrowHeap in Wasm (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix compile Created 4 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/ia32/assembler-ia32.h ('k') | src/mips/assembler-mips-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 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 *p += delta; // Relocate entry. 74 *p += delta; // Relocate entry.
75 } 75 }
76 } 76 }
77 77
78 78
79 Address RelocInfo::target_address() { 79 Address RelocInfo::target_address() {
80 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_)); 80 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_));
81 return Assembler::target_address_at(pc_, host_); 81 return Assembler::target_address_at(pc_, host_);
82 } 82 }
83 83
84 Address RelocInfo::wasm_memory_reference() {
85 DCHECK(IsWasmMemoryReference(rmode_));
86 return Memory::Address_at(pc_);
87 }
84 88
85 Address RelocInfo::target_address_address() { 89 Address RelocInfo::target_address_address() {
86 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) 90 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_)
87 || rmode_ == EMBEDDED_OBJECT 91 || rmode_ == EMBEDDED_OBJECT
88 || rmode_ == EXTERNAL_REFERENCE); 92 || rmode_ == EXTERNAL_REFERENCE);
89 return reinterpret_cast<Address>(pc_); 93 return reinterpret_cast<Address>(pc_);
90 } 94 }
91 95
92 96
93 Address RelocInfo::constant_pool_entry_address() { 97 Address RelocInfo::constant_pool_entry_address() {
(...skipping 14 matching lines...) Expand all
108 icache_flush_mode); 112 icache_flush_mode);
109 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_)); 113 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_));
110 if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != NULL && 114 if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != NULL &&
111 IsCodeTarget(rmode_)) { 115 IsCodeTarget(rmode_)) {
112 Object* target_code = Code::GetCodeFromTargetAddress(target); 116 Object* target_code = Code::GetCodeFromTargetAddress(target);
113 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode( 117 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode(
114 host(), this, HeapObject::cast(target_code)); 118 host(), this, HeapObject::cast(target_code));
115 } 119 }
116 } 120 }
117 121
122 void RelocInfo::update_wasm_memory_reference(
123 Address old_base, Address new_base, size_t old_size, size_t new_size,
124 ICacheFlushMode icache_flush_mode) {
125 DCHECK(IsWasmMemoryReference(rmode_));
126 DCHECK(old_base <= wasm_memory_reference() &&
127 wasm_memory_reference() < old_base + old_size);
128 Address updated_reference = new_base + (wasm_memory_reference() - old_base);
129 DCHECK(new_base <= updated_reference &&
130 updated_reference < new_base + new_size);
131 Memory::Address_at(pc_) = updated_reference;
132 if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
133 Assembler::FlushICache(isolate_, pc_, sizeof(int32_t));
134 }
135 }
118 136
119 Object* RelocInfo::target_object() { 137 Object* RelocInfo::target_object() {
120 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); 138 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
121 return Memory::Object_at(pc_); 139 return Memory::Object_at(pc_);
122 } 140 }
123 141
124 142
125 Handle<Object> RelocInfo::target_object_handle(Assembler* origin) { 143 Handle<Object> RelocInfo::target_object_handle(Assembler* origin) {
126 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); 144 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
127 return Memory::Object_Handle_at(pc_); 145 return Memory::Object_Handle_at(pc_);
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 } 332 }
315 } 333 }
316 334
317 335
318 336
319 Immediate::Immediate(int x) { 337 Immediate::Immediate(int x) {
320 x_ = x; 338 x_ = x;
321 rmode_ = RelocInfo::NONE32; 339 rmode_ = RelocInfo::NONE32;
322 } 340 }
323 341
342 Immediate::Immediate(Address x, RelocInfo::Mode rmode) {
343 x_ = reinterpret_cast<int32_t>(x);
344 rmode_ = rmode;
345 }
324 346
325 Immediate::Immediate(const ExternalReference& ext) { 347 Immediate::Immediate(const ExternalReference& ext) {
326 x_ = reinterpret_cast<int32_t>(ext.address()); 348 x_ = reinterpret_cast<int32_t>(ext.address());
327 rmode_ = RelocInfo::EXTERNAL_REFERENCE; 349 rmode_ = RelocInfo::EXTERNAL_REFERENCE;
328 } 350 }
329 351
330 352
331 Immediate::Immediate(Label* internal_offset) { 353 Immediate::Immediate(Label* internal_offset) {
332 x_ = reinterpret_cast<int32_t>(internal_offset); 354 x_ = reinterpret_cast<int32_t>(internal_offset);
333 rmode_ = RelocInfo::INTERNAL_REFERENCE; 355 rmode_ = RelocInfo::INTERNAL_REFERENCE;
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 568
547 Operand::Operand(Immediate imm) { 569 Operand::Operand(Immediate imm) {
548 // [disp/r] 570 // [disp/r]
549 set_modrm(0, ebp); 571 set_modrm(0, ebp);
550 set_dispr(imm.x_, imm.rmode_); 572 set_dispr(imm.x_, imm.rmode_);
551 } 573 }
552 } // namespace internal 574 } // namespace internal
553 } // namespace v8 575 } // namespace v8
554 576
555 #endif // V8_IA32_ASSEMBLER_IA32_INL_H_ 577 #endif // V8_IA32_ASSEMBLER_IA32_INL_H_
OLDNEW
« no previous file with comments | « src/ia32/assembler-ia32.h ('k') | src/mips/assembler-mips-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698