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

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

Issue 2416543002: [wasm] Fix bounds check for zero initial memory. (Closed)
Patch Set: Created 4 years, 2 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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/compilation-info.h" 7 #include "src/compilation-info.h"
8 #include "src/compiler/code-generator-impl.h" 8 #include "src/compiler/code-generator-impl.h"
9 #include "src/compiler/gap-resolver.h" 9 #include "src/compiler/gap-resolver.h"
10 #include "src/compiler/node-matchers.h" 10 #include "src/compiler/node-matchers.h"
(...skipping 2324 matching lines...) Expand 10 before | Expand all | Expand 10 after
2335 __ StoreP(temp, g.ToMemOperand(destination)); 2335 __ StoreP(temp, g.ToMemOperand(destination));
2336 } 2336 }
2337 } else if (source->IsConstant()) { 2337 } else if (source->IsConstant()) {
2338 Constant src = g.ToConstant(source); 2338 Constant src = g.ToConstant(source);
2339 if (destination->IsRegister() || destination->IsStackSlot()) { 2339 if (destination->IsRegister() || destination->IsStackSlot()) {
2340 Register dst = 2340 Register dst =
2341 destination->IsRegister() ? g.ToRegister(destination) : kScratchReg; 2341 destination->IsRegister() ? g.ToRegister(destination) : kScratchReg;
2342 switch (src.type()) { 2342 switch (src.type()) {
2343 case Constant::kInt32: 2343 case Constant::kInt32:
2344 #if V8_TARGET_ARCH_S390X 2344 #if V8_TARGET_ARCH_S390X
2345 if (src.rmode() == RelocInfo::WASM_MEMORY_SIZE_REFERENCE) { 2345 if (RelocInfo::IsWasmMemorySizeReference(src.rmode())) {
2346 #else 2346 #else
2347 if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE || 2347 if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE ||
2348 src.rmode() == RelocInfo::WASM_GLOBAL_REFERENCE || 2348 src.rmode() == RelocInfo::WASM_GLOBAL_REFERENCE ||
2349 src.rmode() == RelocInfo::WASM_MEMORY_SIZE_REFERENCE) { 2349 RelocInfo::IsWasmMemorySizeReference(src.rmode())) {
2350 #endif 2350 #endif
2351 __ mov(dst, Operand(src.ToInt32(), src.rmode())); 2351 __ mov(dst, Operand(src.ToInt32(), src.rmode()));
2352 } else { 2352 } else {
2353 __ mov(dst, Operand(src.ToInt32())); 2353 __ mov(dst, Operand(src.ToInt32()));
2354 } 2354 }
2355 break; 2355 break;
2356 case Constant::kInt64: 2356 case Constant::kInt64:
2357 #if V8_TARGET_ARCH_S390X 2357 #if V8_TARGET_ARCH_S390X
2358 if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE || 2358 if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE ||
2359 src.rmode() == RelocInfo::WASM_GLOBAL_REFERENCE) { 2359 src.rmode() == RelocInfo::WASM_GLOBAL_REFERENCE) {
2360 __ mov(dst, Operand(src.ToInt64(), src.rmode())); 2360 __ mov(dst, Operand(src.ToInt64(), src.rmode()));
2361 } else { 2361 } else {
2362 DCHECK(src.rmode() != RelocInfo::WASM_MEMORY_SIZE_REFERENCE); 2362 DCHECK(!RelocInfo::IsWasmMemorySizeReference(src.rmode()));
2363 __ mov(dst, Operand(src.ToInt64())); 2363 __ mov(dst, Operand(src.ToInt64()));
2364 } 2364 }
2365 #else 2365 #else
2366 __ mov(dst, Operand(src.ToInt64())); 2366 __ mov(dst, Operand(src.ToInt64()));
2367 #endif // V8_TARGET_ARCH_S390X 2367 #endif // V8_TARGET_ARCH_S390X
2368 break; 2368 break;
2369 case Constant::kFloat32: 2369 case Constant::kFloat32:
2370 __ Move(dst, 2370 __ Move(dst,
2371 isolate()->factory()->NewNumber(src.ToFloat32(), TENURED)); 2371 isolate()->factory()->NewNumber(src.ToFloat32(), TENURED));
2372 break; 2372 break;
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
2542 padding_size -= 2; 2542 padding_size -= 2;
2543 } 2543 }
2544 } 2544 }
2545 } 2545 }
2546 2546
2547 #undef __ 2547 #undef __
2548 2548
2549 } // namespace compiler 2549 } // namespace compiler
2550 } // namespace internal 2550 } // namespace internal
2551 } // namespace v8 2551 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698