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

Side by Side Diff: src/compiler/arm64/code-generator-arm64.cc

Issue 1921203002: Add new relocation type WASM_MEMORY_SIZE_REFERENCE, use relocatable pointers to update wasm memory … (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add compiler test Created 4 years, 7 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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/code-generator.h" 5 #include "src/compiler/code-generator.h"
6 6
7 #include "src/arm64/frames-arm64.h" 7 #include "src/arm64/frames-arm64.h"
8 #include "src/arm64/macro-assembler-arm64.h" 8 #include "src/arm64/macro-assembler-arm64.h"
9 #include "src/ast/scopes.h" 9 #include "src/ast/scopes.h"
10 #include "src/compiler/code-generator-impl.h" 10 #include "src/compiler/code-generator-impl.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 if (op->IsRegister()) { 176 if (op->IsRegister()) {
177 return Operand(ToRegister(op).W()); 177 return Operand(ToRegister(op).W());
178 } 178 }
179 return ToImmediate(op); 179 return ToImmediate(op);
180 } 180 }
181 181
182 Operand ToImmediate(InstructionOperand* operand) { 182 Operand ToImmediate(InstructionOperand* operand) {
183 Constant constant = ToConstant(operand); 183 Constant constant = ToConstant(operand);
184 switch (constant.type()) { 184 switch (constant.type()) {
185 case Constant::kInt32: 185 case Constant::kInt32:
186 return Operand(constant.ToInt32()); 186 if (constant.rmode() == RelocInfo::WASM_MEMORY_SIZE_REFERENCE) {
187 return Operand(constant.ToInt32(), constant.rmode());
188 } else {
189 return Operand(constant.ToInt32());
190 }
187 case Constant::kInt64: 191 case Constant::kInt64:
188 if (constant.rmode() == RelocInfo::WASM_MEMORY_REFERENCE) { 192 if (constant.rmode() == RelocInfo::WASM_MEMORY_REFERENCE ||
193 constant.rmode() == RelocInfo::WASM_MEMORY_SIZE_REFERENCE) {
titzer 2016/04/28 11:40:19 I think we are limiting ourselves to 32 bit sizes
gdeepti 2016/05/02 23:56:08 Dropped, and added a DCHECK for x64 & Arm64. There
189 return Operand(constant.ToInt64(), constant.rmode()); 194 return Operand(constant.ToInt64(), constant.rmode());
190 } else { 195 } else {
191 return Operand(constant.ToInt64()); 196 return Operand(constant.ToInt64());
192 } 197 }
193 case Constant::kFloat32: 198 case Constant::kFloat32:
194 return Operand( 199 return Operand(
195 isolate()->factory()->NewNumber(constant.ToFloat32(), TENURED)); 200 isolate()->factory()->NewNumber(constant.ToFloat32(), TENURED));
196 case Constant::kFloat64: 201 case Constant::kFloat64:
197 return Operand( 202 return Operand(
198 isolate()->factory()->NewNumber(constant.ToFloat64(), TENURED)); 203 isolate()->factory()->NewNumber(constant.ToFloat64(), TENURED));
(...skipping 1656 matching lines...) Expand 10 before | Expand all | Expand 10 after
1855 padding_size -= kInstructionSize; 1860 padding_size -= kInstructionSize;
1856 } 1861 }
1857 } 1862 }
1858 } 1863 }
1859 1864
1860 #undef __ 1865 #undef __
1861 1866
1862 } // namespace compiler 1867 } // namespace compiler
1863 } // namespace internal 1868 } // namespace internal
1864 } // namespace v8 1869 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698