OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 | 5 |
6 // Declares a Simulator for ARM instructions if we are not generating a native | 6 // Declares a Simulator for ARM instructions if we are not generating a native |
7 // ARM binary. This Simulator allows us to run and debug ARM code generation on | 7 // ARM binary. This Simulator allows us to run and debug ARM code generation on |
8 // regular desktop machines. | 8 // regular desktop machines. |
9 // V8 calls into generated code by "calling" the CALL_GENERATED_CODE macro, | 9 // V8 calls into generated code by "calling" the CALL_GENERATED_CODE macro, |
10 // which will start execution in the Simulator or forwards to the real entry | 10 // which will start execution in the Simulator or forwards to the real entry |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 | 255 |
256 // Checks if the current instruction should be executed based on its | 256 // Checks if the current instruction should be executed based on its |
257 // condition bits. | 257 // condition bits. |
258 inline bool ConditionallyExecute(Instruction* instr); | 258 inline bool ConditionallyExecute(Instruction* instr); |
259 | 259 |
260 // Helper functions to set the conditional flags in the architecture state. | 260 // Helper functions to set the conditional flags in the architecture state. |
261 void SetNZFlags(int32_t val); | 261 void SetNZFlags(int32_t val); |
262 void SetCFlag(bool val); | 262 void SetCFlag(bool val); |
263 void SetVFlag(bool val); | 263 void SetVFlag(bool val); |
264 bool CarryFrom(int32_t left, int32_t right, int32_t carry = 0); | 264 bool CarryFrom(int32_t left, int32_t right, int32_t carry = 0); |
265 bool BorrowFrom(int32_t left, int32_t right); | 265 bool BorrowFrom(int32_t left, int32_t right, int32_t carry = 1); |
266 bool OverflowFrom(int32_t alu_out, | 266 bool OverflowFrom(int32_t alu_out, |
267 int32_t left, | 267 int32_t left, |
268 int32_t right, | 268 int32_t right, |
269 bool addition); | 269 bool addition); |
270 | 270 |
271 inline int GetCarry() { | 271 inline int GetCarry() { |
272 return c_flag_ ? 1 : 0; | 272 return c_flag_ ? 1 : 0; |
273 } | 273 } |
274 | 274 |
275 // Support for VFP. | 275 // Support for VFP. |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 static inline void UnregisterCTryCatch(v8::internal::Isolate* isolate) { | 467 static inline void UnregisterCTryCatch(v8::internal::Isolate* isolate) { |
468 Simulator::current(isolate)->PopAddress(); | 468 Simulator::current(isolate)->PopAddress(); |
469 } | 469 } |
470 }; | 470 }; |
471 | 471 |
472 } // namespace internal | 472 } // namespace internal |
473 } // namespace v8 | 473 } // namespace v8 |
474 | 474 |
475 #endif // !defined(USE_SIMULATOR) | 475 #endif // !defined(USE_SIMULATOR) |
476 #endif // V8_ARM_SIMULATOR_ARM_H_ | 476 #endif // V8_ARM_SIMULATOR_ARM_H_ |
OLD | NEW |