OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 namespace v8 { | 34 namespace v8 { |
35 namespace internal { | 35 namespace internal { |
36 | 36 |
37 | 37 |
38 void ArrayNativeCode(MacroAssembler* masm, Label* call_generic_code); | 38 void ArrayNativeCode(MacroAssembler* masm, Label* call_generic_code); |
39 | 39 |
40 | 40 |
41 class StoreBufferOverflowStub: public PlatformCodeStub { | 41 class StoreBufferOverflowStub: public PlatformCodeStub { |
42 public: | 42 public: |
43 explicit StoreBufferOverflowStub(SaveFPRegsMode save_fp) | 43 StoreBufferOverflowStub(Isolate* isolate, SaveFPRegsMode save_fp) |
44 : save_doubles_(save_fp) {} | 44 : PlatformCodeStub(isolate), save_doubles_(save_fp) {} |
45 | 45 |
46 void Generate(MacroAssembler* masm); | 46 void Generate(MacroAssembler* masm); |
47 | 47 |
48 static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate); | 48 static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate); |
49 virtual bool SometimesSetsUpAFrame() { return false; } | 49 virtual bool SometimesSetsUpAFrame() { return false; } |
50 | 50 |
51 private: | 51 private: |
52 SaveFPRegsMode save_doubles_; | 52 SaveFPRegsMode save_doubles_; |
53 | 53 |
54 Major MajorKey() { return StoreBufferOverflow; } | 54 Major MajorKey() { return StoreBufferOverflow; } |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 static void GenerateHashGetHash(MacroAssembler* masm, | 86 static void GenerateHashGetHash(MacroAssembler* masm, |
87 Register hash); | 87 Register hash); |
88 | 88 |
89 private: | 89 private: |
90 DISALLOW_IMPLICIT_CONSTRUCTORS(StringHelper); | 90 DISALLOW_IMPLICIT_CONSTRUCTORS(StringHelper); |
91 }; | 91 }; |
92 | 92 |
93 | 93 |
94 class SubStringStub: public PlatformCodeStub { | 94 class SubStringStub: public PlatformCodeStub { |
95 public: | 95 public: |
96 SubStringStub() {} | 96 explicit SubStringStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
97 | 97 |
98 private: | 98 private: |
99 Major MajorKey() { return SubString; } | 99 Major MajorKey() { return SubString; } |
100 int MinorKey() { return 0; } | 100 int MinorKey() { return 0; } |
101 | 101 |
102 void Generate(MacroAssembler* masm); | 102 void Generate(MacroAssembler* masm); |
103 }; | 103 }; |
104 | 104 |
105 class StoreRegistersStateStub: public PlatformCodeStub { | 105 class StoreRegistersStateStub: public PlatformCodeStub { |
106 public: | 106 public: |
107 explicit StoreRegistersStateStub(SaveFPRegsMode with_fp) | 107 explicit StoreRegistersStateStub(Isolate* isolate, SaveFPRegsMode with_fp) |
108 : save_doubles_(with_fp) {} | 108 : PlatformCodeStub(isolate), save_doubles_(with_fp) {} |
109 | 109 |
110 static void GenerateAheadOfTime(Isolate* isolate); | 110 static void GenerateAheadOfTime(Isolate* isolate); |
111 private: | 111 private: |
112 Major MajorKey() { return StoreRegistersState; } | 112 Major MajorKey() { return StoreRegistersState; } |
113 int MinorKey() { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; } | 113 int MinorKey() { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; } |
114 SaveFPRegsMode save_doubles_; | 114 SaveFPRegsMode save_doubles_; |
115 | 115 |
116 void Generate(MacroAssembler* masm); | 116 void Generate(MacroAssembler* masm); |
117 }; | 117 }; |
118 | 118 |
119 class RestoreRegistersStateStub: public PlatformCodeStub { | 119 class RestoreRegistersStateStub: public PlatformCodeStub { |
120 public: | 120 public: |
121 explicit RestoreRegistersStateStub(SaveFPRegsMode with_fp) | 121 explicit RestoreRegistersStateStub(Isolate* isolate, SaveFPRegsMode with_fp) |
122 : save_doubles_(with_fp) {} | 122 : PlatformCodeStub(isolate), save_doubles_(with_fp) {} |
123 | 123 |
124 static void GenerateAheadOfTime(Isolate* isolate); | 124 static void GenerateAheadOfTime(Isolate* isolate); |
125 private: | 125 private: |
126 Major MajorKey() { return RestoreRegistersState; } | 126 Major MajorKey() { return RestoreRegistersState; } |
127 int MinorKey() { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; } | 127 int MinorKey() { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; } |
128 SaveFPRegsMode save_doubles_; | 128 SaveFPRegsMode save_doubles_; |
129 | 129 |
130 void Generate(MacroAssembler* masm); | 130 void Generate(MacroAssembler* masm); |
131 }; | 131 }; |
132 | 132 |
133 class StringCompareStub: public PlatformCodeStub { | 133 class StringCompareStub: public PlatformCodeStub { |
134 public: | 134 public: |
135 StringCompareStub() { } | 135 explicit StringCompareStub(Isolate* isolate) : PlatformCodeStub(isolate) { } |
136 | 136 |
137 // Compare two flat ASCII strings and returns result in v0. | 137 // Compare two flat ASCII strings and returns result in v0. |
138 static void GenerateCompareFlatAsciiStrings(MacroAssembler* masm, | 138 static void GenerateCompareFlatAsciiStrings(MacroAssembler* masm, |
139 Register left, | 139 Register left, |
140 Register right, | 140 Register right, |
141 Register scratch1, | 141 Register scratch1, |
142 Register scratch2, | 142 Register scratch2, |
143 Register scratch3, | 143 Register scratch3, |
144 Register scratch4); | 144 Register scratch4); |
145 | 145 |
(...skipping 20 matching lines...) Expand all Loading... |
166 Register scratch3, | 166 Register scratch3, |
167 Label* chars_not_equal); | 167 Label* chars_not_equal); |
168 }; | 168 }; |
169 | 169 |
170 | 170 |
171 // This stub can convert a signed int32 to a heap number (double). It does | 171 // This stub can convert a signed int32 to a heap number (double). It does |
172 // not work for int32s that are in Smi range! No GC occurs during this stub | 172 // not work for int32s that are in Smi range! No GC occurs during this stub |
173 // so you don't have to set up the frame. | 173 // so you don't have to set up the frame. |
174 class WriteInt32ToHeapNumberStub : public PlatformCodeStub { | 174 class WriteInt32ToHeapNumberStub : public PlatformCodeStub { |
175 public: | 175 public: |
176 WriteInt32ToHeapNumberStub(Register the_int, | 176 WriteInt32ToHeapNumberStub(Isolate* isolate, |
| 177 Register the_int, |
177 Register the_heap_number, | 178 Register the_heap_number, |
178 Register scratch, | 179 Register scratch, |
179 Register scratch2) | 180 Register scratch2) |
180 : the_int_(the_int), | 181 : PlatformCodeStub(isolate), |
| 182 the_int_(the_int), |
181 the_heap_number_(the_heap_number), | 183 the_heap_number_(the_heap_number), |
182 scratch_(scratch), | 184 scratch_(scratch), |
183 sign_(scratch2) { | 185 sign_(scratch2) { |
184 ASSERT(IntRegisterBits::is_valid(the_int_.code())); | 186 ASSERT(IntRegisterBits::is_valid(the_int_.code())); |
185 ASSERT(HeapNumberRegisterBits::is_valid(the_heap_number_.code())); | 187 ASSERT(HeapNumberRegisterBits::is_valid(the_heap_number_.code())); |
186 ASSERT(ScratchRegisterBits::is_valid(scratch_.code())); | 188 ASSERT(ScratchRegisterBits::is_valid(scratch_.code())); |
187 ASSERT(SignRegisterBits::is_valid(sign_.code())); | 189 ASSERT(SignRegisterBits::is_valid(sign_.code())); |
188 } | 190 } |
189 | 191 |
190 static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate); | 192 static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate); |
(...skipping 18 matching lines...) Expand all Loading... |
209 | ScratchRegisterBits::encode(scratch_.code()) | 211 | ScratchRegisterBits::encode(scratch_.code()) |
210 | SignRegisterBits::encode(sign_.code()); | 212 | SignRegisterBits::encode(sign_.code()); |
211 } | 213 } |
212 | 214 |
213 void Generate(MacroAssembler* masm); | 215 void Generate(MacroAssembler* masm); |
214 }; | 216 }; |
215 | 217 |
216 | 218 |
217 class RecordWriteStub: public PlatformCodeStub { | 219 class RecordWriteStub: public PlatformCodeStub { |
218 public: | 220 public: |
219 RecordWriteStub(Register object, | 221 RecordWriteStub(Isolate* isolate, |
| 222 Register object, |
220 Register value, | 223 Register value, |
221 Register address, | 224 Register address, |
222 RememberedSetAction remembered_set_action, | 225 RememberedSetAction remembered_set_action, |
223 SaveFPRegsMode fp_mode) | 226 SaveFPRegsMode fp_mode) |
224 : object_(object), | 227 : PlatformCodeStub(isolate), |
| 228 object_(object), |
225 value_(value), | 229 value_(value), |
226 address_(address), | 230 address_(address), |
227 remembered_set_action_(remembered_set_action), | 231 remembered_set_action_(remembered_set_action), |
228 save_fp_regs_mode_(fp_mode), | 232 save_fp_regs_mode_(fp_mode), |
229 regs_(object, // An input reg. | 233 regs_(object, // An input reg. |
230 address, // An input reg. | 234 address, // An input reg. |
231 value) { // One scratch reg. | 235 value) { // One scratch reg. |
232 } | 236 } |
233 | 237 |
234 enum Mode { | 238 enum Mode { |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 }; | 403 }; |
400 | 404 |
401 | 405 |
402 // Trampoline stub to call into native code. To call safely into native code | 406 // Trampoline stub to call into native code. To call safely into native code |
403 // in the presence of compacting GC (which can move code objects) we need to | 407 // in the presence of compacting GC (which can move code objects) we need to |
404 // keep the code which called into native pinned in the memory. Currently the | 408 // keep the code which called into native pinned in the memory. Currently the |
405 // simplest approach is to generate such stub early enough so it can never be | 409 // simplest approach is to generate such stub early enough so it can never be |
406 // moved by GC | 410 // moved by GC |
407 class DirectCEntryStub: public PlatformCodeStub { | 411 class DirectCEntryStub: public PlatformCodeStub { |
408 public: | 412 public: |
409 DirectCEntryStub() {} | 413 explicit DirectCEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
410 void Generate(MacroAssembler* masm); | 414 void Generate(MacroAssembler* masm); |
411 void GenerateCall(MacroAssembler* masm, Register target); | 415 void GenerateCall(MacroAssembler* masm, Register target); |
412 | 416 |
413 private: | 417 private: |
414 Major MajorKey() { return DirectCEntry; } | 418 Major MajorKey() { return DirectCEntry; } |
415 int MinorKey() { return 0; } | 419 int MinorKey() { return 0; } |
416 | 420 |
417 bool NeedsImmovableCode() { return true; } | 421 bool NeedsImmovableCode() { return true; } |
418 }; | 422 }; |
419 | 423 |
420 | 424 |
421 class NameDictionaryLookupStub: public PlatformCodeStub { | 425 class NameDictionaryLookupStub: public PlatformCodeStub { |
422 public: | 426 public: |
423 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; | 427 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; |
424 | 428 |
425 explicit NameDictionaryLookupStub(LookupMode mode) : mode_(mode) { } | 429 NameDictionaryLookupStub(Isolate* isolate, LookupMode mode) |
| 430 : PlatformCodeStub(isolate), mode_(mode) { } |
426 | 431 |
427 void Generate(MacroAssembler* masm); | 432 void Generate(MacroAssembler* masm); |
428 | 433 |
429 static void GenerateNegativeLookup(MacroAssembler* masm, | 434 static void GenerateNegativeLookup(MacroAssembler* masm, |
430 Label* miss, | 435 Label* miss, |
431 Label* done, | 436 Label* done, |
432 Register receiver, | 437 Register receiver, |
433 Register properties, | 438 Register properties, |
434 Handle<Name> name, | 439 Handle<Name> name, |
435 Register scratch0); | 440 Register scratch0); |
(...skipping 28 matching lines...) Expand all Loading... |
464 | 469 |
465 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; | 470 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; |
466 | 471 |
467 LookupMode mode_; | 472 LookupMode mode_; |
468 }; | 473 }; |
469 | 474 |
470 | 475 |
471 } } // namespace v8::internal | 476 } } // namespace v8::internal |
472 | 477 |
473 #endif // V8_MIPS_CODE_STUBS_ARM_H_ | 478 #endif // V8_MIPS_CODE_STUBS_ARM_H_ |
OLD | NEW |