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

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

Issue 2832193002: 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/mips64/interface-descriptors-mips64.cc ('k') | src/ppc/code-stubs-ppc.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 11 matching lines...) Expand all
22 namespace v8 { 22 namespace v8 {
23 namespace internal { 23 namespace internal {
24 24
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 29
30 // Call the generated regexp code directly. The code at the entry address 30 // Call the generated regexp code directly. The code at the entry address
31 // should act as a function matching the type arm_regexp_matcher. 31 // should act as a function matching the type arm_regexp_matcher.
32 // The fifth (or ninth) argument is a dummy that reserves the space used for
33 // the return address added by the ExitFrame in native calls.
32 typedef int (*mips_regexp_matcher)(String* input, 34 typedef int (*mips_regexp_matcher)(String* input,
33 int64_t start_offset, 35 int64_t start_offset,
34 const byte* input_start, 36 const byte* input_start,
35 const byte* input_end, 37 const byte* input_end,
36 int* output, 38 int* output,
37 int64_t output_size, 39 int64_t output_size,
38 Address stack_base, 40 Address stack_base,
39 int64_t direct_call, 41 int64_t direct_call,
42 void* return_address,
40 Isolate* isolate); 43 Isolate* isolate);
41 44
42 #define CALL_GENERATED_REGEXP_CODE(isolate, entry, p0, p1, p2, p3, p4, p5, p6, \ 45 #define CALL_GENERATED_REGEXP_CODE(isolate, entry, p0, p1, p2, p3, p4, p5, p6, \
43 p7, p8) \ 46 p7, p8) \
44 (FUNCTION_CAST<mips_regexp_matcher>(entry)(p0, p1, p2, p3, p4, p5, p6, p7, \ 47 (FUNCTION_CAST<mips_regexp_matcher>(entry)(p0, p1, p2, p3, p4, p5, p6, p7, \
45 p8)) 48 NULL, p8))
49
46 50
47 // The stack limit beyond which we will throw stack overflow errors in 51 // The stack limit beyond which we will throw stack overflow errors in
48 // generated code. Because generated code on mips uses the C stack, we 52 // generated code. Because generated code on mips uses the C stack, we
49 // just use the C stack limit. 53 // just use the C stack limit.
50 class SimulatorStack : public v8::internal::AllStatic { 54 class SimulatorStack : public v8::internal::AllStatic {
51 public: 55 public:
52 static inline uintptr_t JsLimitFromCLimit(Isolate* isolate, 56 static inline uintptr_t JsLimitFromCLimit(Isolate* isolate,
53 uintptr_t c_limit) { 57 uintptr_t c_limit) {
54 return c_limit; 58 return c_limit;
55 } 59 }
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 553
550 554
551 // When running with the simulator transition into simulated execution at this 555 // When running with the simulator transition into simulated execution at this
552 // point. 556 // point.
553 #define CALL_GENERATED_CODE(isolate, entry, p0, p1, p2, p3, p4) \ 557 #define CALL_GENERATED_CODE(isolate, entry, p0, p1, p2, p3, p4) \
554 reinterpret_cast<Object*>(Simulator::current(isolate)->Call( \ 558 reinterpret_cast<Object*>(Simulator::current(isolate)->Call( \
555 FUNCTION_ADDR(entry), 5, reinterpret_cast<int64_t*>(p0), \ 559 FUNCTION_ADDR(entry), 5, reinterpret_cast<int64_t*>(p0), \
556 reinterpret_cast<int64_t*>(p1), reinterpret_cast<int64_t*>(p2), \ 560 reinterpret_cast<int64_t*>(p1), reinterpret_cast<int64_t*>(p2), \
557 reinterpret_cast<int64_t*>(p3), reinterpret_cast<int64_t*>(p4))) 561 reinterpret_cast<int64_t*>(p3), reinterpret_cast<int64_t*>(p4)))
558 562
563
559 #define CALL_GENERATED_REGEXP_CODE(isolate, entry, p0, p1, p2, p3, p4, p5, p6, \ 564 #define CALL_GENERATED_REGEXP_CODE(isolate, entry, p0, p1, p2, p3, p4, p5, p6, \
560 p7, p8) \ 565 p7, p8) \
561 static_cast<int>(Simulator::current(isolate)->Call( \ 566 static_cast<int>(Simulator::current(isolate)->Call( \
562 entry, 9, p0, p1, p2, p3, p4, reinterpret_cast<int64_t*>(p5), p6, p7, \ 567 entry, 10, p0, p1, p2, p3, p4, reinterpret_cast<int64_t*>(p5), p6, p7, \
563 p8)) 568 NULL, p8))
569
564 570
565 // The simulator has its own stack. Thus it has a different stack limit from 571 // The simulator has its own stack. Thus it has a different stack limit from
566 // the C-based native code. The JS-based limit normally points near the end of 572 // the C-based native code. The JS-based limit normally points near the end of
567 // the simulator stack. When the C-based limit is exhausted we reflect that by 573 // the simulator stack. When the C-based limit is exhausted we reflect that by
568 // lowering the JS-based limit as well, to make stack checks trigger. 574 // lowering the JS-based limit as well, to make stack checks trigger.
569 class SimulatorStack : public v8::internal::AllStatic { 575 class SimulatorStack : public v8::internal::AllStatic {
570 public: 576 public:
571 static inline uintptr_t JsLimitFromCLimit(Isolate* isolate, 577 static inline uintptr_t JsLimitFromCLimit(Isolate* isolate,
572 uintptr_t c_limit) { 578 uintptr_t c_limit) {
573 return Simulator::current(isolate)->StackLimit(c_limit); 579 return Simulator::current(isolate)->StackLimit(c_limit);
574 } 580 }
575 581
576 static inline uintptr_t RegisterCTryCatch(Isolate* isolate, 582 static inline uintptr_t RegisterCTryCatch(Isolate* isolate,
577 uintptr_t try_catch_address) { 583 uintptr_t try_catch_address) {
578 Simulator* sim = Simulator::current(isolate); 584 Simulator* sim = Simulator::current(isolate);
579 return sim->PushAddress(try_catch_address); 585 return sim->PushAddress(try_catch_address);
580 } 586 }
581 587
582 static inline void UnregisterCTryCatch(Isolate* isolate) { 588 static inline void UnregisterCTryCatch(Isolate* isolate) {
583 Simulator::current(isolate)->PopAddress(); 589 Simulator::current(isolate)->PopAddress();
584 } 590 }
585 }; 591 };
586 592
587 } // namespace internal 593 } // namespace internal
588 } // namespace v8 594 } // namespace v8
589 595
590 #endif // !defined(USE_SIMULATOR) 596 #endif // !defined(USE_SIMULATOR)
591 #endif // V8_MIPS_SIMULATOR_MIPS_H_ 597 #endif // V8_MIPS_SIMULATOR_MIPS_H_
OLDNEW
« no previous file with comments | « src/mips64/interface-descriptors-mips64.cc ('k') | src/ppc/code-stubs-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698