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/codegen.h" | 7 #include "src/codegen.h" |
8 #include "src/compiler.h" | 8 #include "src/compiler.h" |
9 #include "src/debug.h" | 9 #include "src/debug.h" |
10 #include "src/full-codegen.h" | 10 #include "src/full-codegen.h" |
(...skipping 1521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1532 expr->extension()->GetNativeFunctionTemplate( | 1532 expr->extension()->GetNativeFunctionTemplate( |
1533 reinterpret_cast<v8::Isolate*>(isolate()), v8::Utils::ToLocal(name)); | 1533 reinterpret_cast<v8::Isolate*>(isolate()), v8::Utils::ToLocal(name)); |
1534 ASSERT(!fun_template.IsEmpty()); | 1534 ASSERT(!fun_template.IsEmpty()); |
1535 | 1535 |
1536 // Instantiate the function and create a shared function info from it. | 1536 // Instantiate the function and create a shared function info from it. |
1537 Handle<JSFunction> fun = Utils::OpenHandle(*fun_template->GetFunction()); | 1537 Handle<JSFunction> fun = Utils::OpenHandle(*fun_template->GetFunction()); |
1538 const int literals = fun->NumberOfLiterals(); | 1538 const int literals = fun->NumberOfLiterals(); |
1539 Handle<Code> code = Handle<Code>(fun->shared()->code()); | 1539 Handle<Code> code = Handle<Code>(fun->shared()->code()); |
1540 Handle<Code> construct_stub = Handle<Code>(fun->shared()->construct_stub()); | 1540 Handle<Code> construct_stub = Handle<Code>(fun->shared()->construct_stub()); |
1541 bool is_generator = false; | 1541 bool is_generator = false; |
| 1542 bool is_arrow = false; |
1542 Handle<SharedFunctionInfo> shared = | 1543 Handle<SharedFunctionInfo> shared = |
1543 isolate()->factory()->NewSharedFunctionInfo( | 1544 isolate()->factory()->NewSharedFunctionInfo( |
1544 name, literals, is_generator, | 1545 name, literals, is_generator, is_arrow, code, |
1545 code, Handle<ScopeInfo>(fun->shared()->scope_info()), | 1546 Handle<ScopeInfo>(fun->shared()->scope_info()), |
1546 Handle<FixedArray>(fun->shared()->feedback_vector())); | 1547 Handle<FixedArray>(fun->shared()->feedback_vector())); |
1547 shared->set_construct_stub(*construct_stub); | 1548 shared->set_construct_stub(*construct_stub); |
1548 | 1549 |
1549 // Copy the function data to the shared function info. | 1550 // Copy the function data to the shared function info. |
1550 shared->set_function_data(fun->shared()->function_data()); | 1551 shared->set_function_data(fun->shared()->function_data()); |
1551 int parameters = fun->shared()->formal_parameter_count(); | 1552 int parameters = fun->shared()->formal_parameter_count(); |
1552 shared->set_formal_parameter_count(parameters); | 1553 shared->set_formal_parameter_count(parameters); |
1553 | 1554 |
1554 EmitNewClosure(shared, false); | 1555 EmitNewClosure(shared, false); |
1555 } | 1556 } |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1682 } | 1683 } |
1683 return true; | 1684 return true; |
1684 } | 1685 } |
1685 #endif // DEBUG | 1686 #endif // DEBUG |
1686 | 1687 |
1687 | 1688 |
1688 #undef __ | 1689 #undef __ |
1689 | 1690 |
1690 | 1691 |
1691 } } // namespace v8::internal | 1692 } } // namespace v8::internal |
OLD | NEW |