| 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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 Node* trap_reason_smi = builder_->BuildChangeInt32ToSmi(trap_reason_); | 226 Node* trap_reason_smi = builder_->BuildChangeInt32ToSmi(trap_reason_); |
| 227 Node* trap_position_smi = builder_->BuildChangeInt32ToSmi(trap_position_); | 227 Node* trap_position_smi = builder_->BuildChangeInt32ToSmi(trap_position_); |
| 228 | 228 |
| 229 if (module && !module->instance->context.is_null()) { | 229 if (module && !module->instance->context.is_null()) { |
| 230 // Use the module context to call the runtime to throw an exception. | 230 // Use the module context to call the runtime to throw an exception. |
| 231 Runtime::FunctionId f = Runtime::kThrowWasmError; | 231 Runtime::FunctionId f = Runtime::kThrowWasmError; |
| 232 const Runtime::Function* fun = Runtime::FunctionForId(f); | 232 const Runtime::Function* fun = Runtime::FunctionForId(f); |
| 233 CallDescriptor* desc = Linkage::GetRuntimeCallDescriptor( | 233 CallDescriptor* desc = Linkage::GetRuntimeCallDescriptor( |
| 234 jsgraph()->zone(), f, fun->nargs, Operator::kNoProperties, | 234 jsgraph()->zone(), f, fun->nargs, Operator::kNoProperties, |
| 235 CallDescriptor::kNoFlags); | 235 CallDescriptor::kNoFlags); |
| 236 // CEntryStubConstant nodes have to be created and cached in the main |
| 237 // thread. At the moment this is only done for CEntryStubConstant(1). |
| 238 DCHECK_EQ(1, fun->result_size); |
| 236 Node* inputs[] = { | 239 Node* inputs[] = { |
| 237 jsgraph()->CEntryStubConstant(fun->result_size), // C entry | 240 jsgraph()->CEntryStubConstant(fun->result_size), // C entry |
| 238 trap_reason_smi, // message id | 241 trap_reason_smi, // message id |
| 239 trap_position_smi, // byte position | 242 trap_position_smi, // byte position |
| 240 jsgraph()->ExternalConstant( | 243 jsgraph()->ExternalConstant( |
| 241 ExternalReference(f, jsgraph()->isolate())), // ref | 244 ExternalReference(f, jsgraph()->isolate())), // ref |
| 242 jsgraph()->Int32Constant(fun->nargs), // arity | 245 jsgraph()->Int32Constant(fun->nargs), // arity |
| 243 jsgraph()->Constant(module->instance->context), // context | 246 builder_->HeapConstant(module->instance->context), // context |
| 244 *effect_ptr, | 247 *effect_ptr, |
| 245 *control_ptr}; | 248 *control_ptr}; |
| 246 | 249 |
| 247 Node* node = graph()->NewNode( | 250 Node* node = graph()->NewNode( |
| 248 common()->Call(desc), static_cast<int>(arraysize(inputs)), inputs); | 251 common()->Call(desc), static_cast<int>(arraysize(inputs)), inputs); |
| 249 *control_ptr = node; | 252 *control_ptr = node; |
| 250 *effect_ptr = node; | 253 *effect_ptr = node; |
| 251 } | 254 } |
| 252 if (false) { | 255 if (false) { |
| 253 // End the control flow with a throw | 256 // End the control flow with a throw |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 878 | 881 |
| 879 Node* WasmGraphBuilder::Float32Constant(float value) { | 882 Node* WasmGraphBuilder::Float32Constant(float value) { |
| 880 return jsgraph()->Float32Constant(value); | 883 return jsgraph()->Float32Constant(value); |
| 881 } | 884 } |
| 882 | 885 |
| 883 | 886 |
| 884 Node* WasmGraphBuilder::Float64Constant(double value) { | 887 Node* WasmGraphBuilder::Float64Constant(double value) { |
| 885 return jsgraph()->Float64Constant(value); | 888 return jsgraph()->Float64Constant(value); |
| 886 } | 889 } |
| 887 | 890 |
| 888 | 891 Node* WasmGraphBuilder::HeapConstant(Handle<HeapObject> value) { |
| 889 Node* WasmGraphBuilder::Constant(Handle<Object> value) { | 892 return jsgraph()->HeapConstant(value); |
| 890 return jsgraph()->Constant(value); | |
| 891 } | 893 } |
| 892 | 894 |
| 893 | 895 |
| 894 Node* WasmGraphBuilder::Branch(Node* cond, Node** true_node, | 896 Node* WasmGraphBuilder::Branch(Node* cond, Node** true_node, |
| 895 Node** false_node) { | 897 Node** false_node) { |
| 896 DCHECK_NOT_NULL(cond); | 898 DCHECK_NOT_NULL(cond); |
| 897 DCHECK_NOT_NULL(*control_); | 899 DCHECK_NOT_NULL(*control_); |
| 898 Node* branch = | 900 Node* branch = |
| 899 graph()->NewNode(jsgraph()->common()->Branch(), cond, *control_); | 901 graph()->NewNode(jsgraph()->common()->Branch(), cond, *control_); |
| 900 *true_node = graph()->NewNode(jsgraph()->common()->IfTrue(), branch); | 902 *true_node = graph()->NewNode(jsgraph()->common()->IfTrue(), branch); |
| (...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1896 | 1898 |
| 1897 *effect_ = call; | 1899 *effect_ = call; |
| 1898 return call; | 1900 return call; |
| 1899 } | 1901 } |
| 1900 | 1902 |
| 1901 Node* WasmGraphBuilder::CallDirect(uint32_t index, Node** args, | 1903 Node* WasmGraphBuilder::CallDirect(uint32_t index, Node** args, |
| 1902 wasm::WasmCodePosition position) { | 1904 wasm::WasmCodePosition position) { |
| 1903 DCHECK_NULL(args[0]); | 1905 DCHECK_NULL(args[0]); |
| 1904 | 1906 |
| 1905 // Add code object as constant. | 1907 // Add code object as constant. |
| 1906 args[0] = Constant(module_->GetFunctionCode(index)); | 1908 args[0] = HeapConstant(module_->GetFunctionCode(index)); |
| 1907 wasm::FunctionSig* sig = module_->GetFunctionSignature(index); | 1909 wasm::FunctionSig* sig = module_->GetFunctionSignature(index); |
| 1908 | 1910 |
| 1909 return BuildWasmCall(sig, args, position); | 1911 return BuildWasmCall(sig, args, position); |
| 1910 } | 1912 } |
| 1911 | 1913 |
| 1912 Node* WasmGraphBuilder::CallImport(uint32_t index, Node** args, | 1914 Node* WasmGraphBuilder::CallImport(uint32_t index, Node** args, |
| 1913 wasm::WasmCodePosition position) { | 1915 wasm::WasmCodePosition position) { |
| 1914 DCHECK_NULL(args[0]); | 1916 DCHECK_NULL(args[0]); |
| 1915 | 1917 |
| 1916 // Add code object as constant. | 1918 // Add code object as constant. |
| 1917 args[0] = Constant(module_->GetImportCode(index)); | 1919 args[0] = HeapConstant(module_->GetImportCode(index)); |
| 1918 wasm::FunctionSig* sig = module_->GetImportSignature(index); | 1920 wasm::FunctionSig* sig = module_->GetImportSignature(index); |
| 1919 | 1921 |
| 1920 return BuildWasmCall(sig, args, position); | 1922 return BuildWasmCall(sig, args, position); |
| 1921 } | 1923 } |
| 1922 | 1924 |
| 1923 Node* WasmGraphBuilder::CallIndirect(uint32_t index, Node** args, | 1925 Node* WasmGraphBuilder::CallIndirect(uint32_t index, Node** args, |
| 1924 wasm::WasmCodePosition position) { | 1926 wasm::WasmCodePosition position) { |
| 1925 DCHECK_NOT_NULL(args[0]); | 1927 DCHECK_NOT_NULL(args[0]); |
| 1926 DCHECK(module_ && module_->instance); | 1928 DCHECK(module_ && module_->instance); |
| 1927 | 1929 |
| (...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2385 Node* start = Start(param_count + 5); | 2387 Node* start = Start(param_count + 5); |
| 2386 *control_ = start; | 2388 *control_ = start; |
| 2387 *effect_ = start; | 2389 *effect_ = start; |
| 2388 // Create the context parameter | 2390 // Create the context parameter |
| 2389 Node* context = graph()->NewNode( | 2391 Node* context = graph()->NewNode( |
| 2390 jsgraph()->common()->Parameter( | 2392 jsgraph()->common()->Parameter( |
| 2391 Linkage::GetJSCallContextParamIndex(wasm_count + 1), "%context"), | 2393 Linkage::GetJSCallContextParamIndex(wasm_count + 1), "%context"), |
| 2392 graph()->start()); | 2394 graph()->start()); |
| 2393 | 2395 |
| 2394 int pos = 0; | 2396 int pos = 0; |
| 2395 args[pos++] = Constant(wasm_code); | 2397 args[pos++] = HeapConstant(wasm_code); |
| 2396 | 2398 |
| 2397 // Convert JS parameters to WASM numbers. | 2399 // Convert JS parameters to WASM numbers. |
| 2398 for (int i = 0; i < wasm_count; i++) { | 2400 for (int i = 0; i < wasm_count; i++) { |
| 2399 Node* param = | 2401 Node* param = |
| 2400 graph()->NewNode(jsgraph()->common()->Parameter(i + 1), start); | 2402 graph()->NewNode(jsgraph()->common()->Parameter(i + 1), start); |
| 2401 Node* wasm_param = FromJS(param, context, sig->GetParam(i)); | 2403 Node* wasm_param = FromJS(param, context, sig->GetParam(i)); |
| 2402 args[pos++] = wasm_param; | 2404 args[pos++] = wasm_param; |
| 2403 if (jsgraph()->machine()->Is32() && sig->GetParam(i) == wasm::kAstI64) { | 2405 if (jsgraph()->machine()->Is32() && sig->GetParam(i) == wasm::kAstI64) { |
| 2404 // We make up the high word with SAR to get the proper sign extension. | 2406 // We make up the high word with SAR to get the proper sign extension. |
| 2405 args[pos++] = graph()->NewNode(jsgraph()->machine()->Word32Sar(), | 2407 args[pos++] = graph()->NewNode(jsgraph()->machine()->Word32Sar(), |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2444 param_count = Int64Lowering::GetParameterCountAfterLowering(sig); | 2446 param_count = Int64Lowering::GetParameterCountAfterLowering(sig); |
| 2445 } | 2447 } |
| 2446 | 2448 |
| 2447 // Build the start and the parameter nodes. | 2449 // Build the start and the parameter nodes. |
| 2448 Isolate* isolate = jsgraph()->isolate(); | 2450 Isolate* isolate = jsgraph()->isolate(); |
| 2449 CallDescriptor* desc; | 2451 CallDescriptor* desc; |
| 2450 Node* start = Start(param_count + 3); | 2452 Node* start = Start(param_count + 3); |
| 2451 *effect_ = start; | 2453 *effect_ = start; |
| 2452 *control_ = start; | 2454 *control_ = start; |
| 2453 // JS context is the last parameter. | 2455 // JS context is the last parameter. |
| 2454 Node* context = Constant(Handle<Context>(function->context(), isolate)); | 2456 Node* context = HeapConstant(Handle<Context>(function->context(), isolate)); |
| 2455 Node** args = Buffer(wasm_count + 7); | 2457 Node** args = Buffer(wasm_count + 7); |
| 2456 | 2458 |
| 2457 bool arg_count_before_args = false; | 2459 bool arg_count_before_args = false; |
| 2458 bool add_new_target_undefined = false; | 2460 bool add_new_target_undefined = false; |
| 2459 | 2461 |
| 2460 int pos = 0; | 2462 int pos = 0; |
| 2461 if (js_count == wasm_count) { | 2463 if (js_count == wasm_count) { |
| 2462 // exact arity match, just call the function directly. | 2464 // exact arity match, just call the function directly. |
| 2463 desc = Linkage::GetJSCallDescriptor(graph()->zone(), false, wasm_count + 1, | 2465 desc = Linkage::GetJSCallDescriptor(graph()->zone(), false, wasm_count + 1, |
| 2464 CallDescriptor::kNoFlags); | 2466 CallDescriptor::kNoFlags); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2552 } else { | 2554 } else { |
| 2553 return jsgraph()->Int32Constant(size + offset); | 2555 return jsgraph()->Int32Constant(size + offset); |
| 2554 } | 2556 } |
| 2555 } | 2557 } |
| 2556 | 2558 |
| 2557 | 2559 |
| 2558 Node* WasmGraphBuilder::FunctionTable() { | 2560 Node* WasmGraphBuilder::FunctionTable() { |
| 2559 DCHECK(module_ && module_->instance && | 2561 DCHECK(module_ && module_->instance && |
| 2560 !module_->instance->function_table.is_null()); | 2562 !module_->instance->function_table.is_null()); |
| 2561 if (!function_table_) { | 2563 if (!function_table_) { |
| 2562 function_table_ = jsgraph()->Constant(module_->instance->function_table); | 2564 function_table_ = HeapConstant(module_->instance->function_table); |
| 2563 } | 2565 } |
| 2564 return function_table_; | 2566 return function_table_; |
| 2565 } | 2567 } |
| 2566 | 2568 |
| 2567 | 2569 |
| 2568 Node* WasmGraphBuilder::LoadGlobal(uint32_t index) { | 2570 Node* WasmGraphBuilder::LoadGlobal(uint32_t index) { |
| 2569 DCHECK(module_ && module_->instance && module_->instance->globals_start); | 2571 DCHECK(module_ && module_->instance && module_->instance->globals_start); |
| 2570 MachineType mem_type = module_->GetGlobalType(index); | 2572 MachineType mem_type = module_->GetGlobalType(index); |
| 2571 Node* addr = jsgraph()->IntPtrConstant( | 2573 Node* addr = jsgraph()->IntPtrConstant( |
| 2572 reinterpret_cast<uintptr_t>(module_->instance->globals_start + | 2574 reinterpret_cast<uintptr_t>(module_->instance->globals_start + |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2894 buffer.Dispose(); | 2896 buffer.Dispose(); |
| 2895 } | 2897 } |
| 2896 | 2898 |
| 2897 RecordFunctionCompilation(Logger::FUNCTION_TAG, &info, "wasm-to-js", 0, | 2899 RecordFunctionCompilation(Logger::FUNCTION_TAG, &info, "wasm-to-js", 0, |
| 2898 module_name); | 2900 module_name); |
| 2899 } | 2901 } |
| 2900 return code; | 2902 return code; |
| 2901 } | 2903 } |
| 2902 | 2904 |
| 2903 std::pair<JSGraph*, SourcePositionTable*> BuildGraphForWasmFunction( | 2905 std::pair<JSGraph*, SourcePositionTable*> BuildGraphForWasmFunction( |
| 2904 Zone* zone, wasm::ErrorThrower* thrower, Isolate* isolate, | 2906 JSGraph* jsgraph, wasm::ErrorThrower* thrower, Isolate* isolate, |
| 2905 wasm::ModuleEnv*& module_env, const wasm::WasmFunction* function, | 2907 wasm::ModuleEnv*& module_env, const wasm::WasmFunction* function, |
| 2906 double* decode_ms) { | 2908 double* decode_ms) { |
| 2907 base::ElapsedTimer decode_timer; | 2909 base::ElapsedTimer decode_timer; |
| 2908 if (FLAG_trace_wasm_decode_time) { | 2910 if (FLAG_trace_wasm_decode_time) { |
| 2909 decode_timer.Start(); | 2911 decode_timer.Start(); |
| 2910 } | 2912 } |
| 2911 // Create a TF graph during decoding. | 2913 // Create a TF graph during decoding. |
| 2912 Graph* graph = new (zone) Graph(zone); | 2914 Graph* graph = jsgraph->graph(); |
| 2913 CommonOperatorBuilder* common = new (zone) CommonOperatorBuilder(zone); | 2915 CommonOperatorBuilder* common = jsgraph->common(); |
| 2914 MachineOperatorBuilder* machine = new (zone) MachineOperatorBuilder( | 2916 MachineOperatorBuilder* machine = jsgraph->machine(); |
| 2915 zone, MachineType::PointerRepresentation(), | |
| 2916 InstructionSelector::SupportedMachineOperatorFlags()); | |
| 2917 JSGraph* jsgraph = | |
| 2918 new (zone) JSGraph(isolate, graph, common, nullptr, nullptr, machine); | |
| 2919 SourcePositionTable* source_position_table = | 2917 SourcePositionTable* source_position_table = |
| 2920 new (zone) SourcePositionTable(graph); | 2918 new (jsgraph->zone()) SourcePositionTable(graph); |
| 2921 WasmGraphBuilder builder(zone, jsgraph, function->sig, source_position_table); | 2919 WasmGraphBuilder builder(jsgraph->zone(), jsgraph, function->sig, |
| 2920 source_position_table); |
| 2922 wasm::FunctionBody body = { | 2921 wasm::FunctionBody body = { |
| 2923 module_env, function->sig, module_env->module->module_start, | 2922 module_env, function->sig, module_env->module->module_start, |
| 2924 module_env->module->module_start + function->code_start_offset, | 2923 module_env->module->module_start + function->code_start_offset, |
| 2925 module_env->module->module_start + function->code_end_offset}; | 2924 module_env->module->module_start + function->code_end_offset}; |
| 2926 wasm::TreeResult result = | 2925 wasm::TreeResult result = |
| 2927 wasm::BuildTFGraph(isolate->allocator(), &builder, body); | 2926 wasm::BuildTFGraph(isolate->allocator(), &builder, body); |
| 2928 | 2927 |
| 2929 if (machine->Is32()) { | 2928 if (machine->Is32()) { |
| 2930 Int64Lowering r(graph, machine, common, zone, function->sig); | 2929 Int64Lowering r(graph, machine, common, jsgraph->zone(), function->sig); |
| 2931 r.LowerGraph(); | 2930 r.LowerGraph(); |
| 2932 } | 2931 } |
| 2933 | 2932 |
| 2934 if (result.failed()) { | 2933 if (result.failed()) { |
| 2935 if (FLAG_trace_wasm_compiler) { | 2934 if (FLAG_trace_wasm_compiler) { |
| 2936 OFStream os(stdout); | 2935 OFStream os(stdout); |
| 2937 os << "Compilation failed: " << result << std::endl; | 2936 os << "Compilation failed: " << result << std::endl; |
| 2938 } | 2937 } |
| 2939 // Add the function as another context for the exception | 2938 // Add the function as another context for the exception |
| 2940 ScopedVector<char> buffer(128); | 2939 ScopedVector<char> buffer(128); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 2957 | 2956 |
| 2958 class WasmCompilationUnit { | 2957 class WasmCompilationUnit { |
| 2959 public: | 2958 public: |
| 2960 WasmCompilationUnit(wasm::ErrorThrower* thrower, Isolate* isolate, | 2959 WasmCompilationUnit(wasm::ErrorThrower* thrower, Isolate* isolate, |
| 2961 wasm::ModuleEnv* module_env, | 2960 wasm::ModuleEnv* module_env, |
| 2962 const wasm::WasmFunction* function, uint32_t index) | 2961 const wasm::WasmFunction* function, uint32_t index) |
| 2963 : thrower_(thrower), | 2962 : thrower_(thrower), |
| 2964 isolate_(isolate), | 2963 isolate_(isolate), |
| 2965 module_env_(module_env), | 2964 module_env_(module_env), |
| 2966 function_(function), | 2965 function_(function), |
| 2966 graph_zone_(new Zone(isolate->allocator())), |
| 2967 jsgraph_(new (graph_zone()) JSGraph( |
| 2968 isolate, new (graph_zone()) Graph(graph_zone()), |
| 2969 new (graph_zone()) CommonOperatorBuilder(graph_zone()), nullptr, |
| 2970 nullptr, |
| 2971 new (graph_zone()) MachineOperatorBuilder( |
| 2972 graph_zone(), MachineType::PointerRepresentation(), |
| 2973 InstructionSelector::SupportedMachineOperatorFlags()))), |
| 2967 compilation_zone_(isolate->allocator()), | 2974 compilation_zone_(isolate->allocator()), |
| 2968 info_(function->name_length != 0 | 2975 info_(function->name_length != 0 |
| 2969 ? module_env->module->GetNameOrNull(function->name_offset, | 2976 ? module_env->module->GetNameOrNull(function->name_offset, |
| 2970 function->name_length) | 2977 function->name_length) |
| 2971 : ArrayVector("wasm"), | 2978 : ArrayVector("wasm"), |
| 2972 isolate, &compilation_zone_, | 2979 isolate, &compilation_zone_, |
| 2973 Code::ComputeFlags(Code::WASM_FUNCTION)), | 2980 Code::ComputeFlags(Code::WASM_FUNCTION)), |
| 2974 job_(), | 2981 job_(), |
| 2975 index_(index), | 2982 index_(index), |
| 2976 ok_(true) {} | 2983 ok_(true) { |
| 2984 // Create and cache this node in the main thread. |
| 2985 jsgraph_->CEntryStubConstant(1); |
| 2986 } |
| 2987 |
| 2988 Zone* graph_zone() { return graph_zone_.get(); } |
| 2977 | 2989 |
| 2978 void ExecuteCompilation() { | 2990 void ExecuteCompilation() { |
| 2979 HistogramTimerScope wasm_compile_function_time_scope( | 2991 HistogramTimerScope wasm_compile_function_time_scope( |
| 2980 isolate_->counters()->wasm_compile_function_time()); | 2992 isolate_->counters()->wasm_compile_function_time()); |
| 2981 if (FLAG_trace_wasm_compiler) { | 2993 if (FLAG_trace_wasm_compiler) { |
| 2982 OFStream os(stdout); | 2994 OFStream os(stdout); |
| 2983 os << "Compiling WASM function " | 2995 os << "Compiling WASM function " |
| 2984 << wasm::WasmFunctionName(function_, module_env_) << std::endl; | 2996 << wasm::WasmFunctionName(function_, module_env_) << std::endl; |
| 2985 os << std::endl; | 2997 os << std::endl; |
| 2986 } | 2998 } |
| 2987 | 2999 |
| 2988 double decode_ms = 0; | 3000 double decode_ms = 0; |
| 2989 size_t node_count = 0; | 3001 size_t node_count = 0; |
| 2990 | 3002 |
| 2991 Zone zone(isolate_->allocator()); | 3003 base::SmartPointer<Zone> graph_zone(graph_zone_.Detach()); |
| 2992 std::pair<JSGraph*, SourcePositionTable*> graph_result = | 3004 std::pair<JSGraph*, SourcePositionTable*> graph_result = |
| 2993 BuildGraphForWasmFunction(&zone, thrower_, isolate_, module_env_, | 3005 BuildGraphForWasmFunction(jsgraph_, thrower_, isolate_, module_env_, |
| 2994 function_, &decode_ms); | 3006 function_, &decode_ms); |
| 2995 JSGraph* jsgraph = graph_result.first; | 3007 JSGraph* jsgraph = graph_result.first; |
| 2996 SourcePositionTable* source_positions = graph_result.second; | 3008 SourcePositionTable* source_positions = graph_result.second; |
| 2997 | 3009 |
| 2998 if (jsgraph == nullptr) { | 3010 if (jsgraph == nullptr) { |
| 2999 ok_ = false; | 3011 ok_ = false; |
| 3000 return; | 3012 return; |
| 3001 } | 3013 } |
| 3002 | 3014 |
| 3003 base::ElapsedTimer pipeline_timer; | 3015 base::ElapsedTimer pipeline_timer; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3068 compile_ms); | 3080 compile_ms); |
| 3069 } | 3081 } |
| 3070 | 3082 |
| 3071 return code; | 3083 return code; |
| 3072 } | 3084 } |
| 3073 | 3085 |
| 3074 wasm::ErrorThrower* thrower_; | 3086 wasm::ErrorThrower* thrower_; |
| 3075 Isolate* isolate_; | 3087 Isolate* isolate_; |
| 3076 wasm::ModuleEnv* module_env_; | 3088 wasm::ModuleEnv* module_env_; |
| 3077 const wasm::WasmFunction* function_; | 3089 const wasm::WasmFunction* function_; |
| 3090 // The graph zone is deallocated at the end of ExecuteCompilation. |
| 3091 base::SmartPointer<Zone> graph_zone_; |
| 3092 JSGraph* jsgraph_; |
| 3078 Zone compilation_zone_; | 3093 Zone compilation_zone_; |
| 3079 CompilationInfo info_; | 3094 CompilationInfo info_; |
| 3080 base::SmartPointer<CompilationJob> job_; | 3095 base::SmartPointer<CompilationJob> job_; |
| 3081 uint32_t index_; | 3096 uint32_t index_; |
| 3082 bool ok_; | 3097 bool ok_; |
| 3083 }; | 3098 }; |
| 3084 | 3099 |
| 3085 WasmCompilationUnit* CreateWasmCompilationUnit( | 3100 WasmCompilationUnit* CreateWasmCompilationUnit( |
| 3086 wasm::ErrorThrower* thrower, Isolate* isolate, wasm::ModuleEnv* module_env, | 3101 wasm::ErrorThrower* thrower, Isolate* isolate, wasm::ModuleEnv* module_env, |
| 3087 const wasm::WasmFunction* function, uint32_t index) { | 3102 const wasm::WasmFunction* function, uint32_t index) { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 3108 const wasm::WasmFunction* function) { | 3123 const wasm::WasmFunction* function) { |
| 3109 WasmCompilationUnit* unit = | 3124 WasmCompilationUnit* unit = |
| 3110 CreateWasmCompilationUnit(thrower, isolate, module_env, function, 0); | 3125 CreateWasmCompilationUnit(thrower, isolate, module_env, function, 0); |
| 3111 ExecuteCompilation(unit); | 3126 ExecuteCompilation(unit); |
| 3112 return FinishCompilation(unit); | 3127 return FinishCompilation(unit); |
| 3113 } | 3128 } |
| 3114 | 3129 |
| 3115 } // namespace compiler | 3130 } // namespace compiler |
| 3116 } // namespace internal | 3131 } // namespace internal |
| 3117 } // namespace v8 | 3132 } // namespace v8 |
| OLD | NEW |