| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 namespace v8 { | 33 namespace v8 { |
| 34 namespace internal { | 34 namespace internal { |
| 35 | 35 |
| 36 | 36 |
| 37 void ArrayNativeCode(MacroAssembler* masm, Label* call_generic_code); | 37 void ArrayNativeCode(MacroAssembler* masm, Label* call_generic_code); |
| 38 | 38 |
| 39 | 39 |
| 40 class StoreBufferOverflowStub: public PlatformCodeStub { | 40 class StoreBufferOverflowStub: public PlatformCodeStub { |
| 41 public: | 41 public: |
| 42 explicit StoreBufferOverflowStub(SaveFPRegsMode save_fp) | 42 StoreBufferOverflowStub(Isolate* isolate, SaveFPRegsMode save_fp) |
| 43 : save_doubles_(save_fp) {} | 43 : PlatformCodeStub(isolate), save_doubles_(save_fp) {} |
| 44 | 44 |
| 45 void Generate(MacroAssembler* masm); | 45 void Generate(MacroAssembler* masm); |
| 46 | 46 |
| 47 static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate); | 47 static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate); |
| 48 virtual bool SometimesSetsUpAFrame() { return false; } | 48 virtual bool SometimesSetsUpAFrame() { return false; } |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 SaveFPRegsMode save_doubles_; | 51 SaveFPRegsMode save_doubles_; |
| 52 | 52 |
| 53 Major MajorKey() { return StoreBufferOverflow; } | 53 Major MajorKey() { return StoreBufferOverflow; } |
| (...skipping 30 matching lines...) Expand all Loading... |
| 84 static void GenerateHashGetHash(MacroAssembler* masm, | 84 static void GenerateHashGetHash(MacroAssembler* masm, |
| 85 Register hash); | 85 Register hash); |
| 86 | 86 |
| 87 private: | 87 private: |
| 88 DISALLOW_IMPLICIT_CONSTRUCTORS(StringHelper); | 88 DISALLOW_IMPLICIT_CONSTRUCTORS(StringHelper); |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 | 91 |
| 92 class SubStringStub: public PlatformCodeStub { | 92 class SubStringStub: public PlatformCodeStub { |
| 93 public: | 93 public: |
| 94 SubStringStub() {} | 94 explicit SubStringStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
| 95 | 95 |
| 96 private: | 96 private: |
| 97 Major MajorKey() { return SubString; } | 97 Major MajorKey() { return SubString; } |
| 98 int MinorKey() { return 0; } | 98 int MinorKey() { return 0; } |
| 99 | 99 |
| 100 void Generate(MacroAssembler* masm); | 100 void Generate(MacroAssembler* masm); |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 | 103 |
| 104 | 104 |
| 105 class StringCompareStub: public PlatformCodeStub { | 105 class StringCompareStub: public PlatformCodeStub { |
| 106 public: | 106 public: |
| 107 StringCompareStub() { } | 107 explicit StringCompareStub(Isolate* isolate) : PlatformCodeStub(isolate) { } |
| 108 | 108 |
| 109 // Compares two flat ASCII strings and returns result in r0. | 109 // Compares two flat ASCII strings and returns result in r0. |
| 110 static void GenerateCompareFlatAsciiStrings(MacroAssembler* masm, | 110 static void GenerateCompareFlatAsciiStrings(MacroAssembler* masm, |
| 111 Register left, | 111 Register left, |
| 112 Register right, | 112 Register right, |
| 113 Register scratch1, | 113 Register scratch1, |
| 114 Register scratch2, | 114 Register scratch2, |
| 115 Register scratch3, | 115 Register scratch3, |
| 116 Register scratch4); | 116 Register scratch4); |
| 117 | 117 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 137 Register scratch2, | 137 Register scratch2, |
| 138 Label* chars_not_equal); | 138 Label* chars_not_equal); |
| 139 }; | 139 }; |
| 140 | 140 |
| 141 | 141 |
| 142 // This stub can convert a signed int32 to a heap number (double). It does | 142 // 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 | 143 // 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. | 144 // so you don't have to set up the frame. |
| 145 class WriteInt32ToHeapNumberStub : public PlatformCodeStub { | 145 class WriteInt32ToHeapNumberStub : public PlatformCodeStub { |
| 146 public: | 146 public: |
| 147 WriteInt32ToHeapNumberStub(Register the_int, | 147 WriteInt32ToHeapNumberStub(Isolate* isolate, |
| 148 Register the_int, |
| 148 Register the_heap_number, | 149 Register the_heap_number, |
| 149 Register scratch) | 150 Register scratch) |
| 150 : the_int_(the_int), | 151 : PlatformCodeStub(isolate), |
| 152 the_int_(the_int), |
| 151 the_heap_number_(the_heap_number), | 153 the_heap_number_(the_heap_number), |
| 152 scratch_(scratch) { } | 154 scratch_(scratch) { } |
| 153 | 155 |
| 154 static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate); | 156 static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate); |
| 155 | 157 |
| 156 private: | 158 private: |
| 157 Register the_int_; | 159 Register the_int_; |
| 158 Register the_heap_number_; | 160 Register the_heap_number_; |
| 159 Register scratch_; | 161 Register scratch_; |
| 160 | 162 |
| 161 // Minor key encoding in 16 bits. | 163 // Minor key encoding in 16 bits. |
| 162 class IntRegisterBits: public BitField<int, 0, 4> {}; | 164 class IntRegisterBits: public BitField<int, 0, 4> {}; |
| 163 class HeapNumberRegisterBits: public BitField<int, 4, 4> {}; | 165 class HeapNumberRegisterBits: public BitField<int, 4, 4> {}; |
| 164 class ScratchRegisterBits: public BitField<int, 8, 4> {}; | 166 class ScratchRegisterBits: public BitField<int, 8, 4> {}; |
| 165 | 167 |
| 166 Major MajorKey() { return WriteInt32ToHeapNumber; } | 168 Major MajorKey() { return WriteInt32ToHeapNumber; } |
| 167 int MinorKey() { | 169 int MinorKey() { |
| 168 // Encode the parameters in a unique 16 bit value. | 170 // Encode the parameters in a unique 16 bit value. |
| 169 return IntRegisterBits::encode(the_int_.code()) | 171 return IntRegisterBits::encode(the_int_.code()) |
| 170 | HeapNumberRegisterBits::encode(the_heap_number_.code()) | 172 | HeapNumberRegisterBits::encode(the_heap_number_.code()) |
| 171 | ScratchRegisterBits::encode(scratch_.code()); | 173 | ScratchRegisterBits::encode(scratch_.code()); |
| 172 } | 174 } |
| 173 | 175 |
| 174 void Generate(MacroAssembler* masm); | 176 void Generate(MacroAssembler* masm); |
| 175 }; | 177 }; |
| 176 | 178 |
| 177 | 179 |
| 178 class RecordWriteStub: public PlatformCodeStub { | 180 class RecordWriteStub: public PlatformCodeStub { |
| 179 public: | 181 public: |
| 180 RecordWriteStub(Register object, | 182 RecordWriteStub(Isolate* isolate, |
| 183 Register object, |
| 181 Register value, | 184 Register value, |
| 182 Register address, | 185 Register address, |
| 183 RememberedSetAction remembered_set_action, | 186 RememberedSetAction remembered_set_action, |
| 184 SaveFPRegsMode fp_mode) | 187 SaveFPRegsMode fp_mode) |
| 185 : object_(object), | 188 : PlatformCodeStub(isolate), |
| 189 object_(object), |
| 186 value_(value), | 190 value_(value), |
| 187 address_(address), | 191 address_(address), |
| 188 remembered_set_action_(remembered_set_action), | 192 remembered_set_action_(remembered_set_action), |
| 189 save_fp_regs_mode_(fp_mode), | 193 save_fp_regs_mode_(fp_mode), |
| 190 regs_(object, // An input reg. | 194 regs_(object, // An input reg. |
| 191 address, // An input reg. | 195 address, // An input reg. |
| 192 value) { // One scratch reg. | 196 value) { // One scratch reg. |
| 193 } | 197 } |
| 194 | 198 |
| 195 enum Mode { | 199 enum Mode { |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 }; | 360 }; |
| 357 | 361 |
| 358 | 362 |
| 359 // Trampoline stub to call into native code. To call safely into native code | 363 // Trampoline stub to call into native code. To call safely into native code |
| 360 // in the presence of compacting GC (which can move code objects) we need to | 364 // in the presence of compacting GC (which can move code objects) we need to |
| 361 // keep the code which called into native pinned in the memory. Currently the | 365 // keep the code which called into native pinned in the memory. Currently the |
| 362 // simplest approach is to generate such stub early enough so it can never be | 366 // simplest approach is to generate such stub early enough so it can never be |
| 363 // moved by GC | 367 // moved by GC |
| 364 class DirectCEntryStub: public PlatformCodeStub { | 368 class DirectCEntryStub: public PlatformCodeStub { |
| 365 public: | 369 public: |
| 366 DirectCEntryStub() {} | 370 explicit DirectCEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
| 367 void Generate(MacroAssembler* masm); | 371 void Generate(MacroAssembler* masm); |
| 368 void GenerateCall(MacroAssembler* masm, Register target); | 372 void GenerateCall(MacroAssembler* masm, Register target); |
| 369 | 373 |
| 370 private: | 374 private: |
| 371 Major MajorKey() { return DirectCEntry; } | 375 Major MajorKey() { return DirectCEntry; } |
| 372 int MinorKey() { return 0; } | 376 int MinorKey() { return 0; } |
| 373 | 377 |
| 374 bool NeedsImmovableCode() { return true; } | 378 bool NeedsImmovableCode() { return true; } |
| 375 }; | 379 }; |
| 376 | 380 |
| 377 | 381 |
| 378 class NameDictionaryLookupStub: public PlatformCodeStub { | 382 class NameDictionaryLookupStub: public PlatformCodeStub { |
| 379 public: | 383 public: |
| 380 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; | 384 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; |
| 381 | 385 |
| 382 explicit NameDictionaryLookupStub(LookupMode mode) : mode_(mode) { } | 386 NameDictionaryLookupStub(Isolate* isolate, LookupMode mode) |
| 387 : PlatformCodeStub(isolate), mode_(mode) { } |
| 383 | 388 |
| 384 void Generate(MacroAssembler* masm); | 389 void Generate(MacroAssembler* masm); |
| 385 | 390 |
| 386 static void GenerateNegativeLookup(MacroAssembler* masm, | 391 static void GenerateNegativeLookup(MacroAssembler* masm, |
| 387 Label* miss, | 392 Label* miss, |
| 388 Label* done, | 393 Label* done, |
| 389 Register receiver, | 394 Register receiver, |
| 390 Register properties, | 395 Register properties, |
| 391 Handle<Name> name, | 396 Handle<Name> name, |
| 392 Register scratch0); | 397 Register scratch0); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 TargetAddressStorageMode storage_mode() { return storage_mode_; } | 438 TargetAddressStorageMode storage_mode() { return storage_mode_; } |
| 434 | 439 |
| 435 private: | 440 private: |
| 436 TargetAddressStorageMode storage_mode_; | 441 TargetAddressStorageMode storage_mode_; |
| 437 }; | 442 }; |
| 438 | 443 |
| 439 | 444 |
| 440 } } // namespace v8::internal | 445 } } // namespace v8::internal |
| 441 | 446 |
| 442 #endif // V8_ARM_CODE_STUBS_ARM_H_ | 447 #endif // V8_ARM_CODE_STUBS_ARM_H_ |
| OLD | NEW |