| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 #include "heap.h" | 31 #include "heap.h" |
| 32 | 32 |
| 33 namespace v8 { namespace internal { | 33 namespace v8 { namespace internal { |
| 34 | 34 |
| 35 | 35 |
| 36 // Interface for handle based allocation. | 36 // Interface for handle based allocation. |
| 37 | 37 |
| 38 class Factory : public AllStatic { | 38 class Factory : public AllStatic { |
| 39 public: | 39 public: |
| 40 // Allocate a new fixed array. | 40 // Allocate a new fixed array with undefined entries. |
| 41 static Handle<FixedArray> NewFixedArray( | 41 static Handle<FixedArray> NewFixedArray( |
| 42 int size, | 42 int size, |
| 43 PretenureFlag pretenure = NOT_TENURED); | 43 PretenureFlag pretenure = NOT_TENURED); |
| 44 |
| 45 // Allocate a new fixed array with non-existing entries (the hole). |
| 46 static Handle<FixedArray> NewFixedArrayWithHoles(int size); |
| 47 |
| 44 static Handle<Dictionary> NewDictionary(int at_least_space_for); | 48 static Handle<Dictionary> NewDictionary(int at_least_space_for); |
| 45 | 49 |
| 46 static Handle<DescriptorArray> NewDescriptorArray(int number_of_descriptors); | 50 static Handle<DescriptorArray> NewDescriptorArray(int number_of_descriptors); |
| 47 | 51 |
| 48 static Handle<String> LookupSymbol(Vector<const char> str); | 52 static Handle<String> LookupSymbol(Vector<const char> str); |
| 49 static Handle<String> LookupAsciiSymbol(const char* str) { | 53 static Handle<String> LookupAsciiSymbol(const char* str) { |
| 50 return LookupSymbol(CStrVector(str)); | 54 return LookupSymbol(CStrVector(str)); |
| 51 } | 55 } |
| 52 | 56 |
| 53 | 57 |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 // Update the map cache in the global context with (keys, map) | 339 // Update the map cache in the global context with (keys, map) |
| 336 static Handle<MapCache> AddToMapCache(Handle<Context> context, | 340 static Handle<MapCache> AddToMapCache(Handle<Context> context, |
| 337 Handle<FixedArray> keys, | 341 Handle<FixedArray> keys, |
| 338 Handle<Map> map); | 342 Handle<Map> map); |
| 339 }; | 343 }; |
| 340 | 344 |
| 341 | 345 |
| 342 } } // namespace v8::internal | 346 } } // namespace v8::internal |
| 343 | 347 |
| 344 #endif // V8_FACTORY_H_ | 348 #endif // V8_FACTORY_H_ |
| OLD | NEW |