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 "macro-assembler.h" | 7 #include "macro-assembler.h" |
8 #include "isolate-inl.h" | 8 #include "isolate-inl.h" |
9 #include "v8conversions.h" | 9 #include "v8conversions.h" |
10 | 10 |
(...skipping 1792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1803 } | 1803 } |
1804 shared->set_num_literals(literals_array_size); | 1804 shared->set_num_literals(literals_array_size); |
1805 if (is_generator) { | 1805 if (is_generator) { |
1806 shared->set_instance_class_name(isolate()->heap()->Generator_string()); | 1806 shared->set_instance_class_name(isolate()->heap()->Generator_string()); |
1807 shared->DisableOptimization(kGenerator); | 1807 shared->DisableOptimization(kGenerator); |
1808 } | 1808 } |
1809 return shared; | 1809 return shared; |
1810 } | 1810 } |
1811 | 1811 |
1812 | 1812 |
| 1813 Handle<FixedArray> Factory::NewTypeFeedbackVector(int slot_count) { |
| 1814 Handle<FixedArray> vector = NewFixedArray(slot_count, TENURED); |
| 1815 // Ensure we can skip the write barrier |
| 1816 ASSERT_EQ(isolate()->heap()->uninitialized_symbol(), |
| 1817 *TypeFeedbackInfo::UninitializedSentinel(isolate())); |
| 1818 for (int i = 0; i < slot_count; i++) { |
| 1819 vector->set( |
| 1820 i, |
| 1821 *TypeFeedbackInfo::UninitializedSentinel(isolate()), |
| 1822 SKIP_WRITE_BARRIER); |
| 1823 } |
| 1824 return vector; |
| 1825 } |
| 1826 |
| 1827 |
1813 Handle<JSMessageObject> Factory::NewJSMessageObject( | 1828 Handle<JSMessageObject> Factory::NewJSMessageObject( |
1814 Handle<String> type, | 1829 Handle<String> type, |
1815 Handle<JSArray> arguments, | 1830 Handle<JSArray> arguments, |
1816 int start_position, | 1831 int start_position, |
1817 int end_position, | 1832 int end_position, |
1818 Handle<Object> script, | 1833 Handle<Object> script, |
1819 Handle<Object> stack_frames) { | 1834 Handle<Object> stack_frames) { |
1820 Handle<Map> map = message_object_map(); | 1835 Handle<Map> map = message_object_map(); |
1821 Handle<JSMessageObject> message = New<JSMessageObject>(map, NEW_SPACE); | 1836 Handle<JSMessageObject> message = New<JSMessageObject>(map, NEW_SPACE); |
1822 message->set_properties(*empty_fixed_array(), SKIP_WRITE_BARRIER); | 1837 message->set_properties(*empty_fixed_array(), SKIP_WRITE_BARRIER); |
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2329 return Handle<Object>::null(); | 2344 return Handle<Object>::null(); |
2330 } | 2345 } |
2331 | 2346 |
2332 | 2347 |
2333 Handle<Object> Factory::ToBoolean(bool value) { | 2348 Handle<Object> Factory::ToBoolean(bool value) { |
2334 return value ? true_value() : false_value(); | 2349 return value ? true_value() : false_value(); |
2335 } | 2350 } |
2336 | 2351 |
2337 | 2352 |
2338 } } // namespace v8::internal | 2353 } } // namespace v8::internal |
OLD | NEW |