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