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

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

Issue 2827243005: Revert of [regexp] Remove remainder of native RegExpExecStub (Closed)
Patch Set: 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
« no previous file with comments | « src/mips/interface-descriptors-mips.cc ('k') | src/mips64/code-stubs-mips64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
35 #define CALL_GENERATED_REGEXP_CODE(isolate, entry, p0, p1, p2, p3, p4, p5, p6, \ 37 #define CALL_GENERATED_REGEXP_CODE(isolate, entry, p0, p1, p2, p3, p4, p5, p6, \
36 p7, p8) \ 38 p7, p8) \
37 (FUNCTION_CAST<mips_regexp_matcher>(entry)(p0, p1, p2, p3, p4, p5, p6, p7, \ 39 (FUNCTION_CAST<mips_regexp_matcher>(entry)(p0, p1, p2, p3, NULL, p4, p5, p6, \
38 p8)) 40 p7, p8))
39 41
40 // The stack limit beyond which we will throw stack overflow errors in 42 // The stack limit beyond which we will throw stack overflow errors in
41 // generated code. Because generated code on mips uses the C stack, we 43 // generated code. Because generated code on mips uses the C stack, we
42 // just use the C stack limit. 44 // just use the C stack limit.
43 class SimulatorStack : public v8::internal::AllStatic { 45 class SimulatorStack : public v8::internal::AllStatic {
44 public: 46 public:
45 static inline uintptr_t JsLimitFromCLimit(Isolate* isolate, 47 static inline uintptr_t JsLimitFromCLimit(Isolate* isolate,
46 uintptr_t c_limit) { 48 uintptr_t c_limit) {
47 return c_limit; 49 return c_limit;
48 } 50 }
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 523
522 524
523 // When running with the simulator transition into simulated execution at this 525 // When running with the simulator transition into simulated execution at this
524 // point. 526 // point.
525 #define CALL_GENERATED_CODE(isolate, entry, p0, p1, p2, p3, p4) \ 527 #define CALL_GENERATED_CODE(isolate, entry, p0, p1, p2, p3, p4) \
526 reinterpret_cast<Object*>(Simulator::current(isolate)->Call( \ 528 reinterpret_cast<Object*>(Simulator::current(isolate)->Call( \
527 FUNCTION_ADDR(entry), 5, p0, p1, p2, p3, p4)) 529 FUNCTION_ADDR(entry), 5, p0, p1, p2, p3, p4))
528 530
529 #define CALL_GENERATED_REGEXP_CODE(isolate, entry, p0, p1, p2, p3, p4, p5, p6, \ 531 #define CALL_GENERATED_REGEXP_CODE(isolate, entry, p0, p1, p2, p3, p4, p5, p6, \
530 p7, p8) \ 532 p7, p8) \
531 Simulator::current(isolate)->Call(entry, 9, p0, p1, p2, p3, p4, p5, p6, p7, \ 533 Simulator::current(isolate) \
532 p8) 534 ->Call(entry, 10, p0, p1, p2, p3, NULL, p4, p5, p6, p7, p8)
535
533 536
534 // The simulator has its own stack. Thus it has a different stack limit from 537 // The simulator has its own stack. Thus it has a different stack limit from
535 // the C-based native code. The JS-based limit normally points near the end of 538 // the C-based native code. The JS-based limit normally points near the end of
536 // the simulator stack. When the C-based limit is exhausted we reflect that by 539 // the simulator stack. When the C-based limit is exhausted we reflect that by
537 // lowering the JS-based limit as well, to make stack checks trigger. 540 // lowering the JS-based limit as well, to make stack checks trigger.
538 class SimulatorStack : public v8::internal::AllStatic { 541 class SimulatorStack : public v8::internal::AllStatic {
539 public: 542 public:
540 static inline uintptr_t JsLimitFromCLimit(Isolate* isolate, 543 static inline uintptr_t JsLimitFromCLimit(Isolate* isolate,
541 uintptr_t c_limit) { 544 uintptr_t c_limit) {
542 return Simulator::current(isolate)->StackLimit(c_limit); 545 return Simulator::current(isolate)->StackLimit(c_limit);
543 } 546 }
544 547
545 static inline uintptr_t RegisterCTryCatch(Isolate* isolate, 548 static inline uintptr_t RegisterCTryCatch(Isolate* isolate,
546 uintptr_t try_catch_address) { 549 uintptr_t try_catch_address) {
547 Simulator* sim = Simulator::current(isolate); 550 Simulator* sim = Simulator::current(isolate);
548 return sim->PushAddress(try_catch_address); 551 return sim->PushAddress(try_catch_address);
549 } 552 }
550 553
551 static inline void UnregisterCTryCatch(Isolate* isolate) { 554 static inline void UnregisterCTryCatch(Isolate* isolate) {
552 Simulator::current(isolate)->PopAddress(); 555 Simulator::current(isolate)->PopAddress();
553 } 556 }
554 }; 557 };
555 558
556 } // namespace internal 559 } // namespace internal
557 } // namespace v8 560 } // namespace v8
558 561
559 #endif // !defined(USE_SIMULATOR) 562 #endif // !defined(USE_SIMULATOR)
560 #endif // V8_MIPS_SIMULATOR_MIPS_H_ 563 #endif // V8_MIPS_SIMULATOR_MIPS_H_
OLDNEW
« no previous file with comments | « src/mips/interface-descriptors-mips.cc ('k') | src/mips64/code-stubs-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698