| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 1598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1609 expr->extension()->GetNativeFunctionTemplate( | 1609 expr->extension()->GetNativeFunctionTemplate( |
| 1610 reinterpret_cast<v8::Isolate*>(isolate()), v8::Utils::ToLocal(name)); | 1610 reinterpret_cast<v8::Isolate*>(isolate()), v8::Utils::ToLocal(name)); |
| 1611 ASSERT(!fun_template.IsEmpty()); | 1611 ASSERT(!fun_template.IsEmpty()); |
| 1612 | 1612 |
| 1613 // Instantiate the function and create a shared function info from it. | 1613 // Instantiate the function and create a shared function info from it. |
| 1614 Handle<JSFunction> fun = Utils::OpenHandle(*fun_template->GetFunction()); | 1614 Handle<JSFunction> fun = Utils::OpenHandle(*fun_template->GetFunction()); |
| 1615 const int literals = fun->NumberOfLiterals(); | 1615 const int literals = fun->NumberOfLiterals(); |
| 1616 Handle<Code> code = Handle<Code>(fun->shared()->code()); | 1616 Handle<Code> code = Handle<Code>(fun->shared()->code()); |
| 1617 Handle<Code> construct_stub = Handle<Code>(fun->shared()->construct_stub()); | 1617 Handle<Code> construct_stub = Handle<Code>(fun->shared()->construct_stub()); |
| 1618 bool is_generator = false; | 1618 bool is_generator = false; |
| 1619 bool is_arrow = false; |
| 1619 Handle<SharedFunctionInfo> shared = | 1620 Handle<SharedFunctionInfo> shared = |
| 1620 isolate()->factory()->NewSharedFunctionInfo(name, literals, is_generator, | 1621 isolate()->factory()->NewSharedFunctionInfo(name, literals, is_generator, |
| 1621 code, Handle<ScopeInfo>(fun->shared()->scope_info())); | 1622 is_arrow, code, Handle<ScopeInfo>(fun->shared()->scope_info())); |
| 1622 shared->set_construct_stub(*construct_stub); | 1623 shared->set_construct_stub(*construct_stub); |
| 1623 | 1624 |
| 1624 // Copy the function data to the shared function info. | 1625 // Copy the function data to the shared function info. |
| 1625 shared->set_function_data(fun->shared()->function_data()); | 1626 shared->set_function_data(fun->shared()->function_data()); |
| 1626 int parameters = fun->shared()->formal_parameter_count(); | 1627 int parameters = fun->shared()->formal_parameter_count(); |
| 1627 shared->set_formal_parameter_count(parameters); | 1628 shared->set_formal_parameter_count(parameters); |
| 1628 | 1629 |
| 1629 EmitNewClosure(shared, false); | 1630 EmitNewClosure(shared, false); |
| 1630 } | 1631 } |
| 1631 | 1632 |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1758 } | 1759 } |
| 1759 return true; | 1760 return true; |
| 1760 } | 1761 } |
| 1761 #endif // DEBUG | 1762 #endif // DEBUG |
| 1762 | 1763 |
| 1763 | 1764 |
| 1764 #undef __ | 1765 #undef __ |
| 1765 | 1766 |
| 1766 | 1767 |
| 1767 } } // namespace v8::internal | 1768 } } // namespace v8::internal |
| OLD | NEW |