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

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: Ben's review 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
« no previous file with comments | « src/compiler/arm/code-generator-arm.cc ('k') | src/compiler/common-operator.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 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 if (op->IsRegister()) { 194 if (op->IsRegister()) {
195 return Operand(ToRegister(op).W()); 195 return Operand(ToRegister(op).W());
196 } 196 }
197 return ToImmediate(op); 197 return ToImmediate(op);
198 } 198 }
199 199
200 Operand ToImmediate(InstructionOperand* operand) { 200 Operand ToImmediate(InstructionOperand* operand) {
201 Constant constant = ToConstant(operand); 201 Constant constant = ToConstant(operand);
202 switch (constant.type()) { 202 switch (constant.type()) {
203 case Constant::kInt32: 203 case Constant::kInt32:
204 return Operand(constant.ToInt32()); 204 if (constant.rmode() == RelocInfo::WASM_MEMORY_SIZE_REFERENCE) {
205 return Operand(constant.ToInt32(), constant.rmode());
206 } else {
207 return Operand(constant.ToInt32());
208 }
205 case Constant::kInt64: 209 case Constant::kInt64:
206 if (constant.rmode() == RelocInfo::WASM_MEMORY_REFERENCE) { 210 if (constant.rmode() == RelocInfo::WASM_MEMORY_REFERENCE) {
207 return Operand(constant.ToInt64(), constant.rmode()); 211 return Operand(constant.ToInt64(), constant.rmode());
208 } else { 212 } else {
213 DCHECK(constant.rmode() != RelocInfo::WASM_MEMORY_SIZE_REFERENCE);
209 return Operand(constant.ToInt64()); 214 return Operand(constant.ToInt64());
210 } 215 }
211 case Constant::kFloat32: 216 case Constant::kFloat32:
212 return Operand( 217 return Operand(
213 isolate()->factory()->NewNumber(constant.ToFloat32(), TENURED)); 218 isolate()->factory()->NewNumber(constant.ToFloat32(), TENURED));
214 case Constant::kFloat64: 219 case Constant::kFloat64:
215 return Operand( 220 return Operand(
216 isolate()->factory()->NewNumber(constant.ToFloat64(), TENURED)); 221 isolate()->factory()->NewNumber(constant.ToFloat64(), TENURED));
217 case Constant::kExternalReference: 222 case Constant::kExternalReference:
218 return Operand(constant.ToExternalReference()); 223 return Operand(constant.ToExternalReference());
(...skipping 1672 matching lines...) Expand 10 before | Expand all | Expand 10 after
1891 padding_size -= kInstructionSize; 1896 padding_size -= kInstructionSize;
1892 } 1897 }
1893 } 1898 }
1894 } 1899 }
1895 1900
1896 #undef __ 1901 #undef __
1897 1902
1898 } // namespace compiler 1903 } // namespace compiler
1899 } // namespace internal 1904 } // namespace internal
1900 } // namespace v8 1905 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/arm/code-generator-arm.cc ('k') | src/compiler/common-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698