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 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
677 int capture_count); | 677 int capture_count); |
678 | 678 |
679 // Returns the value for a known global constant (a property of the global | 679 // Returns the value for a known global constant (a property of the global |
680 // object which is neither configurable nor writable) like 'undefined'. | 680 // object which is neither configurable nor writable) like 'undefined'. |
681 // Returns a null handle when the given name is unknown. | 681 // Returns a null handle when the given name is unknown. |
682 Handle<Object> GlobalConstantFor(Handle<Name> name); | 682 Handle<Object> GlobalConstantFor(Handle<Name> name); |
683 | 683 |
684 // Converts the given boolean condition to JavaScript boolean value. | 684 // Converts the given boolean condition to JavaScript boolean value. |
685 Handle<Object> ToBoolean(bool value); | 685 Handle<Object> ToBoolean(bool value); |
686 | 686 |
| 687 // Converts the given ToPrimitive hint to it's string representation. |
| 688 Handle<String> ToPrimitiveHintString(ToPrimitiveHint hint); |
| 689 |
687 private: | 690 private: |
688 Isolate* isolate() { return reinterpret_cast<Isolate*>(this); } | 691 Isolate* isolate() { return reinterpret_cast<Isolate*>(this); } |
689 | 692 |
690 // Creates a heap object based on the map. The fields of the heap object are | 693 // Creates a heap object based on the map. The fields of the heap object are |
691 // not initialized by New<>() functions. It's the responsibility of the caller | 694 // not initialized by New<>() functions. It's the responsibility of the caller |
692 // to do that. | 695 // to do that. |
693 template<typename T> | 696 template<typename T> |
694 Handle<T> New(Handle<Map> map, AllocationSpace space); | 697 Handle<T> New(Handle<Map> map, AllocationSpace space); |
695 | 698 |
696 template<typename T> | 699 template<typename T> |
(...skipping 16 matching lines...) Expand all Loading... |
713 | 716 |
714 // Create a JSArray with no elements and no length. | 717 // Create a JSArray with no elements and no length. |
715 Handle<JSArray> NewJSArray(ElementsKind elements_kind, | 718 Handle<JSArray> NewJSArray(ElementsKind elements_kind, |
716 PretenureFlag pretenure = NOT_TENURED); | 719 PretenureFlag pretenure = NOT_TENURED); |
717 }; | 720 }; |
718 | 721 |
719 } // namespace internal | 722 } // namespace internal |
720 } // namespace v8 | 723 } // namespace v8 |
721 | 724 |
722 #endif // V8_FACTORY_H_ | 725 #endif // V8_FACTORY_H_ |
OLD | NEW |