| 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/elapsed-timer.h" | 9 #include "src/base/platform/elapsed-timer.h" |
| 10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 Node* trap_reason_smi = builder_->BuildChangeInt32ToSmi(trap_reason_); | 225 Node* trap_reason_smi = builder_->BuildChangeInt32ToSmi(trap_reason_); |
| 226 Node* trap_position_smi = builder_->BuildChangeInt32ToSmi(trap_position_); | 226 Node* trap_position_smi = builder_->BuildChangeInt32ToSmi(trap_position_); |
| 227 | 227 |
| 228 if (module && !module->instance->context.is_null()) { | 228 if (module && !module->instance->context.is_null()) { |
| 229 // Use the module context to call the runtime to throw an exception. | 229 // Use the module context to call the runtime to throw an exception. |
| 230 Runtime::FunctionId f = Runtime::kThrowWasmError; | 230 Runtime::FunctionId f = Runtime::kThrowWasmError; |
| 231 const Runtime::Function* fun = Runtime::FunctionForId(f); | 231 const Runtime::Function* fun = Runtime::FunctionForId(f); |
| 232 CallDescriptor* desc = Linkage::GetRuntimeCallDescriptor( | 232 CallDescriptor* desc = Linkage::GetRuntimeCallDescriptor( |
| 233 jsgraph()->zone(), f, fun->nargs, Operator::kNoProperties, | 233 jsgraph()->zone(), f, fun->nargs, Operator::kNoProperties, |
| 234 CallDescriptor::kNoFlags); | 234 CallDescriptor::kNoFlags); |
| 235 // CEntryStubConstant nodes have to be created and cached in the main | |
| 236 // thread. At the moment this is only done for CEntryStubConstant(1). | |
| 237 DCHECK_EQ(1, fun->result_size); | |
| 238 Node* inputs[] = { | 235 Node* inputs[] = { |
| 239 jsgraph()->CEntryStubConstant(fun->result_size), // C entry | 236 jsgraph()->CEntryStubConstant(fun->result_size), // C entry |
| 240 trap_reason_smi, // message id | 237 trap_reason_smi, // message id |
| 241 trap_position_smi, // byte position | 238 trap_position_smi, // byte position |
| 242 jsgraph()->ExternalConstant( | 239 jsgraph()->ExternalConstant( |
| 243 ExternalReference(f, jsgraph()->isolate())), // ref | 240 ExternalReference(f, jsgraph()->isolate())), // ref |
| 244 jsgraph()->Int32Constant(fun->nargs), // arity | 241 jsgraph()->Int32Constant(fun->nargs), // arity |
| 245 builder_->HeapConstant(module->instance->context), // context | 242 jsgraph()->Constant(module->instance->context), // context |
| 246 *effect_ptr, | 243 *effect_ptr, |
| 247 *control_ptr}; | 244 *control_ptr}; |
| 248 | 245 |
| 249 Node* node = graph()->NewNode( | 246 Node* node = graph()->NewNode( |
| 250 common()->Call(desc), static_cast<int>(arraysize(inputs)), inputs); | 247 common()->Call(desc), static_cast<int>(arraysize(inputs)), inputs); |
| 251 *control_ptr = node; | 248 *control_ptr = node; |
| 252 *effect_ptr = node; | 249 *effect_ptr = node; |
| 253 } | 250 } |
| 254 if (false) { | 251 if (false) { |
| 255 // End the control flow with a throw | 252 // End the control flow with a throw |
| (...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 886 } | 883 } |
| 887 | 884 |
| 888 Node* WasmGraphBuilder::Float32Constant(float value) { | 885 Node* WasmGraphBuilder::Float32Constant(float value) { |
| 889 return jsgraph()->Float32Constant(value); | 886 return jsgraph()->Float32Constant(value); |
| 890 } | 887 } |
| 891 | 888 |
| 892 Node* WasmGraphBuilder::Float64Constant(double value) { | 889 Node* WasmGraphBuilder::Float64Constant(double value) { |
| 893 return jsgraph()->Float64Constant(value); | 890 return jsgraph()->Float64Constant(value); |
| 894 } | 891 } |
| 895 | 892 |
| 896 Node* WasmGraphBuilder::HeapConstant(Handle<HeapObject> value) { | 893 Node* WasmGraphBuilder::Constant(Handle<Object> value) { |
| 897 return jsgraph()->HeapConstant(value); | 894 return jsgraph()->Constant(value); |
| 898 } | 895 } |
| 899 | 896 |
| 900 Node* WasmGraphBuilder::Branch(Node* cond, Node** true_node, | 897 Node* WasmGraphBuilder::Branch(Node* cond, Node** true_node, |
| 901 Node** false_node) { | 898 Node** false_node) { |
| 902 DCHECK_NOT_NULL(cond); | 899 DCHECK_NOT_NULL(cond); |
| 903 DCHECK_NOT_NULL(*control_); | 900 DCHECK_NOT_NULL(*control_); |
| 904 Node* branch = | 901 Node* branch = |
| 905 graph()->NewNode(jsgraph()->common()->Branch(), cond, *control_); | 902 graph()->NewNode(jsgraph()->common()->Branch(), cond, *control_); |
| 906 *true_node = graph()->NewNode(jsgraph()->common()->IfTrue(), branch); | 903 *true_node = graph()->NewNode(jsgraph()->common()->IfTrue(), branch); |
| 907 *false_node = graph()->NewNode(jsgraph()->common()->IfFalse(), branch); | 904 *false_node = graph()->NewNode(jsgraph()->common()->IfFalse(), branch); |
| (...skipping 981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1889 | 1886 |
| 1890 *effect_ = call; | 1887 *effect_ = call; |
| 1891 return call; | 1888 return call; |
| 1892 } | 1889 } |
| 1893 | 1890 |
| 1894 Node* WasmGraphBuilder::CallDirect(uint32_t index, Node** args, | 1891 Node* WasmGraphBuilder::CallDirect(uint32_t index, Node** args, |
| 1895 wasm::WasmCodePosition position) { | 1892 wasm::WasmCodePosition position) { |
| 1896 DCHECK_NULL(args[0]); | 1893 DCHECK_NULL(args[0]); |
| 1897 | 1894 |
| 1898 // Add code object as constant. | 1895 // Add code object as constant. |
| 1899 args[0] = HeapConstant(module_->GetFunctionCode(index)); | 1896 args[0] = Constant(module_->GetFunctionCode(index)); |
| 1900 wasm::FunctionSig* sig = module_->GetFunctionSignature(index); | 1897 wasm::FunctionSig* sig = module_->GetFunctionSignature(index); |
| 1901 | 1898 |
| 1902 return BuildWasmCall(sig, args, position); | 1899 return BuildWasmCall(sig, args, position); |
| 1903 } | 1900 } |
| 1904 | 1901 |
| 1905 Node* WasmGraphBuilder::CallImport(uint32_t index, Node** args, | 1902 Node* WasmGraphBuilder::CallImport(uint32_t index, Node** args, |
| 1906 wasm::WasmCodePosition position) { | 1903 wasm::WasmCodePosition position) { |
| 1907 DCHECK_NULL(args[0]); | 1904 DCHECK_NULL(args[0]); |
| 1908 | 1905 |
| 1909 // Add code object as constant. | 1906 // Add code object as constant. |
| 1910 args[0] = HeapConstant(module_->GetImportCode(index)); | 1907 args[0] = Constant(module_->GetImportCode(index)); |
| 1911 wasm::FunctionSig* sig = module_->GetImportSignature(index); | 1908 wasm::FunctionSig* sig = module_->GetImportSignature(index); |
| 1912 | 1909 |
| 1913 return BuildWasmCall(sig, args, position); | 1910 return BuildWasmCall(sig, args, position); |
| 1914 } | 1911 } |
| 1915 | 1912 |
| 1916 Node* WasmGraphBuilder::CallIndirect(uint32_t index, Node** args, | 1913 Node* WasmGraphBuilder::CallIndirect(uint32_t index, Node** args, |
| 1917 wasm::WasmCodePosition position) { | 1914 wasm::WasmCodePosition position) { |
| 1918 DCHECK_NOT_NULL(args[0]); | 1915 DCHECK_NOT_NULL(args[0]); |
| 1919 DCHECK(module_ && module_->instance); | 1916 DCHECK(module_ && module_->instance); |
| 1920 | 1917 |
| (...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2378 Node* start = Start(param_count + 5); | 2375 Node* start = Start(param_count + 5); |
| 2379 *control_ = start; | 2376 *control_ = start; |
| 2380 *effect_ = start; | 2377 *effect_ = start; |
| 2381 // Create the context parameter | 2378 // Create the context parameter |
| 2382 Node* context = graph()->NewNode( | 2379 Node* context = graph()->NewNode( |
| 2383 jsgraph()->common()->Parameter( | 2380 jsgraph()->common()->Parameter( |
| 2384 Linkage::GetJSCallContextParamIndex(wasm_count + 1), "%context"), | 2381 Linkage::GetJSCallContextParamIndex(wasm_count + 1), "%context"), |
| 2385 graph()->start()); | 2382 graph()->start()); |
| 2386 | 2383 |
| 2387 int pos = 0; | 2384 int pos = 0; |
| 2388 args[pos++] = HeapConstant(wasm_code); | 2385 args[pos++] = Constant(wasm_code); |
| 2389 | 2386 |
| 2390 // Convert JS parameters to WASM numbers. | 2387 // Convert JS parameters to WASM numbers. |
| 2391 for (int i = 0; i < wasm_count; i++) { | 2388 for (int i = 0; i < wasm_count; i++) { |
| 2392 Node* param = | 2389 Node* param = |
| 2393 graph()->NewNode(jsgraph()->common()->Parameter(i + 1), start); | 2390 graph()->NewNode(jsgraph()->common()->Parameter(i + 1), start); |
| 2394 Node* wasm_param = FromJS(param, context, sig->GetParam(i)); | 2391 Node* wasm_param = FromJS(param, context, sig->GetParam(i)); |
| 2395 args[pos++] = wasm_param; | 2392 args[pos++] = wasm_param; |
| 2396 if (jsgraph()->machine()->Is32() && sig->GetParam(i) == wasm::kAstI64) { | 2393 if (jsgraph()->machine()->Is32() && sig->GetParam(i) == wasm::kAstI64) { |
| 2397 // We make up the high word with SAR to get the proper sign extension. | 2394 // We make up the high word with SAR to get the proper sign extension. |
| 2398 args[pos++] = graph()->NewNode(jsgraph()->machine()->Word32Sar(), | 2395 args[pos++] = graph()->NewNode(jsgraph()->machine()->Word32Sar(), |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2436 param_count = Int64Lowering::GetParameterCountAfterLowering(sig); | 2433 param_count = Int64Lowering::GetParameterCountAfterLowering(sig); |
| 2437 } | 2434 } |
| 2438 | 2435 |
| 2439 // Build the start and the parameter nodes. | 2436 // Build the start and the parameter nodes. |
| 2440 Isolate* isolate = jsgraph()->isolate(); | 2437 Isolate* isolate = jsgraph()->isolate(); |
| 2441 CallDescriptor* desc; | 2438 CallDescriptor* desc; |
| 2442 Node* start = Start(param_count + 3); | 2439 Node* start = Start(param_count + 3); |
| 2443 *effect_ = start; | 2440 *effect_ = start; |
| 2444 *control_ = start; | 2441 *control_ = start; |
| 2445 // JS context is the last parameter. | 2442 // JS context is the last parameter. |
| 2446 Node* context = HeapConstant(Handle<Context>(function->context(), isolate)); | 2443 Node* context = Constant(Handle<Context>(function->context(), isolate)); |
| 2447 Node** args = Buffer(wasm_count + 7); | 2444 Node** args = Buffer(wasm_count + 7); |
| 2448 | 2445 |
| 2449 bool arg_count_before_args = false; | 2446 bool arg_count_before_args = false; |
| 2450 bool add_new_target_undefined = false; | 2447 bool add_new_target_undefined = false; |
| 2451 | 2448 |
| 2452 int pos = 0; | 2449 int pos = 0; |
| 2453 if (js_count == wasm_count) { | 2450 if (js_count == wasm_count) { |
| 2454 // exact arity match, just call the function directly. | 2451 // exact arity match, just call the function directly. |
| 2455 desc = Linkage::GetJSCallDescriptor(graph()->zone(), false, wasm_count + 1, | 2452 desc = Linkage::GetJSCallDescriptor(graph()->zone(), false, wasm_count + 1, |
| 2456 CallDescriptor::kNoFlags); | 2453 CallDescriptor::kNoFlags); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2541 return mem_size_; | 2538 return mem_size_; |
| 2542 } else { | 2539 } else { |
| 2543 return jsgraph()->Int32Constant(size + offset); | 2540 return jsgraph()->Int32Constant(size + offset); |
| 2544 } | 2541 } |
| 2545 } | 2542 } |
| 2546 | 2543 |
| 2547 Node* WasmGraphBuilder::FunctionTable() { | 2544 Node* WasmGraphBuilder::FunctionTable() { |
| 2548 DCHECK(module_ && module_->instance && | 2545 DCHECK(module_ && module_->instance && |
| 2549 !module_->instance->function_table.is_null()); | 2546 !module_->instance->function_table.is_null()); |
| 2550 if (!function_table_) { | 2547 if (!function_table_) { |
| 2551 function_table_ = HeapConstant(module_->instance->function_table); | 2548 function_table_ = jsgraph()->Constant(module_->instance->function_table); |
| 2552 } | 2549 } |
| 2553 return function_table_; | 2550 return function_table_; |
| 2554 } | 2551 } |
| 2555 | 2552 |
| 2556 Node* WasmGraphBuilder::LoadGlobal(uint32_t index) { | 2553 Node* WasmGraphBuilder::LoadGlobal(uint32_t index) { |
| 2557 DCHECK(module_ && module_->instance && module_->instance->globals_start); | 2554 DCHECK(module_ && module_->instance && module_->instance->globals_start); |
| 2558 MachineType mem_type = module_->GetGlobalType(index); | 2555 MachineType mem_type = module_->GetGlobalType(index); |
| 2559 Node* addr = jsgraph()->IntPtrConstant( | 2556 Node* addr = jsgraph()->IntPtrConstant( |
| 2560 reinterpret_cast<uintptr_t>(module_->instance->globals_start + | 2557 reinterpret_cast<uintptr_t>(module_->instance->globals_start + |
| 2561 module_->module->globals[index].offset)); | 2558 module_->module->globals[index].offset)); |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2881 buffer.Dispose(); | 2878 buffer.Dispose(); |
| 2882 } | 2879 } |
| 2883 | 2880 |
| 2884 RecordFunctionCompilation(Logger::FUNCTION_TAG, &info, "wasm-to-js", 0, | 2881 RecordFunctionCompilation(Logger::FUNCTION_TAG, &info, "wasm-to-js", 0, |
| 2885 module_name); | 2882 module_name); |
| 2886 } | 2883 } |
| 2887 return code; | 2884 return code; |
| 2888 } | 2885 } |
| 2889 | 2886 |
| 2890 std::pair<JSGraph*, SourcePositionTable*> BuildGraphForWasmFunction( | 2887 std::pair<JSGraph*, SourcePositionTable*> BuildGraphForWasmFunction( |
| 2891 JSGraph* jsgraph, wasm::ErrorThrower* thrower, Isolate* isolate, | 2888 Zone* zone, wasm::ErrorThrower* thrower, Isolate* isolate, |
| 2892 wasm::ModuleEnv*& module_env, const wasm::WasmFunction* function, | 2889 wasm::ModuleEnv*& module_env, const wasm::WasmFunction* function, |
| 2893 double* decode_ms) { | 2890 double* decode_ms) { |
| 2894 base::ElapsedTimer decode_timer; | 2891 base::ElapsedTimer decode_timer; |
| 2895 if (FLAG_trace_wasm_decode_time) { | 2892 if (FLAG_trace_wasm_decode_time) { |
| 2896 decode_timer.Start(); | 2893 decode_timer.Start(); |
| 2897 } | 2894 } |
| 2898 // Create a TF graph during decoding. | 2895 // Create a TF graph during decoding. |
| 2899 Graph* graph = jsgraph->graph(); | 2896 Graph* graph = new (zone) Graph(zone); |
| 2900 CommonOperatorBuilder* common = jsgraph->common(); | 2897 CommonOperatorBuilder* common = new (zone) CommonOperatorBuilder(zone); |
| 2901 MachineOperatorBuilder* machine = jsgraph->machine(); | 2898 MachineOperatorBuilder* machine = new (zone) MachineOperatorBuilder( |
| 2899 zone, MachineType::PointerRepresentation(), |
| 2900 InstructionSelector::SupportedMachineOperatorFlags()); |
| 2901 JSGraph* jsgraph = |
| 2902 new (zone) JSGraph(isolate, graph, common, nullptr, nullptr, machine); |
| 2902 SourcePositionTable* source_position_table = | 2903 SourcePositionTable* source_position_table = |
| 2903 new (jsgraph->zone()) SourcePositionTable(graph); | 2904 new (zone) SourcePositionTable(graph); |
| 2904 WasmGraphBuilder builder(jsgraph->zone(), jsgraph, function->sig, | 2905 WasmGraphBuilder builder(zone, jsgraph, function->sig, source_position_table); |
| 2905 source_position_table); | |
| 2906 wasm::FunctionBody body = { | 2906 wasm::FunctionBody body = { |
| 2907 module_env, function->sig, module_env->module->module_start, | 2907 module_env, function->sig, module_env->module->module_start, |
| 2908 module_env->module->module_start + function->code_start_offset, | 2908 module_env->module->module_start + function->code_start_offset, |
| 2909 module_env->module->module_start + function->code_end_offset}; | 2909 module_env->module->module_start + function->code_end_offset}; |
| 2910 wasm::TreeResult result = | 2910 wasm::TreeResult result = |
| 2911 wasm::BuildTFGraph(isolate->allocator(), &builder, body); | 2911 wasm::BuildTFGraph(isolate->allocator(), &builder, body); |
| 2912 | 2912 |
| 2913 if (machine->Is32()) { | 2913 if (machine->Is32()) { |
| 2914 Int64Lowering r(graph, machine, common, jsgraph->zone(), function->sig); | 2914 Int64Lowering r(graph, machine, common, zone, function->sig); |
| 2915 r.LowerGraph(); | 2915 r.LowerGraph(); |
| 2916 } | 2916 } |
| 2917 | 2917 |
| 2918 if (result.failed()) { | 2918 if (result.failed()) { |
| 2919 if (FLAG_trace_wasm_compiler) { | 2919 if (FLAG_trace_wasm_compiler) { |
| 2920 OFStream os(stdout); | 2920 OFStream os(stdout); |
| 2921 os << "Compilation failed: " << result << std::endl; | 2921 os << "Compilation failed: " << result << std::endl; |
| 2922 } | 2922 } |
| 2923 // Add the function as another context for the exception | 2923 // Add the function as another context for the exception |
| 2924 ScopedVector<char> buffer(128); | 2924 ScopedVector<char> buffer(128); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 2941 | 2941 |
| 2942 class WasmCompilationUnit { | 2942 class WasmCompilationUnit { |
| 2943 public: | 2943 public: |
| 2944 WasmCompilationUnit(wasm::ErrorThrower* thrower, Isolate* isolate, | 2944 WasmCompilationUnit(wasm::ErrorThrower* thrower, Isolate* isolate, |
| 2945 wasm::ModuleEnv* module_env, | 2945 wasm::ModuleEnv* module_env, |
| 2946 const wasm::WasmFunction* function, uint32_t index) | 2946 const wasm::WasmFunction* function, uint32_t index) |
| 2947 : thrower_(thrower), | 2947 : thrower_(thrower), |
| 2948 isolate_(isolate), | 2948 isolate_(isolate), |
| 2949 module_env_(module_env), | 2949 module_env_(module_env), |
| 2950 function_(function), | 2950 function_(function), |
| 2951 graph_zone_(new Zone(isolate->allocator())), | |
| 2952 jsgraph_(new (graph_zone()) JSGraph( | |
| 2953 isolate, new (graph_zone()) Graph(graph_zone()), | |
| 2954 new (graph_zone()) CommonOperatorBuilder(graph_zone()), nullptr, | |
| 2955 nullptr, | |
| 2956 new (graph_zone()) MachineOperatorBuilder( | |
| 2957 graph_zone(), MachineType::PointerRepresentation(), | |
| 2958 InstructionSelector::SupportedMachineOperatorFlags()))), | |
| 2959 compilation_zone_(isolate->allocator()), | 2951 compilation_zone_(isolate->allocator()), |
| 2960 info_(function->name_length != 0 | 2952 info_(function->name_length != 0 |
| 2961 ? module_env->module->GetNameOrNull(function->name_offset, | 2953 ? module_env->module->GetNameOrNull(function->name_offset, |
| 2962 function->name_length) | 2954 function->name_length) |
| 2963 : ArrayVector("wasm"), | 2955 : ArrayVector("wasm"), |
| 2964 isolate, &compilation_zone_, | 2956 isolate, &compilation_zone_, |
| 2965 Code::ComputeFlags(Code::WASM_FUNCTION)), | 2957 Code::ComputeFlags(Code::WASM_FUNCTION)), |
| 2966 job_(), | 2958 job_(), |
| 2967 index_(index), | 2959 index_(index), |
| 2968 ok_(true) { | 2960 ok_(true) {} |
| 2969 // Create and cache this node in the main thread. | |
| 2970 jsgraph_->CEntryStubConstant(1); | |
| 2971 } | |
| 2972 | |
| 2973 Zone* graph_zone() { return graph_zone_.get(); } | |
| 2974 | 2961 |
| 2975 void ExecuteCompilation() { | 2962 void ExecuteCompilation() { |
| 2976 HistogramTimerScope wasm_compile_function_time_scope( | 2963 HistogramTimerScope wasm_compile_function_time_scope( |
| 2977 isolate_->counters()->wasm_compile_function_time()); | 2964 isolate_->counters()->wasm_compile_function_time()); |
| 2978 if (FLAG_trace_wasm_compiler) { | 2965 if (FLAG_trace_wasm_compiler) { |
| 2979 OFStream os(stdout); | 2966 OFStream os(stdout); |
| 2980 os << "Compiling WASM function " | 2967 os << "Compiling WASM function " |
| 2981 << wasm::WasmFunctionName(function_, module_env_) << std::endl; | 2968 << wasm::WasmFunctionName(function_, module_env_) << std::endl; |
| 2982 os << std::endl; | 2969 os << std::endl; |
| 2983 } | 2970 } |
| 2984 | 2971 |
| 2985 double decode_ms = 0; | 2972 double decode_ms = 0; |
| 2986 size_t node_count = 0; | 2973 size_t node_count = 0; |
| 2987 | 2974 |
| 2988 base::SmartPointer<Zone> graph_zone(graph_zone_.Detach()); | 2975 Zone zone(isolate_->allocator()); |
| 2989 std::pair<JSGraph*, SourcePositionTable*> graph_result = | 2976 std::pair<JSGraph*, SourcePositionTable*> graph_result = |
| 2990 BuildGraphForWasmFunction(jsgraph_, thrower_, isolate_, module_env_, | 2977 BuildGraphForWasmFunction(&zone, thrower_, isolate_, module_env_, |
| 2991 function_, &decode_ms); | 2978 function_, &decode_ms); |
| 2992 JSGraph* jsgraph = graph_result.first; | 2979 JSGraph* jsgraph = graph_result.first; |
| 2993 SourcePositionTable* source_positions = graph_result.second; | 2980 SourcePositionTable* source_positions = graph_result.second; |
| 2994 | 2981 |
| 2995 if (jsgraph == nullptr) { | 2982 if (jsgraph == nullptr) { |
| 2996 ok_ = false; | 2983 ok_ = false; |
| 2997 return; | 2984 return; |
| 2998 } | 2985 } |
| 2999 | 2986 |
| 3000 base::ElapsedTimer pipeline_timer; | 2987 base::ElapsedTimer pipeline_timer; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3065 compile_ms); | 3052 compile_ms); |
| 3066 } | 3053 } |
| 3067 | 3054 |
| 3068 return code; | 3055 return code; |
| 3069 } | 3056 } |
| 3070 | 3057 |
| 3071 wasm::ErrorThrower* thrower_; | 3058 wasm::ErrorThrower* thrower_; |
| 3072 Isolate* isolate_; | 3059 Isolate* isolate_; |
| 3073 wasm::ModuleEnv* module_env_; | 3060 wasm::ModuleEnv* module_env_; |
| 3074 const wasm::WasmFunction* function_; | 3061 const wasm::WasmFunction* function_; |
| 3075 // The graph zone is deallocated at the end of ExecuteCompilation. | |
| 3076 base::SmartPointer<Zone> graph_zone_; | |
| 3077 JSGraph* jsgraph_; | |
| 3078 Zone compilation_zone_; | 3062 Zone compilation_zone_; |
| 3079 CompilationInfo info_; | 3063 CompilationInfo info_; |
| 3080 base::SmartPointer<CompilationJob> job_; | 3064 base::SmartPointer<CompilationJob> job_; |
| 3081 uint32_t index_; | 3065 uint32_t index_; |
| 3082 bool ok_; | 3066 bool ok_; |
| 3083 }; | 3067 }; |
| 3084 | 3068 |
| 3085 WasmCompilationUnit* CreateWasmCompilationUnit( | 3069 WasmCompilationUnit* CreateWasmCompilationUnit( |
| 3086 wasm::ErrorThrower* thrower, Isolate* isolate, wasm::ModuleEnv* module_env, | 3070 wasm::ErrorThrower* thrower, Isolate* isolate, wasm::ModuleEnv* module_env, |
| 3087 const wasm::WasmFunction* function, uint32_t index) { | 3071 const wasm::WasmFunction* function, uint32_t index) { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 3108 const wasm::WasmFunction* function) { | 3092 const wasm::WasmFunction* function) { |
| 3109 WasmCompilationUnit* unit = | 3093 WasmCompilationUnit* unit = |
| 3110 CreateWasmCompilationUnit(thrower, isolate, module_env, function, 0); | 3094 CreateWasmCompilationUnit(thrower, isolate, module_env, function, 0); |
| 3111 ExecuteCompilation(unit); | 3095 ExecuteCompilation(unit); |
| 3112 return FinishCompilation(unit); | 3096 return FinishCompilation(unit); |
| 3113 } | 3097 } |
| 3114 | 3098 |
| 3115 } // namespace compiler | 3099 } // namespace compiler |
| 3116 } // namespace internal | 3100 } // namespace internal |
| 3117 } // namespace v8 | 3101 } // namespace v8 |
| OLD | NEW |