| 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 #ifndef V8_FACTORY_H_ | 5 #ifndef V8_FACTORY_H_ |
| 6 #define V8_FACTORY_H_ | 6 #define V8_FACTORY_H_ |
| 7 | 7 |
| 8 #include "src/isolate.h" | 8 #include "src/isolate.h" |
| 9 #include "src/messages.h" | 9 #include "src/messages.h" |
| 10 | 10 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 // so the return type must be the general fixed array class. | 39 // so the return type must be the general fixed array class. |
| 40 Handle<FixedArrayBase> NewFixedDoubleArray( | 40 Handle<FixedArrayBase> NewFixedDoubleArray( |
| 41 int size, | 41 int size, |
| 42 PretenureFlag pretenure = NOT_TENURED); | 42 PretenureFlag pretenure = NOT_TENURED); |
| 43 | 43 |
| 44 // Allocate a new fixed double array with hole values. | 44 // Allocate a new fixed double array with hole values. |
| 45 Handle<FixedArrayBase> NewFixedDoubleArrayWithHoles( | 45 Handle<FixedArrayBase> NewFixedDoubleArrayWithHoles( |
| 46 int size, | 46 int size, |
| 47 PretenureFlag pretenure = NOT_TENURED); | 47 PretenureFlag pretenure = NOT_TENURED); |
| 48 | 48 |
| 49 Handle<ConstantPoolArray> NewConstantPoolArray( | |
| 50 const ConstantPoolArray::NumberOfEntries& small); | |
| 51 | |
| 52 Handle<ConstantPoolArray> NewExtendedConstantPoolArray( | |
| 53 const ConstantPoolArray::NumberOfEntries& small, | |
| 54 const ConstantPoolArray::NumberOfEntries& extended); | |
| 55 | |
| 56 Handle<OrderedHashSet> NewOrderedHashSet(); | 49 Handle<OrderedHashSet> NewOrderedHashSet(); |
| 57 Handle<OrderedHashMap> NewOrderedHashMap(); | 50 Handle<OrderedHashMap> NewOrderedHashMap(); |
| 58 | 51 |
| 59 // Create a new boxed value. | 52 // Create a new boxed value. |
| 60 Handle<Box> NewBox(Handle<Object> value); | 53 Handle<Box> NewBox(Handle<Object> value); |
| 61 | 54 |
| 62 // Create a new PrototypeInfo struct. | 55 // Create a new PrototypeInfo struct. |
| 63 Handle<PrototypeInfo> NewPrototypeInfo(); | 56 Handle<PrototypeInfo> NewPrototypeInfo(); |
| 64 | 57 |
| 65 // Create a pre-tenured empty AccessorPair. | 58 // Create a pre-tenured empty AccessorPair. |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 | 325 |
| 333 Handle<FixedArray> CopyFixedArray(Handle<FixedArray> array); | 326 Handle<FixedArray> CopyFixedArray(Handle<FixedArray> array); |
| 334 | 327 |
| 335 // This method expects a COW array in new space, and creates a copy | 328 // This method expects a COW array in new space, and creates a copy |
| 336 // of it in old space. | 329 // of it in old space. |
| 337 Handle<FixedArray> CopyAndTenureFixedCOWArray(Handle<FixedArray> array); | 330 Handle<FixedArray> CopyAndTenureFixedCOWArray(Handle<FixedArray> array); |
| 338 | 331 |
| 339 Handle<FixedDoubleArray> CopyFixedDoubleArray( | 332 Handle<FixedDoubleArray> CopyFixedDoubleArray( |
| 340 Handle<FixedDoubleArray> array); | 333 Handle<FixedDoubleArray> array); |
| 341 | 334 |
| 342 Handle<ConstantPoolArray> CopyConstantPoolArray( | |
| 343 Handle<ConstantPoolArray> array); | |
| 344 | |
| 345 // Numbers (e.g. literals) are pretenured by the parser. | 335 // Numbers (e.g. literals) are pretenured by the parser. |
| 346 // The return value may be a smi or a heap number. | 336 // The return value may be a smi or a heap number. |
| 347 Handle<Object> NewNumber(double value, | 337 Handle<Object> NewNumber(double value, |
| 348 PretenureFlag pretenure = NOT_TENURED); | 338 PretenureFlag pretenure = NOT_TENURED); |
| 349 | 339 |
| 350 Handle<Object> NewNumberFromInt(int32_t value, | 340 Handle<Object> NewNumberFromInt(int32_t value, |
| 351 PretenureFlag pretenure = NOT_TENURED); | 341 PretenureFlag pretenure = NOT_TENURED); |
| 352 Handle<Object> NewNumberFromUint(uint32_t value, | 342 Handle<Object> NewNumberFromUint(uint32_t value, |
| 353 PretenureFlag pretenure = NOT_TENURED); | 343 PretenureFlag pretenure = NOT_TENURED); |
| 354 Handle<Object> NewNumberFromSize(size_t value, | 344 Handle<Object> NewNumberFromSize(size_t value, |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 751 // Reinitialize a JSProxy into an (empty) JS object of respective type and | 741 // Reinitialize a JSProxy into an (empty) JS object of respective type and |
| 752 // size, but keeping the original prototype. The receiver must have at least | 742 // size, but keeping the original prototype. The receiver must have at least |
| 753 // the size of the new object. The object is reinitialized and behaves as an | 743 // the size of the new object. The object is reinitialized and behaves as an |
| 754 // object that has been freshly allocated. | 744 // object that has been freshly allocated. |
| 755 void ReinitializeJSProxy(Handle<JSProxy> proxy, InstanceType type, int size); | 745 void ReinitializeJSProxy(Handle<JSProxy> proxy, InstanceType type, int size); |
| 756 }; | 746 }; |
| 757 | 747 |
| 758 } } // namespace v8::internal | 748 } } // namespace v8::internal |
| 759 | 749 |
| 760 #endif // V8_FACTORY_H_ | 750 #endif // V8_FACTORY_H_ |
| OLD | NEW |