| 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/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
| 9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
| 10 #include "src/debug.h" | 10 #include "src/debug.h" |
| (...skipping 1554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1565 | 1565 |
| 1566 // Instantiate the function and create a shared function info from it. | 1566 // Instantiate the function and create a shared function info from it. |
| 1567 Handle<JSFunction> fun = Utils::OpenHandle(*fun_template->GetFunction()); | 1567 Handle<JSFunction> fun = Utils::OpenHandle(*fun_template->GetFunction()); |
| 1568 const int literals = fun->NumberOfLiterals(); | 1568 const int literals = fun->NumberOfLiterals(); |
| 1569 Handle<Code> code = Handle<Code>(fun->shared()->code()); | 1569 Handle<Code> code = Handle<Code>(fun->shared()->code()); |
| 1570 Handle<Code> construct_stub = Handle<Code>(fun->shared()->construct_stub()); | 1570 Handle<Code> construct_stub = Handle<Code>(fun->shared()->construct_stub()); |
| 1571 Handle<SharedFunctionInfo> shared = | 1571 Handle<SharedFunctionInfo> shared = |
| 1572 isolate()->factory()->NewSharedFunctionInfo( | 1572 isolate()->factory()->NewSharedFunctionInfo( |
| 1573 name, literals, FunctionKind::kNormalFunction, code, | 1573 name, literals, FunctionKind::kNormalFunction, code, |
| 1574 Handle<ScopeInfo>(fun->shared()->scope_info()), | 1574 Handle<ScopeInfo>(fun->shared()->scope_info()), |
| 1575 Handle<FixedArray>(fun->shared()->feedback_vector())); | 1575 Handle<TypeFeedbackVector>(fun->shared()->feedback_vector())); |
| 1576 shared->set_construct_stub(*construct_stub); | 1576 shared->set_construct_stub(*construct_stub); |
| 1577 | 1577 |
| 1578 // Copy the function data to the shared function info. | 1578 // Copy the function data to the shared function info. |
| 1579 shared->set_function_data(fun->shared()->function_data()); | 1579 shared->set_function_data(fun->shared()->function_data()); |
| 1580 int parameters = fun->shared()->formal_parameter_count(); | 1580 int parameters = fun->shared()->formal_parameter_count(); |
| 1581 shared->set_formal_parameter_count(parameters); | 1581 shared->set_formal_parameter_count(parameters); |
| 1582 | 1582 |
| 1583 EmitNewClosure(shared, false); | 1583 EmitNewClosure(shared, false); |
| 1584 } | 1584 } |
| 1585 | 1585 |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1711 } | 1711 } |
| 1712 return true; | 1712 return true; |
| 1713 } | 1713 } |
| 1714 #endif // DEBUG | 1714 #endif // DEBUG |
| 1715 | 1715 |
| 1716 | 1716 |
| 1717 #undef __ | 1717 #undef __ |
| 1718 | 1718 |
| 1719 | 1719 |
| 1720 } } // namespace v8::internal | 1720 } } // namespace v8::internal |
| OLD | NEW |