Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Side by Side Diff: src/mips/simulator-mips.h

Issue 2752143003: [regexp] Remove remainder of native RegExpExecStub (Closed)
Patch Set: Update comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 5
6 // Declares a Simulator for MIPS instructions if we are not generating a native 6 // Declares a Simulator for MIPS instructions if we are not generating a native
7 // MIPS binary. This Simulator allows us to run and debug MIPS code generation 7 // MIPS binary. This Simulator allows us to run and debug MIPS code generation
8 // on regular desktop machines. 8 // on regular desktop machines.
9 // V8 calls into generated code by "calling" the CALL_GENERATED_CODE macro, 9 // V8 calls into generated code by "calling" the CALL_GENERATED_CODE macro,
10 // which will start execution in the Simulator or forwards to the real entry 10 // which will start execution in the Simulator or forwards to the real entry
(...skipping 14 matching lines...) Expand all
25 // When running without a simulator we call the entry directly. 25 // When running without a simulator we call the entry directly.
26 #define CALL_GENERATED_CODE(isolate, entry, p0, p1, p2, p3, p4) \ 26 #define CALL_GENERATED_CODE(isolate, entry, p0, p1, p2, p3, p4) \
27 entry(p0, p1, p2, p3, p4) 27 entry(p0, p1, p2, p3, p4)
28 28
29 typedef int (*mips_regexp_matcher)(String*, int, const byte*, const byte*, 29 typedef int (*mips_regexp_matcher)(String*, int, const byte*, const byte*,
30 void*, int*, int, Address, int, Isolate*); 30 void*, int*, int, Address, int, Isolate*);
31 31
32 32
33 // Call the generated regexp code directly. The code at the entry address 33 // Call the generated regexp code directly. The code at the entry address
34 // should act as a function matching the type arm_regexp_matcher. 34 // should act as a function matching the type arm_regexp_matcher.
35 // The fifth argument is a dummy that reserves the space used for
36 // the return address added by the ExitFrame in native calls.
37 #define CALL_GENERATED_REGEXP_CODE(isolate, entry, p0, p1, p2, p3, p4, p5, p6, \ 35 #define CALL_GENERATED_REGEXP_CODE(isolate, entry, p0, p1, p2, p3, p4, p5, p6, \
38 p7, p8) \ 36 p7, p8) \
39 (FUNCTION_CAST<mips_regexp_matcher>(entry)(p0, p1, p2, p3, NULL, p4, p5, p6, \ 37 (FUNCTION_CAST<mips_regexp_matcher>(entry)(p0, p1, p2, p3, p4, p5, p6, p7, \
40 p7, p8)) 38 p8))
41 39
42 // The stack limit beyond which we will throw stack overflow errors in 40 // The stack limit beyond which we will throw stack overflow errors in
43 // generated code. Because generated code on mips uses the C stack, we 41 // generated code. Because generated code on mips uses the C stack, we
44 // just use the C stack limit. 42 // just use the C stack limit.
45 class SimulatorStack : public v8::internal::AllStatic { 43 class SimulatorStack : public v8::internal::AllStatic {
46 public: 44 public:
47 static inline uintptr_t JsLimitFromCLimit(Isolate* isolate, 45 static inline uintptr_t JsLimitFromCLimit(Isolate* isolate,
48 uintptr_t c_limit) { 46 uintptr_t c_limit) {
49 return c_limit; 47 return c_limit;
50 } 48 }
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 521
524 522
525 // When running with the simulator transition into simulated execution at this 523 // When running with the simulator transition into simulated execution at this
526 // point. 524 // point.
527 #define CALL_GENERATED_CODE(isolate, entry, p0, p1, p2, p3, p4) \ 525 #define CALL_GENERATED_CODE(isolate, entry, p0, p1, p2, p3, p4) \
528 reinterpret_cast<Object*>(Simulator::current(isolate)->Call( \ 526 reinterpret_cast<Object*>(Simulator::current(isolate)->Call( \
529 FUNCTION_ADDR(entry), 5, p0, p1, p2, p3, p4)) 527 FUNCTION_ADDR(entry), 5, p0, p1, p2, p3, p4))
530 528
531 #define CALL_GENERATED_REGEXP_CODE(isolate, entry, p0, p1, p2, p3, p4, p5, p6, \ 529 #define CALL_GENERATED_REGEXP_CODE(isolate, entry, p0, p1, p2, p3, p4, p5, p6, \
532 p7, p8) \ 530 p7, p8) \
533 Simulator::current(isolate) \ 531 Simulator::current(isolate)->Call(entry, 10, p0, p1, p2, p3, p4, p5, p6, p7, \
534 ->Call(entry, 10, p0, p1, p2, p3, NULL, p4, p5, p6, p7, p8) 532 p8)
535
536 533
537 // The simulator has its own stack. Thus it has a different stack limit from 534 // The simulator has its own stack. Thus it has a different stack limit from
538 // the C-based native code. The JS-based limit normally points near the end of 535 // the C-based native code. The JS-based limit normally points near the end of
539 // the simulator stack. When the C-based limit is exhausted we reflect that by 536 // the simulator stack. When the C-based limit is exhausted we reflect that by
540 // lowering the JS-based limit as well, to make stack checks trigger. 537 // lowering the JS-based limit as well, to make stack checks trigger.
541 class SimulatorStack : public v8::internal::AllStatic { 538 class SimulatorStack : public v8::internal::AllStatic {
542 public: 539 public:
543 static inline uintptr_t JsLimitFromCLimit(Isolate* isolate, 540 static inline uintptr_t JsLimitFromCLimit(Isolate* isolate,
544 uintptr_t c_limit) { 541 uintptr_t c_limit) {
545 return Simulator::current(isolate)->StackLimit(c_limit); 542 return Simulator::current(isolate)->StackLimit(c_limit);
546 } 543 }
547 544
548 static inline uintptr_t RegisterCTryCatch(Isolate* isolate, 545 static inline uintptr_t RegisterCTryCatch(Isolate* isolate,
549 uintptr_t try_catch_address) { 546 uintptr_t try_catch_address) {
550 Simulator* sim = Simulator::current(isolate); 547 Simulator* sim = Simulator::current(isolate);
551 return sim->PushAddress(try_catch_address); 548 return sim->PushAddress(try_catch_address);
552 } 549 }
553 550
554 static inline void UnregisterCTryCatch(Isolate* isolate) { 551 static inline void UnregisterCTryCatch(Isolate* isolate) {
555 Simulator::current(isolate)->PopAddress(); 552 Simulator::current(isolate)->PopAddress();
556 } 553 }
557 }; 554 };
558 555
559 } // namespace internal 556 } // namespace internal
560 } // namespace v8 557 } // namespace v8
561 558
562 #endif // !defined(USE_SIMULATOR) 559 #endif // !defined(USE_SIMULATOR)
563 #endif // V8_MIPS_SIMULATOR_MIPS_H_ 560 #endif // V8_MIPS_SIMULATOR_MIPS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698