OLD | NEW |
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
2 // All Rights Reserved. | 2 // All Rights Reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
10 // | 10 // |
(...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
952 static void set_redirector(Isolate* isolate, | 952 static void set_redirector(Isolate* isolate, |
953 ExternalReferenceRedirector* redirector) { | 953 ExternalReferenceRedirector* redirector) { |
954 // We can't stack them. | 954 // We can't stack them. |
955 DCHECK(isolate->external_reference_redirector() == NULL); | 955 DCHECK(isolate->external_reference_redirector() == NULL); |
956 isolate->set_external_reference_redirector( | 956 isolate->set_external_reference_redirector( |
957 reinterpret_cast<ExternalReferenceRedirectorPointer*>(redirector)); | 957 reinterpret_cast<ExternalReferenceRedirectorPointer*>(redirector)); |
958 } | 958 } |
959 | 959 |
960 static ExternalReference stress_deopt_count(Isolate* isolate); | 960 static ExternalReference stress_deopt_count(Isolate* isolate); |
961 | 961 |
962 bool operator==(const ExternalReference& other) const { | |
963 return address_ == other.address_; | |
964 } | |
965 | |
966 bool operator!=(const ExternalReference& other) const { | |
967 return !(*this == other); | |
968 } | |
969 | |
970 private: | 962 private: |
971 explicit ExternalReference(void* address) | 963 explicit ExternalReference(void* address) |
972 : address_(address) {} | 964 : address_(address) {} |
973 | 965 |
974 static void* Redirect(Isolate* isolate, | 966 static void* Redirect(Isolate* isolate, |
975 Address address_arg, | 967 Address address_arg, |
976 Type type = ExternalReference::BUILTIN_CALL) { | 968 Type type = ExternalReference::BUILTIN_CALL) { |
977 ExternalReferenceRedirector* redirector = | 969 ExternalReferenceRedirector* redirector = |
978 reinterpret_cast<ExternalReferenceRedirector*>( | 970 reinterpret_cast<ExternalReferenceRedirector*>( |
979 isolate->external_reference_redirector()); | 971 isolate->external_reference_redirector()); |
980 void* address = reinterpret_cast<void*>(address_arg); | 972 void* address = reinterpret_cast<void*>(address_arg); |
981 void* answer = (redirector == NULL) ? | 973 void* answer = (redirector == NULL) ? |
982 address : | 974 address : |
983 (*redirector)(address, type); | 975 (*redirector)(address, type); |
984 return answer; | 976 return answer; |
985 } | 977 } |
986 | 978 |
987 void* address_; | 979 void* address_; |
988 }; | 980 }; |
989 | 981 |
| 982 bool operator==(ExternalReference, ExternalReference); |
| 983 bool operator!=(ExternalReference, ExternalReference); |
| 984 |
| 985 size_t hash_value(ExternalReference); |
| 986 |
| 987 std::ostream& operator<<(std::ostream&, ExternalReference); |
| 988 |
990 | 989 |
991 // ----------------------------------------------------------------------------- | 990 // ----------------------------------------------------------------------------- |
992 // Position recording support | 991 // Position recording support |
993 | 992 |
994 struct PositionState { | 993 struct PositionState { |
995 PositionState() : current_position(RelocInfo::kNoPosition), | 994 PositionState() : current_position(RelocInfo::kNoPosition), |
996 written_position(RelocInfo::kNoPosition), | 995 written_position(RelocInfo::kNoPosition), |
997 current_statement_position(RelocInfo::kNoPosition), | 996 current_statement_position(RelocInfo::kNoPosition), |
998 written_statement_position(RelocInfo::kNoPosition) {} | 997 written_statement_position(RelocInfo::kNoPosition) {} |
999 | 998 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1104 NullCallWrapper() { } | 1103 NullCallWrapper() { } |
1105 virtual ~NullCallWrapper() { } | 1104 virtual ~NullCallWrapper() { } |
1106 virtual void BeforeCall(int call_size) const { } | 1105 virtual void BeforeCall(int call_size) const { } |
1107 virtual void AfterCall() const { } | 1106 virtual void AfterCall() const { } |
1108 }; | 1107 }; |
1109 | 1108 |
1110 | 1109 |
1111 } } // namespace v8::internal | 1110 } } // namespace v8::internal |
1112 | 1111 |
1113 #endif // V8_ASSEMBLER_H_ | 1112 #endif // V8_ASSEMBLER_H_ |
OLD | NEW |