OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 // Running without a simulator on a native mips platform. | 43 // Running without a simulator on a native mips platform. |
44 | 44 |
45 namespace v8 { | 45 namespace v8 { |
46 namespace internal { | 46 namespace internal { |
47 | 47 |
48 // When running without a simulator we call the entry directly. | 48 // When running without a simulator we call the entry directly. |
49 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \ | 49 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \ |
50 entry(p0, p1, p2, p3, p4) | 50 entry(p0, p1, p2, p3, p4) |
51 | 51 |
52 typedef int (*mips_regexp_matcher)(String*, int, const byte*, const byte*, | 52 typedef int (*mips_regexp_matcher)(String*, int, const byte*, const byte*, |
53 void*, int*, Address, int, Isolate*); | 53 void*, int*, int, Address, int, Isolate*); |
54 | 54 |
55 | 55 |
56 // Call the generated regexp code directly. The code at the entry address | 56 // Call the generated regexp code directly. The code at the entry address |
57 // should act as a function matching the type arm_regexp_matcher. | 57 // should act as a function matching the type arm_regexp_matcher. |
58 // The fifth argument is a dummy that reserves the space used for | 58 // The fifth argument is a dummy that reserves the space used for |
59 // the return address added by the ExitFrame in native calls. | 59 // the return address added by the ExitFrame in native calls. |
60 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7) \ | 60 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7, p8) \ |
61 (FUNCTION_CAST<mips_regexp_matcher>(entry)( \ | 61 (FUNCTION_CAST<mips_regexp_matcher>(entry)( \ |
62 p0, p1, p2, p3, NULL, p4, p5, p6, p7)) | 62 p0, p1, p2, p3, NULL, p4, p5, p6, p7, p8)) |
63 | 63 |
64 #define TRY_CATCH_FROM_ADDRESS(try_catch_address) \ | 64 #define TRY_CATCH_FROM_ADDRESS(try_catch_address) \ |
65 reinterpret_cast<TryCatch*>(try_catch_address) | 65 reinterpret_cast<TryCatch*>(try_catch_address) |
66 | 66 |
67 // The stack limit beyond which we will throw stack overflow errors in | 67 // The stack limit beyond which we will throw stack overflow errors in |
68 // generated code. Because generated code on mips uses the C stack, we | 68 // generated code. Because generated code on mips uses the C stack, we |
69 // just use the C stack limit. | 69 // just use the C stack limit. |
70 class SimulatorStack : public v8::internal::AllStatic { | 70 class SimulatorStack : public v8::internal::AllStatic { |
71 public: | 71 public: |
72 static inline uintptr_t JsLimitFromCLimit(Isolate* isolate, | 72 static inline uintptr_t JsLimitFromCLimit(Isolate* isolate, |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 StopCountAndDesc watched_stops[kMaxStopCode + 1]; | 396 StopCountAndDesc watched_stops[kMaxStopCode + 1]; |
397 }; | 397 }; |
398 | 398 |
399 | 399 |
400 // When running with the simulator transition into simulated execution at this | 400 // When running with the simulator transition into simulated execution at this |
401 // point. | 401 // point. |
402 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \ | 402 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \ |
403 reinterpret_cast<Object*>(Simulator::current(Isolate::Current())->Call( \ | 403 reinterpret_cast<Object*>(Simulator::current(Isolate::Current())->Call( \ |
404 FUNCTION_ADDR(entry), 5, p0, p1, p2, p3, p4)) | 404 FUNCTION_ADDR(entry), 5, p0, p1, p2, p3, p4)) |
405 | 405 |
406 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7) \ | 406 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7, p8) \ |
407 Simulator::current(Isolate::Current())->Call( \ | 407 Simulator::current(Isolate::Current())->Call( \ |
408 entry, 9, p0, p1, p2, p3, NULL, p4, p5, p6, p7) | 408 entry, 10, p0, p1, p2, p3, NULL, p4, p5, p6, p7, p8) |
409 | 409 |
410 #define TRY_CATCH_FROM_ADDRESS(try_catch_address) \ | 410 #define TRY_CATCH_FROM_ADDRESS(try_catch_address) \ |
411 try_catch_address == NULL ? \ | 411 try_catch_address == NULL ? \ |
412 NULL : *(reinterpret_cast<TryCatch**>(try_catch_address)) | 412 NULL : *(reinterpret_cast<TryCatch**>(try_catch_address)) |
413 | 413 |
414 | 414 |
415 // The simulator has its own stack. Thus it has a different stack limit from | 415 // The simulator has its own stack. Thus it has a different stack limit from |
416 // the C-based native code. Setting the c_limit to indicate a very small | 416 // the C-based native code. Setting the c_limit to indicate a very small |
417 // stack cause stack overflow errors, since the simulator ignores the input. | 417 // stack cause stack overflow errors, since the simulator ignores the input. |
418 // This is unlikely to be an issue in practice, though it might cause testing | 418 // This is unlikely to be an issue in practice, though it might cause testing |
(...skipping 12 matching lines...) Expand all Loading... |
431 | 431 |
432 static inline void UnregisterCTryCatch() { | 432 static inline void UnregisterCTryCatch() { |
433 Simulator::current(Isolate::Current())->PopAddress(); | 433 Simulator::current(Isolate::Current())->PopAddress(); |
434 } | 434 } |
435 }; | 435 }; |
436 | 436 |
437 } } // namespace v8::internal | 437 } } // namespace v8::internal |
438 | 438 |
439 #endif // !defined(USE_SIMULATOR) | 439 #endif // !defined(USE_SIMULATOR) |
440 #endif // V8_MIPS_SIMULATOR_MIPS_H_ | 440 #endif // V8_MIPS_SIMULATOR_MIPS_H_ |
OLD | NEW |