| Index: src/compiler/wasm-compiler.cc
|
| diff --git a/src/compiler/wasm-compiler.cc b/src/compiler/wasm-compiler.cc
|
| index f2c48769fb98a2d1beceff828fc32d8e3451afc3..8357635e017879f12aaa9baaf0a16a0d035c331a 100644
|
| --- a/src/compiler/wasm-compiler.cc
|
| +++ b/src/compiler/wasm-compiler.cc
|
| @@ -54,7 +54,6 @@ const Operator* UnsupportedOpcode(wasm::WasmOpcode opcode) {
|
| return nullptr;
|
| }
|
|
|
| -
|
| void MergeControlToEnd(JSGraph* jsgraph, Node* node) {
|
| Graph* g = jsgraph->graph();
|
| if (g->end()) {
|
| @@ -285,28 +284,23 @@ WasmGraphBuilder::WasmGraphBuilder(
|
| DCHECK_NOT_NULL(jsgraph_);
|
| }
|
|
|
| -
|
| Node* WasmGraphBuilder::Error() { return jsgraph()->Dead(); }
|
|
|
| -
|
| Node* WasmGraphBuilder::Start(unsigned params) {
|
| Node* start = graph()->NewNode(jsgraph()->common()->Start(params));
|
| graph()->SetStart(start);
|
| return start;
|
| }
|
|
|
| -
|
| Node* WasmGraphBuilder::Param(unsigned index, wasm::LocalType type) {
|
| return graph()->NewNode(jsgraph()->common()->Parameter(index),
|
| graph()->start());
|
| }
|
|
|
| -
|
| Node* WasmGraphBuilder::Loop(Node* entry) {
|
| return graph()->NewNode(jsgraph()->common()->Loop(1), entry);
|
| }
|
|
|
| -
|
| Node* WasmGraphBuilder::Terminate(Node* effect, Node* control) {
|
| Node* terminate =
|
| graph()->NewNode(jsgraph()->common()->Terminate(), effect, control);
|
| @@ -314,18 +308,15 @@ Node* WasmGraphBuilder::Terminate(Node* effect, Node* control) {
|
| return terminate;
|
| }
|
|
|
| -
|
| unsigned WasmGraphBuilder::InputCount(Node* node) {
|
| return static_cast<unsigned>(node->InputCount());
|
| }
|
|
|
| -
|
| bool WasmGraphBuilder::IsPhiWithMerge(Node* phi, Node* merge) {
|
| return phi && IrOpcode::IsPhiOpcode(phi->opcode()) &&
|
| NodeProperties::GetControlInput(phi) == merge;
|
| }
|
|
|
| -
|
| void WasmGraphBuilder::AppendToMerge(Node* merge, Node* from) {
|
| DCHECK(IrOpcode::IsMergeOpcode(merge->opcode()));
|
| merge->AppendInput(jsgraph()->zone(), from);
|
| @@ -342,12 +333,10 @@ void WasmGraphBuilder::AppendToPhi(Node* phi, Node* from) {
|
| phi, jsgraph()->common()->ResizeMergeOrPhi(phi->op(), new_size));
|
| }
|
|
|
| -
|
| Node* WasmGraphBuilder::Merge(unsigned count, Node** controls) {
|
| return graph()->NewNode(jsgraph()->common()->Merge(count), count, controls);
|
| }
|
|
|
| -
|
| Node* WasmGraphBuilder::Phi(wasm::LocalType type, unsigned count, Node** vals,
|
| Node* control) {
|
| DCHECK(IrOpcode::IsMergeOpcode(control->opcode()));
|
| @@ -357,7 +346,6 @@ Node* WasmGraphBuilder::Phi(wasm::LocalType type, unsigned count, Node** vals,
|
| buf);
|
| }
|
|
|
| -
|
| Node* WasmGraphBuilder::EffectPhi(unsigned count, Node** effects,
|
| Node* control) {
|
| DCHECK(IrOpcode::IsMergeOpcode(control->opcode()));
|
| @@ -375,7 +363,6 @@ Node* WasmGraphBuilder::Int32Constant(int32_t value) {
|
| return jsgraph()->Int32Constant(value);
|
| }
|
|
|
| -
|
| Node* WasmGraphBuilder::Int64Constant(int64_t value) {
|
| return jsgraph()->Int64Constant(value);
|
| }
|
| @@ -895,22 +882,18 @@ Node* WasmGraphBuilder::Unop(wasm::WasmOpcode opcode, Node* input,
|
| return graph()->NewNode(op, input);
|
| }
|
|
|
| -
|
| Node* WasmGraphBuilder::Float32Constant(float value) {
|
| return jsgraph()->Float32Constant(value);
|
| }
|
|
|
| -
|
| Node* WasmGraphBuilder::Float64Constant(double value) {
|
| return jsgraph()->Float64Constant(value);
|
| }
|
|
|
| -
|
| Node* WasmGraphBuilder::Constant(Handle<Object> value) {
|
| return jsgraph()->Constant(value);
|
| }
|
|
|
| -
|
| Node* WasmGraphBuilder::Branch(Node* cond, Node** true_node,
|
| Node** false_node) {
|
| DCHECK_NOT_NULL(cond);
|
| @@ -922,24 +905,20 @@ Node* WasmGraphBuilder::Branch(Node* cond, Node** true_node,
|
| return branch;
|
| }
|
|
|
| -
|
| Node* WasmGraphBuilder::Switch(unsigned count, Node* key) {
|
| return graph()->NewNode(jsgraph()->common()->Switch(count), key, *control_);
|
| }
|
|
|
| -
|
| Node* WasmGraphBuilder::IfValue(int32_t value, Node* sw) {
|
| DCHECK_EQ(IrOpcode::kSwitch, sw->opcode());
|
| return graph()->NewNode(jsgraph()->common()->IfValue(value), sw);
|
| }
|
|
|
| -
|
| Node* WasmGraphBuilder::IfDefault(Node* sw) {
|
| DCHECK_EQ(IrOpcode::kSwitch, sw->opcode());
|
| return graph()->NewNode(jsgraph()->common()->IfDefault(), sw);
|
| }
|
|
|
| -
|
| Node* WasmGraphBuilder::Return(unsigned count, Node** vals) {
|
| DCHECK_NOT_NULL(*control_);
|
| DCHECK_NOT_NULL(*effect_);
|
| @@ -959,7 +938,6 @@ Node* WasmGraphBuilder::Return(unsigned count, Node** vals) {
|
| return ret;
|
| }
|
|
|
| -
|
| Node* WasmGraphBuilder::ReturnVoid() { return Return(0, Buffer(0)); }
|
|
|
| Node* WasmGraphBuilder::Unreachable(wasm::WasmCodePosition position) {
|
| @@ -1008,7 +986,6 @@ Node* WasmGraphBuilder::BuildF32Neg(Node* input) {
|
| return result;
|
| }
|
|
|
| -
|
| Node* WasmGraphBuilder::BuildF64Neg(Node* input) {
|
| #if WASM_64
|
| Node* result =
|
| @@ -1028,7 +1005,6 @@ Node* WasmGraphBuilder::BuildF64Neg(Node* input) {
|
| #endif
|
| }
|
|
|
| -
|
| Node* WasmGraphBuilder::BuildF32CopySign(Node* left, Node* right) {
|
| Node* result = Unop(
|
| wasm::kExprF32ReinterpretI32,
|
| @@ -1041,7 +1017,6 @@ Node* WasmGraphBuilder::BuildF32CopySign(Node* left, Node* right) {
|
| return result;
|
| }
|
|
|
| -
|
| Node* WasmGraphBuilder::BuildF64CopySign(Node* left, Node* right) {
|
| #if WASM_64
|
| Node* result = Unop(
|
| @@ -1070,7 +1045,6 @@ Node* WasmGraphBuilder::BuildF64CopySign(Node* left, Node* right) {
|
| #endif
|
| }
|
|
|
| -
|
| Node* WasmGraphBuilder::BuildF32Min(Node* left, Node* right) {
|
| Diamond left_le_right(graph(), jsgraph()->common(),
|
| Binop(wasm::kExprF32Le, left, right));
|
| @@ -1091,7 +1065,6 @@ Node* WasmGraphBuilder::BuildF32Min(Node* left, Node* right) {
|
| Binop(wasm::kExprF32Mul, left, Float32Constant(1.0)))));
|
| }
|
|
|
| -
|
| Node* WasmGraphBuilder::BuildF32Max(Node* left, Node* right) {
|
| Diamond left_ge_right(graph(), jsgraph()->common(),
|
| Binop(wasm::kExprF32Ge, left, right));
|
| @@ -1112,7 +1085,6 @@ Node* WasmGraphBuilder::BuildF32Max(Node* left, Node* right) {
|
| Binop(wasm::kExprF32Mul, left, Float32Constant(1.0)))));
|
| }
|
|
|
| -
|
| Node* WasmGraphBuilder::BuildF64Min(Node* left, Node* right) {
|
| Diamond left_le_right(graph(), jsgraph()->common(),
|
| Binop(wasm::kExprF64Le, left, right));
|
| @@ -1133,7 +1105,6 @@ Node* WasmGraphBuilder::BuildF64Min(Node* left, Node* right) {
|
| Binop(wasm::kExprF64Mul, left, Float64Constant(1.0)))));
|
| }
|
|
|
| -
|
| Node* WasmGraphBuilder::BuildF64Max(Node* left, Node* right) {
|
| Diamond left_ge_right(graph(), jsgraph()->common(),
|
| Binop(wasm::kExprF64Ge, left, right));
|
| @@ -1284,7 +1255,6 @@ Node* WasmGraphBuilder::BuildI32Popcnt(Node* input) {
|
| MachineRepresentation::kWord32);
|
| }
|
|
|
| -
|
| Node* WasmGraphBuilder::BuildI64Popcnt(Node* input) {
|
| return Unop(wasm::kExprI64UConvertI32,
|
| BuildBitCountingCall(input, ExternalReference::wasm_word64_popcnt(
|
| @@ -2452,7 +2422,6 @@ void WasmGraphBuilder::BuildJSToWasmWrapper(Handle<Code> wasm_code,
|
| MergeControlToEnd(jsgraph(), ret);
|
| }
|
|
|
| -
|
| void WasmGraphBuilder::BuildWasmToJSWrapper(Handle<JSFunction> function,
|
| wasm::FunctionSig* sig) {
|
| int js_count = function->shared()->internal_formal_parameter_count();
|
| @@ -2545,7 +2514,6 @@ void WasmGraphBuilder::BuildWasmToJSWrapper(Handle<JSFunction> function,
|
| MergeControlToEnd(jsgraph(), ret);
|
| }
|
|
|
| -
|
| Node* WasmGraphBuilder::MemBuffer(uint32_t offset) {
|
| DCHECK(module_ && module_->instance);
|
| if (offset == 0) {
|
| @@ -2562,7 +2530,6 @@ Node* WasmGraphBuilder::MemBuffer(uint32_t offset) {
|
| }
|
| }
|
|
|
| -
|
| Node* WasmGraphBuilder::MemSize(uint32_t offset) {
|
| DCHECK(module_ && module_->instance);
|
| uint32_t size = static_cast<uint32_t>(module_->instance->mem_size);
|
| @@ -2574,7 +2541,6 @@ Node* WasmGraphBuilder::MemSize(uint32_t offset) {
|
| }
|
| }
|
|
|
| -
|
| Node* WasmGraphBuilder::FunctionTable() {
|
| DCHECK(module_ && module_->instance &&
|
| !module_->instance->function_table.is_null());
|
| @@ -2584,7 +2550,6 @@ Node* WasmGraphBuilder::FunctionTable() {
|
| return function_table_;
|
| }
|
|
|
| -
|
| Node* WasmGraphBuilder::LoadGlobal(uint32_t index) {
|
| DCHECK(module_ && module_->instance && module_->instance->globals_start);
|
| MachineType mem_type = module_->GetGlobalType(index);
|
| @@ -2598,7 +2563,6 @@ Node* WasmGraphBuilder::LoadGlobal(uint32_t index) {
|
| return node;
|
| }
|
|
|
| -
|
| Node* WasmGraphBuilder::StoreGlobal(uint32_t index, Node* val) {
|
| DCHECK(module_ && module_->instance && module_->instance->globals_start);
|
| MachineType mem_type = module_->GetGlobalType(index);
|
| @@ -2713,13 +2677,11 @@ void WasmGraphBuilder::PrintDebugName(Node* node) {
|
| PrintF("#%d:%s", node->id(), node->op()->mnemonic());
|
| }
|
|
|
| -
|
| Node* WasmGraphBuilder::String(const char* string) {
|
| return jsgraph()->Constant(
|
| jsgraph()->isolate()->factory()->NewStringFromAsciiChecked(string));
|
| }
|
|
|
| -
|
| Graph* WasmGraphBuilder::graph() { return jsgraph()->graph(); }
|
|
|
| void WasmGraphBuilder::Int64LoweringForTesting() {
|
|
|