OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_RUNTIME_RUNTIME_H_ | 5 #ifndef V8_RUNTIME_RUNTIME_H_ |
6 #define V8_RUNTIME_RUNTIME_H_ | 6 #define V8_RUNTIME_RUNTIME_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/objects.h" | 9 #include "src/objects.h" |
10 #include "src/zone.h" | 10 #include "src/zone.h" |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 F(ThrowNotDateError, 0, 1) \ | 145 F(ThrowNotDateError, 0, 1) \ |
146 F(DateCurrentTime, 0, 1) \ | 146 F(DateCurrentTime, 0, 1) \ |
147 F(DateParseString, 2, 1) \ | 147 F(DateParseString, 2, 1) \ |
148 F(DateLocalTimezone, 1, 1) \ | 148 F(DateLocalTimezone, 1, 1) \ |
149 F(DateToUTC, 1, 1) \ | 149 F(DateToUTC, 1, 1) \ |
150 F(DateCacheVersion, 0, 1) \ | 150 F(DateCacheVersion, 0, 1) \ |
151 F(DateField, 2 /* date object, field index */, 1) | 151 F(DateField, 2 /* date object, field index */, 1) |
152 | 152 |
153 | 153 |
154 #define FOR_EACH_INTRINSIC_DEBUG(F) \ | 154 #define FOR_EACH_INTRINSIC_DEBUG(F) \ |
| 155 F(HandleDebuggerStatement, 0, 1) \ |
155 F(DebugBreak, 0, 1) \ | 156 F(DebugBreak, 0, 1) \ |
156 F(SetDebugEventListener, 2, 1) \ | 157 F(SetDebugEventListener, 2, 1) \ |
157 F(ScheduleBreak, 0, 1) \ | 158 F(ScheduleBreak, 0, 1) \ |
158 F(DebugGetInternalProperties, 1, 1) \ | 159 F(DebugGetInternalProperties, 1, 1) \ |
159 F(DebugGetPropertyDetails, 2, 1) \ | 160 F(DebugGetPropertyDetails, 2, 1) \ |
160 F(DebugGetProperty, 2, 1) \ | 161 F(DebugGetProperty, 2, 1) \ |
161 F(DebugPropertyTypeFromDetails, 1, 1) \ | 162 F(DebugPropertyTypeFromDetails, 1, 1) \ |
162 F(DebugPropertyAttributesFromDetails, 1, 1) \ | 163 F(DebugPropertyAttributesFromDetails, 1, 1) \ |
163 F(DebugPropertyIndexFromDetails, 1, 1) \ | 164 F(DebugPropertyIndexFromDetails, 1, 1) \ |
164 F(DebugNamedInterceptorPropertyValue, 2, 1) \ | 165 F(DebugNamedInterceptorPropertyValue, 2, 1) \ |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 #define FOR_EACH_INTRINSIC_URI(F) \ | 719 #define FOR_EACH_INTRINSIC_URI(F) \ |
719 F(URIEscape, 1, 1) \ | 720 F(URIEscape, 1, 1) \ |
720 F(URIUnescape, 1, 1) | 721 F(URIUnescape, 1, 1) |
721 | 722 |
722 | 723 |
723 #define FOR_EACH_INTRINSIC_RETURN_PAIR(F) \ | 724 #define FOR_EACH_INTRINSIC_RETURN_PAIR(F) \ |
724 F(LoadLookupSlot, 2, 2) \ | 725 F(LoadLookupSlot, 2, 2) \ |
725 F(LoadLookupSlotNoReferenceError, 2, 2) | 726 F(LoadLookupSlotNoReferenceError, 2, 2) |
726 | 727 |
727 | 728 |
| 729 // Most intrinsics are implemented in the runtime/ directory, but ICs are |
| 730 // implemented in ic.cc for now. |
| 731 #define FOR_EACH_INTRINSIC_IC(F) \ |
| 732 F(LoadIC_Miss, 3, 1) \ |
| 733 F(KeyedLoadIC_Miss, 3, 1) \ |
| 734 F(CallIC_Miss, 3, 1) \ |
| 735 F(CallIC_Customization_Miss, 3, 1) \ |
| 736 F(StoreIC_Miss, 3, 1) \ |
| 737 F(StoreIC_Slow, 3, 1) \ |
| 738 F(KeyedStoreIC_Miss, 3, 1) \ |
| 739 F(KeyedStoreIC_Slow, 3, 1) \ |
| 740 F(StoreCallbackProperty, 5, 1) \ |
| 741 F(LoadPropertyWithInterceptorOnly, 4, 1) \ |
| 742 F(LoadPropertyWithInterceptor, 3, 1) \ |
| 743 F(LoadElementWithInterceptor, 2, 1) \ |
| 744 F(StorePropertyWithInterceptor, 3, 1) \ |
| 745 F(CompareIC_Miss, 3, 1) \ |
| 746 F(BinaryOpIC_Miss, 2, 1) \ |
| 747 F(CompareNilIC_Miss, 1, 1) \ |
| 748 F(Unreachable, 0, 1) \ |
| 749 F(ToBooleanIC_Miss, 1, 1) \ |
| 750 F(KeyedLoadIC_MissFromStubFailure, 4, 1) \ |
| 751 F(KeyedStoreIC_MissFromStubFailure, 3, 1) \ |
| 752 F(StoreIC_MissFromStubFailure, 3, 1) \ |
| 753 F(ElementsTransitionAndStoreIC_Miss, 4, 1) \ |
| 754 F(BinaryOpIC_MissWithAllocationSite, 3, 1) \ |
| 755 F(LoadIC_MissFromStubFailure, 0, 1) |
| 756 |
| 757 |
728 #define FOR_EACH_INTRINSIC_RETURN_OBJECT(F) \ | 758 #define FOR_EACH_INTRINSIC_RETURN_OBJECT(F) \ |
| 759 FOR_EACH_INTRINSIC_IC(F) \ |
729 FOR_EACH_INTRINSIC_ARRAY(F) \ | 760 FOR_EACH_INTRINSIC_ARRAY(F) \ |
730 FOR_EACH_INTRINSIC_ATOMICS(F) \ | 761 FOR_EACH_INTRINSIC_ATOMICS(F) \ |
731 FOR_EACH_INTRINSIC_CLASSES(F) \ | 762 FOR_EACH_INTRINSIC_CLASSES(F) \ |
732 FOR_EACH_INTRINSIC_COLLECTIONS(F) \ | 763 FOR_EACH_INTRINSIC_COLLECTIONS(F) \ |
733 FOR_EACH_INTRINSIC_COMPILER(F) \ | 764 FOR_EACH_INTRINSIC_COMPILER(F) \ |
734 FOR_EACH_INTRINSIC_DATE(F) \ | 765 FOR_EACH_INTRINSIC_DATE(F) \ |
735 FOR_EACH_INTRINSIC_DEBUG(F) \ | 766 FOR_EACH_INTRINSIC_DEBUG(F) \ |
736 FOR_EACH_INTRINSIC_FORIN(F) \ | 767 FOR_EACH_INTRINSIC_FORIN(F) \ |
737 FOR_EACH_INTRINSIC_FUNCTION(F) \ | 768 FOR_EACH_INTRINSIC_FUNCTION(F) \ |
738 FOR_EACH_INTRINSIC_FUTEX(F) \ | 769 FOR_EACH_INTRINSIC_FUTEX(F) \ |
(...skipping 17 matching lines...) Expand all Loading... |
756 FOR_EACH_INTRINSIC_TYPEDARRAY(F) \ | 787 FOR_EACH_INTRINSIC_TYPEDARRAY(F) \ |
757 FOR_EACH_INTRINSIC_URI(F) | 788 FOR_EACH_INTRINSIC_URI(F) |
758 | 789 |
759 // FOR_EACH_INTRINSIC defines the list of all intrinsics, coming in 2 flavors, | 790 // FOR_EACH_INTRINSIC defines the list of all intrinsics, coming in 2 flavors, |
760 // either returning an object or a pair. | 791 // either returning an object or a pair. |
761 #define FOR_EACH_INTRINSIC(F) \ | 792 #define FOR_EACH_INTRINSIC(F) \ |
762 FOR_EACH_INTRINSIC_RETURN_PAIR(F) \ | 793 FOR_EACH_INTRINSIC_RETURN_PAIR(F) \ |
763 FOR_EACH_INTRINSIC_RETURN_OBJECT(F) | 794 FOR_EACH_INTRINSIC_RETURN_OBJECT(F) |
764 | 795 |
765 | 796 |
| 797 #define F(name, nargs, ressize) \ |
| 798 Object* Runtime_##name(int args_length, Object** args_object, \ |
| 799 Isolate* isolate); |
| 800 FOR_EACH_INTRINSIC_RETURN_OBJECT(F) |
| 801 #undef F |
| 802 |
766 //--------------------------------------------------------------------------- | 803 //--------------------------------------------------------------------------- |
767 // Runtime provides access to all C++ runtime functions. | 804 // Runtime provides access to all C++ runtime functions. |
768 | 805 |
769 class RuntimeState { | 806 class RuntimeState { |
770 public: | 807 public: |
771 unibrow::Mapping<unibrow::ToUppercase, 128>* to_upper_mapping() { | 808 unibrow::Mapping<unibrow::ToUppercase, 128>* to_upper_mapping() { |
772 return &to_upper_mapping_; | 809 return &to_upper_mapping_; |
773 } | 810 } |
774 unibrow::Mapping<unibrow::ToLowercase, 128>* to_lower_mapping() { | 811 unibrow::Mapping<unibrow::ToLowercase, 128>* to_lower_mapping() { |
775 return &to_lower_mapping_; | 812 return &to_lower_mapping_; |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
954 inline bool Runtime::AtomicIsLockFree(uint32_t size) { | 991 inline bool Runtime::AtomicIsLockFree(uint32_t size) { |
955 return size == 1 || size == 2 || size == 4; | 992 return size == 1 || size == 2 || size == 4; |
956 } | 993 } |
957 | 994 |
958 #endif | 995 #endif |
959 | 996 |
960 } // namespace internal | 997 } // namespace internal |
961 } // namespace v8 | 998 } // namespace v8 |
962 | 999 |
963 #endif // V8_RUNTIME_RUNTIME_H_ | 1000 #endif // V8_RUNTIME_RUNTIME_H_ |
OLD | NEW |