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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 }; | 59 }; |
60 | 60 |
61 | 61 |
62 class StoreBufferOverflowStub: public CodeStub { | 62 class StoreBufferOverflowStub: public CodeStub { |
63 public: | 63 public: |
64 explicit StoreBufferOverflowStub(SaveFPRegsMode save_fp) | 64 explicit StoreBufferOverflowStub(SaveFPRegsMode save_fp) |
65 : save_doubles_(save_fp) { } | 65 : save_doubles_(save_fp) { } |
66 | 66 |
67 void Generate(MacroAssembler* masm); | 67 void Generate(MacroAssembler* masm); |
68 | 68 |
69 virtual bool CompilingCallsToThisStubIsGCSafe() { return true; } | 69 virtual bool IsPregenerated(); |
70 static void GenerateFixedRegStubsAheadOfTime(); | 70 static void GenerateFixedRegStubsAheadOfTime(); |
71 virtual bool SometimesSetsUpAFrame() { return false; } | 71 virtual bool SometimesSetsUpAFrame() { return false; } |
72 | 72 |
73 private: | 73 private: |
74 SaveFPRegsMode save_doubles_; | 74 SaveFPRegsMode save_doubles_; |
75 | 75 |
76 Major MajorKey() { return StoreBufferOverflow; } | 76 Major MajorKey() { return StoreBufferOverflow; } |
77 int MinorKey() { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; } | 77 int MinorKey() { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; } |
78 }; | 78 }; |
79 | 79 |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 : the_int_(the_int), | 343 : the_int_(the_int), |
344 the_heap_number_(the_heap_number), | 344 the_heap_number_(the_heap_number), |
345 scratch_(scratch), | 345 scratch_(scratch), |
346 sign_(scratch2) { | 346 sign_(scratch2) { |
347 ASSERT(IntRegisterBits::is_valid(the_int_.code())); | 347 ASSERT(IntRegisterBits::is_valid(the_int_.code())); |
348 ASSERT(HeapNumberRegisterBits::is_valid(the_heap_number_.code())); | 348 ASSERT(HeapNumberRegisterBits::is_valid(the_heap_number_.code())); |
349 ASSERT(ScratchRegisterBits::is_valid(scratch_.code())); | 349 ASSERT(ScratchRegisterBits::is_valid(scratch_.code())); |
350 ASSERT(SignRegisterBits::is_valid(sign_.code())); | 350 ASSERT(SignRegisterBits::is_valid(sign_.code())); |
351 } | 351 } |
352 | 352 |
353 bool CompilingCallsToThisStubIsGCSafe(); | 353 bool IsPregenerated(); |
354 static void GenerateFixedRegStubsAheadOfTime(); | 354 static void GenerateFixedRegStubsAheadOfTime(); |
355 | 355 |
356 private: | 356 private: |
357 Register the_int_; | 357 Register the_int_; |
358 Register the_heap_number_; | 358 Register the_heap_number_; |
359 Register scratch_; | 359 Register scratch_; |
360 Register sign_; | 360 Register sign_; |
361 | 361 |
362 // Minor key encoding in 16 bits. | 362 // Minor key encoding in 16 bits. |
363 class IntRegisterBits: public BitField<int, 0, 4> {}; | 363 class IntRegisterBits: public BitField<int, 0, 4> {}; |
364 class HeapNumberRegisterBits: public BitField<int, 4, 4> {}; | 364 class HeapNumberRegisterBits: public BitField<int, 4, 4> {}; |
365 class ScratchRegisterBits: public BitField<int, 8, 4> {}; | 365 class ScratchRegisterBits: public BitField<int, 8, 4> {}; |
| 366 class SignRegisterBits: public BitField<int, 12, 4> {}; |
366 | 367 |
367 Major MajorKey() { return WriteInt32ToHeapNumber; } | 368 Major MajorKey() { return WriteInt32ToHeapNumber; } |
368 int MinorKey() { | 369 int MinorKey() { |
369 // Encode the parameters in a unique 16 bit value. | 370 // Encode the parameters in a unique 16 bit value. |
370 return IntRegisterBits::encode(the_int_.code()) | 371 return IntRegisterBits::encode(the_int_.code()) |
371 | HeapNumberRegisterBits::encode(the_heap_number_.code()) | 372 | HeapNumberRegisterBits::encode(the_heap_number_.code()) |
372 | ScratchRegisterBits::encode(scratch_.code()); | 373 | ScratchRegisterBits::encode(scratch_.code()) |
| 374 | SignRegisterBits::encode(sign_.code()); |
373 } | 375 } |
374 | 376 |
375 void Generate(MacroAssembler* masm); | 377 void Generate(MacroAssembler* masm); |
376 }; | 378 }; |
377 | 379 |
378 | 380 |
379 class NumberToStringStub: public CodeStub { | 381 class NumberToStringStub: public CodeStub { |
380 public: | 382 public: |
381 NumberToStringStub() { } | 383 NumberToStringStub() { } |
382 | 384 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 address, // An input reg. | 420 address, // An input reg. |
419 value) { // One scratch reg. | 421 value) { // One scratch reg. |
420 } | 422 } |
421 | 423 |
422 enum Mode { | 424 enum Mode { |
423 STORE_BUFFER_ONLY, | 425 STORE_BUFFER_ONLY, |
424 INCREMENTAL, | 426 INCREMENTAL, |
425 INCREMENTAL_COMPACTION | 427 INCREMENTAL_COMPACTION |
426 }; | 428 }; |
427 | 429 |
428 virtual bool CompilingCallsToThisStubIsGCSafe(); | 430 virtual bool IsPregenerated(); |
429 static void GenerateFixedRegStubsAheadOfTime(); | 431 static void GenerateFixedRegStubsAheadOfTime(); |
430 virtual bool SometimesSetsUpAFrame() { return false; } | 432 virtual bool SometimesSetsUpAFrame() { return false; } |
431 | 433 |
432 static void PatchBranchIntoNop(MacroAssembler* masm, int pos) { | 434 static void PatchBranchIntoNop(MacroAssembler* masm, int pos) { |
433 const unsigned offset = masm->instr_at(pos) & kImm16Mask; | 435 const unsigned offset = masm->instr_at(pos) & kImm16Mask; |
434 masm->instr_at_put(pos, BNE | (zero_reg.code() << kRsShift) | | 436 masm->instr_at_put(pos, BNE | (zero_reg.code() << kRsShift) | |
435 (zero_reg.code() << kRtShift) | (offset & kImm16Mask)); | 437 (zero_reg.code() << kRtShift) | (offset & kImm16Mask)); |
436 ASSERT(Assembler::IsBne(masm->instr_at(pos))); | 438 ASSERT(Assembler::IsBne(masm->instr_at(pos))); |
437 } | 439 } |
438 | 440 |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
836 | 838 |
837 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; | 839 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; |
838 | 840 |
839 LookupMode mode_; | 841 LookupMode mode_; |
840 }; | 842 }; |
841 | 843 |
842 | 844 |
843 } } // namespace v8::internal | 845 } } // namespace v8::internal |
844 | 846 |
845 #endif // V8_MIPS_CODE_STUBS_ARM_H_ | 847 #endif // V8_MIPS_CODE_STUBS_ARM_H_ |
OLD | NEW |