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