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

Side by Side Diff: src/compiler/wasm-compiler.cc

Issue 2324733002: [wasm] Do not support grow_memory for asmjs modules. (Closed)
Patch Set: Fixed a typo Created 4 years, 3 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/wasm-compiler.h ('k') | src/wasm/ast-decoder.cc » ('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 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/wasm-compiler.h" 5 #include "src/compiler/wasm-compiler.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "src/isolate-inl.h" 9 #include "src/isolate-inl.h"
10 10
(...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after
925 op = m->RoundUint64ToFloat64(); 925 op = m->RoundUint64ToFloat64();
926 break; 926 break;
927 case wasm::kExprI64SConvertF32: 927 case wasm::kExprI64SConvertF32:
928 return BuildI64SConvertF32(input, position); 928 return BuildI64SConvertF32(input, position);
929 case wasm::kExprI64SConvertF64: 929 case wasm::kExprI64SConvertF64:
930 return BuildI64SConvertF64(input, position); 930 return BuildI64SConvertF64(input, position);
931 case wasm::kExprI64UConvertF32: 931 case wasm::kExprI64UConvertF32:
932 return BuildI64UConvertF32(input, position); 932 return BuildI64UConvertF32(input, position);
933 case wasm::kExprI64UConvertF64: 933 case wasm::kExprI64UConvertF64:
934 return BuildI64UConvertF64(input, position); 934 return BuildI64UConvertF64(input, position);
935 case wasm::kExprGrowMemory:
936 return BuildGrowMemory(input);
937 case wasm::kExprI32AsmjsLoadMem8S: 935 case wasm::kExprI32AsmjsLoadMem8S:
938 return BuildAsmjsLoadMem(MachineType::Int8(), input); 936 return BuildAsmjsLoadMem(MachineType::Int8(), input);
939 case wasm::kExprI32AsmjsLoadMem8U: 937 case wasm::kExprI32AsmjsLoadMem8U:
940 return BuildAsmjsLoadMem(MachineType::Uint8(), input); 938 return BuildAsmjsLoadMem(MachineType::Uint8(), input);
941 case wasm::kExprI32AsmjsLoadMem16S: 939 case wasm::kExprI32AsmjsLoadMem16S:
942 return BuildAsmjsLoadMem(MachineType::Int16(), input); 940 return BuildAsmjsLoadMem(MachineType::Int16(), input);
943 case wasm::kExprI32AsmjsLoadMem16U: 941 case wasm::kExprI32AsmjsLoadMem16U:
944 return BuildAsmjsLoadMem(MachineType::Uint16(), input); 942 return BuildAsmjsLoadMem(MachineType::Uint16(), input);
945 case wasm::kExprI32AsmjsLoadMem: 943 case wasm::kExprI32AsmjsLoadMem:
946 return BuildAsmjsLoadMem(MachineType::Int32(), input); 944 return BuildAsmjsLoadMem(MachineType::Int32(), input);
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after
1660 trap_->ZeroCheck32(wasm::kTrapFloatUnrepresentable, 1658 trap_->ZeroCheck32(wasm::kTrapFloatUnrepresentable,
1661 BuildCCall(sig_builder.Build(), args), position); 1659 BuildCCall(sig_builder.Build(), args), position);
1662 const Operator* load_op = jsgraph()->machine()->Load(result_type); 1660 const Operator* load_op = jsgraph()->machine()->Load(result_type);
1663 Node* load = 1661 Node* load =
1664 graph()->NewNode(load_op, stack_slot_result, jsgraph()->Int32Constant(0), 1662 graph()->NewNode(load_op, stack_slot_result, jsgraph()->Int32Constant(0),
1665 *effect_, *control_); 1663 *effect_, *control_);
1666 *effect_ = load; 1664 *effect_ = load;
1667 return load; 1665 return load;
1668 } 1666 }
1669 1667
1670 Node* WasmGraphBuilder::BuildGrowMemory(Node* input) { 1668 Node* WasmGraphBuilder::GrowMemory(Node* input) {
1671 Diamond check_input_range( 1669 Diamond check_input_range(
1672 graph(), jsgraph()->common(), 1670 graph(), jsgraph()->common(),
1673 graph()->NewNode( 1671 graph()->NewNode(
1674 jsgraph()->machine()->Uint32LessThanOrEqual(), input, 1672 jsgraph()->machine()->Uint32LessThanOrEqual(), input,
1675 jsgraph()->Uint32Constant(wasm::WasmModule::kMaxMemPages)), 1673 jsgraph()->Uint32Constant(wasm::WasmModule::kMaxMemPages)),
1676 BranchHint::kTrue); 1674 BranchHint::kTrue);
1677 1675
1678 check_input_range.Chain(*control_); 1676 check_input_range.Chain(*control_);
1679 1677
1680 Runtime::FunctionId function_id = Runtime::kWasmGrowMemory; 1678 Runtime::FunctionId function_id = Runtime::kWasmGrowMemory;
(...skipping 1589 matching lines...) Expand 10 before | Expand all | Expand 10 after
3270 function_->code_start_offset), 3268 function_->code_start_offset),
3271 compile_ms); 3269 compile_ms);
3272 } 3270 }
3273 3271
3274 return code; 3272 return code;
3275 } 3273 }
3276 3274
3277 } // namespace compiler 3275 } // namespace compiler
3278 } // namespace internal 3276 } // namespace internal
3279 } // namespace v8 3277 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/wasm-compiler.h ('k') | src/wasm/ast-decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698