| OLD | NEW |
| 1 // Copyright 2011 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 |
| 11 // with the distribution. | 11 // with the distribution. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 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 typedef int (*arm_regexp_matcher)(String*, int, const byte*, const byte*, | 51 typedef int (*arm_regexp_matcher)(String*, int, const byte*, const byte*, |
| 52 void*, int*, Address, int, Isolate*); | 52 void*, int*, int, Address, int, Isolate*); |
| 53 | 53 |
| 54 | 54 |
| 55 // Call the generated regexp code directly. The code at the entry address | 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. | 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 | 57 // The fifth argument is a dummy that reserves the space used for |
| 58 // the return address added by the ExitFrame in native calls. | 58 // the return address added by the ExitFrame in native calls. |
| 59 #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, p8) \ |
| 60 (FUNCTION_CAST<arm_regexp_matcher>(entry)( \ | 60 (FUNCTION_CAST<arm_regexp_matcher>(entry)( \ |
| 61 p0, p1, p2, p3, NULL, p4, p5, p6, p7)) | 61 p0, p1, p2, p3, NULL, p4, p5, p6, p7, p8)) |
| 62 | 62 |
| 63 #define TRY_CATCH_FROM_ADDRESS(try_catch_address) \ | 63 #define TRY_CATCH_FROM_ADDRESS(try_catch_address) \ |
| 64 reinterpret_cast<TryCatch*>(try_catch_address) | 64 reinterpret_cast<TryCatch*>(try_catch_address) |
| 65 | 65 |
| 66 // 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 |
| 67 // 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 |
| 68 // just use the C stack limit. | 68 // just use the C stack limit. |
| 69 class SimulatorStack : public v8::internal::AllStatic { | 69 class SimulatorStack : public v8::internal::AllStatic { |
| 70 public: | 70 public: |
| 71 static inline uintptr_t JsLimitFromCLimit(v8::internal::Isolate* isolate, | 71 static inline uintptr_t JsLimitFromCLimit(v8::internal::Isolate* isolate, |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 StopCountAndDesc watched_stops[kNumOfWatchedStops]; | 394 StopCountAndDesc watched_stops[kNumOfWatchedStops]; |
| 395 }; | 395 }; |
| 396 | 396 |
| 397 | 397 |
| 398 // When running with the simulator transition into simulated execution at this | 398 // When running with the simulator transition into simulated execution at this |
| 399 // point. | 399 // point. |
| 400 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \ | 400 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \ |
| 401 reinterpret_cast<Object*>(Simulator::current(Isolate::Current())->Call( \ | 401 reinterpret_cast<Object*>(Simulator::current(Isolate::Current())->Call( \ |
| 402 FUNCTION_ADDR(entry), 5, p0, p1, p2, p3, p4)) | 402 FUNCTION_ADDR(entry), 5, p0, p1, p2, p3, p4)) |
| 403 | 403 |
| 404 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7) \ | 404 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7, p8) \ |
| 405 Simulator::current(Isolate::Current())->Call( \ | 405 Simulator::current(Isolate::Current())->Call( \ |
| 406 entry, 9, p0, p1, p2, p3, NULL, p4, p5, p6, p7) | 406 entry, 10, p0, p1, p2, p3, NULL, p4, p5, p6, p7, p8) |
| 407 | 407 |
| 408 #define TRY_CATCH_FROM_ADDRESS(try_catch_address) \ | 408 #define TRY_CATCH_FROM_ADDRESS(try_catch_address) \ |
| 409 try_catch_address == NULL ? \ | 409 try_catch_address == NULL ? \ |
| 410 NULL : *(reinterpret_cast<TryCatch**>(try_catch_address)) | 410 NULL : *(reinterpret_cast<TryCatch**>(try_catch_address)) |
| 411 | 411 |
| 412 | 412 |
| 413 // The simulator has its own stack. Thus it has a different stack limit from | 413 // The simulator has its own stack. Thus it has a different stack limit from |
| 414 // the C-based native code. Setting the c_limit to indicate a very small | 414 // the C-based native code. Setting the c_limit to indicate a very small |
| 415 // stack cause stack overflow errors, since the simulator ignores the input. | 415 // stack cause stack overflow errors, since the simulator ignores the input. |
| 416 // This is unlikely to be an issue in practice, though it might cause testing | 416 // This is unlikely to be an issue in practice, though it might cause testing |
| (...skipping 12 matching lines...) Expand all Loading... |
| 429 | 429 |
| 430 static inline void UnregisterCTryCatch() { | 430 static inline void UnregisterCTryCatch() { |
| 431 Simulator::current(Isolate::Current())->PopAddress(); | 431 Simulator::current(Isolate::Current())->PopAddress(); |
| 432 } | 432 } |
| 433 }; | 433 }; |
| 434 | 434 |
| 435 } } // namespace v8::internal | 435 } } // namespace v8::internal |
| 436 | 436 |
| 437 #endif // !defined(USE_SIMULATOR) | 437 #endif // !defined(USE_SIMULATOR) |
| 438 #endif // V8_ARM_SIMULATOR_ARM_H_ | 438 #endif // V8_ARM_SIMULATOR_ARM_H_ |
| OLD | NEW |