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 2947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2958 Handle<SharedFunctionInfo> shared = | 2958 Handle<SharedFunctionInfo> shared = |
2959 isolate->factory()->NewSharedFunctionInfo(name_str, code, false); | 2959 isolate->factory()->NewSharedFunctionInfo(name_str, code, false); |
2960 PROFILE(isolate, CodeCreateEvent(tag, AbstractCode::cast(*code), *shared, | 2960 PROFILE(isolate, CodeCreateEvent(tag, AbstractCode::cast(*code), *shared, |
2961 *script_str, 0, 0)); | 2961 *script_str, 0, 0)); |
2962 } | 2962 } |
2963 } | 2963 } |
2964 | 2964 |
2965 Handle<JSFunction> CompileJSToWasmWrapper( | 2965 Handle<JSFunction> CompileJSToWasmWrapper( |
2966 Isolate* isolate, wasm::ModuleEnv* module, Handle<String> name, | 2966 Isolate* isolate, wasm::ModuleEnv* module, Handle<String> name, |
2967 Handle<Code> wasm_code, Handle<JSObject> module_object, uint32_t index) { | 2967 Handle<Code> wasm_code, Handle<JSObject> module_object, uint32_t index) { |
2968 wasm::WasmFunction* func = &module->module->functions[index]; | 2968 const wasm::WasmFunction* func = &module->module->functions[index]; |
2969 | 2969 |
2970 //---------------------------------------------------------------------------- | 2970 //---------------------------------------------------------------------------- |
2971 // Create the JSFunction object. | 2971 // Create the JSFunction object. |
2972 //---------------------------------------------------------------------------- | 2972 //---------------------------------------------------------------------------- |
2973 Handle<SharedFunctionInfo> shared = | 2973 Handle<SharedFunctionInfo> shared = |
2974 isolate->factory()->NewSharedFunctionInfo(name, wasm_code, false); | 2974 isolate->factory()->NewSharedFunctionInfo(name, wasm_code, false); |
2975 int params = static_cast<int>(func->sig->parameter_count()); | 2975 int params = static_cast<int>(func->sig->parameter_count()); |
2976 shared->set_length(params); | 2976 shared->set_length(params); |
2977 shared->set_internal_formal_parameter_count(params); | 2977 shared->set_internal_formal_parameter_count(params); |
2978 Handle<JSFunction> function = isolate->factory()->NewFunction( | 2978 Handle<JSFunction> function = isolate->factory()->NewFunction( |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3301 function_->code_start_offset), | 3301 function_->code_start_offset), |
3302 compile_ms); | 3302 compile_ms); |
3303 } | 3303 } |
3304 | 3304 |
3305 return code; | 3305 return code; |
3306 } | 3306 } |
3307 | 3307 |
3308 } // namespace compiler | 3308 } // namespace compiler |
3309 } // namespace internal | 3309 } // namespace internal |
3310 } // namespace v8 | 3310 } // namespace v8 |
OLD | NEW |