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

Side by Side Diff: src/compiler/ppc/code-generator-ppc.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 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/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 2219 matching lines...) Expand 10 before | Expand all | Expand 10 after
2230 __ StoreP(temp, g.ToMemOperand(destination), r0); 2230 __ StoreP(temp, g.ToMemOperand(destination), r0);
2231 } 2231 }
2232 } else if (source->IsConstant()) { 2232 } else if (source->IsConstant()) {
2233 Constant src = g.ToConstant(source); 2233 Constant src = g.ToConstant(source);
2234 if (destination->IsRegister() || destination->IsStackSlot()) { 2234 if (destination->IsRegister() || destination->IsStackSlot()) {
2235 Register dst = 2235 Register dst =
2236 destination->IsRegister() ? g.ToRegister(destination) : kScratchReg; 2236 destination->IsRegister() ? g.ToRegister(destination) : kScratchReg;
2237 switch (src.type()) { 2237 switch (src.type()) {
2238 case Constant::kInt32: 2238 case Constant::kInt32:
2239 #if V8_TARGET_ARCH_PPC64 2239 #if V8_TARGET_ARCH_PPC64
2240 if (src.rmode() == RelocInfo::WASM_MEMORY_SIZE_REFERENCE) { 2240 if (RelocInfo::IsWasmMemorySizeReference(src.rmode())) {
2241 #else 2241 #else
2242 if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE || 2242 if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE ||
2243 src.rmode() == RelocInfo::WASM_GLOBAL_REFERENCE || 2243 src.rmode() == RelocInfo::WASM_GLOBAL_REFERENCE ||
2244 src.rmode() == RelocInfo::WASM_MEMORY_SIZE_REFERENCE) { 2244 RelocInfo::IsWasmMemorySizeReference(src.rmode())) {
2245 #endif 2245 #endif
2246 __ mov(dst, Operand(src.ToInt32(), src.rmode())); 2246 __ mov(dst, Operand(src.ToInt32(), src.rmode()));
2247 } else { 2247 } else {
2248 __ mov(dst, Operand(src.ToInt32())); 2248 __ mov(dst, Operand(src.ToInt32()));
2249 } 2249 }
2250 break; 2250 break;
2251 case Constant::kInt64: 2251 case Constant::kInt64:
2252 #if V8_TARGET_ARCH_PPC64 2252 #if V8_TARGET_ARCH_PPC64
2253 if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE || 2253 if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE ||
2254 src.rmode() == RelocInfo::WASM_GLOBAL_REFERENCE) { 2254 src.rmode() == RelocInfo::WASM_GLOBAL_REFERENCE) {
2255 __ mov(dst, Operand(src.ToInt64(), src.rmode())); 2255 __ mov(dst, Operand(src.ToInt64(), src.rmode()));
2256 } else { 2256 } else {
2257 DCHECK(src.rmode() != RelocInfo::WASM_MEMORY_SIZE_REFERENCE); 2257 DCHECK(!RelocInfo::IsWasmMemorySizeReference(src.rmode()));
2258 #endif 2258 #endif
2259 __ mov(dst, Operand(src.ToInt64())); 2259 __ mov(dst, Operand(src.ToInt64()));
2260 #if V8_TARGET_ARCH_PPC64 2260 #if V8_TARGET_ARCH_PPC64
2261 } 2261 }
2262 #endif 2262 #endif
2263 break; 2263 break;
2264 case Constant::kFloat32: 2264 case Constant::kFloat32:
2265 __ Move(dst, 2265 __ Move(dst,
2266 isolate()->factory()->NewNumber(src.ToFloat32(), TENURED)); 2266 isolate()->factory()->NewNumber(src.ToFloat32(), TENURED));
2267 break; 2267 break;
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
2437 padding_size -= v8::internal::Assembler::kInstrSize; 2437 padding_size -= v8::internal::Assembler::kInstrSize;
2438 } 2438 }
2439 } 2439 }
2440 } 2440 }
2441 2441
2442 #undef __ 2442 #undef __
2443 2443
2444 } // namespace compiler 2444 } // namespace compiler
2445 } // namespace internal 2445 } // namespace internal
2446 } // namespace v8 2446 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698