| 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 #include "src/type-feedback-vector.h" | 10 #include "src/type-feedback-vector.h" |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 | 495 |
| 496 // Reinitialize an JSGlobalProxy based on a constructor. The object | 496 // Reinitialize an JSGlobalProxy based on a constructor. The object |
| 497 // must have the same size as objects allocated using the | 497 // must have the same size as objects allocated using the |
| 498 // constructor. The object is reinitialized and behaves as an | 498 // constructor. The object is reinitialized and behaves as an |
| 499 // object that has been freshly allocated using the constructor. | 499 // object that has been freshly allocated using the constructor. |
| 500 void ReinitializeJSGlobalProxy(Handle<JSGlobalProxy> global, | 500 void ReinitializeJSGlobalProxy(Handle<JSGlobalProxy> global, |
| 501 Handle<JSFunction> constructor); | 501 Handle<JSFunction> constructor); |
| 502 | 502 |
| 503 Handle<JSGlobalProxy> NewUninitializedJSGlobalProxy(); | 503 Handle<JSGlobalProxy> NewUninitializedJSGlobalProxy(); |
| 504 | 504 |
| 505 Handle<JSFunction> NewFunction(Handle<Map> map, |
| 506 Handle<SharedFunctionInfo> info, |
| 507 Handle<Object> context_or_undefined, |
| 508 PretenureFlag pretenure = TENURED); |
| 505 Handle<JSFunction> NewFunction(Handle<String> name, Handle<Code> code, | 509 Handle<JSFunction> NewFunction(Handle<String> name, Handle<Code> code, |
| 506 Handle<Object> prototype, | 510 Handle<Object> prototype, |
| 507 bool is_strict = false); | 511 bool is_strict = false); |
| 508 Handle<JSFunction> NewFunction(Handle<String> name); | 512 Handle<JSFunction> NewFunction(Handle<String> name); |
| 509 Handle<JSFunction> NewFunctionWithoutPrototype(Handle<String> name, | 513 Handle<JSFunction> NewFunctionWithoutPrototype(Handle<String> name, |
| 510 Handle<Code> code, | 514 Handle<Code> code, |
| 511 bool is_strict = false); | 515 bool is_strict = false); |
| 512 | 516 |
| 513 Handle<JSFunction> NewFunctionFromSharedFunctionInfo( | 517 Handle<JSFunction> NewFunctionFromSharedFunctionInfo( |
| 514 Handle<Map> initial_map, Handle<SharedFunctionInfo> function_info, | 518 Handle<Map> initial_map, Handle<SharedFunctionInfo> function_info, |
| 515 Handle<Context> context, PretenureFlag pretenure = TENURED); | 519 Handle<Object> context_or_undefined, PretenureFlag pretenure = TENURED); |
| 516 | 520 |
| 517 Handle<JSFunction> NewFunctionFromSharedFunctionInfo( | 521 Handle<JSFunction> NewFunctionFromSharedFunctionInfo( |
| 518 Handle<SharedFunctionInfo> function_info, Handle<Context> context, | 522 Handle<SharedFunctionInfo> function_info, Handle<Context> context, |
| 519 PretenureFlag pretenure = TENURED); | 523 PretenureFlag pretenure = TENURED); |
| 520 | 524 |
| 521 Handle<JSFunction> NewFunction(Handle<String> name, Handle<Code> code, | 525 Handle<JSFunction> NewFunction(Handle<String> name, Handle<Code> code, |
| 522 Handle<Object> prototype, InstanceType type, | 526 Handle<Object> prototype, InstanceType type, |
| 523 int instance_size, | 527 int instance_size, |
| 524 bool is_strict = false); | 528 bool is_strict = false); |
| 525 Handle<JSFunction> NewFunction(Handle<String> name, | 529 Handle<JSFunction> NewFunction(Handle<String> name, |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 702 // Creates a code object that is not yet fully initialized yet. | 706 // Creates a code object that is not yet fully initialized yet. |
| 703 inline Handle<Code> NewCodeRaw(int object_size, bool immovable); | 707 inline Handle<Code> NewCodeRaw(int object_size, bool immovable); |
| 704 | 708 |
| 705 // Attempt to find the number in a small cache. If we finds it, return | 709 // Attempt to find the number in a small cache. If we finds it, return |
| 706 // the string representation of the number. Otherwise return undefined. | 710 // the string representation of the number. Otherwise return undefined. |
| 707 Handle<Object> GetNumberStringCache(Handle<Object> number); | 711 Handle<Object> GetNumberStringCache(Handle<Object> number); |
| 708 | 712 |
| 709 // Update the cache with a new number-string pair. | 713 // Update the cache with a new number-string pair. |
| 710 void SetNumberStringCache(Handle<Object> number, Handle<String> string); | 714 void SetNumberStringCache(Handle<Object> number, Handle<String> string); |
| 711 | 715 |
| 712 // Creates a function initialized with a shared part. | |
| 713 Handle<JSFunction> NewFunction(Handle<Map> map, | |
| 714 Handle<SharedFunctionInfo> info, | |
| 715 Handle<Context> context, | |
| 716 PretenureFlag pretenure = TENURED); | |
| 717 | |
| 718 // Create a JSArray with no elements and no length. | 716 // Create a JSArray with no elements and no length. |
| 719 Handle<JSArray> NewJSArray(ElementsKind elements_kind, | 717 Handle<JSArray> NewJSArray(ElementsKind elements_kind, |
| 720 PretenureFlag pretenure = NOT_TENURED); | 718 PretenureFlag pretenure = NOT_TENURED); |
| 721 }; | 719 }; |
| 722 | 720 |
| 723 } // namespace internal | 721 } // namespace internal |
| 724 } // namespace v8 | 722 } // namespace v8 |
| 725 | 723 |
| 726 #endif // V8_FACTORY_H_ | 724 #endif // V8_FACTORY_H_ |
| OLD | NEW |