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 "isolate.h" | 8 #include "isolate.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 | 669 |
670 // Creates a code object that is not yet fully initialized yet. | 670 // Creates a code object that is not yet fully initialized yet. |
671 inline Handle<Code> NewCodeRaw(int object_size, bool immovable); | 671 inline Handle<Code> NewCodeRaw(int object_size, bool immovable); |
672 | 672 |
673 // Initializes a function with a shared part and prototype. | 673 // Initializes a function with a shared part and prototype. |
674 // Note: this code was factored out of NewFunction such that other parts of | 674 // Note: this code was factored out of NewFunction such that other parts of |
675 // the VM could use it. Specifically, a function that creates instances of | 675 // the VM could use it. Specifically, a function that creates instances of |
676 // type JS_FUNCTION_TYPE benefit from the use of this function. | 676 // type JS_FUNCTION_TYPE benefit from the use of this function. |
677 inline void InitializeFunction(Handle<JSFunction> function, | 677 inline void InitializeFunction(Handle<JSFunction> function, |
678 Handle<SharedFunctionInfo> info, | 678 Handle<SharedFunctionInfo> info, |
679 Handle<Context> context, | 679 Handle<Context> context); |
680 MaybeHandle<Object> maybe_prototype); | |
681 | 680 |
682 // Creates a function initialized with a shared part. | 681 // Creates a function initialized with a shared part. |
683 inline Handle<JSFunction> NewFunction(Handle<SharedFunctionInfo> info, | 682 inline Handle<JSFunction> NewFunction(Handle<Map> map, |
| 683 Handle<SharedFunctionInfo> info, |
684 Handle<Context> context, | 684 Handle<Context> context, |
685 MaybeHandle<Object> maybe_prototype, | |
686 PretenureFlag pretenure = TENURED); | 685 PretenureFlag pretenure = TENURED); |
687 | 686 |
688 // Create a new map cache. | 687 // Create a new map cache. |
689 Handle<MapCache> NewMapCache(int at_least_space_for); | 688 Handle<MapCache> NewMapCache(int at_least_space_for); |
690 | 689 |
691 // Update the map cache in the native context with (keys, map) | 690 // Update the map cache in the native context with (keys, map) |
692 Handle<MapCache> AddToMapCache(Handle<Context> context, | 691 Handle<MapCache> AddToMapCache(Handle<Context> context, |
693 Handle<FixedArray> keys, | 692 Handle<FixedArray> keys, |
694 Handle<Map> map); | 693 Handle<Map> map); |
695 | 694 |
696 // Attempt to find the number in a small cache. If we finds it, return | 695 // Attempt to find the number in a small cache. If we finds it, return |
697 // the string representation of the number. Otherwise return undefined. | 696 // the string representation of the number. Otherwise return undefined. |
698 Handle<Object> GetNumberStringCache(Handle<Object> number); | 697 Handle<Object> GetNumberStringCache(Handle<Object> number); |
699 | 698 |
700 // Update the cache with a new number-string pair. | 699 // Update the cache with a new number-string pair. |
701 void SetNumberStringCache(Handle<Object> number, Handle<String> string); | 700 void SetNumberStringCache(Handle<Object> number, Handle<String> string); |
702 }; | 701 }; |
703 | 702 |
704 } } // namespace v8::internal | 703 } } // namespace v8::internal |
705 | 704 |
706 #endif // V8_FACTORY_H_ | 705 #endif // V8_FACTORY_H_ |
OLD | NEW |