OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 #include <limits.h> | 5 #include <limits.h> |
6 #include <stdarg.h> | 6 #include <stdarg.h> |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "src/v8.h" | 10 #include "src/v8.h" |
(...skipping 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1028 Redirection* current = isolate->simulator_redirection(); | 1028 Redirection* current = isolate->simulator_redirection(); |
1029 for (; current != NULL; current = current->next_) { | 1029 for (; current != NULL; current = current->next_) { |
1030 if (current->external_function_ == external_function) return current; | 1030 if (current->external_function_ == external_function) return current; |
1031 } | 1031 } |
1032 return new Redirection(external_function, type); | 1032 return new Redirection(external_function, type); |
1033 } | 1033 } |
1034 | 1034 |
1035 static Redirection* FromSwiInstruction(Instruction* swi_instruction) { | 1035 static Redirection* FromSwiInstruction(Instruction* swi_instruction) { |
1036 char* addr_of_swi = reinterpret_cast<char*>(swi_instruction); | 1036 char* addr_of_swi = reinterpret_cast<char*>(swi_instruction); |
1037 char* addr_of_redirection = | 1037 char* addr_of_redirection = |
1038 addr_of_swi - OFFSET_OF(Redirection, swi_instruction_); | 1038 addr_of_swi - offsetof(Redirection, swi_instruction_); |
1039 return reinterpret_cast<Redirection*>(addr_of_redirection); | 1039 return reinterpret_cast<Redirection*>(addr_of_redirection); |
1040 } | 1040 } |
1041 | 1041 |
1042 static void* ReverseRedirection(int32_t reg) { | 1042 static void* ReverseRedirection(int32_t reg) { |
1043 Redirection* redirection = FromSwiInstruction( | 1043 Redirection* redirection = FromSwiInstruction( |
1044 reinterpret_cast<Instruction*>(reinterpret_cast<void*>(reg))); | 1044 reinterpret_cast<Instruction*>(reinterpret_cast<void*>(reg))); |
1045 return redirection->external_function(); | 1045 return redirection->external_function(); |
1046 } | 1046 } |
1047 | 1047 |
1048 static void DeleteChain(Redirection* redirection) { | 1048 static void DeleteChain(Redirection* redirection) { |
(...skipping 3382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4431 | 4431 |
4432 | 4432 |
4433 #undef UNSUPPORTED | 4433 #undef UNSUPPORTED |
4434 | 4434 |
4435 } // namespace internal | 4435 } // namespace internal |
4436 } // namespace v8 | 4436 } // namespace v8 |
4437 | 4437 |
4438 #endif // USE_SIMULATOR | 4438 #endif // USE_SIMULATOR |
4439 | 4439 |
4440 #endif // V8_TARGET_ARCH_MIPS | 4440 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |