| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 20 matching lines...) Expand all Loading... |
| 31 // regular desktop machines. | 31 // regular desktop machines. |
| 32 // V8 calls into generated code by "calling" the CALL_GENERATED_CODE macro, | 32 // V8 calls into generated code by "calling" the CALL_GENERATED_CODE macro, |
| 33 // which will start execution in the Simulator or forwards to the real entry | 33 // which will start execution in the Simulator or forwards to the real entry |
| 34 // on a ARM HW platform. | 34 // on a ARM HW platform. |
| 35 | 35 |
| 36 #ifndef V8_ARM_SIMULATOR_ARM_H_ | 36 #ifndef V8_ARM_SIMULATOR_ARM_H_ |
| 37 #define V8_ARM_SIMULATOR_ARM_H_ | 37 #define V8_ARM_SIMULATOR_ARM_H_ |
| 38 | 38 |
| 39 #include "allocation.h" | 39 #include "allocation.h" |
| 40 | 40 |
| 41 #if defined(__arm__) | 41 #if defined(__arm__) && !defined(USE_SIMULATOR) |
| 42 | 42 |
| 43 // When running without a simulator we call the entry directly. | 43 // When running without a simulator we call the entry directly. |
| 44 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \ | 44 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \ |
| 45 (entry(p0, p1, p2, p3, p4)) | 45 (entry(p0, p1, p2, p3, p4)) |
| 46 | 46 |
| 47 // The stack limit beyond which we will throw stack overflow errors in | 47 // The stack limit beyond which we will throw stack overflow errors in |
| 48 // generated code. Because generated code on arm uses the C stack, we | 48 // generated code. Because generated code on arm uses the C stack, we |
| 49 // just use the C stack limit. | 49 // just use the C stack limit. |
| 50 class SimulatorStack : public v8::internal::AllStatic { | 50 class SimulatorStack : public v8::internal::AllStatic { |
| 51 public: | 51 public: |
| (...skipping 11 matching lines...) Expand all Loading... |
| 63 | 63 |
| 64 // Call the generated regexp code directly. The entry function pointer should | 64 // Call the generated regexp code directly. The entry function pointer should |
| 65 // expect eight int/pointer sized arguments and return an int. | 65 // expect eight int/pointer sized arguments and return an int. |
| 66 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6) \ | 66 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6) \ |
| 67 entry(p0, p1, p2, p3, p4, p5, p6) | 67 entry(p0, p1, p2, p3, p4, p5, p6) |
| 68 | 68 |
| 69 #define TRY_CATCH_FROM_ADDRESS(try_catch_address) \ | 69 #define TRY_CATCH_FROM_ADDRESS(try_catch_address) \ |
| 70 reinterpret_cast<TryCatch*>(try_catch_address) | 70 reinterpret_cast<TryCatch*>(try_catch_address) |
| 71 | 71 |
| 72 | 72 |
| 73 #else // defined(__arm__) | 73 #else // !defined(__arm__) || defined(USE_SIMULATOR) |
| 74 | 74 |
| 75 // When running with the simulator transition into simulated execution at this | 75 // When running with the simulator transition into simulated execution at this |
| 76 // point. | 76 // point. |
| 77 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \ | 77 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \ |
| 78 reinterpret_cast<Object*>( \ | 78 reinterpret_cast<Object*>( \ |
| 79 assembler::arm::Simulator::current()->Call(FUNCTION_ADDR(entry), 5, \ | 79 assembler::arm::Simulator::current()->Call(FUNCTION_ADDR(entry), 5, \ |
| 80 p0, p1, p2, p3, p4)) | 80 p0, p1, p2, p3, p4)) |
| 81 | 81 |
| 82 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6) \ | 82 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6) \ |
| 83 assembler::arm::Simulator::current()->Call( \ | 83 assembler::arm::Simulator::current()->Call( \ |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 assembler::arm::Simulator* sim = assembler::arm::Simulator::current(); | 349 assembler::arm::Simulator* sim = assembler::arm::Simulator::current(); |
| 350 return sim->PushAddress(try_catch_address); | 350 return sim->PushAddress(try_catch_address); |
| 351 } | 351 } |
| 352 | 352 |
| 353 static inline void UnregisterCTryCatch() { | 353 static inline void UnregisterCTryCatch() { |
| 354 assembler::arm::Simulator::current()->PopAddress(); | 354 assembler::arm::Simulator::current()->PopAddress(); |
| 355 } | 355 } |
| 356 }; | 356 }; |
| 357 | 357 |
| 358 | 358 |
| 359 #endif // defined(__arm__) | 359 #endif // !defined(__arm__) || defined(USE_SIMULATOR) |
| 360 | 360 |
| 361 #endif // V8_ARM_SIMULATOR_ARM_H_ | 361 #endif // V8_ARM_SIMULATOR_ARM_H_ |
| OLD | NEW |