| 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 30 matching lines...) Expand all Loading... |
| 41 #if !defined(USE_SIMULATOR) | 41 #if !defined(USE_SIMULATOR) |
| 42 // Running without a simulator on a native arm platform. | 42 // Running without a simulator on a native arm platform. |
| 43 | 43 |
| 44 namespace v8 { | 44 namespace v8 { |
| 45 namespace internal { | 45 namespace internal { |
| 46 | 46 |
| 47 // When running without a simulator we call the entry directly. | 47 // When running without a simulator we call the entry directly. |
| 48 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \ | 48 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \ |
| 49 (entry(p0, p1, p2, p3, p4)) | 49 (entry(p0, p1, p2, p3, p4)) |
| 50 | 50 |
| 51 // Call the generated regexp code directly. The entry function pointer should | 51 typedef int (*arm_regexp_matcher)(String*, int, const byte*, const byte*, |
| 52 // expect eight int/pointer sized arguments and return an int. | 52 void*, int*, Address, int); |
| 53 |
| 54 |
| 55 // Call the generated regexp code directly. The code at the entry address |
| 56 // should act as a function matching the type arm_regexp_matcher. |
| 57 // The fifth argument is a dummy that reserves the space used for |
| 58 // the return address added by the ExitFrame in native calls. |
| 53 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7) \ | 59 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7) \ |
| 54 entry(p0, p1, p2, p3, p4, p5, p6, p7) | 60 (FUNCTION_CAST<arm_regexp_matcher>(entry)( \ |
| 61 p0, p1, p2, p3, NULL, p4, p5, p6, p7)) |
| 55 | 62 |
| 56 #define TRY_CATCH_FROM_ADDRESS(try_catch_address) \ | 63 #define TRY_CATCH_FROM_ADDRESS(try_catch_address) \ |
| 57 reinterpret_cast<TryCatch*>(try_catch_address) | 64 reinterpret_cast<TryCatch*>(try_catch_address) |
| 58 | 65 |
| 59 // The stack limit beyond which we will throw stack overflow errors in | 66 // The stack limit beyond which we will throw stack overflow errors in |
| 60 // generated code. Because generated code on arm uses the C stack, we | 67 // generated code. Because generated code on arm uses the C stack, we |
| 61 // just use the C stack limit. | 68 // just use the C stack limit. |
| 62 class SimulatorStack : public v8::internal::AllStatic { | 69 class SimulatorStack : public v8::internal::AllStatic { |
| 63 public: | 70 public: |
| 64 static inline uintptr_t JsLimitFromCLimit(uintptr_t c_limit) { | 71 static inline uintptr_t JsLimitFromCLimit(uintptr_t c_limit) { |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 | 364 |
| 358 | 365 |
| 359 // When running with the simulator transition into simulated execution at this | 366 // When running with the simulator transition into simulated execution at this |
| 360 // point. | 367 // point. |
| 361 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \ | 368 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \ |
| 362 reinterpret_cast<Object*>(Simulator::current(Isolate::Current())->Call( \ | 369 reinterpret_cast<Object*>(Simulator::current(Isolate::Current())->Call( \ |
| 363 FUNCTION_ADDR(entry), 5, p0, p1, p2, p3, p4)) | 370 FUNCTION_ADDR(entry), 5, p0, p1, p2, p3, p4)) |
| 364 | 371 |
| 365 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7) \ | 372 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7) \ |
| 366 Simulator::current(Isolate::Current())->Call( \ | 373 Simulator::current(Isolate::Current())->Call( \ |
| 367 FUNCTION_ADDR(entry), 8, p0, p1, p2, p3, p4, p5, p6, p7) | 374 entry, 9, p0, p1, p2, p3, NULL, p4, p5, p6, p7) |
| 368 | 375 |
| 369 #define TRY_CATCH_FROM_ADDRESS(try_catch_address) \ | 376 #define TRY_CATCH_FROM_ADDRESS(try_catch_address) \ |
| 370 try_catch_address == NULL ? \ | 377 try_catch_address == NULL ? \ |
| 371 NULL : *(reinterpret_cast<TryCatch**>(try_catch_address)) | 378 NULL : *(reinterpret_cast<TryCatch**>(try_catch_address)) |
| 372 | 379 |
| 373 | 380 |
| 374 // The simulator has its own stack. Thus it has a different stack limit from | 381 // The simulator has its own stack. Thus it has a different stack limit from |
| 375 // the C-based native code. Setting the c_limit to indicate a very small | 382 // the C-based native code. Setting the c_limit to indicate a very small |
| 376 // stack cause stack overflow errors, since the simulator ignores the input. | 383 // stack cause stack overflow errors, since the simulator ignores the input. |
| 377 // This is unlikely to be an issue in practice, though it might cause testing | 384 // This is unlikely to be an issue in practice, though it might cause testing |
| (...skipping 11 matching lines...) Expand all Loading... |
| 389 | 396 |
| 390 static inline void UnregisterCTryCatch() { | 397 static inline void UnregisterCTryCatch() { |
| 391 Simulator::current(Isolate::Current())->PopAddress(); | 398 Simulator::current(Isolate::Current())->PopAddress(); |
| 392 } | 399 } |
| 393 }; | 400 }; |
| 394 | 401 |
| 395 } } // namespace v8::internal | 402 } } // namespace v8::internal |
| 396 | 403 |
| 397 #endif // !defined(USE_SIMULATOR) | 404 #endif // !defined(USE_SIMULATOR) |
| 398 #endif // V8_ARM_SIMULATOR_ARM_H_ | 405 #endif // V8_ARM_SIMULATOR_ARM_H_ |
| OLD | NEW |