| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64_SIMULATOR_ARM64_H_ | 5 #ifndef V8_ARM64_SIMULATOR_ARM64_H_ |
| 6 #define V8_ARM64_SIMULATOR_ARM64_H_ | 6 #define V8_ARM64_SIMULATOR_ARM64_H_ |
| 7 | 7 |
| 8 #include <stdarg.h> | 8 #include <stdarg.h> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 Isolate* isolate); | 47 Isolate* isolate); |
| 48 | 48 |
| 49 // Call the generated regexp code directly. The code at the entry address | 49 // Call the generated regexp code directly. The code at the entry address |
| 50 // should act as a function matching the type arm64_regexp_matcher. | 50 // should act as a function matching the type arm64_regexp_matcher. |
| 51 // The ninth argument is a dummy that reserves the space used for | 51 // The ninth argument is a dummy that reserves the space used for |
| 52 // the return address added by the ExitFrame in native calls. | 52 // the return address added by the ExitFrame in native calls. |
| 53 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7, p8) \ | 53 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7, p8) \ |
| 54 (FUNCTION_CAST<arm64_regexp_matcher>(entry)( \ | 54 (FUNCTION_CAST<arm64_regexp_matcher>(entry)( \ |
| 55 p0, p1, p2, p3, p4, p5, p6, p7, NULL, p8)) | 55 p0, p1, p2, p3, p4, p5, p6, p7, NULL, p8)) |
| 56 | 56 |
| 57 #define TRY_CATCH_FROM_ADDRESS(try_catch_address) \ | |
| 58 reinterpret_cast<TryCatch*>(try_catch_address) | |
| 59 | |
| 60 // Running without a simulator there is nothing to do. | 57 // Running without a simulator there is nothing to do. |
| 61 class SimulatorStack : public v8::internal::AllStatic { | 58 class SimulatorStack : public v8::internal::AllStatic { |
| 62 public: | 59 public: |
| 63 static uintptr_t JsLimitFromCLimit(v8::internal::Isolate* isolate, | 60 static uintptr_t JsLimitFromCLimit(v8::internal::Isolate* isolate, |
| 64 uintptr_t c_limit) { | 61 uintptr_t c_limit) { |
| 65 USE(isolate); | 62 USE(isolate); |
| 66 return c_limit; | 63 return c_limit; |
| 67 } | 64 } |
| 68 | 65 |
| 69 static uintptr_t RegisterCTryCatch(uintptr_t try_catch_address) { | 66 static uintptr_t RegisterCTryCatch(uintptr_t try_catch_address) { |
| (...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 850 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \ | 847 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \ |
| 851 reinterpret_cast<Object*>(Simulator::current(Isolate::Current())->CallJS( \ | 848 reinterpret_cast<Object*>(Simulator::current(Isolate::Current())->CallJS( \ |
| 852 FUNCTION_ADDR(entry), \ | 849 FUNCTION_ADDR(entry), \ |
| 853 p0, p1, p2, p3, p4)) | 850 p0, p1, p2, p3, p4)) |
| 854 | 851 |
| 855 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7, p8) \ | 852 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7, p8) \ |
| 856 Simulator::current(Isolate::Current())->CallRegExp( \ | 853 Simulator::current(Isolate::Current())->CallRegExp( \ |
| 857 entry, \ | 854 entry, \ |
| 858 p0, p1, p2, p3, p4, p5, p6, p7, NULL, p8) | 855 p0, p1, p2, p3, p4, p5, p6, p7, NULL, p8) |
| 859 | 856 |
| 860 #define TRY_CATCH_FROM_ADDRESS(try_catch_address) \ | |
| 861 try_catch_address == NULL ? \ | |
| 862 NULL : *(reinterpret_cast<TryCatch**>(try_catch_address)) | |
| 863 | |
| 864 | 857 |
| 865 // The simulator has its own stack. Thus it has a different stack limit from | 858 // The simulator has its own stack. Thus it has a different stack limit from |
| 866 // the C-based native code. | 859 // the C-based native code. |
| 867 // See also 'class SimulatorStack' in arm/simulator-arm.h. | 860 // See also 'class SimulatorStack' in arm/simulator-arm.h. |
| 868 class SimulatorStack : public v8::internal::AllStatic { | 861 class SimulatorStack : public v8::internal::AllStatic { |
| 869 public: | 862 public: |
| 870 static uintptr_t JsLimitFromCLimit(v8::internal::Isolate* isolate, | 863 static uintptr_t JsLimitFromCLimit(v8::internal::Isolate* isolate, |
| 871 uintptr_t c_limit) { | 864 uintptr_t c_limit) { |
| 872 return Simulator::current(isolate)->StackLimit(); | 865 return Simulator::current(isolate)->StackLimit(); |
| 873 } | 866 } |
| 874 | 867 |
| 875 static uintptr_t RegisterCTryCatch(uintptr_t try_catch_address) { | 868 static uintptr_t RegisterCTryCatch(uintptr_t try_catch_address) { |
| 876 Simulator* sim = Simulator::current(Isolate::Current()); | 869 Simulator* sim = Simulator::current(Isolate::Current()); |
| 877 return sim->PushAddress(try_catch_address); | 870 return sim->PushAddress(try_catch_address); |
| 878 } | 871 } |
| 879 | 872 |
| 880 static void UnregisterCTryCatch() { | 873 static void UnregisterCTryCatch() { |
| 881 Simulator::current(Isolate::Current())->PopAddress(); | 874 Simulator::current(Isolate::Current())->PopAddress(); |
| 882 } | 875 } |
| 883 }; | 876 }; |
| 884 | 877 |
| 885 #endif // !defined(USE_SIMULATOR) | 878 #endif // !defined(USE_SIMULATOR) |
| 886 | 879 |
| 887 } } // namespace v8::internal | 880 } } // namespace v8::internal |
| 888 | 881 |
| 889 #endif // V8_ARM64_SIMULATOR_ARM64_H_ | 882 #endif // V8_ARM64_SIMULATOR_ARM64_H_ |
| OLD | NEW |