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

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

Issue 2416543002: [wasm] Fix bounds check for zero initial memory. (Closed)
Patch Set: Add aTODO 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 #include "src/compilation-info.h" 6 #include "src/compilation-info.h"
7 #include "src/compiler/code-generator-impl.h" 7 #include "src/compiler/code-generator-impl.h"
8 #include "src/compiler/gap-resolver.h" 8 #include "src/compiler/gap-resolver.h"
9 #include "src/compiler/node-matchers.h" 9 #include "src/compiler/node-matchers.h"
10 #include "src/compiler/osr.h" 10 #include "src/compiler/osr.h"
(...skipping 2326 matching lines...) Expand 10 before | Expand all | Expand 10 after
2337 __ ld(temp, src); 2337 __ ld(temp, src);
2338 __ sd(temp, g.ToMemOperand(destination)); 2338 __ sd(temp, g.ToMemOperand(destination));
2339 } 2339 }
2340 } else if (source->IsConstant()) { 2340 } else if (source->IsConstant()) {
2341 Constant src = g.ToConstant(source); 2341 Constant src = g.ToConstant(source);
2342 if (destination->IsRegister() || destination->IsStackSlot()) { 2342 if (destination->IsRegister() || destination->IsStackSlot()) {
2343 Register dst = 2343 Register dst =
2344 destination->IsRegister() ? g.ToRegister(destination) : kScratchReg; 2344 destination->IsRegister() ? g.ToRegister(destination) : kScratchReg;
2345 switch (src.type()) { 2345 switch (src.type()) {
2346 case Constant::kInt32: 2346 case Constant::kInt32:
2347 if (src.rmode() == RelocInfo::WASM_MEMORY_SIZE_REFERENCE) { 2347 if (RelocInfo::IsWasmSizeReference(src.rmode())) {
2348 __ li(dst, Operand(src.ToInt32(), src.rmode())); 2348 __ li(dst, Operand(src.ToInt32(), src.rmode()));
2349 } else { 2349 } else {
2350 __ li(dst, Operand(src.ToInt32())); 2350 __ li(dst, Operand(src.ToInt32()));
2351 } 2351 }
2352 break; 2352 break;
2353 case Constant::kFloat32: 2353 case Constant::kFloat32:
2354 __ li(dst, isolate()->factory()->NewNumber(src.ToFloat32(), TENURED)); 2354 __ li(dst, isolate()->factory()->NewNumber(src.ToFloat32(), TENURED));
2355 break; 2355 break;
2356 case Constant::kInt64: 2356 case Constant::kInt64:
2357 if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE || 2357 if (src.rmode() == RelocInfo::WASM_MEMORY_REFERENCE ||
2358 src.rmode() == RelocInfo::WASM_GLOBAL_REFERENCE) { 2358 src.rmode() == RelocInfo::WASM_GLOBAL_REFERENCE) {
2359 __ li(dst, Operand(src.ToInt64(), src.rmode())); 2359 __ li(dst, Operand(src.ToInt64(), src.rmode()));
2360 } else { 2360 } else {
2361 DCHECK(src.rmode() != RelocInfo::WASM_MEMORY_SIZE_REFERENCE); 2361 DCHECK(!RelocInfo::IsWasmReference(src.rmode()));
2362 __ li(dst, Operand(src.ToInt64())); 2362 __ li(dst, Operand(src.ToInt64()));
2363 } 2363 }
2364 break; 2364 break;
2365 case Constant::kFloat64: 2365 case Constant::kFloat64:
2366 __ li(dst, isolate()->factory()->NewNumber(src.ToFloat64(), TENURED)); 2366 __ li(dst, isolate()->factory()->NewNumber(src.ToFloat64(), TENURED));
2367 break; 2367 break;
2368 case Constant::kExternalReference: 2368 case Constant::kExternalReference:
2369 __ li(dst, Operand(src.ToExternalReference())); 2369 __ li(dst, Operand(src.ToExternalReference()));
2370 break; 2370 break;
2371 case Constant::kHeapObject: { 2371 case Constant::kHeapObject: {
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
2525 padding_size -= v8::internal::Assembler::kInstrSize; 2525 padding_size -= v8::internal::Assembler::kInstrSize;
2526 } 2526 }
2527 } 2527 }
2528 } 2528 }
2529 2529
2530 #undef __ 2530 #undef __
2531 2531
2532 } // namespace compiler 2532 } // namespace compiler
2533 } // namespace internal 2533 } // namespace internal
2534 } // namespace v8 2534 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698