OLD | NEW |
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 2986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2997 | 2997 |
2998 // We are passing the raw arg_buffer here. To the GC and other parts, it looks | 2998 // We are passing the raw arg_buffer here. To the GC and other parts, it looks |
2999 // like a Smi (lowest bit not set). In the runtime function however, don't | 2999 // like a Smi (lowest bit not set). In the runtime function however, don't |
3000 // call Smi::value on it, but just cast it to a byte pointer. | 3000 // call Smi::value on it, but just cast it to a byte pointer. |
3001 Node* parameters[] = { | 3001 Node* parameters[] = { |
3002 jsgraph()->HeapConstant(instance), // wasm instance | 3002 jsgraph()->HeapConstant(instance), // wasm instance |
3003 jsgraph()->SmiConstant(function_index), // function index | 3003 jsgraph()->SmiConstant(function_index), // function index |
3004 arg_buffer, // argument buffer | 3004 arg_buffer, // argument buffer |
3005 }; | 3005 }; |
3006 BuildCallToRuntime(Runtime::kWasmRunInterpreter, jsgraph(), | 3006 BuildCallToRuntime(Runtime::kWasmRunInterpreter, jsgraph(), |
3007 jsgraph()->isolate()->native_context(), parameters, | 3007 jsgraph()->isolate()->context() |
3008 arraysize(parameters), effect_, *control_); | 3008 ? jsgraph()->isolate()->native_context() |
| 3009 : Handle<Context>::null(), |
| 3010 parameters, arraysize(parameters), effect_, *control_); |
3009 | 3011 |
3010 // Read back the return value. | 3012 // Read back the return value. |
3011 if (jsgraph()->machine()->Is32() && sig->return_count() > 0 && | 3013 if (jsgraph()->machine()->Is32() && sig->return_count() > 0 && |
3012 sig->GetReturn() == wasm::kWasmI64) { | 3014 sig->GetReturn() == wasm::kWasmI64) { |
3013 MachineType load_rep = wasm::WasmOpcodes::MachineTypeFor(wasm::kWasmI32); | 3015 MachineType load_rep = wasm::WasmOpcodes::MachineTypeFor(wasm::kWasmI32); |
3014 Node* lower = | 3016 Node* lower = |
3015 graph()->NewNode(jsgraph()->machine()->Load(load_rep), arg_buffer, | 3017 graph()->NewNode(jsgraph()->machine()->Load(load_rep), arg_buffer, |
3016 Int32Constant(0), *effect_, *control_); | 3018 Int32Constant(0), *effect_, *control_); |
3017 Node* upper = | 3019 Node* upper = |
3018 graph()->NewNode(jsgraph()->machine()->Load(load_rep), arg_buffer, | 3020 graph()->NewNode(jsgraph()->machine()->Load(load_rep), arg_buffer, |
(...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4134 function_->code_start_offset), | 4136 function_->code_start_offset), |
4135 compile_ms); | 4137 compile_ms); |
4136 } | 4138 } |
4137 | 4139 |
4138 return code; | 4140 return code; |
4139 } | 4141 } |
4140 | 4142 |
4141 } // namespace compiler | 4143 } // namespace compiler |
4142 } // namespace internal | 4144 } // namespace internal |
4143 } // namespace v8 | 4145 } // namespace v8 |
OLD | NEW |