| 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 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 #ifndef V8_FACTORY_H_ | 28 #ifndef V8_FACTORY_H_ |
| 29 #define V8_FACTORY_H_ | 29 #define V8_FACTORY_H_ |
| 30 | 30 |
| 31 #include "globals.h" | 31 #include "globals.h" |
| 32 #include "heap.h" | 32 #include "heap.h" |
| 33 | 33 |
| 34 namespace v8 { | 34 namespace v8 { |
| 35 namespace internal { | 35 namespace internal { |
| 36 | 36 |
| 37 // Forward declarations. | |
| 38 class ZoneScopeInfo; | |
| 39 | |
| 40 // Interface for handle based allocation. | 37 // Interface for handle based allocation. |
| 41 | 38 |
| 42 class Factory : public AllStatic { | 39 class Factory : public AllStatic { |
| 43 public: | 40 public: |
| 44 // Allocate a new fixed array with undefined entries. | 41 // Allocate a new fixed array with undefined entries. |
| 45 static Handle<FixedArray> NewFixedArray( | 42 static Handle<FixedArray> NewFixedArray( |
| 46 int size, | 43 int size, |
| 47 PretenureFlag pretenure = NOT_TENURED); | 44 PretenureFlag pretenure = NOT_TENURED); |
| 48 | 45 |
| 49 // Allocate a new fixed array with non-existing entries (the hole). | 46 // Allocate a new fixed array with non-existing entries (the hole). |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 Handle<SharedFunctionInfo> function_info, | 231 Handle<SharedFunctionInfo> function_info, |
| 235 Handle<Map> function_map, | 232 Handle<Map> function_map, |
| 236 PretenureFlag pretenure); | 233 PretenureFlag pretenure); |
| 237 | 234 |
| 238 static Handle<JSFunction> NewFunctionFromSharedFunctionInfo( | 235 static Handle<JSFunction> NewFunctionFromSharedFunctionInfo( |
| 239 Handle<SharedFunctionInfo> function_info, | 236 Handle<SharedFunctionInfo> function_info, |
| 240 Handle<Context> context, | 237 Handle<Context> context, |
| 241 PretenureFlag pretenure = TENURED); | 238 PretenureFlag pretenure = TENURED); |
| 242 | 239 |
| 243 static Handle<Code> NewCode(const CodeDesc& desc, | 240 static Handle<Code> NewCode(const CodeDesc& desc, |
| 244 ZoneScopeInfo* sinfo, | |
| 245 Code::Flags flags, | 241 Code::Flags flags, |
| 246 Handle<Object> self_reference); | 242 Handle<Object> self_reference); |
| 247 | 243 |
| 248 static Handle<Code> CopyCode(Handle<Code> code); | 244 static Handle<Code> CopyCode(Handle<Code> code); |
| 249 | 245 |
| 250 static Handle<Code> CopyCode(Handle<Code> code, Vector<byte> reloc_info); | 246 static Handle<Code> CopyCode(Handle<Code> code, Vector<byte> reloc_info); |
| 251 | 247 |
| 252 static Handle<Object> ToObject(Handle<Object> object); | 248 static Handle<Object> ToObject(Handle<Object> object); |
| 253 static Handle<Object> ToObject(Handle<Object> object, | 249 static Handle<Object> ToObject(Handle<Object> object, |
| 254 Handle<Context> global_context); | 250 Handle<Context> global_context); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 &Heap::roots_[Heap::k##name##RootIndex])); \ | 341 &Heap::roots_[Heap::k##name##RootIndex])); \ |
| 346 } | 342 } |
| 347 SYMBOL_LIST(SYMBOL_ACCESSOR) | 343 SYMBOL_LIST(SYMBOL_ACCESSOR) |
| 348 #undef SYMBOL_ACCESSOR | 344 #undef SYMBOL_ACCESSOR |
| 349 | 345 |
| 350 static Handle<String> hidden_symbol() { | 346 static Handle<String> hidden_symbol() { |
| 351 return Handle<String>(&Heap::hidden_symbol_); | 347 return Handle<String>(&Heap::hidden_symbol_); |
| 352 } | 348 } |
| 353 | 349 |
| 354 static Handle<SharedFunctionInfo> NewSharedFunctionInfo( | 350 static Handle<SharedFunctionInfo> NewSharedFunctionInfo( |
| 355 Handle<String> name, int number_of_literals, Handle<Code> code); | 351 Handle<String> name, |
| 352 int number_of_literals, |
| 353 Handle<Code> code, |
| 354 Handle<Object> scope_info); |
| 356 static Handle<SharedFunctionInfo> NewSharedFunctionInfo(Handle<String> name); | 355 static Handle<SharedFunctionInfo> NewSharedFunctionInfo(Handle<String> name); |
| 357 | 356 |
| 358 static Handle<NumberDictionary> DictionaryAtNumberPut( | 357 static Handle<NumberDictionary> DictionaryAtNumberPut( |
| 359 Handle<NumberDictionary>, | 358 Handle<NumberDictionary>, |
| 360 uint32_t key, | 359 uint32_t key, |
| 361 Handle<Object> value); | 360 Handle<Object> value); |
| 362 | 361 |
| 363 #ifdef ENABLE_DEBUGGER_SUPPORT | 362 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 364 static Handle<DebugInfo> NewDebugInfo(Handle<SharedFunctionInfo> shared); | 363 static Handle<DebugInfo> NewDebugInfo(Handle<SharedFunctionInfo> shared); |
| 365 #endif | 364 #endif |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 // Update the map cache in the global context with (keys, map) | 401 // Update the map cache in the global context with (keys, map) |
| 403 static Handle<MapCache> AddToMapCache(Handle<Context> context, | 402 static Handle<MapCache> AddToMapCache(Handle<Context> context, |
| 404 Handle<FixedArray> keys, | 403 Handle<FixedArray> keys, |
| 405 Handle<Map> map); | 404 Handle<Map> map); |
| 406 }; | 405 }; |
| 407 | 406 |
| 408 | 407 |
| 409 } } // namespace v8::internal | 408 } } // namespace v8::internal |
| 410 | 409 |
| 411 #endif // V8_FACTORY_H_ | 410 #endif // V8_FACTORY_H_ |
| OLD | NEW |