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 1530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1541 reinterpret_cast<v8::Isolate*>(isolate()), v8::Utils::ToLocal(name)); | 1541 reinterpret_cast<v8::Isolate*>(isolate()), v8::Utils::ToLocal(name)); |
1542 DCHECK(!fun_template.IsEmpty()); | 1542 DCHECK(!fun_template.IsEmpty()); |
1543 | 1543 |
1544 // Instantiate the function and create a shared function info from it. | 1544 // Instantiate the function and create a shared function info from it. |
1545 Handle<JSFunction> fun = Utils::OpenHandle(*fun_template->GetFunction()); | 1545 Handle<JSFunction> fun = Utils::OpenHandle(*fun_template->GetFunction()); |
1546 const int literals = fun->NumberOfLiterals(); | 1546 const int literals = fun->NumberOfLiterals(); |
1547 Handle<Code> code = Handle<Code>(fun->shared()->code()); | 1547 Handle<Code> code = Handle<Code>(fun->shared()->code()); |
1548 Handle<Code> construct_stub = Handle<Code>(fun->shared()->construct_stub()); | 1548 Handle<Code> construct_stub = Handle<Code>(fun->shared()->construct_stub()); |
1549 bool is_generator = false; | 1549 bool is_generator = false; |
1550 bool is_arrow = false; | 1550 bool is_arrow = false; |
| 1551 bool is_concise_method = false; |
1551 Handle<SharedFunctionInfo> shared = | 1552 Handle<SharedFunctionInfo> shared = |
1552 isolate()->factory()->NewSharedFunctionInfo( | 1553 isolate()->factory()->NewSharedFunctionInfo( |
1553 name, literals, is_generator, is_arrow, code, | 1554 name, literals, is_generator, is_arrow, is_concise_method, code, |
1554 Handle<ScopeInfo>(fun->shared()->scope_info()), | 1555 Handle<ScopeInfo>(fun->shared()->scope_info()), |
1555 Handle<FixedArray>(fun->shared()->feedback_vector())); | 1556 Handle<FixedArray>(fun->shared()->feedback_vector())); |
1556 shared->set_construct_stub(*construct_stub); | 1557 shared->set_construct_stub(*construct_stub); |
1557 | 1558 |
1558 // Copy the function data to the shared function info. | 1559 // Copy the function data to the shared function info. |
1559 shared->set_function_data(fun->shared()->function_data()); | 1560 shared->set_function_data(fun->shared()->function_data()); |
1560 int parameters = fun->shared()->formal_parameter_count(); | 1561 int parameters = fun->shared()->formal_parameter_count(); |
1561 shared->set_formal_parameter_count(parameters); | 1562 shared->set_formal_parameter_count(parameters); |
1562 | 1563 |
1563 EmitNewClosure(shared, false); | 1564 EmitNewClosure(shared, false); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1691 } | 1692 } |
1692 return true; | 1693 return true; |
1693 } | 1694 } |
1694 #endif // DEBUG | 1695 #endif // DEBUG |
1695 | 1696 |
1696 | 1697 |
1697 #undef __ | 1698 #undef __ |
1698 | 1699 |
1699 | 1700 |
1700 } } // namespace v8::internal | 1701 } } // namespace v8::internal |
OLD | NEW |