| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 // The currently executing Simulator instance. Potentially there can be one | 156 // The currently executing Simulator instance. Potentially there can be one |
| 157 // for each native thread. | 157 // for each native thread. |
| 158 static Simulator* current(v8::internal::Isolate* isolate); | 158 static Simulator* current(v8::internal::Isolate* isolate); |
| 159 | 159 |
| 160 // Accessors for register state. Reading the pc value adheres to the ARM | 160 // Accessors for register state. Reading the pc value adheres to the ARM |
| 161 // architecture specification and is off by a 8 from the currently executing | 161 // architecture specification and is off by a 8 from the currently executing |
| 162 // instruction. | 162 // instruction. |
| 163 void set_register(int reg, int32_t value); | 163 void set_register(int reg, int32_t value); |
| 164 int32_t get_register(int reg) const; | 164 int32_t get_register(int reg) const; |
| 165 double get_double_from_register_pair(int reg); | 165 double get_double_from_register_pair(int reg); |
| 166 void set_register_pair_from_double(int reg, double* value); |
| 166 void set_dw_register(int dreg, const int* dbl); | 167 void set_dw_register(int dreg, const int* dbl); |
| 167 | 168 |
| 168 // Support for VFP. | 169 // Support for VFP. |
| 169 void get_d_register(int dreg, uint64_t* value); | 170 void get_d_register(int dreg, uint64_t* value); |
| 170 void set_d_register(int dreg, const uint64_t* value); | 171 void set_d_register(int dreg, const uint64_t* value); |
| 171 void get_d_register(int dreg, uint32_t* value); | 172 void get_d_register(int dreg, uint32_t* value); |
| 172 void set_d_register(int dreg, const uint32_t* value); | 173 void set_d_register(int dreg, const uint32_t* value); |
| 173 void get_q_register(int qreg, uint64_t* value); | 174 void get_q_register(int qreg, uint64_t* value); |
| 174 void set_q_register(int qreg, const uint64_t* value); | 175 void set_q_register(int qreg, const uint64_t* value); |
| 175 void get_q_register(int qreg, uint32_t* value); | 176 void get_q_register(int qreg, uint32_t* value); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 void Execute(); | 214 void Execute(); |
| 214 | 215 |
| 215 // Call on program start. | 216 // Call on program start. |
| 216 static void Initialize(Isolate* isolate); | 217 static void Initialize(Isolate* isolate); |
| 217 | 218 |
| 218 // V8 generally calls into generated JS code with 5 parameters and into | 219 // V8 generally calls into generated JS code with 5 parameters and into |
| 219 // generated RegExp code with 7 parameters. This is a convenience function, | 220 // generated RegExp code with 7 parameters. This is a convenience function, |
| 220 // which sets up the simulator state and grabs the result on return. | 221 // which sets up the simulator state and grabs the result on return. |
| 221 int32_t Call(byte* entry, int argument_count, ...); | 222 int32_t Call(byte* entry, int argument_count, ...); |
| 222 // Alternative: call a 2-argument double function. | 223 // Alternative: call a 2-argument double function. |
| 223 double CallFP(byte* entry, double d0, double d1); | 224 void CallFP(byte* entry, double d0, double d1); |
| 225 int32_t CallFPReturnsInt(byte* entry, double d0, double d1); |
| 226 double CallFPReturnsDouble(byte* entry, double d0, double d1); |
| 224 | 227 |
| 225 // Push an address onto the JS stack. | 228 // Push an address onto the JS stack. |
| 226 uintptr_t PushAddress(uintptr_t address); | 229 uintptr_t PushAddress(uintptr_t address); |
| 227 | 230 |
| 228 // Pop an address from the JS stack. | 231 // Pop an address from the JS stack. |
| 229 uintptr_t PopAddress(); | 232 uintptr_t PopAddress(); |
| 230 | 233 |
| 231 // Debugger input. | 234 // Debugger input. |
| 232 void set_last_debugger_input(char* input); | 235 void set_last_debugger_input(char* input); |
| 233 char* last_debugger_input() { return last_debugger_input_; } | 236 char* last_debugger_input() { return last_debugger_input_; } |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 StopCountAndDesc watched_stops_[kNumOfWatchedStops]; | 440 StopCountAndDesc watched_stops_[kNumOfWatchedStops]; |
| 438 }; | 441 }; |
| 439 | 442 |
| 440 | 443 |
| 441 // When running with the simulator transition into simulated execution at this | 444 // When running with the simulator transition into simulated execution at this |
| 442 // point. | 445 // point. |
| 443 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \ | 446 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \ |
| 444 reinterpret_cast<Object*>(Simulator::current(Isolate::Current())->Call( \ | 447 reinterpret_cast<Object*>(Simulator::current(Isolate::Current())->Call( \ |
| 445 FUNCTION_ADDR(entry), 5, p0, p1, p2, p3, p4)) | 448 FUNCTION_ADDR(entry), 5, p0, p1, p2, p3, p4)) |
| 446 | 449 |
| 450 #define CALL_GENERATED_FP_INT(entry, p0, p1) \ |
| 451 Simulator::current(Isolate::Current())->CallFPReturnsInt( \ |
| 452 FUNCTION_ADDR(entry), p0, p1) |
| 453 |
| 447 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7, p8) \ | 454 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7, p8) \ |
| 448 Simulator::current(Isolate::Current())->Call( \ | 455 Simulator::current(Isolate::Current())->Call( \ |
| 449 entry, 10, p0, p1, p2, p3, NULL, p4, p5, p6, p7, p8) | 456 entry, 10, p0, p1, p2, p3, NULL, p4, p5, p6, p7, p8) |
| 450 | 457 |
| 451 #define TRY_CATCH_FROM_ADDRESS(try_catch_address) \ | 458 #define TRY_CATCH_FROM_ADDRESS(try_catch_address) \ |
| 452 try_catch_address == NULL ? \ | 459 try_catch_address == NULL ? \ |
| 453 NULL : *(reinterpret_cast<TryCatch**>(try_catch_address)) | 460 NULL : *(reinterpret_cast<TryCatch**>(try_catch_address)) |
| 454 | 461 |
| 455 | 462 |
| 456 // The simulator has its own stack. Thus it has a different stack limit from | 463 // The simulator has its own stack. Thus it has a different stack limit from |
| (...skipping 15 matching lines...) Expand all Loading... |
| 472 | 479 |
| 473 static inline void UnregisterCTryCatch() { | 480 static inline void UnregisterCTryCatch() { |
| 474 Simulator::current(Isolate::Current())->PopAddress(); | 481 Simulator::current(Isolate::Current())->PopAddress(); |
| 475 } | 482 } |
| 476 }; | 483 }; |
| 477 | 484 |
| 478 } } // namespace v8::internal | 485 } } // namespace v8::internal |
| 479 | 486 |
| 480 #endif // !defined(USE_SIMULATOR) | 487 #endif // !defined(USE_SIMULATOR) |
| 481 #endif // V8_ARM_SIMULATOR_ARM_H_ | 488 #endif // V8_ARM_SIMULATOR_ARM_H_ |
| OLD | NEW |