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_MACRO_ASSEMBLER_ARM64_H_ | 5 #ifndef V8_ARM64_MACRO_ASSEMBLER_ARM64_H_ |
6 #define V8_ARM64_MACRO_ASSEMBLER_ARM64_H_ | 6 #define V8_ARM64_MACRO_ASSEMBLER_ARM64_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "src/arm64/assembler-arm64.h" | 10 #include "src/arm64/assembler-arm64.h" |
(...skipping 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1083 // This is required for compatibility in architecture indepenedant code. | 1083 // This is required for compatibility in architecture indepenedant code. |
1084 inline void jmp(Label* L) { B(L); } | 1084 inline void jmp(Label* L) { B(L); } |
1085 | 1085 |
1086 void CallStub(CodeStub* stub, TypeFeedbackId ast_id = TypeFeedbackId::None()); | 1086 void CallStub(CodeStub* stub, TypeFeedbackId ast_id = TypeFeedbackId::None()); |
1087 void TailCallStub(CodeStub* stub); | 1087 void TailCallStub(CodeStub* stub); |
1088 | 1088 |
1089 void CallRuntime(const Runtime::Function* f, | 1089 void CallRuntime(const Runtime::Function* f, |
1090 int num_arguments, | 1090 int num_arguments, |
1091 SaveFPRegsMode save_doubles = kDontSaveFPRegs); | 1091 SaveFPRegsMode save_doubles = kDontSaveFPRegs); |
1092 | 1092 |
1093 void CallRuntime(Runtime::FunctionId id, | 1093 // Convenience function: Same as above, but takes the fid instead. |
1094 int num_arguments, | 1094 void CallRuntime(Runtime::FunctionId fid, int num_arguments, |
1095 SaveFPRegsMode save_doubles = kDontSaveFPRegs) { | 1095 SaveFPRegsMode save_doubles = kDontSaveFPRegs) { |
1096 CallRuntime(Runtime::FunctionForId(id), num_arguments, save_doubles); | 1096 CallRuntime(Runtime::FunctionForId(fid), num_arguments, save_doubles); |
1097 } | 1097 } |
1098 | 1098 |
1099 void CallRuntimeSaveDoubles(Runtime::FunctionId id) { | 1099 // Convenience function: Same as above, but takes the fid instead. |
1100 const Runtime::Function* function = Runtime::FunctionForId(id); | 1100 void CallRuntime(Runtime::FunctionId fid, |
| 1101 SaveFPRegsMode save_doubles = kDontSaveFPRegs) { |
| 1102 const Runtime::Function* function = Runtime::FunctionForId(fid); |
| 1103 CallRuntime(function, function->nargs, save_doubles); |
| 1104 } |
| 1105 |
| 1106 void CallRuntimeSaveDoubles(Runtime::FunctionId fid) { |
| 1107 const Runtime::Function* function = Runtime::FunctionForId(fid); |
1101 CallRuntime(function, function->nargs, kSaveFPRegs); | 1108 CallRuntime(function, function->nargs, kSaveFPRegs); |
1102 } | 1109 } |
1103 | 1110 |
1104 void TailCallRuntime(Runtime::FunctionId fid, int num_arguments); | 1111 void TailCallRuntime(Runtime::FunctionId fid); |
1105 | 1112 |
1106 int ActivationFrameAlignment(); | 1113 int ActivationFrameAlignment(); |
1107 | 1114 |
1108 // Calls a C function. | 1115 // Calls a C function. |
1109 // The called function is not allowed to trigger a | 1116 // The called function is not allowed to trigger a |
1110 // garbage collection, since that might move the code and invalidate the | 1117 // garbage collection, since that might move the code and invalidate the |
1111 // return address (unless this is somehow accounted for by the called | 1118 // return address (unless this is somehow accounted for by the called |
1112 // function). | 1119 // function). |
1113 void CallCFunction(ExternalReference function, | 1120 void CallCFunction(ExternalReference function, |
1114 int num_reg_arguments); | 1121 int num_reg_arguments); |
1115 void CallCFunction(ExternalReference function, | 1122 void CallCFunction(ExternalReference function, |
1116 int num_reg_arguments, | 1123 int num_reg_arguments, |
1117 int num_double_arguments); | 1124 int num_double_arguments); |
1118 void CallCFunction(Register function, | 1125 void CallCFunction(Register function, |
1119 int num_reg_arguments, | 1126 int num_reg_arguments, |
1120 int num_double_arguments); | 1127 int num_double_arguments); |
1121 | 1128 |
1122 // Jump to a runtime routine. | 1129 // Jump to a runtime routine. |
1123 void JumpToExternalReference(const ExternalReference& builtin); | 1130 void JumpToExternalReference(const ExternalReference& builtin); |
1124 // Tail call of a runtime routine (jump). | 1131 |
1125 // Like JumpToExternalReference, but also takes care of passing the number | 1132 // Convenience function: call an external reference. |
1126 // of parameters. | |
1127 void TailCallExternalReference(const ExternalReference& ext, | |
1128 int num_arguments); | |
1129 void CallExternalReference(const ExternalReference& ext, | 1133 void CallExternalReference(const ExternalReference& ext, |
1130 int num_arguments); | 1134 int num_arguments); |
1131 | 1135 |
1132 | 1136 |
1133 // Invoke specified builtin JavaScript function. | 1137 // Invoke specified builtin JavaScript function. |
1134 void InvokeBuiltin(int native_context_index, InvokeFlag flag, | 1138 void InvokeBuiltin(int native_context_index, InvokeFlag flag, |
1135 const CallWrapper& call_wrapper = NullCallWrapper()); | 1139 const CallWrapper& call_wrapper = NullCallWrapper()); |
1136 | 1140 |
1137 void Jump(Register target); | 1141 void Jump(Register target); |
1138 void Jump(Address target, RelocInfo::Mode rmode, Condition cond = al); | 1142 void Jump(Address target, RelocInfo::Mode rmode, Condition cond = al); |
(...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2238 #error "Unsupported option" | 2242 #error "Unsupported option" |
2239 #define CODE_COVERAGE_STRINGIFY(x) #x | 2243 #define CODE_COVERAGE_STRINGIFY(x) #x |
2240 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) | 2244 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) |
2241 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 2245 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
2242 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 2246 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
2243 #else | 2247 #else |
2244 #define ACCESS_MASM(masm) masm-> | 2248 #define ACCESS_MASM(masm) masm-> |
2245 #endif | 2249 #endif |
2246 | 2250 |
2247 #endif // V8_ARM64_MACRO_ASSEMBLER_ARM64_H_ | 2251 #endif // V8_ARM64_MACRO_ASSEMBLER_ARM64_H_ |
OLD | NEW |