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

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: Adding x64 test 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
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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 *p -= delta; // Relocate entry. 70 *p -= delta; // Relocate entry.
71 } else if (IsInternalReference(rmode_)) { 71 } else if (IsInternalReference(rmode_)) {
72 // absolute code pointer inside code object moves with the code object. 72 // absolute code pointer inside code object moves with the code object.
73 int32_t* p = reinterpret_cast<int32_t*>(pc_); 73 int32_t* p = reinterpret_cast<int32_t*>(pc_);
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 IsWasmCodeEntry(rmode_));
81 return Assembler::target_address_at(pc_, host_); 82 return Assembler::target_address_at(pc_, host_);
82 } 83 }
83 84
84 85
85 Address RelocInfo::target_address_address() { 86 Address RelocInfo::target_address_address() {
86 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) 87 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_)
87 || rmode_ == EMBEDDED_OBJECT 88 || rmode_ == EMBEDDED_OBJECT
88 || rmode_ == EXTERNAL_REFERENCE); 89 || rmode_ == EXTERNAL_REFERENCE);
89 return reinterpret_cast<Address>(pc_); 90 return reinterpret_cast<Address>(pc_);
90 } 91 }
91 92
92 93
93 Address RelocInfo::constant_pool_entry_address() { 94 Address RelocInfo::constant_pool_entry_address() {
94 UNREACHABLE(); 95 UNREACHABLE();
95 return NULL; 96 return NULL;
96 } 97 }
97 98
98 99
99 int RelocInfo::target_address_size() { 100 int RelocInfo::target_address_size() {
100 return Assembler::kSpecialTargetSize; 101 return Assembler::kSpecialTargetSize;
101 } 102 }
102 103
103 104
104 void RelocInfo::set_target_address(Address target, 105 void RelocInfo::set_target_address(Address target,
Yang 2016/03/03 06:21:56 Can we create a separate method to do the wasm hea
gdeepti1 2016/03/03 22:59:15 Done.
105 WriteBarrierMode write_barrier_mode, 106 WriteBarrierMode write_barrier_mode,
106 ICacheFlushMode icache_flush_mode) { 107 ICacheFlushMode icache_flush_mode) {
107 Assembler::set_target_address_at(isolate_, pc_, host_, target, 108 Assembler::set_target_address_at(isolate_, pc_, host_, target,
108 icache_flush_mode); 109 icache_flush_mode);
109 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_)); 110 DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) ||
111 IsWasmCodeEntry(rmode_));
110 if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != NULL && 112 if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != NULL &&
111 IsCodeTarget(rmode_)) { 113 IsCodeTarget(rmode_)) {
112 Object* target_code = Code::GetCodeFromTargetAddress(target); 114 Object* target_code = Code::GetCodeFromTargetAddress(target);
113 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode( 115 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode(
114 host(), this, HeapObject::cast(target_code)); 116 host(), this, HeapObject::cast(target_code));
115 } 117 }
116 } 118 }
117 119
118 120
119 Object* RelocInfo::target_object() { 121 Object* RelocInfo::target_object() {
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 } 316 }
315 } 317 }
316 318
317 319
318 320
319 Immediate::Immediate(int x) { 321 Immediate::Immediate(int x) {
320 x_ = x; 322 x_ = x;
321 rmode_ = RelocInfo::NONE32; 323 rmode_ = RelocInfo::NONE32;
322 } 324 }
323 325
326 Immediate::Immediate(int x, RelocInfo::Mode rmode) {
327 x_ = x;
328 rmode_ = rmode;
329 }
324 330
325 Immediate::Immediate(const ExternalReference& ext) { 331 Immediate::Immediate(const ExternalReference& ext) {
326 x_ = reinterpret_cast<int32_t>(ext.address()); 332 x_ = reinterpret_cast<int32_t>(ext.address());
327 rmode_ = RelocInfo::EXTERNAL_REFERENCE; 333 rmode_ = RelocInfo::EXTERNAL_REFERENCE;
328 } 334 }
329 335
330 336
331 Immediate::Immediate(Label* internal_offset) { 337 Immediate::Immediate(Label* internal_offset) {
332 x_ = reinterpret_cast<int32_t>(internal_offset); 338 x_ = reinterpret_cast<int32_t>(internal_offset);
333 rmode_ = RelocInfo::INTERNAL_REFERENCE; 339 rmode_ = RelocInfo::INTERNAL_REFERENCE;
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 552
547 Operand::Operand(Immediate imm) { 553 Operand::Operand(Immediate imm) {
548 // [disp/r] 554 // [disp/r]
549 set_modrm(0, ebp); 555 set_modrm(0, ebp);
550 set_dispr(imm.x_, imm.rmode_); 556 set_dispr(imm.x_, imm.rmode_);
551 } 557 }
552 } // namespace internal 558 } // namespace internal
553 } // namespace v8 559 } // namespace v8
554 560
555 #endif // V8_IA32_ASSEMBLER_IA32_INL_H_ 561 #endif // V8_IA32_ASSEMBLER_IA32_INL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698