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 "src/isolate-inl.h" | 7 #include "src/isolate-inl.h" |
8 | 8 |
9 #include "src/base/platform/platform.h" | 9 #include "src/base/platform/platform.h" |
10 | 10 |
(...skipping 2215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2226 OFStream os(stdout); | 2226 OFStream os(stdout); |
2227 os << "-- Graph after change lowering -- " << std::endl; | 2227 os << "-- Graph after change lowering -- " << std::endl; |
2228 os << AsRPO(graph); | 2228 os << AsRPO(graph); |
2229 } | 2229 } |
2230 | 2230 |
2231 // Schedule and compile to machine code. | 2231 // Schedule and compile to machine code. |
2232 int params = static_cast<int>( | 2232 int params = static_cast<int>( |
2233 module->GetFunctionSignature(index)->parameter_count()); | 2233 module->GetFunctionSignature(index)->parameter_count()); |
2234 CallDescriptor* incoming = Linkage::GetJSCallDescriptor( | 2234 CallDescriptor* incoming = Linkage::GetJSCallDescriptor( |
2235 &zone, false, params + 1, CallDescriptor::kNoFlags); | 2235 &zone, false, params + 1, CallDescriptor::kNoFlags); |
2236 // TODO(titzer): this is technically a WASM wrapper, not a wasm function. | 2236 Code::Flags flags = Code::ComputeFlags(Code::JS_TO_WASM_FUNCTION); |
2237 Code::Flags flags = Code::ComputeFlags(Code::WASM_FUNCTION); | |
2238 bool debugging = | 2237 bool debugging = |
2239 #if DEBUG | 2238 #if DEBUG |
2240 true; | 2239 true; |
2241 #else | 2240 #else |
2242 FLAG_print_opt_code || FLAG_trace_turbo || FLAG_trace_turbo_graph; | 2241 FLAG_print_opt_code || FLAG_trace_turbo || FLAG_trace_turbo_graph; |
2243 #endif | 2242 #endif |
2244 const char* func_name = "js-to-wasm"; | 2243 const char* func_name = "js-to-wasm"; |
2245 | 2244 |
2246 static unsigned id = 0; | 2245 static unsigned id = 0; |
2247 Vector<char> buffer; | 2246 Vector<char> buffer; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2306 | 2305 |
2307 if (FLAG_trace_turbo_graph) { // Simple textual RPO. | 2306 if (FLAG_trace_turbo_graph) { // Simple textual RPO. |
2308 OFStream os(stdout); | 2307 OFStream os(stdout); |
2309 os << "-- Graph after change lowering -- " << std::endl; | 2308 os << "-- Graph after change lowering -- " << std::endl; |
2310 os << AsRPO(graph); | 2309 os << AsRPO(graph); |
2311 } | 2310 } |
2312 | 2311 |
2313 // Schedule and compile to machine code. | 2312 // Schedule and compile to machine code. |
2314 CallDescriptor* incoming = | 2313 CallDescriptor* incoming = |
2315 wasm::ModuleEnv::GetWasmCallDescriptor(&zone, sig); | 2314 wasm::ModuleEnv::GetWasmCallDescriptor(&zone, sig); |
2316 // TODO(titzer): this is technically a WASM wrapper, not a wasm function. | 2315 Code::Flags flags = Code::ComputeFlags(Code::WASM_TO_JS_FUNCTION); |
2317 Code::Flags flags = Code::ComputeFlags(Code::WASM_FUNCTION); | |
2318 bool debugging = | 2316 bool debugging = |
2319 #if DEBUG | 2317 #if DEBUG |
2320 true; | 2318 true; |
2321 #else | 2319 #else |
2322 FLAG_print_opt_code || FLAG_trace_turbo || FLAG_trace_turbo_graph; | 2320 FLAG_print_opt_code || FLAG_trace_turbo || FLAG_trace_turbo_graph; |
2323 #endif | 2321 #endif |
2324 const char* func_name = "wasm-to-js"; | 2322 const char* func_name = "wasm-to-js"; |
2325 static unsigned id = 0; | 2323 static unsigned id = 0; |
2326 Vector<char> buffer; | 2324 Vector<char> buffer; |
2327 if (debugging) { | 2325 if (debugging) { |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2427 module_env->module->GetName(function.name_offset)); | 2425 module_env->module->GetName(function.name_offset)); |
2428 } | 2426 } |
2429 | 2427 |
2430 return code; | 2428 return code; |
2431 } | 2429 } |
2432 | 2430 |
2433 | 2431 |
2434 } // namespace compiler | 2432 } // namespace compiler |
2435 } // namespace internal | 2433 } // namespace internal |
2436 } // namespace v8 | 2434 } // namespace v8 |
OLD | NEW |