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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 81 |
82 | 82 |
83 Handle<FixedArray> Factory::NewUninitializedFixedArray(int size) { | 83 Handle<FixedArray> Factory::NewUninitializedFixedArray(int size) { |
84 CALL_HEAP_FUNCTION( | 84 CALL_HEAP_FUNCTION( |
85 isolate(), | 85 isolate(), |
86 isolate()->heap()->AllocateUninitializedFixedArray(size), | 86 isolate()->heap()->AllocateUninitializedFixedArray(size), |
87 FixedArray); | 87 FixedArray); |
88 } | 88 } |
89 | 89 |
90 | 90 |
91 Handle<FixedDoubleArray> Factory::NewFixedDoubleArray(int size, | 91 Handle<FixedArrayBase> Factory::NewFixedDoubleArray(int size, |
92 PretenureFlag pretenure) { | 92 PretenureFlag pretenure) { |
93 ASSERT(0 <= size); | 93 ASSERT(0 <= size); |
94 CALL_HEAP_FUNCTION( | 94 CALL_HEAP_FUNCTION( |
95 isolate(), | 95 isolate(), |
96 isolate()->heap()->AllocateUninitializedFixedDoubleArray(size, pretenure), | 96 isolate()->heap()->AllocateUninitializedFixedDoubleArray(size, pretenure), |
97 FixedDoubleArray); | 97 FixedArrayBase); |
98 } | 98 } |
99 | 99 |
100 | 100 |
101 Handle<FixedDoubleArray> Factory::NewFixedDoubleArrayWithHoles( | 101 Handle<FixedArrayBase> Factory::NewFixedDoubleArrayWithHoles( |
102 int size, | 102 int size, |
103 PretenureFlag pretenure) { | 103 PretenureFlag pretenure) { |
104 ASSERT(0 <= size); | 104 ASSERT(0 <= size); |
105 Handle<FixedDoubleArray> array = NewFixedDoubleArray(size, pretenure); | 105 Handle<FixedArrayBase> array = NewFixedDoubleArray(size, pretenure); |
106 for (int i = 0; i < size; ++i) { | 106 if (size > 0) { |
107 array->set_the_hole(i); | 107 Handle<FixedDoubleArray> double_array = |
| 108 Handle<FixedDoubleArray>::cast(array); |
| 109 for (int i = 0; i < size; ++i) { |
| 110 double_array->set_the_hole(i); |
| 111 } |
108 } | 112 } |
109 return array; | 113 return array; |
110 } | 114 } |
111 | 115 |
112 | 116 |
113 Handle<ConstantPoolArray> Factory::NewConstantPoolArray( | 117 Handle<ConstantPoolArray> Factory::NewConstantPoolArray( |
114 int number_of_int64_entries, | 118 int number_of_int64_entries, |
115 int number_of_code_ptr_entries, | 119 int number_of_code_ptr_entries, |
116 int number_of_heap_ptr_entries, | 120 int number_of_heap_ptr_entries, |
117 int number_of_int32_entries) { | 121 int number_of_int32_entries) { |
(...skipping 2210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2328 return Handle<Object>::null(); | 2332 return Handle<Object>::null(); |
2329 } | 2333 } |
2330 | 2334 |
2331 | 2335 |
2332 Handle<Object> Factory::ToBoolean(bool value) { | 2336 Handle<Object> Factory::ToBoolean(bool value) { |
2333 return value ? true_value() : false_value(); | 2337 return value ? true_value() : false_value(); |
2334 } | 2338 } |
2335 | 2339 |
2336 | 2340 |
2337 } } // namespace v8::internal | 2341 } } // namespace v8::internal |
OLD | NEW |