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

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

Issue 2752143003: [regexp] Remove remainder of native RegExpExecStub (Closed)
Patch Set: Fix non-sim arm64 and mips builds 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/arm/interface-descriptors-arm.cc ('k') | src/arm64/code-stubs-arm64.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 ARM instructions if we are not generating a native 6 // Declares a Simulator for ARM instructions if we are not generating a native
7 // ARM binary. This Simulator allows us to run and debug ARM code generation on 7 // ARM binary. This Simulator allows us to run and debug ARM code generation on
8 // regular desktop machines. 8 // 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
11 // on a ARM HW platform. 11 // on a ARM HW platform.
12 12
13 #ifndef V8_ARM_SIMULATOR_ARM_H_ 13 #ifndef V8_ARM_SIMULATOR_ARM_H_
14 #define V8_ARM_SIMULATOR_ARM_H_ 14 #define V8_ARM_SIMULATOR_ARM_H_
15 15
16 #include "src/allocation.h" 16 #include "src/allocation.h"
17 #include "src/base/lazy-instance.h" 17 #include "src/base/lazy-instance.h"
18 #include "src/base/platform/mutex.h" 18 #include "src/base/platform/mutex.h"
19 19
20 #if !defined(USE_SIMULATOR) 20 #if !defined(USE_SIMULATOR)
21 // Running without a simulator on a native arm platform. 21 // Running without a simulator on a native arm platform.
22 22
23 namespace v8 { 23 namespace v8 {
24 namespace internal { 24 namespace internal {
25 25
26 // When running without a simulator we call the entry directly. 26 // When running without a simulator we call the entry directly.
27 #define CALL_GENERATED_CODE(isolate, entry, p0, p1, p2, p3, p4) \ 27 #define CALL_GENERATED_CODE(isolate, entry, p0, p1, p2, p3, p4) \
28 (entry(p0, p1, p2, p3, p4)) 28 (entry(p0, p1, p2, p3, p4))
29 29
30 typedef int (*arm_regexp_matcher)(String*, int, const byte*, const byte*, 30 typedef int (*arm_regexp_matcher)(String*, int, const byte*, const byte*, int*,
31 void*, int*, int, Address, int, Isolate*); 31 int, Address, int, Isolate*);
32
33 32
34 // 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
35 // should act as a function matching the type arm_regexp_matcher. 34 // should act as a function matching the type arm_regexp_matcher.
36 // The fifth argument is a dummy that reserves the space used for
37 // the return address added by the ExitFrame in native calls.
38 #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, \
39 p7, p8) \ 36 p7, p8) \
40 (FUNCTION_CAST<arm_regexp_matcher>(entry)(p0, p1, p2, p3, NULL, p4, p5, p6, \ 37 (FUNCTION_CAST<arm_regexp_matcher>(entry)(p0, p1, p2, p3, p4, p5, p6, p7, p8))
41 p7, p8))
42 38
43 // The stack limit beyond which we will throw stack overflow errors in 39 // The stack limit beyond which we will throw stack overflow errors in
44 // generated code. Because generated code on arm uses the C stack, we 40 // generated code. Because generated code on arm uses the C stack, we
45 // just use the C stack limit. 41 // just use the C stack limit.
46 class SimulatorStack : public v8::internal::AllStatic { 42 class SimulatorStack : public v8::internal::AllStatic {
47 public: 43 public:
48 static inline uintptr_t JsLimitFromCLimit(v8::internal::Isolate* isolate, 44 static inline uintptr_t JsLimitFromCLimit(v8::internal::Isolate* isolate,
49 uintptr_t c_limit) { 45 uintptr_t c_limit) {
50 USE(isolate); 46 USE(isolate);
51 return c_limit; 47 return c_limit;
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 // point. 538 // point.
543 #define CALL_GENERATED_CODE(isolate, entry, p0, p1, p2, p3, p4) \ 539 #define CALL_GENERATED_CODE(isolate, entry, p0, p1, p2, p3, p4) \
544 reinterpret_cast<Object*>(Simulator::current(isolate)->Call( \ 540 reinterpret_cast<Object*>(Simulator::current(isolate)->Call( \
545 FUNCTION_ADDR(entry), 5, p0, p1, p2, p3, p4)) 541 FUNCTION_ADDR(entry), 5, p0, p1, p2, p3, p4))
546 542
547 #define CALL_GENERATED_FP_INT(isolate, entry, p0, p1) \ 543 #define CALL_GENERATED_FP_INT(isolate, entry, p0, p1) \
548 Simulator::current(isolate)->CallFPReturnsInt(FUNCTION_ADDR(entry), p0, p1) 544 Simulator::current(isolate)->CallFPReturnsInt(FUNCTION_ADDR(entry), p0, p1)
549 545
550 #define CALL_GENERATED_REGEXP_CODE(isolate, entry, p0, p1, p2, p3, p4, p5, p6, \ 546 #define CALL_GENERATED_REGEXP_CODE(isolate, entry, p0, p1, p2, p3, p4, p5, p6, \
551 p7, p8) \ 547 p7, p8) \
552 Simulator::current(isolate) \ 548 Simulator::current(isolate)->Call(entry, 9, p0, p1, p2, p3, p4, p5, p6, p7, \
553 ->Call(entry, 10, p0, p1, p2, p3, NULL, p4, p5, p6, p7, p8) 549 p8)
554
555 550
556 // The simulator has its own stack. Thus it has a different stack limit from 551 // The simulator has its own stack. Thus it has a different stack limit from
557 // the C-based native code. The JS-based limit normally points near the end of 552 // the C-based native code. The JS-based limit normally points near the end of
558 // the simulator stack. When the C-based limit is exhausted we reflect that by 553 // the simulator stack. When the C-based limit is exhausted we reflect that by
559 // lowering the JS-based limit as well, to make stack checks trigger. 554 // lowering the JS-based limit as well, to make stack checks trigger.
560 class SimulatorStack : public v8::internal::AllStatic { 555 class SimulatorStack : public v8::internal::AllStatic {
561 public: 556 public:
562 static inline uintptr_t JsLimitFromCLimit(v8::internal::Isolate* isolate, 557 static inline uintptr_t JsLimitFromCLimit(v8::internal::Isolate* isolate,
563 uintptr_t c_limit) { 558 uintptr_t c_limit) {
564 return Simulator::current(isolate)->StackLimit(c_limit); 559 return Simulator::current(isolate)->StackLimit(c_limit);
565 } 560 }
566 561
567 static inline uintptr_t RegisterCTryCatch(v8::internal::Isolate* isolate, 562 static inline uintptr_t RegisterCTryCatch(v8::internal::Isolate* isolate,
568 uintptr_t try_catch_address) { 563 uintptr_t try_catch_address) {
569 Simulator* sim = Simulator::current(isolate); 564 Simulator* sim = Simulator::current(isolate);
570 return sim->PushAddress(try_catch_address); 565 return sim->PushAddress(try_catch_address);
571 } 566 }
572 567
573 static inline void UnregisterCTryCatch(v8::internal::Isolate* isolate) { 568 static inline void UnregisterCTryCatch(v8::internal::Isolate* isolate) {
574 Simulator::current(isolate)->PopAddress(); 569 Simulator::current(isolate)->PopAddress();
575 } 570 }
576 }; 571 };
577 572
578 } // namespace internal 573 } // namespace internal
579 } // namespace v8 574 } // namespace v8
580 575
581 #endif // !defined(USE_SIMULATOR) 576 #endif // !defined(USE_SIMULATOR)
582 #endif // V8_ARM_SIMULATOR_ARM_H_ 577 #endif // V8_ARM_SIMULATOR_ARM_H_
OLDNEW
« no previous file with comments | « src/arm/interface-descriptors-arm.cc ('k') | src/arm64/code-stubs-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698