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 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 Handle<String> EmergencyNewError(const char* message, Handle<JSArray> args); | 542 Handle<String> EmergencyNewError(const char* message, Handle<JSArray> args); |
543 | 543 |
544 Handle<Object> NewError(const char* constructor, Handle<String> message); | 544 Handle<Object> NewError(const char* constructor, Handle<String> message); |
545 | 545 |
546 Handle<Object> NewInvalidStringLengthError() { | 546 Handle<Object> NewInvalidStringLengthError() { |
547 return NewRangeError(MessageTemplate::kInvalidStringLength); | 547 return NewRangeError(MessageTemplate::kInvalidStringLength); |
548 } | 548 } |
549 | 549 |
550 Handle<Object> NewError(const char* maker, | 550 Handle<Object> NewError(const char* maker, |
551 MessageTemplate::Template template_index, | 551 MessageTemplate::Template template_index, |
552 Handle<Object> arg0, Handle<Object> arg1, | 552 Handle<Object> arg0 = Handle<Object>(), |
553 Handle<Object> arg2); | 553 Handle<Object> arg1 = Handle<Object>(), |
| 554 Handle<Object> arg2 = Handle<Object>()); |
554 | 555 |
555 Handle<Object> NewError(MessageTemplate::Template template_index, | 556 Handle<Object> NewError(MessageTemplate::Template template_index, |
556 Handle<Object> arg0 = Handle<Object>(), | 557 Handle<Object> arg0 = Handle<Object>(), |
557 Handle<Object> arg1 = Handle<Object>(), | 558 Handle<Object> arg1 = Handle<Object>(), |
558 Handle<Object> arg2 = Handle<Object>()); | 559 Handle<Object> arg2 = Handle<Object>()); |
559 | 560 |
560 Handle<Object> NewTypeError(MessageTemplate::Template template_index, | 561 Handle<Object> NewTypeError(MessageTemplate::Template template_index, |
561 Handle<Object> arg0 = Handle<Object>(), | 562 Handle<Object> arg0 = Handle<Object>(), |
562 Handle<Object> arg1 = Handle<Object>(), | 563 Handle<Object> arg1 = Handle<Object>(), |
563 Handle<Object> arg2 = Handle<Object>()); | 564 Handle<Object> arg2 = Handle<Object>()); |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
649 Handle<Code> code, Handle<ScopeInfo> scope_info, | 650 Handle<Code> code, Handle<ScopeInfo> scope_info, |
650 Handle<TypeFeedbackVector> feedback_vector); | 651 Handle<TypeFeedbackVector> feedback_vector); |
651 Handle<SharedFunctionInfo> NewSharedFunctionInfo(Handle<String> name, | 652 Handle<SharedFunctionInfo> NewSharedFunctionInfo(Handle<String> name, |
652 MaybeHandle<Code> code); | 653 MaybeHandle<Code> code); |
653 | 654 |
654 // Allocate a new type feedback vector | 655 // Allocate a new type feedback vector |
655 template <typename Spec> | 656 template <typename Spec> |
656 Handle<TypeFeedbackVector> NewTypeFeedbackVector(const Spec* spec); | 657 Handle<TypeFeedbackVector> NewTypeFeedbackVector(const Spec* spec); |
657 | 658 |
658 // Allocates a new JSMessageObject object. | 659 // Allocates a new JSMessageObject object. |
659 Handle<JSMessageObject> NewJSMessageObject( | 660 Handle<JSMessageObject> NewJSMessageObject(MessageTemplate::Template message, |
660 Handle<String> type, | 661 Handle<Object> argument, |
661 Handle<JSArray> arguments, | 662 int start_position, |
662 int start_position, | 663 int end_position, |
663 int end_position, | 664 Handle<Object> script, |
664 Handle<Object> script, | 665 Handle<Object> stack_frames); |
665 Handle<Object> stack_frames); | |
666 | 666 |
667 Handle<DebugInfo> NewDebugInfo(Handle<SharedFunctionInfo> shared); | 667 Handle<DebugInfo> NewDebugInfo(Handle<SharedFunctionInfo> shared); |
668 | 668 |
669 // Return a map for given number of properties using the map cache in the | 669 // Return a map for given number of properties using the map cache in the |
670 // native context. | 670 // native context. |
671 Handle<Map> ObjectLiteralMapFromCache(Handle<Context> context, | 671 Handle<Map> ObjectLiteralMapFromCache(Handle<Context> context, |
672 int number_of_properties, | 672 int number_of_properties, |
673 bool* is_result_from_cache); | 673 bool* is_result_from_cache); |
674 | 674 |
675 // Creates a new FixedArray that holds the data associated with the | 675 // Creates a new FixedArray that holds the data associated with the |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 // 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 |
742 // 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 |
743 // 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 |
744 // object that has been freshly allocated. | 744 // object that has been freshly allocated. |
745 void ReinitializeJSProxy(Handle<JSProxy> proxy, InstanceType type, int size); | 745 void ReinitializeJSProxy(Handle<JSProxy> proxy, InstanceType type, int size); |
746 }; | 746 }; |
747 | 747 |
748 } } // namespace v8::internal | 748 } } // namespace v8::internal |
749 | 749 |
750 #endif // V8_FACTORY_H_ | 750 #endif // V8_FACTORY_H_ |
OLD | NEW |