| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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.h" | 5 #include "src/compiler.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "src/asmjs/asm-js.h" | 10 #include "src/asmjs/asm-js.h" |
| (...skipping 1831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1842 v8::Utils::ToLocal(name)); | 1842 v8::Utils::ToLocal(name)); |
| 1843 DCHECK(!fun_template.IsEmpty()); | 1843 DCHECK(!fun_template.IsEmpty()); |
| 1844 | 1844 |
| 1845 // Instantiate the function and create a shared function info from it. | 1845 // Instantiate the function and create a shared function info from it. |
| 1846 Handle<JSFunction> fun = Handle<JSFunction>::cast(Utils::OpenHandle( | 1846 Handle<JSFunction> fun = Handle<JSFunction>::cast(Utils::OpenHandle( |
| 1847 *fun_template->GetFunction(v8_isolate->GetCurrentContext()) | 1847 *fun_template->GetFunction(v8_isolate->GetCurrentContext()) |
| 1848 .ToLocalChecked())); | 1848 .ToLocalChecked())); |
| 1849 Handle<Code> code = Handle<Code>(fun->shared()->code()); | 1849 Handle<Code> code = Handle<Code>(fun->shared()->code()); |
| 1850 Handle<Code> construct_stub = Handle<Code>(fun->shared()->construct_stub()); | 1850 Handle<Code> construct_stub = Handle<Code>(fun->shared()->construct_stub()); |
| 1851 Handle<SharedFunctionInfo> shared = isolate->factory()->NewSharedFunctionInfo( | 1851 Handle<SharedFunctionInfo> shared = isolate->factory()->NewSharedFunctionInfo( |
| 1852 name, fun->shared()->num_literals(), FunctionKind::kNormalFunction, code, | 1852 name, FunctionKind::kNormalFunction, code, |
| 1853 Handle<ScopeInfo>(fun->shared()->scope_info())); | 1853 Handle<ScopeInfo>(fun->shared()->scope_info())); |
| 1854 shared->set_outer_scope_info(fun->shared()->outer_scope_info()); | 1854 shared->set_outer_scope_info(fun->shared()->outer_scope_info()); |
| 1855 shared->SetConstructStub(*construct_stub); | 1855 shared->SetConstructStub(*construct_stub); |
| 1856 shared->set_feedback_metadata(fun->shared()->feedback_metadata()); | 1856 shared->set_feedback_metadata(fun->shared()->feedback_metadata()); |
| 1857 | 1857 |
| 1858 // Copy the function data to the shared function info. | 1858 // Copy the function data to the shared function info. |
| 1859 shared->set_function_data(fun->shared()->function_data()); | 1859 shared->set_function_data(fun->shared()->function_data()); |
| 1860 int parameters = fun->shared()->internal_formal_parameter_count(); | 1860 int parameters = fun->shared()->internal_formal_parameter_count(); |
| 1861 shared->set_internal_formal_parameter_count(parameters); | 1861 shared->set_internal_formal_parameter_count(parameters); |
| 1862 | 1862 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1915 } | 1915 } |
| 1916 | 1916 |
| 1917 if (shared->is_compiled()) { | 1917 if (shared->is_compiled()) { |
| 1918 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. | 1918 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. |
| 1919 JSFunction::EnsureLiterals(function); | 1919 JSFunction::EnsureLiterals(function); |
| 1920 } | 1920 } |
| 1921 } | 1921 } |
| 1922 | 1922 |
| 1923 } // namespace internal | 1923 } // namespace internal |
| 1924 } // namespace v8 | 1924 } // namespace v8 |
| OLD | NEW |