| 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 2305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2316 RecordFunctionCompilation(Logger::FUNCTION_TAG, &info, "js-to-wasm", index, | 2316 RecordFunctionCompilation(Logger::FUNCTION_TAG, &info, "js-to-wasm", index, |
| 2317 module->module->GetName(func->name_offset)); | 2317 module->module->GetName(func->name_offset)); |
| 2318 // Set the JSFunction's machine code. | 2318 // Set the JSFunction's machine code. |
| 2319 function->set_code(*code); | 2319 function->set_code(*code); |
| 2320 } | 2320 } |
| 2321 return function; | 2321 return function; |
| 2322 } | 2322 } |
| 2323 | 2323 |
| 2324 Handle<Code> CompileWasmToJSWrapper(Isolate* isolate, wasm::ModuleEnv* module, | 2324 Handle<Code> CompileWasmToJSWrapper(Isolate* isolate, wasm::ModuleEnv* module, |
| 2325 Handle<JSFunction> function, | 2325 Handle<JSFunction> function, |
| 2326 wasm::FunctionSig* sig, const char* name) { | 2326 wasm::FunctionSig* sig, |
| 2327 const char* module_cstr, |
| 2328 const char* function_cstr) { |
| 2327 //---------------------------------------------------------------------------- | 2329 //---------------------------------------------------------------------------- |
| 2328 // Create the Graph | 2330 // Create the Graph |
| 2329 //---------------------------------------------------------------------------- | 2331 //---------------------------------------------------------------------------- |
| 2330 Zone zone; | 2332 Zone zone; |
| 2331 Graph graph(&zone); | 2333 Graph graph(&zone); |
| 2332 CommonOperatorBuilder common(&zone); | 2334 CommonOperatorBuilder common(&zone); |
| 2333 JSOperatorBuilder javascript(&zone); | 2335 JSOperatorBuilder javascript(&zone); |
| 2334 MachineOperatorBuilder machine(&zone); | 2336 MachineOperatorBuilder machine(&zone); |
| 2335 JSGraph jsgraph(isolate, &graph, &common, &javascript, nullptr, &machine); | 2337 JSGraph jsgraph(isolate, &graph, &common, &javascript, nullptr, &machine); |
| 2336 | 2338 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2384 func_name = buffer.start(); | 2386 func_name = buffer.start(); |
| 2385 } | 2387 } |
| 2386 | 2388 |
| 2387 CompilationInfo info(func_name, isolate, &zone, flags); | 2389 CompilationInfo info(func_name, isolate, &zone, flags); |
| 2388 code = Pipeline::GenerateCodeForTesting(&info, incoming, &graph, nullptr); | 2390 code = Pipeline::GenerateCodeForTesting(&info, incoming, &graph, nullptr); |
| 2389 if (debugging) { | 2391 if (debugging) { |
| 2390 buffer.Dispose(); | 2392 buffer.Dispose(); |
| 2391 } | 2393 } |
| 2392 | 2394 |
| 2393 RecordFunctionCompilation(Logger::FUNCTION_TAG, &info, "wasm-to-js", 0, | 2395 RecordFunctionCompilation(Logger::FUNCTION_TAG, &info, "wasm-to-js", 0, |
| 2394 name); | 2396 module_cstr); |
| 2395 } | 2397 } |
| 2396 return code; | 2398 return code; |
| 2397 } | 2399 } |
| 2398 | 2400 |
| 2399 | 2401 |
| 2400 // Helper function to compile a single function. | 2402 // Helper function to compile a single function. |
| 2401 Handle<Code> CompileWasmFunction(wasm::ErrorThrower& thrower, Isolate* isolate, | 2403 Handle<Code> CompileWasmFunction(wasm::ErrorThrower& thrower, Isolate* isolate, |
| 2402 wasm::ModuleEnv* module_env, | 2404 wasm::ModuleEnv* module_env, |
| 2403 const wasm::WasmFunction& function) { | 2405 const wasm::WasmFunction& function) { |
| 2404 if (FLAG_trace_wasm_compiler || FLAG_trace_wasm_decode_time) { | 2406 if (FLAG_trace_wasm_compiler || FLAG_trace_wasm_decode_time) { |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2472 module_env->module->GetName(function.name_offset)); | 2474 module_env->module->GetName(function.name_offset)); |
| 2473 } | 2475 } |
| 2474 | 2476 |
| 2475 return code; | 2477 return code; |
| 2476 } | 2478 } |
| 2477 | 2479 |
| 2478 | 2480 |
| 2479 } // namespace compiler | 2481 } // namespace compiler |
| 2480 } // namespace internal | 2482 } // namespace internal |
| 2481 } // namespace v8 | 2483 } // namespace v8 |
| OLD | NEW |