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 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
967 | 967 |
968 bool operator!=(const ExternalReference& other) const { | 968 bool operator!=(const ExternalReference& other) const { |
969 return !(*this == other); | 969 return !(*this == other); |
970 } | 970 } |
971 | 971 |
972 private: | 972 private: |
973 explicit ExternalReference(void* address) | 973 explicit ExternalReference(void* address) |
974 : address_(address) {} | 974 : address_(address) {} |
975 | 975 |
976 static void* Redirect(Isolate* isolate, | 976 static void* Redirect(Isolate* isolate, |
977 void* address, | |
978 Type type = ExternalReference::BUILTIN_CALL) { | |
979 ExternalReferenceRedirector* redirector = | |
980 reinterpret_cast<ExternalReferenceRedirector*>( | |
981 isolate->external_reference_redirector()); | |
982 if (redirector == NULL) return address; | |
983 void* answer = (*redirector)(address, type); | |
984 return answer; | |
985 } | |
986 | |
987 static void* Redirect(Isolate* isolate, | |
988 Address address_arg, | 977 Address address_arg, |
989 Type type = ExternalReference::BUILTIN_CALL) { | 978 Type type = ExternalReference::BUILTIN_CALL) { |
990 ExternalReferenceRedirector* redirector = | 979 ExternalReferenceRedirector* redirector = |
991 reinterpret_cast<ExternalReferenceRedirector*>( | 980 reinterpret_cast<ExternalReferenceRedirector*>( |
992 isolate->external_reference_redirector()); | 981 isolate->external_reference_redirector()); |
993 void* address = reinterpret_cast<void*>(address_arg); | 982 void* address = reinterpret_cast<void*>(address_arg); |
994 void* answer = (redirector == NULL) ? | 983 void* answer = (redirector == NULL) ? |
995 address : | 984 address : |
996 (*redirector)(address, type); | 985 (*redirector)(address, type); |
997 return answer; | 986 return answer; |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1131 | 1120 |
1132 private: | 1121 private: |
1133 int32_t multiplier_; | 1122 int32_t multiplier_; |
1134 int32_t shift_; | 1123 int32_t shift_; |
1135 }; | 1124 }; |
1136 | 1125 |
1137 | 1126 |
1138 } } // namespace v8::internal | 1127 } } // namespace v8::internal |
1139 | 1128 |
1140 #endif // V8_ASSEMBLER_H_ | 1129 #endif // V8_ASSEMBLER_H_ |
OLD | NEW |