OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
897 const char* GetName() { return "NumberToStringStub"; } | 897 const char* GetName() { return "NumberToStringStub"; } |
898 | 898 |
899 #ifdef DEBUG | 899 #ifdef DEBUG |
900 void Print() { | 900 void Print() { |
901 PrintF("NumberToStringStub\n"); | 901 PrintF("NumberToStringStub\n"); |
902 } | 902 } |
903 #endif | 903 #endif |
904 }; | 904 }; |
905 | 905 |
906 | 906 |
| 907 class RecordWriteStub : public CodeStub { |
| 908 public: |
| 909 RecordWriteStub(Register object, Register offset, Register scratch) |
| 910 : object_(object), offset_(offset), scratch_(scratch) { } |
| 911 |
| 912 void Generate(MacroAssembler* masm); |
| 913 |
| 914 private: |
| 915 Register object_; |
| 916 Register offset_; |
| 917 Register scratch_; |
| 918 |
| 919 #ifdef DEBUG |
| 920 void Print() { |
| 921 PrintF("RecordWriteStub (object reg %d), (offset reg %d)," |
| 922 " (scratch reg %d)\n", |
| 923 object_.code(), offset_.code(), scratch_.code()); |
| 924 } |
| 925 #endif |
| 926 |
| 927 // Minor key encoding in 12 bits. 4 bits for each of the three |
| 928 // registers (object, offset and scratch) OOOOAAAASSSS. |
| 929 class ScratchBits: public BitField<uint32_t, 0, 4> {}; |
| 930 class OffsetBits: public BitField<uint32_t, 4, 4> {}; |
| 931 class ObjectBits: public BitField<uint32_t, 8, 4> {}; |
| 932 |
| 933 Major MajorKey() { return RecordWrite; } |
| 934 |
| 935 int MinorKey() { |
| 936 // Encode the registers. |
| 937 return ObjectBits::encode(object_.code()) | |
| 938 OffsetBits::encode(offset_.code()) | |
| 939 ScratchBits::encode(scratch_.code()); |
| 940 } |
| 941 }; |
| 942 |
| 943 |
907 } } // namespace v8::internal | 944 } } // namespace v8::internal |
908 | 945 |
909 #endif // V8_ARM_CODEGEN_ARM_H_ | 946 #endif // V8_ARM_CODEGEN_ARM_H_ |
OLD | NEW |