| 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 "src/factory.h" | 5 #include "src/factory.h" |
| 6 | 6 |
| 7 #include "src/conversions.h" | 7 #include "src/conversions.h" |
| 8 #include "src/isolate-inl.h" | 8 #include "src/isolate-inl.h" |
| 9 #include "src/macro-assembler.h" | 9 #include "src/macro-assembler.h" |
| 10 | 10 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 Handle<FixedDoubleArray>::cast(array); | 108 Handle<FixedDoubleArray>::cast(array); |
| 109 for (int i = 0; i < size; ++i) { | 109 for (int i = 0; i < size; ++i) { |
| 110 double_array->set_the_hole(i); | 110 double_array->set_the_hole(i); |
| 111 } | 111 } |
| 112 } | 112 } |
| 113 return array; | 113 return array; |
| 114 } | 114 } |
| 115 | 115 |
| 116 | 116 |
| 117 Handle<ConstantPoolArray> Factory::NewConstantPoolArray( | 117 Handle<ConstantPoolArray> Factory::NewConstantPoolArray( |
| 118 int number_of_int64_entries, | 118 const ConstantPoolArray::NumberOfEntries& small) { |
| 119 int number_of_code_ptr_entries, | 119 ASSERT(small.total_count() > 0); |
| 120 int number_of_heap_ptr_entries, | |
| 121 int number_of_int32_entries) { | |
| 122 ASSERT(number_of_int64_entries > 0 || number_of_code_ptr_entries > 0 || | |
| 123 number_of_heap_ptr_entries > 0 || number_of_int32_entries > 0); | |
| 124 CALL_HEAP_FUNCTION( | 120 CALL_HEAP_FUNCTION( |
| 125 isolate(), | 121 isolate(), |
| 126 isolate()->heap()->AllocateConstantPoolArray(number_of_int64_entries, | 122 isolate()->heap()->AllocateConstantPoolArray(small), |
| 127 number_of_code_ptr_entries, | |
| 128 number_of_heap_ptr_entries, | |
| 129 number_of_int32_entries), | |
| 130 ConstantPoolArray); | 123 ConstantPoolArray); |
| 131 } | 124 } |
| 132 | 125 |
| 126 |
| 127 Handle<ConstantPoolArray> Factory::NewExtendedConstantPoolArray( |
| 128 const ConstantPoolArray::NumberOfEntries& small, |
| 129 const ConstantPoolArray::NumberOfEntries& extended) { |
| 130 ASSERT(small.total_count() > 0); |
| 131 ASSERT(extended.total_count() > 0); |
| 132 CALL_HEAP_FUNCTION( |
| 133 isolate(), |
| 134 isolate()->heap()->AllocateExtendedConstantPoolArray(small, extended), |
| 135 ConstantPoolArray); |
| 136 } |
| 137 |
| 133 | 138 |
| 134 Handle<OrderedHashSet> Factory::NewOrderedHashSet() { | 139 Handle<OrderedHashSet> Factory::NewOrderedHashSet() { |
| 135 return OrderedHashSet::Allocate(isolate(), 4); | 140 return OrderedHashSet::Allocate(isolate(), 4); |
| 136 } | 141 } |
| 137 | 142 |
| 138 | 143 |
| 139 Handle<OrderedHashMap> Factory::NewOrderedHashMap() { | 144 Handle<OrderedHashMap> Factory::NewOrderedHashMap() { |
| 140 return OrderedHashMap::Allocate(isolate(), 4); | 145 return OrderedHashMap::Allocate(isolate(), 4); |
| 141 } | 146 } |
| 142 | 147 |
| (...skipping 2188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2331 return Handle<Object>::null(); | 2336 return Handle<Object>::null(); |
| 2332 } | 2337 } |
| 2333 | 2338 |
| 2334 | 2339 |
| 2335 Handle<Object> Factory::ToBoolean(bool value) { | 2340 Handle<Object> Factory::ToBoolean(bool value) { |
| 2336 return value ? true_value() : false_value(); | 2341 return value ? true_value() : false_value(); |
| 2337 } | 2342 } |
| 2338 | 2343 |
| 2339 | 2344 |
| 2340 } } // namespace v8::internal | 2345 } } // namespace v8::internal |
| OLD | NEW |