OLD | NEW |
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 #ifndef V8_MIPS_CODE_STUBS_ARM_H_ | 5 #ifndef V8_MIPS_CODE_STUBS_ARM_H_ |
6 #define V8_MIPS_CODE_STUBS_ARM_H_ | 6 #define V8_MIPS_CODE_STUBS_ARM_H_ |
7 | 7 |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 | 9 |
10 | 10 |
11 namespace v8 { | 11 namespace v8 { |
12 namespace internal { | 12 namespace internal { |
13 | 13 |
14 | 14 |
15 void ArrayNativeCode(MacroAssembler* masm, Label* call_generic_code); | 15 void ArrayNativeCode(MacroAssembler* masm, Label* call_generic_code); |
16 | 16 |
17 | 17 |
18 class StoreBufferOverflowStub: public PlatformCodeStub { | |
19 public: | |
20 StoreBufferOverflowStub(Isolate* isolate, SaveFPRegsMode save_fp) | |
21 : PlatformCodeStub(isolate), save_doubles_(save_fp) {} | |
22 | |
23 void Generate(MacroAssembler* masm); | |
24 | |
25 static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate); | |
26 virtual bool SometimesSetsUpAFrame() { return false; } | |
27 | |
28 private: | |
29 SaveFPRegsMode save_doubles_; | |
30 | |
31 Major MajorKey() const { return StoreBufferOverflow; } | |
32 uint32_t MinorKey() const { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; } | |
33 }; | |
34 | |
35 | |
36 class StringHelper : public AllStatic { | 18 class StringHelper : public AllStatic { |
37 public: | 19 public: |
38 // Generate code for copying a large number of characters. This function | 20 // Generate code for copying a large number of characters. This function |
39 // is allowed to spend extra time setting up conditions to make copying | 21 // is allowed to spend extra time setting up conditions to make copying |
40 // faster. Copying of overlapping regions is not supported. | 22 // faster. Copying of overlapping regions is not supported. |
41 // Dest register ends at the position after the last character written. | 23 // Dest register ends at the position after the last character written. |
42 static void GenerateCopyCharacters(MacroAssembler* masm, | 24 static void GenerateCopyCharacters(MacroAssembler* masm, |
43 Register dest, | 25 Register dest, |
44 Register src, | 26 Register src, |
45 Register count, | 27 Register count, |
46 Register scratch, | 28 Register scratch, |
47 String::Encoding encoding); | 29 String::Encoding encoding); |
48 | 30 |
49 // Generate string hash. | 31 // Generate string hash. |
50 static void GenerateHashInit(MacroAssembler* masm, | 32 static void GenerateHashInit(MacroAssembler* masm, |
51 Register hash, | 33 Register hash, |
52 Register character); | 34 Register character); |
53 | 35 |
54 static void GenerateHashAddCharacter(MacroAssembler* masm, | 36 static void GenerateHashAddCharacter(MacroAssembler* masm, |
55 Register hash, | 37 Register hash, |
56 Register character); | 38 Register character); |
57 | 39 |
58 static void GenerateHashGetHash(MacroAssembler* masm, | 40 static void GenerateHashGetHash(MacroAssembler* masm, |
59 Register hash); | 41 Register hash); |
60 | 42 |
| 43 // Compare two flat ASCII strings and returns result in v0. |
| 44 static void GenerateCompareFlatAsciiStrings(MacroAssembler* masm, |
| 45 Register left, |
| 46 Register right, |
| 47 Register scratch1, |
| 48 Register scratch2, |
| 49 Register scratch3, |
| 50 Register scratch4); |
| 51 |
| 52 // Compares two flat ASCII strings for equality and returns result in v0. |
| 53 static void GenerateFlatAsciiStringEquals(MacroAssembler* masm, |
| 54 Register left, |
| 55 Register right, |
| 56 Register scratch1, |
| 57 Register scratch2, |
| 58 Register scratch3); |
| 59 |
| 60 private: |
| 61 static void GenerateAsciiCharsCompareLoop(MacroAssembler* masm, |
| 62 Register left, |
| 63 Register right, |
| 64 Register length, |
| 65 Register scratch1, |
| 66 Register scratch2, |
| 67 Register scratch3, |
| 68 Label* chars_not_equal); |
| 69 |
61 private: | 70 private: |
62 DISALLOW_IMPLICIT_CONSTRUCTORS(StringHelper); | 71 DISALLOW_IMPLICIT_CONSTRUCTORS(StringHelper); |
63 }; | 72 }; |
64 | 73 |
65 | 74 |
66 class SubStringStub: public PlatformCodeStub { | |
67 public: | |
68 explicit SubStringStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | |
69 | |
70 private: | |
71 Major MajorKey() const { return SubString; } | |
72 uint32_t MinorKey() const { return 0; } | |
73 | |
74 void Generate(MacroAssembler* masm); | |
75 }; | |
76 | |
77 | |
78 class StoreRegistersStateStub: public PlatformCodeStub { | 75 class StoreRegistersStateStub: public PlatformCodeStub { |
79 public: | 76 public: |
80 explicit StoreRegistersStateStub(Isolate* isolate) | 77 explicit StoreRegistersStateStub(Isolate* isolate) |
81 : PlatformCodeStub(isolate) {} | 78 : PlatformCodeStub(isolate) {} |
82 | 79 |
83 static void GenerateAheadOfTime(Isolate* isolate); | 80 static void GenerateAheadOfTime(Isolate* isolate); |
84 private: | 81 private: |
85 Major MajorKey() const { return StoreRegistersState; } | 82 Major MajorKey() const { return StoreRegistersState; } |
86 uint32_t MinorKey() const { return 0; } | 83 uint32_t MinorKey() const { return 0; } |
87 | 84 |
88 void Generate(MacroAssembler* masm); | 85 void Generate(MacroAssembler* masm); |
89 }; | 86 }; |
90 | 87 |
91 class RestoreRegistersStateStub: public PlatformCodeStub { | 88 class RestoreRegistersStateStub: public PlatformCodeStub { |
92 public: | 89 public: |
93 explicit RestoreRegistersStateStub(Isolate* isolate) | 90 explicit RestoreRegistersStateStub(Isolate* isolate) |
94 : PlatformCodeStub(isolate) {} | 91 : PlatformCodeStub(isolate) {} |
95 | 92 |
96 static void GenerateAheadOfTime(Isolate* isolate); | 93 static void GenerateAheadOfTime(Isolate* isolate); |
97 private: | 94 private: |
98 Major MajorKey() const { return RestoreRegistersState; } | 95 Major MajorKey() const { return RestoreRegistersState; } |
99 uint32_t MinorKey() const { return 0; } | 96 uint32_t MinorKey() const { return 0; } |
100 | 97 |
101 void Generate(MacroAssembler* masm); | 98 void Generate(MacroAssembler* masm); |
102 }; | 99 }; |
103 | 100 |
104 class StringCompareStub: public PlatformCodeStub { | |
105 public: | |
106 explicit StringCompareStub(Isolate* isolate) : PlatformCodeStub(isolate) { } | |
107 | |
108 // Compare two flat ASCII strings and returns result in v0. | |
109 static void GenerateCompareFlatAsciiStrings(MacroAssembler* masm, | |
110 Register left, | |
111 Register right, | |
112 Register scratch1, | |
113 Register scratch2, | |
114 Register scratch3, | |
115 Register scratch4); | |
116 | |
117 // Compares two flat ASCII strings for equality and returns result | |
118 // in v0. | |
119 static void GenerateFlatAsciiStringEquals(MacroAssembler* masm, | |
120 Register left, | |
121 Register right, | |
122 Register scratch1, | |
123 Register scratch2, | |
124 Register scratch3); | |
125 | |
126 private: | |
127 virtual Major MajorKey() const { return StringCompare; } | |
128 virtual uint32_t MinorKey() const { return 0; } | |
129 virtual void Generate(MacroAssembler* masm); | |
130 | |
131 static void GenerateAsciiCharsCompareLoop(MacroAssembler* masm, | |
132 Register left, | |
133 Register right, | |
134 Register length, | |
135 Register scratch1, | |
136 Register scratch2, | |
137 Register scratch3, | |
138 Label* chars_not_equal); | |
139 }; | |
140 | |
141 | |
142 // This stub can convert a signed int32 to a heap number (double). It does | 101 // This stub can convert a signed int32 to a heap number (double). It does |
143 // not work for int32s that are in Smi range! No GC occurs during this stub | 102 // not work for int32s that are in Smi range! No GC occurs during this stub |
144 // so you don't have to set up the frame. | 103 // so you don't have to set up the frame. |
145 class WriteInt32ToHeapNumberStub : public PlatformCodeStub { | 104 class WriteInt32ToHeapNumberStub : public PlatformCodeStub { |
146 public: | 105 public: |
147 WriteInt32ToHeapNumberStub(Isolate* isolate, | 106 WriteInt32ToHeapNumberStub(Isolate* isolate, |
148 Register the_int, | 107 Register the_int, |
149 Register the_heap_number, | 108 Register the_heap_number, |
150 Register scratch, | 109 Register scratch, |
151 Register scratch2) | 110 Register scratch2) |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 | 398 |
440 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; | 399 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; |
441 | 400 |
442 LookupMode mode_; | 401 LookupMode mode_; |
443 }; | 402 }; |
444 | 403 |
445 | 404 |
446 } } // namespace v8::internal | 405 } } // namespace v8::internal |
447 | 406 |
448 #endif // V8_MIPS_CODE_STUBS_ARM_H_ | 407 #endif // V8_MIPS_CODE_STUBS_ARM_H_ |
OLD | NEW |