| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 // Declares a Simulator for S390 instructions if we are not generating a native | 5 // Declares a Simulator for S390 instructions if we are not generating a native |
| 6 // S390 binary. This Simulator allows us to run and debug S390 code generation | 6 // S390 binary. This Simulator allows us to run and debug S390 code generation |
| 7 // on regular desktop machines. | 7 // on regular desktop machines. |
| 8 // V8 calls into generated code by "calling" the CALL_GENERATED_CODE macro, | 8 // V8 calls into generated code by "calling" the CALL_GENERATED_CODE macro, |
| 9 // which will start execution in the Simulator or forwards to the real entry | 9 // which will start execution in the Simulator or forwards to the real entry |
| 10 // on a S390 hardware platform. | 10 // on a S390 hardware platform. |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 inline bool isWatchedStop(uint32_t bkpt_code); | 274 inline bool isWatchedStop(uint32_t bkpt_code); |
| 275 inline bool isEnabledStop(uint32_t bkpt_code); | 275 inline bool isEnabledStop(uint32_t bkpt_code); |
| 276 inline void EnableStop(uint32_t bkpt_code); | 276 inline void EnableStop(uint32_t bkpt_code); |
| 277 inline void DisableStop(uint32_t bkpt_code); | 277 inline void DisableStop(uint32_t bkpt_code); |
| 278 inline void IncreaseStopCounter(uint32_t bkpt_code); | 278 inline void IncreaseStopCounter(uint32_t bkpt_code); |
| 279 void PrintStopInfo(uint32_t code); | 279 void PrintStopInfo(uint32_t code); |
| 280 | 280 |
| 281 // Byte Reverse | 281 // Byte Reverse |
| 282 inline int16_t ByteReverse(int16_t hword); | 282 inline int16_t ByteReverse(int16_t hword); |
| 283 inline int32_t ByteReverse(int32_t word); | 283 inline int32_t ByteReverse(int32_t word); |
| 284 inline int64_t ByteReverse(int64_t dword); |
| 284 | 285 |
| 285 // Read and write memory. | 286 // Read and write memory. |
| 286 inline uint8_t ReadBU(intptr_t addr); | 287 inline uint8_t ReadBU(intptr_t addr); |
| 287 inline int8_t ReadB(intptr_t addr); | 288 inline int8_t ReadB(intptr_t addr); |
| 288 inline void WriteB(intptr_t addr, uint8_t value); | 289 inline void WriteB(intptr_t addr, uint8_t value); |
| 289 inline void WriteB(intptr_t addr, int8_t value); | 290 inline void WriteB(intptr_t addr, int8_t value); |
| 290 | 291 |
| 291 inline uint16_t ReadHU(intptr_t addr, Instruction* instr); | 292 inline uint16_t ReadHU(intptr_t addr, Instruction* instr); |
| 292 inline int16_t ReadH(intptr_t addr, Instruction* instr); | 293 inline int16_t ReadH(intptr_t addr, Instruction* instr); |
| 293 // Note: Overloaded on the sign of the value. | 294 // Note: Overloaded on the sign of the value. |
| 294 inline void WriteH(intptr_t addr, uint16_t value, Instruction* instr); | 295 inline void WriteH(intptr_t addr, uint16_t value, Instruction* instr); |
| 295 inline void WriteH(intptr_t addr, int16_t value, Instruction* instr); | 296 inline void WriteH(intptr_t addr, int16_t value, Instruction* instr); |
| 296 | 297 |
| 297 inline uint32_t ReadWU(intptr_t addr, Instruction* instr); | 298 inline uint32_t ReadWU(intptr_t addr, Instruction* instr); |
| 298 inline int32_t ReadW(intptr_t addr, Instruction* instr); | 299 inline int32_t ReadW(intptr_t addr, Instruction* instr); |
| 300 inline int64_t ReadW64(intptr_t addr, Instruction* instr); |
| 299 inline void WriteW(intptr_t addr, uint32_t value, Instruction* instr); | 301 inline void WriteW(intptr_t addr, uint32_t value, Instruction* instr); |
| 300 inline void WriteW(intptr_t addr, int32_t value, Instruction* instr); | 302 inline void WriteW(intptr_t addr, int32_t value, Instruction* instr); |
| 301 | 303 |
| 302 inline int64_t ReadDW(intptr_t addr); | 304 inline int64_t ReadDW(intptr_t addr); |
| 303 inline double ReadDouble(intptr_t addr); | 305 inline double ReadDouble(intptr_t addr); |
| 304 inline void WriteDW(intptr_t addr, int64_t value); | 306 inline void WriteDW(intptr_t addr, int64_t value); |
| 305 | 307 |
| 306 // S390 | 308 // S390 |
| 307 void Trace(Instruction* instr); | 309 void Trace(Instruction* instr); |
| 308 bool DecodeTwoByte(Instruction* instr); | 310 bool DecodeTwoByte(Instruction* instr); |
| (...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1277 static inline void UnregisterCTryCatch(v8::internal::Isolate* isolate) { | 1279 static inline void UnregisterCTryCatch(v8::internal::Isolate* isolate) { |
| 1278 Simulator::current(isolate)->PopAddress(); | 1280 Simulator::current(isolate)->PopAddress(); |
| 1279 } | 1281 } |
| 1280 }; | 1282 }; |
| 1281 | 1283 |
| 1282 } // namespace internal | 1284 } // namespace internal |
| 1283 } // namespace v8 | 1285 } // namespace v8 |
| 1284 | 1286 |
| 1285 #endif // !defined(USE_SIMULATOR) | 1287 #endif // !defined(USE_SIMULATOR) |
| 1286 #endif // V8_S390_SIMULATOR_S390_H_ | 1288 #endif // V8_S390_SIMULATOR_S390_H_ |
| OLD | NEW |