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 | 8 |
9 #include "src/asmjs/asm-js.h" | 9 #include "src/asmjs/asm-js.h" |
10 #include "src/asmjs/typing-asm.h" | 10 #include "src/asmjs/typing-asm.h" |
(...skipping 1726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1737 | 1737 |
1738 // Instantiate the function and create a shared function info from it. | 1738 // Instantiate the function and create a shared function info from it. |
1739 Handle<JSFunction> fun = Handle<JSFunction>::cast(Utils::OpenHandle( | 1739 Handle<JSFunction> fun = Handle<JSFunction>::cast(Utils::OpenHandle( |
1740 *fun_template->GetFunction(v8_isolate->GetCurrentContext()) | 1740 *fun_template->GetFunction(v8_isolate->GetCurrentContext()) |
1741 .ToLocalChecked())); | 1741 .ToLocalChecked())); |
1742 Handle<Code> code = Handle<Code>(fun->shared()->code()); | 1742 Handle<Code> code = Handle<Code>(fun->shared()->code()); |
1743 Handle<Code> construct_stub = Handle<Code>(fun->shared()->construct_stub()); | 1743 Handle<Code> construct_stub = Handle<Code>(fun->shared()->construct_stub()); |
1744 Handle<SharedFunctionInfo> shared = isolate->factory()->NewSharedFunctionInfo( | 1744 Handle<SharedFunctionInfo> shared = isolate->factory()->NewSharedFunctionInfo( |
1745 name, fun->shared()->num_literals(), FunctionKind::kNormalFunction, code, | 1745 name, fun->shared()->num_literals(), FunctionKind::kNormalFunction, code, |
1746 Handle<ScopeInfo>(fun->shared()->scope_info())); | 1746 Handle<ScopeInfo>(fun->shared()->scope_info())); |
1747 shared->set_construct_stub(*construct_stub); | 1747 shared->SetConstructStub(*construct_stub); |
1748 shared->set_feedback_metadata(fun->shared()->feedback_metadata()); | 1748 shared->set_feedback_metadata(fun->shared()->feedback_metadata()); |
1749 | 1749 |
1750 // Copy the function data to the shared function info. | 1750 // Copy the function data to the shared function info. |
1751 shared->set_function_data(fun->shared()->function_data()); | 1751 shared->set_function_data(fun->shared()->function_data()); |
1752 int parameters = fun->shared()->internal_formal_parameter_count(); | 1752 int parameters = fun->shared()->internal_formal_parameter_count(); |
1753 shared->set_internal_formal_parameter_count(parameters); | 1753 shared->set_internal_formal_parameter_count(parameters); |
1754 | 1754 |
1755 return shared; | 1755 return shared; |
1756 } | 1756 } |
1757 | 1757 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1838 DCHECK(shared->is_compiled()); | 1838 DCHECK(shared->is_compiled()); |
1839 function->set_literals(cached.literals); | 1839 function->set_literals(cached.literals); |
1840 } else if (shared->is_compiled()) { | 1840 } else if (shared->is_compiled()) { |
1841 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. | 1841 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. |
1842 JSFunction::EnsureLiterals(function); | 1842 JSFunction::EnsureLiterals(function); |
1843 } | 1843 } |
1844 } | 1844 } |
1845 | 1845 |
1846 } // namespace internal | 1846 } // namespace internal |
1847 } // namespace v8 | 1847 } // namespace v8 |
OLD | NEW |