OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 "factory.h" | 5 #include "factory.h" |
6 | 6 |
7 #include "conversions.h" | 7 #include "conversions.h" |
8 #include "isolate-inl.h" | 8 #include "isolate-inl.h" |
9 #include "macro-assembler.h" | 9 #include "macro-assembler.h" |
10 | 10 |
(...skipping 1845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1856 TENURED, | 1856 TENURED, |
1857 *TypeFeedbackInfo::UninitializedSentinel(isolate())), | 1857 *TypeFeedbackInfo::UninitializedSentinel(isolate())), |
1858 FixedArray); | 1858 FixedArray); |
1859 } | 1859 } |
1860 | 1860 |
1861 | 1861 |
1862 Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo( | 1862 Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo( |
1863 Handle<String> name, | 1863 Handle<String> name, |
1864 int number_of_literals, | 1864 int number_of_literals, |
1865 bool is_generator, | 1865 bool is_generator, |
| 1866 bool is_arrow, |
1866 Handle<Code> code, | 1867 Handle<Code> code, |
1867 Handle<ScopeInfo> scope_info, | 1868 Handle<ScopeInfo> scope_info, |
1868 Handle<FixedArray> feedback_vector) { | 1869 Handle<FixedArray> feedback_vector) { |
1869 Handle<SharedFunctionInfo> shared = NewSharedFunctionInfo(name, code); | 1870 Handle<SharedFunctionInfo> shared = NewSharedFunctionInfo(name, code); |
1870 shared->set_scope_info(*scope_info); | 1871 shared->set_scope_info(*scope_info); |
1871 shared->set_feedback_vector(*feedback_vector); | 1872 shared->set_feedback_vector(*feedback_vector); |
| 1873 shared->set_is_arrow(is_arrow); |
1872 int literals_array_size = number_of_literals; | 1874 int literals_array_size = number_of_literals; |
1873 // If the function contains object, regexp or array literals, | 1875 // If the function contains object, regexp or array literals, |
1874 // allocate extra space for a literals array prefix containing the | 1876 // allocate extra space for a literals array prefix containing the |
1875 // context. | 1877 // context. |
1876 if (number_of_literals > 0) { | 1878 if (number_of_literals > 0) { |
1877 literals_array_size += JSFunction::kLiteralsPrefixSize; | 1879 literals_array_size += JSFunction::kLiteralsPrefixSize; |
1878 } | 1880 } |
1879 shared->set_num_literals(literals_array_size); | 1881 shared->set_num_literals(literals_array_size); |
1880 if (is_generator) { | 1882 if (is_generator) { |
1881 shared->set_instance_class_name(isolate()->heap()->Generator_string()); | 1883 shared->set_instance_class_name(isolate()->heap()->Generator_string()); |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2331 return Handle<Object>::null(); | 2333 return Handle<Object>::null(); |
2332 } | 2334 } |
2333 | 2335 |
2334 | 2336 |
2335 Handle<Object> Factory::ToBoolean(bool value) { | 2337 Handle<Object> Factory::ToBoolean(bool value) { |
2336 return value ? true_value() : false_value(); | 2338 return value ? true_value() : false_value(); |
2337 } | 2339 } |
2338 | 2340 |
2339 | 2341 |
2340 } } // namespace v8::internal | 2342 } } // namespace v8::internal |
OLD | NEW |