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 1570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1581 expr->extension()->GetNativeFunctionTemplate( | 1581 expr->extension()->GetNativeFunctionTemplate( |
1582 reinterpret_cast<v8::Isolate*>(isolate()), v8::Utils::ToLocal(name)); | 1582 reinterpret_cast<v8::Isolate*>(isolate()), v8::Utils::ToLocal(name)); |
1583 ASSERT(!fun_template.IsEmpty()); | 1583 ASSERT(!fun_template.IsEmpty()); |
1584 | 1584 |
1585 // Instantiate the function and create a shared function info from it. | 1585 // Instantiate the function and create a shared function info from it. |
1586 Handle<JSFunction> fun = Utils::OpenHandle(*fun_template->GetFunction()); | 1586 Handle<JSFunction> fun = Utils::OpenHandle(*fun_template->GetFunction()); |
1587 const int literals = fun->NumberOfLiterals(); | 1587 const int literals = fun->NumberOfLiterals(); |
1588 Handle<Code> code = Handle<Code>(fun->shared()->code()); | 1588 Handle<Code> code = Handle<Code>(fun->shared()->code()); |
1589 Handle<Code> construct_stub = Handle<Code>(fun->shared()->construct_stub()); | 1589 Handle<Code> construct_stub = Handle<Code>(fun->shared()->construct_stub()); |
1590 bool is_generator = false; | 1590 bool is_generator = false; |
| 1591 bool is_arrow = false; |
1591 Handle<SharedFunctionInfo> shared = | 1592 Handle<SharedFunctionInfo> shared = |
1592 isolate()->factory()->NewSharedFunctionInfo(name, literals, is_generator, | 1593 isolate()->factory()->NewSharedFunctionInfo(name, literals, is_generator, |
1593 code, Handle<ScopeInfo>(fun->shared()->scope_info())); | 1594 is_arrow, code, Handle<ScopeInfo>(fun->shared()->scope_info())); |
1594 shared->set_construct_stub(*construct_stub); | 1595 shared->set_construct_stub(*construct_stub); |
1595 | 1596 |
1596 // Copy the function data to the shared function info. | 1597 // Copy the function data to the shared function info. |
1597 shared->set_function_data(fun->shared()->function_data()); | 1598 shared->set_function_data(fun->shared()->function_data()); |
1598 int parameters = fun->shared()->formal_parameter_count(); | 1599 int parameters = fun->shared()->formal_parameter_count(); |
1599 shared->set_formal_parameter_count(parameters); | 1600 shared->set_formal_parameter_count(parameters); |
1600 | 1601 |
1601 EmitNewClosure(shared, false); | 1602 EmitNewClosure(shared, false); |
1602 } | 1603 } |
1603 | 1604 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1730 } | 1731 } |
1731 return true; | 1732 return true; |
1732 } | 1733 } |
1733 #endif // DEBUG | 1734 #endif // DEBUG |
1734 | 1735 |
1735 | 1736 |
1736 #undef __ | 1737 #undef __ |
1737 | 1738 |
1738 | 1739 |
1739 } } // namespace v8::internal | 1740 } } // namespace v8::internal |
OLD | NEW |